This commit is contained in:
EdenQwQ 2025-03-01 22:35:08 +08:00
commit 96895ec3aa
100 changed files with 6349 additions and 0 deletions

View file

@ -0,0 +1,9 @@
#!/bin/sh
wallpapers_dir="$HOME/Pictures/Wallpapers/generated"
wall=$(ls $wallpapers_dir | grep -v '\-blurred\.jpg$' | tofi)
if [ -z $wall ]; then
exit
fi
output=$(niri msg -j focused-output | jq -r .name)
swww img -o $output $wallpapers_dir/$wall --transition-type random --transition-duration 1

View file

@ -0,0 +1,7 @@
#!/bin/sh
wall=$(yad --file)
if [[ $wall == "" ]]; then
exit
fi
swww img $wall --transition-type random --transition-duration 1

View file

@ -0,0 +1,27 @@
#!/bin/sh
current_profile=~/.local/state/nix/profiles/home-manager
current_os_profile=/nix/var/nix/profiles/system
specialisations=$(find /nix/store/*home-manager-generation/ -lname "$(realpath $current_profile)")
os_specialisations=$(find /nix/store/*nixos-system* -lname "$(realpath $current_os_profile)")
if [ -z "$specialisations" ]; then
specialisations=$current_profile/specialisation
else
specialisations=$(dirname "$specialisations")
fi
if [ -z "$os_specialisations" ]; then
os_specialisations=$current_os_profile/specialisation
else
specialisations=$(dirname "$specialisations")
fi
colorscheme=$( (ls "$specialisations"; echo default) | tofi --require-match=false)
if [ -z "$colorscheme" ]; then
exit 1
fi
if [ "$colorscheme" = "default" ]; then
colorscheme=".."
fi
"$specialisations/$colorscheme"/activate
doas "$os_specialisations/$colorscheme"/bin/switch-to-configuration switch

View file

@ -0,0 +1,9 @@
#!/bin/sh
tofi_dmenu() {
tofi --prompt-text $1 --fuzzy-match true --terminal "kitty"
}
tofi_full() {
tofi -c ~/.config/tofi/config-full --prompt-text $1 --fuzzy-match true --terminal "kitty"
}

View file

@ -0,0 +1,5 @@
#!/bin/sh
. ~/scripts/tofi/config
printf "yes\nno" | tofi_full $1

View file

@ -0,0 +1,18 @@
#!/bin/sh
tmpfile=~/scripts/tofi/stored_commands
stored=$(cat $tmpfile)
command=$(echo "$stored" | tofi --require-match=false)
if [ -z "$command" ]; then
exit 1
fi
exec $command &
if grep -q "$command" "$tmpfile"; then
exit 1
fi
echo "$command" >> $tmpfile

View file

@ -0,0 +1,9 @@
#!/bin/sh
. ~/scripts/tofi/config
entry=$(printf "power-saver\nbalanced\nperformance" | tofi_full "mode")
entry=$(echo $entry | cut -d' ' -f2 )
notify-send "Power Mode" "Setting mode to $entry"
doas powerprofilesctl set $entry

View file

@ -0,0 +1,21 @@
#!/bin/sh
. ~/scripts/tofi/config
entry=$(printf "⏻ poweroff\n reboot\n mode\n exit\n suspend" | tofi_full "power")
entry=$(echo $entry | cut -d' ' -f2 )
if [ "$entry" = "poweroff" ] || [ "$entry" = "reboot" ]; then
if [ "$(~/scripts/tofi/confirm "confirm")" = "yes" ]; then
doas $entry
fi
elif [ "$entry" = "suspend" ]; then
systemctl suspend
elif [ "$entry" = "mode" ]; then
~/scripts/tofi/mode
elif [ "$entry" = "exit" ]; then
if [ "$(~/scripts/tofi/confirm "exit?")" = "yes" ]; then
doas killall swhkd swhks
wayland-logout
fi
fi