diff options
Diffstat (limited to 'mirenn/home/files/dotfiles/.config/scripts')
4 files changed, 65 insertions, 0 deletions
diff --git a/mirenn/home/files/dotfiles/.config/scripts/powermenu b/mirenn/home/files/dotfiles/.config/scripts/powermenu new file mode 100755 index 0000000..d118a69 --- /dev/null +++ b/mirenn/home/files/dotfiles/.config/scripts/powermenu @@ -0,0 +1,27 @@ +#!/usr/bin/env fish + +set poweroff "" +set reboot "" +set lock "" +set exit "" +set sleep "" +set hibernate "" + +set chosen (echo -e "$poweroff\n$reboot\n$lock\n$exit\n$sleep\n$hibernate" | rofi -dmenu -theme ~/.config/rofi/powermenu.rasi) + +switch $chosen +case $poweroff + loginctl poweroff +case $reboot + loginctl reboot +case $lock + loginctl lock-session +case $exit + niri msg action quit +case $sleep + loginctl suspend +case $hibernate + loginctl hibernate +case '*' + exit 1 +end diff --git a/mirenn/home/files/dotfiles/.config/scripts/set_background b/mirenn/home/files/dotfiles/.config/scripts/set_background new file mode 100755 index 0000000..7fea3d9 --- /dev/null +++ b/mirenn/home/files/dotfiles/.config/scripts/set_background @@ -0,0 +1,18 @@ +#!/usr/bin/env fish + +if test (count $argv) -lt 1; or not test -f $argv[1] + echo "Usage: $(status filename) <img>" + exit 1 +end + +wallust run $argv[1] -Ts; and begin + niri msg action do-screen-transition + set -U IMG $argv[1] & + wallust -q run $IMG & + killall swaybg ; swaybg -i $IMG -m fill & + makoctl reload & + notify-send -i $IMG "Wallust" "Changed wallpaper and palette." +end; or begin + notify-send -i $argv[1] -u critical "Wallust" "Failed to change palette" +end; + diff --git a/mirenn/home/files/dotfiles/.config/scripts/set_random b/mirenn/home/files/dotfiles/.config/scripts/set_random new file mode 100755 index 0000000..33cf267 --- /dev/null +++ b/mirenn/home/files/dotfiles/.config/scripts/set_random @@ -0,0 +1,8 @@ +#!/usr/bin/env fish + +if test (count $argv) -lt 1; or not test -d $argv[1] + echo "Usage: $(status filename) <dir>" + exit 1 +end + +~/.config/scripts/set_background "$(fd -a -t f -d 1 -E "$(basename "$IMG")" -e jpg -e png -e webp . "$argv[1]" | shuf -n1)" diff --git a/mirenn/home/files/dotfiles/.config/scripts/wallpapermenu b/mirenn/home/files/dotfiles/.config/scripts/wallpapermenu new file mode 100755 index 0000000..2d6e1a8 --- /dev/null +++ b/mirenn/home/files/dotfiles/.config/scripts/wallpapermenu @@ -0,0 +1,12 @@ +#!/usr/bin/env fish + +if test (count $argv) -lt 1; or not test -d $argv[1] + echo "Usage: $(status filename) <dir>" + exit 1 +end + +~/.config/scripts/set_background ( + for file in (fd -a -t f -d 1 -E "$(basename "$IMG")" -e jpg -e png -e webp . "$argv[1]") + echo -en "$file\0icon\x1fthumbnail://$file\n" + end | rofi -dmenu -p " " -show-icons -theme ~/.config/rofi/wallpapermenu.rasi +) |
