From a4634fc2ad2b0139f54f6f9af272dab27c9c611d Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 7 May 2023 19:35:29 +0200 Subject: don't copy trailing on imgclip --- bin/guiscripts/imgclip | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin/guiscripts') 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' -- cgit v1.2.3 From fc99e76d7cb26bc2f32109b8239e76b8404029b4 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 7 May 2023 20:48:02 +0200 Subject: added scripts --- bin/extra/fzwin | 5 +++++ bin/guiscripts/favwal | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100755 bin/extra/fzwin create mode 100755 bin/guiscripts/favwal (limited to 'bin/guiscripts') diff --git a/bin/extra/fzwin b/bin/extra/fzwin new file mode 100755 index 0000000..4e1cc79 --- /dev/null +++ b/bin/extra/fzwin @@ -0,0 +1,5 @@ +#!/bin/sh +hyprctl clients -j | + jq '.[].pid' | + fzf --preview "hyprctl clients -j | + jq '.[] | select(.pid == {}) | {class, title, workspace, xwayland}'" diff --git a/bin/guiscripts/favwal b/bin/guiscripts/favwal new file mode 100755 index 0000000..f27123d --- /dev/null +++ b/bin/guiscripts/favwal @@ -0,0 +1,6 @@ +#!/bin/sh +pics=$(xdg-user-dir PICTURES")" +mkdir -p "${pics:=$HOME/pics}/favorites" +wal="$(realpath "pics/wallpaper")" +cp "$wal" "$pics/favorites" +echo "$wal" -- cgit v1.2.3 From e05e81dceb50d408ae1b0dab5e713403f6fe230a Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 8 May 2023 16:36:13 +0200 Subject: added diff to favwal and fixed some issues --- bin/guiscripts/favwal | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/favwal b/bin/guiscripts/favwal index f27123d..94ee709 100755 --- a/bin/guiscripts/favwal +++ b/bin/guiscripts/favwal @@ -1,6 +1,8 @@ #!/bin/sh -pics=$(xdg-user-dir PICTURES")" +pics="$(xdg-user-dir PICTURES)" mkdir -p "${pics:=$HOME/pics}/favorites" -wal="$(realpath "pics/wallpaper")" +wal="$(realpath "$pics/wallpaper")" +diff "$wal" "$pics/favorites/$(realpath "$wal" | xargs basename)" && + exit cp "$wal" "$pics/favorites" echo "$wal" -- cgit v1.2.3 From f825a4ed3262f37511bd2161372cb97b5b1a2808 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 8 May 2023 20:17:32 +0200 Subject: fixed typo error --- bin/guiscripts/favwal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/favwal b/bin/guiscripts/favwal index 94ee709..4be5c9c 100755 --- a/bin/guiscripts/favwal +++ b/bin/guiscripts/favwal @@ -2,7 +2,7 @@ pics="$(xdg-user-dir PICTURES)" mkdir -p "${pics:=$HOME/pics}/favorites" wal="$(realpath "$pics/wallpaper")" -diff "$wal" "$pics/favorites/$(realpath "$wal" | xargs basename)" && +diff "$wal" "$pics/favorites/$(realpath "$wal" | xargs basename)" > /dev/null 2>&1 && exit cp "$wal" "$pics/favorites" echo "$wal" -- cgit v1.2.3 From 338e58b97a662a0522f12d85da7672ac0c2d3f19 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 8 May 2023 20:20:29 +0200 Subject: added copyhist! --- bin/guiscripts/copyhist | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 bin/guiscripts/copyhist (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/copyhist b/bin/guiscripts/copyhist new file mode 100755 index 0000000..f6a177a --- /dev/null +++ b/bin/guiscripts/copyhist @@ -0,0 +1,16 @@ +#!/bin/sh + +if [ "$MENUCMD" = "tofi" ] +then + menucmd="tofi --width 30% --height 20% --padding-left 2% --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 -- cgit v1.2.3 From 4cadb19a3cbb342fdb7256f182a5e3a682a17cb2 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 9 May 2023 00:02:33 +0200 Subject: added nordtheme script! --- bin/guiscripts/nordtheme | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 bin/guiscripts/nordtheme (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/nordtheme b/bin/guiscripts/nordtheme new file mode 100755 index 0000000..898c5d5 --- /dev/null +++ b/bin/guiscripts/nordtheme @@ -0,0 +1,14 @@ +#!/bin/sh +if test -z "$1" +then + ln -sf /usr/share/foot/themes/nord ~/.config/foot/colors + 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 + newwal + sed -i 's/ColorMyPencils("[^"]\+")/ColorMyPencils("pywal")/g' ~/.config/nvim/after/plugin/colors.lua +fi -- cgit v1.2.3 From be69b27d36c3c19c380bfd16aeca7cbc8f4a9c57 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 9 May 2023 00:26:58 +0200 Subject: added height and changed anchor --- bin/guiscripts/copyhist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/copyhist b/bin/guiscripts/copyhist index f6a177a..19dfb59 100755 --- a/bin/guiscripts/copyhist +++ b/bin/guiscripts/copyhist @@ -2,7 +2,7 @@ if [ "$MENUCMD" = "tofi" ] then - menucmd="tofi --width 30% --height 20% --padding-left 2% --matching-algorithm normal" + menucmd="tofi --width 30% --height 50% --anchor bottom-right --matching-algorithm normal" elif [ "$MENUCMD" = "dmenu" ] then menucmd="dmenu -l 10 -g 1 -x -i" -- cgit v1.2.3 From fcdb68fc3e2e7f082c74237153f70e714009077c Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 10 May 2023 00:18:43 +0200 Subject: use variable for favorites dir --- bin/guiscripts/favwal | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/favwal b/bin/guiscripts/favwal index 4be5c9c..f3222a2 100755 --- a/bin/guiscripts/favwal +++ b/bin/guiscripts/favwal @@ -1,8 +1,10 @@ #!/bin/sh pics="$(xdg-user-dir PICTURES)" -mkdir -p "${pics:=$HOME/pics}/favorites" +favs="wallpapers/favorites" + +mkdir -p "${pics:=$HOME/pics}/$favs" wal="$(realpath "$pics/wallpaper")" -diff "$wal" "$pics/favorites/$(realpath "$wal" | xargs basename)" > /dev/null 2>&1 && +diff "$wal" "$pics/$favs/$(realpath "$wal" | xargs basename)" > /dev/null 2>&1 && exit -cp "$wal" "$pics/favorites" +cp "$wal" "$pics/$favs" echo "$wal" -- cgit v1.2.3 From 871b70c9a481af8c5b7d386dd8c58aa0e4f22fcd Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 10 May 2023 22:25:34 +0200 Subject: added tofi reset to nordtheme --- bin/guiscripts/nordtheme | 1 + 1 file changed, 1 insertion(+) (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/nordtheme b/bin/guiscripts/nordtheme index 898c5d5..5efb853 100755 --- a/bin/guiscripts/nordtheme +++ b/bin/guiscripts/nordtheme @@ -2,6 +2,7 @@ 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 & -- cgit v1.2.3 From e0ba0fb4c965c50bfadc30b93f5c8217cfe5c22c Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 14 May 2023 21:32:18 +0200 Subject: added snippets --- bin/guiscripts/nordtheme | 1 + config/essentials/nvim/after/plugin/luasnip.lua | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/nordtheme b/bin/guiscripts/nordtheme index 5efb853..5d118c4 100755 --- a/bin/guiscripts/nordtheme +++ b/bin/guiscripts/nordtheme @@ -10,6 +10,7 @@ then 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/config/essentials/nvim/after/plugin/luasnip.lua b/config/essentials/nvim/after/plugin/luasnip.lua index bba2f9f..13f4432 100644 --- a/config/essentials/nvim/after/plugin/luasnip.lua +++ b/config/essentials/nvim/after/plugin/luasnip.lua @@ -137,6 +137,7 @@ ls.add_snippets("java", { }) ls.add_snippets("sh", { + s("TD", t "THISDIR=$(dirname $(readlink -f \"$0\"))"), parse("fn", "$1 ()\n{\n\t$2\n}$0", {}), parse("fdie", [[ @@ -162,7 +163,14 @@ ls.add_snippets("sh", { ls.add_snippets("javascript", { -- print s("pt", fmt("console.log({});{}", { i(1, "\"Hello World!\"") , i(0) })), - s("rq", fmt("var {} = require('{}');", { i(1), rep(1) })), + s("rq", fmt("const {} = require('{}');", { i(1), rep(1) })), + s("apr", fmt( + [[ + app.get('{}', (req, res) => {{ + {} + }});{} + ]], + { i(1), i(2, "app.get(\"Hello world!\")"), i(0) })), }) ls.add_snippets("telekasten", { -- cgit v1.2.3 From 96d6a9fa2db43ca1c1cbad795355f75627c0fca7 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 16 May 2023 00:49:21 +0200 Subject: use pixelate instead of imagemagick --- bin/guiscripts/locker | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/locker b/bin/guiscripts/locker index 0070a86..972843b 100755 --- a/bin/guiscripts/locker +++ b/bin/guiscripts/locker @@ -1,8 +1,8 @@ #!/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 +pixelate $file $file +swaylock -u -i $file -- cgit v1.2.3 From 1d0d4ac1d9349a0c478b242022c91424155695c1 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 16 May 2023 01:43:25 +0200 Subject: added more scripts --- bin/extra/passvar | 2 ++ bin/guiscripts/keyadd | 24 ++++++++++++++++++++++++ bin/guiscripts/wintitle | 3 +++ 3 files changed, 29 insertions(+) create mode 100755 bin/extra/passvar create mode 100755 bin/guiscripts/keyadd create mode 100755 bin/guiscripts/wintitle (limited to 'bin/guiscripts') diff --git a/bin/extra/passvar b/bin/extra/passvar new file mode 100755 index 0000000..b309ff4 --- /dev/null +++ b/bin/extra/passvar @@ -0,0 +1,2 @@ +#!/bin/sh +pass show $PASSWORD diff --git a/bin/guiscripts/keyadd b/bin/guiscripts/keyadd new file mode 100755 index 0000000..87d844d --- /dev/null +++ b/bin/guiscripts/keyadd @@ -0,0 +1,24 @@ +#!/bin/sh +die () +{ + echo "$1" >&2 +} + +key="$(find ~/.ssh -iname "*.pub" | + sed "s,$HOME/.ssh/,," | + cut -f1 -d. | + $MENUCMD)" +die "key: $key" + +HOST=$(hostnamectl hostname | sed 's/forlure/fl/;s/montecristo/mc/') + +if ! ssh-add -l | grep -q "$(ssh-keygen -lf $HOME/.ssh/$key)" +then + export SSH_ASKPASS="passvar" + export PASSWORD="keys/fl/ssh/$key" + ssh-add - < $HOME/.ssh/$key + notify-send "$0" "added $key" +else + die "key already added." + notify-send "$0" "key already added." +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" "$(hyprctl activewindow -j | jq -r '.title')" -- cgit v1.2.3 From b02d85f46978f4e87e71ab54edbd19e361cc4e77 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 16 May 2023 06:33:44 +0200 Subject: remove bg img after unlocking --- bin/guiscripts/locker | 1 + 1 file changed, 1 insertion(+) (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/locker b/bin/guiscripts/locker index 972843b..f464617 100755 --- a/bin/guiscripts/locker +++ b/bin/guiscripts/locker @@ -6,3 +6,4 @@ file=/tmp/bg.png grim -l 0 - > $file pixelate $file $file swaylock -u -i $file +shred -uz $file -- cgit v1.2.3 From d204513a3eed40976c6212b56bb674cc55811d87 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 16 May 2023 06:34:02 +0200 Subject: don't continue if key does not exist --- bin/guiscripts/keyadd | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/keyadd b/bin/guiscripts/keyadd index 87d844d..3f0baa4 100755 --- a/bin/guiscripts/keyadd +++ b/bin/guiscripts/keyadd @@ -10,6 +10,8 @@ key="$(find ~/.ssh -iname "*.pub" | $MENUCMD)" die "key: $key" +test ! -f "$HOME/.ssh/$key" && exit 1 + HOST=$(hostnamectl hostname | sed 's/forlure/fl/;s/montecristo/mc/') if ! ssh-add -l | grep -q "$(ssh-keygen -lf $HOME/.ssh/$key)" -- cgit v1.2.3 From e1b9863683a9f4ec791ba462175f6d3c17b35da9 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 16 May 2023 06:34:56 +0200 Subject: added delete option --- bin/guiscripts/keyadd | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/keyadd b/bin/guiscripts/keyadd index 3f0baa4..5962e07 100755 --- a/bin/guiscripts/keyadd +++ b/bin/guiscripts/keyadd @@ -14,7 +14,11 @@ test ! -f "$HOME/.ssh/$key" && exit 1 HOST=$(hostnamectl hostname | sed 's/forlure/fl/;s/montecristo/mc/') -if ! ssh-add -l | grep -q "$(ssh-keygen -lf $HOME/.ssh/$key)" +if [ "$1" = "-d" ] +then + ssh-add -d - < $HOME/.ssh/$key.pub && + notify-send "$0" "delted $key" +elif ! ssh-add -l | grep -q "$(ssh-keygen -lf $HOME/.ssh/$key)" then export SSH_ASKPASS="passvar" export PASSWORD="keys/fl/ssh/$key" -- cgit v1.2.3 From 5acfacf76f22948e50aad35557ca67dc54a343df Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 16 May 2023 06:35:03 +0200 Subject: cleanup --- bin/guiscripts/keyadd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/keyadd b/bin/guiscripts/keyadd index 5962e07..53475dc 100755 --- a/bin/guiscripts/keyadd +++ b/bin/guiscripts/keyadd @@ -22,8 +22,8 @@ elif ! ssh-add -l | grep -q "$(ssh-keygen -lf $HOME/.ssh/$key)" then export SSH_ASKPASS="passvar" export PASSWORD="keys/fl/ssh/$key" - ssh-add - < $HOME/.ssh/$key - notify-send "$0" "added $key" + ssh-add - < $HOME/.ssh/$key && + notify-send "$0" "added $key" else die "key already added." notify-send "$0" "key already added." -- cgit v1.2.3 From 0c740d8dbc8a1e0ea78da6a567d1024091d61c59 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 16 May 2023 09:45:28 +0200 Subject: fixed not using $HOST variable --- bin/guiscripts/keyadd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/keyadd b/bin/guiscripts/keyadd index 53475dc..1b024eb 100755 --- a/bin/guiscripts/keyadd +++ b/bin/guiscripts/keyadd @@ -21,7 +21,7 @@ then elif ! ssh-add -l | grep -q "$(ssh-keygen -lf $HOME/.ssh/$key)" then export SSH_ASKPASS="passvar" - export PASSWORD="keys/fl/ssh/$key" + export PASSWORD="keys/$HOST/ssh/$key" ssh-add - < $HOME/.ssh/$key && notify-send "$0" "added $key" else -- cgit v1.2.3 From 8301dab64e215ffc16c1fb7bb7c635f797cbbabb Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 16 May 2023 18:59:15 +0200 Subject: use keyadd instead of passvar --- bin/extra/passvar | 2 -- bin/guiscripts/keyadd | 10 +++++++++- 2 files changed, 9 insertions(+), 3 deletions(-) delete mode 100755 bin/extra/passvar (limited to 'bin/guiscripts') diff --git a/bin/extra/passvar b/bin/extra/passvar deleted file mode 100755 index b309ff4..0000000 --- a/bin/extra/passvar +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -pass show $PASSWORD diff --git a/bin/guiscripts/keyadd b/bin/guiscripts/keyadd index 53475dc..21a3668 100755 --- a/bin/guiscripts/keyadd +++ b/bin/guiscripts/keyadd @@ -4,6 +4,14 @@ die () echo "$1" >&2 } +# For when script calls itself +if [ -n "$PASSWORD" ] +then + pass show "$PASSWORD" && + exit + exit 1 +fi + key="$(find ~/.ssh -iname "*.pub" | sed "s,$HOME/.ssh/,," | cut -f1 -d. | @@ -20,8 +28,8 @@ then notify-send "$0" "delted $key" elif ! ssh-add -l | grep -q "$(ssh-keygen -lf $HOME/.ssh/$key)" then - export SSH_ASKPASS="passvar" export PASSWORD="keys/fl/ssh/$key" + export SSH_ASKPASS="$0" ssh-add - < $HOME/.ssh/$key && notify-send "$0" "added $key" else -- cgit v1.2.3 From 6f7a492a03deb61bf37e3b5b6574c696912144d1 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 16 May 2023 18:59:29 +0200 Subject: fixed typo --- bin/guiscripts/keyadd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/keyadd b/bin/guiscripts/keyadd index 21a3668..aac7cdf 100755 --- a/bin/guiscripts/keyadd +++ b/bin/guiscripts/keyadd @@ -25,7 +25,7 @@ HOST=$(hostnamectl hostname | sed 's/forlure/fl/;s/montecristo/mc/') if [ "$1" = "-d" ] then ssh-add -d - < $HOME/.ssh/$key.pub && - notify-send "$0" "delted $key" + notify-send "$0" "deleted $key" elif ! ssh-add -l | grep -q "$(ssh-keygen -lf $HOME/.ssh/$key)" then export PASSWORD="keys/fl/ssh/$key" -- cgit v1.2.3 From 19a368ddeacebfc3adb6be328ec95fd0d864d53d Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 16 May 2023 19:32:04 +0200 Subject: added pywalfox command --- bin/guiscripts/newwal | 1 + 1 file changed, 1 insertion(+) (limited to 'bin/guiscripts') 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 -- cgit v1.2.3 From ffa80c324e5b26b2cbaf154b5b3f2731bfa55f00 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 17 May 2023 11:17:49 +0200 Subject: added menucmd handling and SSHFOLDER variable --- bin/guiscripts/keyadd | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/keyadd b/bin/guiscripts/keyadd index aac7cdf..7412199 100755 --- a/bin/guiscripts/keyadd +++ b/bin/guiscripts/keyadd @@ -1,8 +1,4 @@ #!/bin/sh -die () -{ - echo "$1" >&2 -} # For when script calls itself if [ -n "$PASSWORD" ] @@ -12,25 +8,42 @@ then exit 1 fi -key="$(find ~/.ssh -iname "*.pub" | - sed "s,$HOME/.ssh/,," | - cut -f1 -d. | - $MENUCMD)" + +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 "$HOME/.ssh/$key" && exit 1 +test ! -f "$SSHFOLDER/$key" && exit 1 HOST=$(hostnamectl hostname | sed 's/forlure/fl/;s/montecristo/mc/') if [ "$1" = "-d" ] then - ssh-add -d - < $HOME/.ssh/$key.pub && - notify-send "$0" "deleted $key" -elif ! ssh-add -l | grep -q "$(ssh-keygen -lf $HOME/.ssh/$key)" + ssh-add -d - < "$SSHFOLDER"/$key.pub && + notify-send "$0" "deleted $key" || + notify-send "$0" "could not delete." +elif ! ssh-add -l | grep -q "$(ssh-keygen -lf "$SSHFOLDER"/$key)" then export PASSWORD="keys/fl/ssh/$key" export SSH_ASKPASS="$0" - ssh-add - < $HOME/.ssh/$key && + ssh-add - < "$SSHFOLDER"/$key && notify-send "$0" "added $key" else die "key already added." -- cgit v1.2.3 From 5638d25af55736ded479373401bce51885e29123 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 17 May 2023 11:59:06 +0200 Subject: fixed HOST variable not used --- bin/guiscripts/keyadd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/keyadd b/bin/guiscripts/keyadd index 7412199..b5bc4d9 100755 --- a/bin/guiscripts/keyadd +++ b/bin/guiscripts/keyadd @@ -33,6 +33,7 @@ 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 @@ -41,7 +42,7 @@ then notify-send "$0" "could not delete." elif ! ssh-add -l | grep -q "$(ssh-keygen -lf "$SSHFOLDER"/$key)" then - export PASSWORD="keys/fl/ssh/$key" + export PASSWORD="keys/$HOST/ssh/$key" export SSH_ASKPASS="$0" ssh-add - < "$SSHFOLDER"/$key && notify-send "$0" "added $key" -- cgit v1.2.3 From 4e65fd1d1aa0ee4aa328eea4eac37f2580490fac Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 21 May 2023 11:38:53 +0200 Subject: added multmonitor support --- bin/guiscripts/locker | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/locker b/bin/guiscripts/locker index f464617..c35f6d4 100755 --- a/bin/guiscripts/locker +++ b/bin/guiscripts/locker @@ -2,8 +2,21 @@ which swaylock grim pixelate > /dev/null || exit 1 umask 077 -file=/tmp/bg.png -grim -l 0 - > $file -pixelate $file $file -swaylock -u -i $file -shred -uz $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 -- cgit v1.2.3