Compare commits

...

7 Commits

Author SHA1 Message Date
deadvey
2153ce4930 2024-12-13 16:31 : id 450 2024-12-13 16:31:51 +00:00
deadvey
9405b7b668 2024-12-13 16:23 : id 449 2024-12-13 16:30:47 +00:00
deadvey
14e5e385fc 2024-12-13 16:23 : id 449 2024-12-13 16:30:05 +00:00
deadvey
c07820a99d 2024-12-13 16:23 : id 449 2024-12-13 16:27:45 +00:00
deadvey
aadc885d13 2024-12-13 16:23 : id 449 2024-12-13 16:26:50 +00:00
deadvey
9275a6b47a 2024-12-13 16:23 : id 449 2024-12-13 16:23:46 +00:00
deadvey
0a1e97d8d0 2024-12-13 16:20 : id 448 2024-12-13 16:23:30 +00:00
2 changed files with 10 additions and 38 deletions

View File

@ -93,19 +93,6 @@ in
size = 16;
};
file = {
"scripts/wallpaper-watcher.sh" = {
text = ''
file=""
while [ 1 == 1 ]; do
new_file=$(cat $HOME/scripts/wallpaper-updater.sh)
if [[ "$new_file" != "$file" ]]; then
bash $HOME/scripts/wallpaper-updater.sh
fi
file=$new_file
done
'';
executable = true;
};
"scripts/wallpaper-updater.sh" = {
text = ''
#magick ${WALLPAPER_PATH} -fuzz 10% -fill "#${BG}" -opaque "$(convert ${WALLPAPER_PATH} -format "%[pixel:u.p{0,0}]" info:-)" ${WALLPAPER_PATH}
@ -121,32 +108,17 @@ in
'';
executable = true;
};
"scripts/mode-switcher-based-on-sunlight.sh" = {
"scripts/theme-switcher.sh" = {
text = ''
run_a_command() {
if [[ "$light" == "DAY" ]]; then
sed -i 's/MODE\ =\ ".*"/MODE\ =\ "light"/' $HOME/.config/home-manager/home.nix
home-manager switch
else
sed -i 's/MODE\ =\ ".*"/MODE\ =\ "dark"/' $HOME/.config/home-manager/home.nix
home-manager switch
fi
};
#!/bin/bash
# Set your latitude and longitude
LATITUDE="53.43N"
LONGITUDE="-1.89E"
# Calculate the sunrise and sunset times for today using sunwait
light=$(sunwait poll $LATITUDE $LONGITUDE)
run_a_command
while sleep 5; do
new_light=$(sunwait poll $LATITUDE $LONGITUDE)
if [[ "$new_light" != "$light" ]]; then
run_a_command
fi
done
echo theme = $1
echo mode = $2
sed -i "s/THEME\ =\ ".*"/THEME\ =\ \"''${1}\";/" $HOME/.config/home-manager/home.nix
sed -i "s/MODE\ =\ ".*"/MODE\ =\ \"''${2}\";/" $HOME/.config/home-manager/home.nix
home-manager switch
bash $HOME/scripts/wallpaper-updater.sh
oldid=$(pgrep wpaperd)
wpaperd &
kill $oldid
'';
executable = true;
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 186 KiB