modified: .config/fish/fish_variables

modified:   .config/foot/foot.ini
modified:   .config/gtk-3.0/bookmarks
modified:   .config/gtk-3.0/settings.ini
deleted:    .config/hypr/hyprpaper.conf
modified:   .config/lf/lfrc
renamed:    Pictures/wallpapers/wallhaven-r2mp6j_1920x1080.png -> Pictures/wallpapers/nature/wallhaven-r2mp6j_1920x1080.png
new file:   Pictures/wallpapers/nord/850990.png
new file:   Pictures/wallpapers/nord/851006.png
new file:   Pictures/wallpapers/nord/cropped-1920-1080-977159.png
deleted:    Pictures/wallpapers/nord/wallhaven-zxwvlj_1920x1080.png
deleted:    Pictures/wallpapers/wallhaven-13gqx9_1920x1080.png
new file:   Pictures/wallpapers/wallhaven-42xjrm_1920x1080 (1).png
new file:   Pictures/wallpapers/wallhaven-4ow217_1920x1080.png
deleted:    Pictures/wallpapers/wallhaven-5we3l7_1920x1080.png
deleted:    Pictures/wallpapers/wallhaven-6o3qx7_1920x1080.png
new file:   Pictures/wallpapers/wallhaven-zxyqyv_1920x1080.png
deleted:    bin/battery
deleted:    bin/ewrap
deleted:    bin/newpyproject
deleted:    bin/notetaker
modified:   .config/lf/lfrc
modified:   README.md

Update dotfiles
This commit is contained in:
hok7z 2023-05-24 20:55:32 +03:00
parent d4f798f07f
commit e4f9a40822
29 changed files with 88 additions and 167 deletions

View File

@ -46,6 +46,6 @@ SETUVAR fish_pager_color_selected_background:\x1d
SETUVAR fish_pager_color_selected_completion:\x1d
SETUVAR fish_pager_color_selected_description:\x1d
SETUVAR fish_pager_color_selected_prefix:\x1d
SETUVAR fish_user_paths:/home/q/bin
SETUVAR fish_user_paths:/home/q/bin\x1e/home/q/\x2elocal/bin
SETUVAR nvm_data:/home/q/\x2elocal/share/nvm
SETUVAR nvm_mirror:https\x3a//nodejs\x2eorg/dist

View File

@ -21,7 +21,6 @@ font=JetBrainsMono Nerd Font Mono:size=9
# underline-offset=<font metrics>
# box-drawings-uses-font-glyphs=no
# dpi-aware=auto
# initial-window-size-pixels=700x500 # Or,
# initial-window-size-chars=<COLSxROWS>
# initial-window-mode=windowed

View File

@ -3,3 +3,4 @@ file:///home/q/Music Music
file:///home/q/Pictures/screenshots screenshots
file:///home/q/Documents
file:///home/q/Documents/
file:///home/q/Music/

View File

@ -1,7 +1,7 @@
[Settings]
gtk-application-prefer-dark-theme=true
gtk-button-images=1
gtk-cursor-theme-name=breeze_cursors
gtk-cursor-theme-name=Nordzy-cursors-white
gtk-cursor-theme-size=24
gtk-decoration-layout=icon:minimize,maximize,close
gtk-enable-animations=true

View File

@ -1,6 +0,0 @@
preload = /home/q/Pictures/wallpapers/nord/wallhaven-4glwwl_1920x1080.png
wallpaper = ,/home/q/Pictures/wallpapers/nord/wallhaven-4glwwl_1920x1080.png
#preload = /home/q/Pictures/wallpapers/catppuccin/tetris.png
#wallpaper = ,/home/q/Pictures/wallpapers/catppuccin/tetris.png

View File

@ -1,8 +1,7 @@
set drawbox
set icons true
set ignorecase true
set drawbox
# interpreter for shell commands
set shell sh
set shellopts '-eu'
@ -12,96 +11,73 @@ set cleaner ctpvclear
&ctpv -s $id
&ctpvquit $id
cmd mkfile ${{
printf "File Name: "
read ans
$EDITOR $ans
}}
cmd edit-config ${{
$EDITOR ~/.config/lf/lfrc
lf -remote "send $id source ~/.config/lf/lfrc"
$EDITOR ~/.config/lf/lfrc
lf -remote "send $id source ~/.config/lf/lfrc"
}}
cmd paste &{{
set -- $(cat ~/.local/share/lf/files)
mode="$1"
shift
case "$mode" in
copy)
rsync -av --ignore-existing --progress -- "$@" . |
stdbuf -i0 -o0 -e0 tr '\r' '\n' |
while IFS= read -r line; do
lf -remote "send $id echo $line"
done
;;
move) mv -n -- "$@" .;;
esac
rm ~/.local/share/lf/files
lf -remote "send clear"
cmd open &{{
case $(file --mime-type "$f" -bL) in
text/*|application/json) lf -remote "send $id \$$EDITOR \$fx";;
image/*) swayimg -f "$f";;
audio/*) lf -remote "send $id \$mpv --audio-display=no \"$fx\" && clear";;
video/*) mpv "$f";;
application/pdf|application/epub) zathura "$f";;
esac
}}
cmd setwallpaper %swww img "$f" --transition-type right --transition-fps 60
cmd fzf_jump ${{
res="$(find . | fzf --reverse --header='Jump to location' | sed 's/\\/\\\\/g;s/"/\\"/g')"
if [ -d "$res" ] ; then
cmd="cd"
elif [ -f "$res" ] ; then
cmd="select"
else
exit 0
fi
lf -remote "send $id $cmd \"$res\""
res="$(find . | fzf --reverse --header='Jump to location' | sed 's/\\/\\\\/g;s/"/\\"/g')"
if [ -d "$res" ] ; then
cmd="cd"
elif [ -f "$res" ] ; then
cmd="select"
else
exit 0
fi
lf -remote "send $id $cmd \"$res\""
}}
cmd fzf_search ${{
res="$( \
RG_PREFIX="rg --column --line-number --no-heading --color=always \
--smart-case "
FZF_DEFAULT_COMMAND="$RG_PREFIX ''" \
fzf --bind "change:reload:$RG_PREFIX {q} || true" \
--ansi --layout=reverse --header 'Search in files' \
| cut -d':' -f1
)"
[ ! -z "$res" ] && lf -remote "send $id select \"$res\""
}}
cmd open &{{
case "$f" in
*.pdf|*.epub) $(zathura "$f");;
*.avi|*.mp4|*.wmv|*.dat|*.3gp|*.ogv|*.mkv|*.mpg|*.mpeg|*.vob|*.fl[icv]|*.m2v|*.mov|*.webm|*.ts|*.mts|*.m4v|*.r[am]|*.qt|*.divx) $(mpv "$f");;
*.bmp|*.jpg|*.jpeg|*.png|*.xpm|*.webp|*.tiff|*.gif|*.jfif|*.ico) $(imv "$f") ;;
*) lf -remote "send $id \$$EDITOR \$fx";;
esac
res="$( \
RG_PREFIX="rg --column --line-number --no-heading --color=always \
--smart-case "
FZF_DEFAULT_COMMAND="$RG_PREFIX ''" \
fzf --bind "change:reload:$RG_PREFIX {q} || true" \
--ansi --layout=reverse --header 'Search in files' \
| cut -d':' -f1
)"
[ ! -z "$res" ] && lf -remote "send $id select \"$res\""
}}
cmd unarchive ${{
set -f
case $f in
*.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf $f;;
*.tar.gz|*.tgz) tar xzvf $f;;
*.tar.xz|*.txz) tar xJvf $f;;
*.zip) unzip $f;;
*.rar) unrar x $f;;
*.7z) 7z x $f;;
esac
set -f
case $f in
*.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf $f;;
*.tar.gz|*.tgz) tar xzvf $f;;
*.tar.xz|*.txz) tar xJvf $f;;
*.zip) unzip $f;;
*.rar) unrar x $f;;
*.7z) 7z x $f;;
esac
}}
cmd tar ${{
set -f
mkdir $1
cp -r $fx $1
tar czf $1.tar.gz $1
rm -rf $1
set -f
mkdir $1
cp -r $fx $1
tar czf $1.tar.gz $1
rm -rf $1
}}
cmd zip ${{
set -f
mkdir $1
cp -r $fx $1
zip -r $1.zip $1
rm -rf $1
set -f
mkdir $1
cp -r $fx $1
zip -r $1.zip $1
rm -rf $1
}}
@ -110,8 +86,13 @@ cmd trash ${{
files=$(printf "$fx" | tr '\n' ';')
while [ "$files" ]; do
file=${files%%;*}
if [[ "$(pwd)" == "/home/$USER/.local/share/Trash/files" ]]; then
rm -rf $file
else
trash-put "$(basename "$file")"
fi
trash-put "$(basename "$file")"
if [ "$files" = "$file" ]; then
files=''
else
@ -120,36 +101,49 @@ cmd trash ${{
done
}}
cmd restore_trash ${{
trash-restore
# lfrc
cmd restore-from-trash ${{
ids="$(echo -ne '\n' | \
trash-restore | \
awk '$1 ~ /^[0-9]+/ {print $0}' | \
fzf --multi | \
awk '{print $1}' | \
sed -z 's/\n/,/g;s/,$/\n/')"
echo $ids | trash-restore
clear
}}
map m
map o
map n
map "'"
map '"'
map d
map e
map f
map t
map . set hidden!
# move current file or selected files to trash folder
# (also see 'man mv' for backup/overwrite options)
cmd trash %set -f; mv $fx ~/.trash
# make sure trash folder exists
%mkdir -p ~/.trash
map dd trash
map dr restore_trash
map md push %mkdir<space>
map y copy
map p paste
map x cut
map <enter> open
map f :fzf_jump
map gf :fzf_search
map <enter> open
map C edit-config
map bg setwallpaper
map dd trash
map dr restore-from-trash
map R reload
map bg setwallpaper
map C edit-config
map gh cd ~
map gd cd ~/Downloads
map gD cd ~/Documents
@ -157,6 +151,8 @@ map gD cd ~/Documents
map gc cd ~/.config
map gr cd ~/repos
map gC cd ~/code
map gp cd ~/Pictures
map gw cd ~/Pictures/wallpapers
map gs cd ~/Pictures/screenshots
@ -165,4 +161,4 @@ map gv cd ~/Videos
map gm cd ~/Music
map gt cd ~/.local/share/Trash/files
map tC rm -rf ~/.local/share/Trash/files/*
map tc %rm -rf ~/.local/share/Trash/files/*

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 MiB

After

Width:  |  Height:  |  Size: 3.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

View File

@ -1,35 +0,0 @@
#!/bin/sh
for pid in $(pidof -x battery); do
if [ "$pid" != $$ ]; then
kill -9 "$pid"
fi
done
notify_icons="/home/q/.config/dunst/icons"
# notify when below this percentage
warning_level=50
# how often to check battery status, in seconds
check_interval=300
while true; do
path_to_battery=$(upower -e | grep BAT)
battery_level=$(upower -i "$path_to_battery" | grep -E "percentage" | sed 's/[^0-9]//g')
discharging=$(upower -i "$path_to_battery" | grep -E "state" | grep -c "discharging")
time_to_empty=$(upower -i "$path_to_battery" | grep -E "time to empty" | sed 's/[^0-9,.]//g')
# check if battery is low and discharging
if [ "$battery_level" -lt "$warning_level" ] && [ "$discharging" -eq 1 ]
then
dunstify -a "Battery" \
"Low battery: ${battery_level}%" \
"Battery is low ($time_to_empty minuts left)" \
-r 100 \
-i "$notify_icons/battery-low.png"
mpv "/home/q/.config/alarm/low-battery-sound.mp3"
fi
sleep ${check_interval}s
done

View File

@ -1,6 +0,0 @@
#!/usr/bin/env sh
if [ -n "$TMUX" ] ; then
tmux split-window -h "nvim \"$*\""
else
kitty -e "nvim \"$*\""
fi

View File

@ -1,15 +0,0 @@
#!/bin/bash
if [ $# -lt 1 ];then
echo "Failed get arguments"
echo "./newpyproject [project name]"
exit
fi
mkdir $1
cd $1
git init
poetry init
cp ~/.config/pyright/pyrightconfig.json .
venv_path=$(poetry env info -p)
echo -e $(jq -r --arg path "$venv_path" '.venvPath |= $path' pyrightconfig.json) > pyrightconfig.json

View File

@ -1,13 +0,0 @@
#!/bin/sh
noteFileName="$HOME/notes/note-$(date +%Y-%m-%d).md"
if [ ! -f $noteFileName ];then
echo "Notes for $(date +%Y-%m-%d)" > $noteFileName
fi
nvim -c "norm Go" \
-c "norm Go## $(date +'%I:%m %p')" \
-c "norm G2o" \
-c "norm zz" \
-c "startinsert" $noteFileName