Skip to content

Instantly share code, notes, and snippets.

@mustafakibar
Forked from Skehmatics/day-mode
Created January 29, 2020 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mustafakibar/b7de9580d5a39ed3f71b9e7a0b503021 to your computer and use it in GitHub Desktop.
Save mustafakibar/b7de9580d5a39ed3f71b9e7a0b503021 to your computer and use it in GitHub Desktop.
#!/bin/bash
# export DBUS_SESSION_BUS_ADDRESS environment variable because cron hates me
PID=$(pgrep -u USER gnome-session-b)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
/usr/bin/gsettings set org.gnome.shell.extensions.user-theme name 'Flat-Plat'
/usr/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Flat-Plat'
/usr/bin/gsettings set org.gnome.desktop.background picture-uri 'file://WALLPAPER-PATH'
/usr/bin/gsettings --schemadir ~/.local/share/gnome-shell/extensions/drop-down-terminal@gs-extensions.zzrough.org set org.zzrough.gs-extensions.drop-down-terminal background-color 'rgb(69,90,100)'
#!/bin/bash
# export DBUS_SESSION_BUS_ADDRESS environment variable because cron hates me
PID=$(pgrep -o gnome-session -u "USER")
export DBUS_SESSION_BUS_ADDRESS=$(sudo grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
TIME="$(date '+%H%M')"
echo "The current time is $TIME"
CIVS="$(/usr/local/bin/find-twilight | cut -f1 -d\ )"
CIVE="$(/usr/local/bin/find-twilight | cut -f2 -d\ )"
echo "Daylight starts at $CIVS ends at $CIVE"
if [ $TIME -ge $CIVS ] && [ $TIME -le $CIVE ] ; then
echo "Switching to Day mode"
RESP=exec /usr/local/bin/day-mode
else
echo "Switching to Night mode"
RESP=exec /usr/local/bin/night-mode
fi
if [[ $RESP ]] ; then
echo "Switch failure"
else
echo "Switch sucess"
fi
#!/bin/bash
echo $(/usr/local/bin/solunar -c CITY --syslocal | grep 'Sunrise\|Sunset' | grep -Eo '[0-9]' | tr -d '\n' | grep -Eo '[0-9]{4,4}')
#!/bin/bash
# export DBUS_SESSION_BUS_ADDRESS environment variable because cron hates me
PID=$(pgrep -u USER gnome-session)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
/usr/bin/gsettings set org.gnome.shell.extensions.user-theme name 'Flat-Plat-Dark'
/usr/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Flat-Plat-Dark'
/usr/bin/gsettings set org.gnome.desktop.background picture-uri 'file://WALLPAPER-PATH'
/usr/bin/gsettings --schemadir ~/.local/share/gnome-shell/extensions/drop-down-terminal@gs-extensions.zzrough.org set org.zzrough.gs-extensions.drop-down-terminal background-color 'rgb(33,33,33)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment