mirror of
https://github.com/EdenQwQ/nixos.git
synced 2026-05-11 17:35:56 +08:00
init
This commit is contained in:
commit
96895ec3aa
100 changed files with 6349 additions and 0 deletions
9
home/programs/desktop/scripts/change-wal-niri
Executable file
9
home/programs/desktop/scripts/change-wal-niri
Executable 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
|
||||
7
home/programs/desktop/scripts/change-wal-wayland
Executable file
7
home/programs/desktop/scripts/change-wal-wayland
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
wall=$(yad --file)
|
||||
if [[ $wall == "" ]]; then
|
||||
exit
|
||||
fi
|
||||
swww img $wall --transition-type random --transition-duration 1
|
||||
27
home/programs/desktop/scripts/tofi/colorscheme
Executable file
27
home/programs/desktop/scripts/tofi/colorscheme
Executable 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
|
||||
9
home/programs/desktop/scripts/tofi/config
Executable file
9
home/programs/desktop/scripts/tofi/config
Executable 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"
|
||||
}
|
||||
5
home/programs/desktop/scripts/tofi/confirm
Executable file
5
home/programs/desktop/scripts/tofi/confirm
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ~/scripts/tofi/config
|
||||
|
||||
printf "yes\nno" | tofi_full $1
|
||||
18
home/programs/desktop/scripts/tofi/custom-command
Executable file
18
home/programs/desktop/scripts/tofi/custom-command
Executable 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
|
||||
9
home/programs/desktop/scripts/tofi/mode
Executable file
9
home/programs/desktop/scripts/tofi/mode
Executable 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
|
||||
21
home/programs/desktop/scripts/tofi/powermenu
Executable file
21
home/programs/desktop/scripts/tofi/powermenu
Executable 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue