diff options
Diffstat (limited to 'bin/guiscripts')
-rwxr-xr-x | bin/guiscripts/copyhist | 16 | ||||
-rwxr-xr-x | bin/guiscripts/favwal | 10 | ||||
-rwxr-xr-x | bin/guiscripts/imgclip | 4 | ||||
-rwxr-xr-x | bin/guiscripts/keyadd | 52 | ||||
-rwxr-xr-x | bin/guiscripts/locker | 24 | ||||
-rwxr-xr-x | bin/guiscripts/newwal | 1 | ||||
-rwxr-xr-x | bin/guiscripts/nordtheme | 16 | ||||
-rwxr-xr-x | bin/guiscripts/wintitle | 3 |
8 files changed, 119 insertions, 7 deletions
diff --git a/bin/guiscripts/copyhist b/bin/guiscripts/copyhist new file mode 100755 index 0000000..19dfb59 --- /dev/null +++ b/bin/guiscripts/copyhist @@ -0,0 +1,16 @@ +#!/bin/sh + +if [ "$MENUCMD" = "tofi" ] +then + menucmd="tofi --width 30% --height 50% --anchor bottom-right --matching-algorithm normal" +elif [ "$MENUCMD" = "dmenu" ] +then + menucmd="dmenu -l 10 -g 1 -x -i" +else + menucmd="fzf" +fi + +cliphist list | + $menucmd | + cliphist decode | + wl-copy -n diff --git a/bin/guiscripts/favwal b/bin/guiscripts/favwal new file mode 100755 index 0000000..f3222a2 --- /dev/null +++ b/bin/guiscripts/favwal @@ -0,0 +1,10 @@ +#!/bin/sh +pics="$(xdg-user-dir PICTURES)" +favs="wallpapers/favorites" + +mkdir -p "${pics:=$HOME/pics}/$favs" +wal="$(realpath "$pics/wallpaper")" +diff "$wal" "$pics/$favs/$(realpath "$wal" | xargs basename)" > /dev/null 2>&1 && + exit +cp "$wal" "$pics/$favs" +echo "$wal" diff --git a/bin/guiscripts/imgclip b/bin/guiscripts/imgclip index 710770b..466f2c6 100755 --- a/bin/guiscripts/imgclip +++ b/bin/guiscripts/imgclip @@ -3,8 +3,8 @@ tmppic="/tmp/imgclip.png" if [ "$WAYLAND_DISPLAY" ] then - clipo='wl-paste' - clipp='wl-copy' + clipo='wl-paste -n' + clipp='wl-copy -n' else clipo='xclip -o -selection clipboard -r' clipp='xclip -selection clipboard -r' diff --git a/bin/guiscripts/keyadd b/bin/guiscripts/keyadd new file mode 100755 index 0000000..b5bc4d9 --- /dev/null +++ b/bin/guiscripts/keyadd @@ -0,0 +1,52 @@ +#!/bin/sh + +# For when script calls itself +if [ -n "$PASSWORD" ] +then + pass show "$PASSWORD" && + exit + exit 1 +fi + + +if [ "$MENUCMD" = "tofi" ] +then + menucmd="tofi --matching-algorithm=normal" +else + menucmd="$MENUCMD" +fi + + +die () +{ + echo "$1" >&2 +} + +SSHFOLDER="$HOME/.ssh" + +key="$(find "$SSHFOLDER" -iname "*.pub" | + sed "s,$SSHFOLDER/,," | # Clean + sed 's/\.pub$//' | + $menucmd)" +die "key: $key" + +test ! -f "$SSHFOLDER/$key" && exit 1 + +HOST=$(hostnamectl hostname | sed 's/forlure/fl/;s/montecristo/mc/') +die "HOST: $HOST" + +if [ "$1" = "-d" ] +then + ssh-add -d - < "$SSHFOLDER"/$key.pub && + notify-send "$0" "deleted <b>$key</b>" || + notify-send "$0" "could not delete." +elif ! ssh-add -l | grep -q "$(ssh-keygen -lf "$SSHFOLDER"/$key)" +then + export PASSWORD="keys/$HOST/ssh/$key" + export SSH_ASKPASS="$0" + ssh-add - < "$SSHFOLDER"/$key && + notify-send "$0" "added <b>$key</b>" +else + die "key already added." + notify-send "$0" "key already added." +fi diff --git a/bin/guiscripts/locker b/bin/guiscripts/locker index 0070a86..c35f6d4 100755 --- a/bin/guiscripts/locker +++ b/bin/guiscripts/locker @@ -1,8 +1,22 @@ #!/bin/sh -which swaylock convert grim > /dev/null || +which swaylock grim pixelate > /dev/null || exit 1 umask 077 -file=/tmp/bg.png -grim -l 0 - > $file -convert -resize 10% -resize 1000% $file $file -swaylock -i $file + +monitors="$(hyprctl monitors -j | + jq -r '.[].name' | + tr '\n' ' ' | + sed 's,.$,,')" + +for monitor in $monitors +do + file="/tmp/locker-$monitor.png" + grim -l 0 -o "$monitor" "$file" + pixelate "$file" "$file" + # Create image command for swaylock + icmd="$icmd --image $monitor:$file" + files="$files $file" +done + +swaylock -f -u $icmd +shred -uz -- $files diff --git a/bin/guiscripts/newwal b/bin/guiscripts/newwal index 4d64a6e..b913552 100755 --- a/bin/guiscripts/newwal +++ b/bin/guiscripts/newwal @@ -69,3 +69,4 @@ EOF # waybar ln -sf "$walcache/colors-waybar.css" "$HOME/.config/waybar/colors.css" pkill -USR2 waybar +pywalfox update diff --git a/bin/guiscripts/nordtheme b/bin/guiscripts/nordtheme new file mode 100755 index 0000000..5d118c4 --- /dev/null +++ b/bin/guiscripts/nordtheme @@ -0,0 +1,16 @@ +#!/bin/sh +if test -z "$1" +then + ln -sf /usr/share/foot/themes/nord ~/.config/foot/colors + ln -sf ~/.config/tofi/themes/nord ~/.config/tofi/config + ln -sf ~/.config/waybar/colors/colors-nord ~/.config/waybar/colors.css + ln -sf ~/pics/wallpapers/nord/nord_background3.jpg ~/pics/wallpaper + swaybg -i ~/pics/wallpaper & + pkill -USR2 waybar + sed -i 's/ColorMyPencils("[^"]\+")/ColorMyPencils("nord")/g' ~/.config/nvim/after/plugin/colors.lua +else + ln -sf ~/.cache/wal/colors-waybar.css ~/.config/waybar/colors.css + ln -sf ~/.config/tofi/themes/base16 ~/.config/tofi/config + newwal + sed -i 's/ColorMyPencils("[^"]\+")/ColorMyPencils("pywal")/g' ~/.config/nvim/after/plugin/colors.lua +fi diff --git a/bin/guiscripts/wintitle b/bin/guiscripts/wintitle new file mode 100755 index 0000000..64938a5 --- /dev/null +++ b/bin/guiscripts/wintitle @@ -0,0 +1,3 @@ +#!/bin/sh + +notify-send "wintitle" "<b>$(hyprctl activewindow -j | jq -r '.title')</b>" |