Compare commits
7 Commits
dd4790155e
...
2153ce4930
Author | SHA1 | Date | |
---|---|---|---|
|
2153ce4930 | ||
|
9405b7b668 | ||
|
14e5e385fc | ||
|
c07820a99d | ||
|
aadc885d13 | ||
|
9275a6b47a | ||
|
0a1e97d8d0 |
@ -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 |
Loading…
Reference in New Issue
Block a user