Skip to content

Instantly share code, notes, and snippets.

@l13t
Forked from Skehmatics/day-mode
Created April 17, 2017 21:40
Show Gist options
  • Save l13t/2baad1aca70d48258c22ca6357762050 to your computer and use it in GitHub Desktop.
Save l13t/2baad1aca70d48258c22ca6357762050 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/[email protected] 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/[email protected] 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