Skip to content

Instantly share code, notes, and snippets.

@xyzshantaram
Created May 7, 2020 15:47
Show Gist options
  • Save xyzshantaram/18e3174c608f516a14ef278abc868fad to your computer and use it in GitHub Desktop.
Save xyzshantaram/18e3174c608f516a14ef278abc868fad to your computer and use it in GitHub Desktop.
#!/bin/sh
echo "Backing up existing config files if any..."
if [ -d "$HOME/.config/openbox" ]; then
cp -r "$HOME/.config/openbox" "$HOME/.config/openbox.bak"
rm -r "$HOME/.config/openbox"
fi
mkdir ~/.config/openbox
if [ -d "$HOME/.config/tint2" ]; then
cp -r "$HOME/.config/tint2" "$HOME/.config/tint2.bak"
rm -r "$HOME/.config/tint2"
fi
mkdir ~/.config/tint2
if [ -d "$HOME/.config/obmenu-generator" ]; then
cp -r "$HOME/.config/obmenu-generator" "$HOME/.config/obmenu-generator.bak"
rm -r "$HOME/.config/obmenu-generator"
fi
mkdir ~/.config/obmenu-generator
echo -n "->"
echo "openbox/rc.xml"
cp "$PWD/rc.xml" "$HOME/.config/openbox/rc.xml"
echo -n "->"
echo "openbox/autostart"
cp "$PWD/autostart" "$HOME/.config/openbox/autostart"
echo -n "->"
echo "openbox/menu.xml"
cp "$PWD/menu.xml" "$HOME/.config/openbox/menu.xml"
echo -n "->"
echo "tint2/tint2rc"
cp "$PWD/tint2rc" "$HOME/.config/tint2/tint2rc"
echo -n "->"
echo "init.sh"
cp "$PWD/init.sh" "$HOME/init.sh"
chmod +x "$HOME/init.sh"
echo -n "->"
echo "randomWallpaper.sh"
cp "$PWD/randomWallpaper.sh" "$HOME/randomWallpaper.sh"
chmod +x "$HOME/randomWallpaper.sh"
echo -n "->"
echo "setWall.sh"
cp "$PWD/setWall.sh" "$HOME/setWall.sh"
chmod +x "$HOME/setWall.sh"
echo -n "->"
echo "lemon.sh"
cp "$PWD/lemon.sh" "$HOME/lemon.sh"
chmod +x "$HOME/lemon.sh"
echo -n "->"
echo "volume_status.py"
cp "$PWD/volume_status.py" "$HOME/volume_status.py"
echo -n "->"
echo "obmenu-generator/schema.pl"
cp "$PWD/schema.pl" "$HOME/.config/obmenu-generator/schema.pl"
echo "Copied files successfully."
#!/bin/sh
sleep 2 && sh -c "~/setWall.sh" &
sleep 1 && export TERMINAL="urxvt" &
sleep 1 && sh -c "/usr/bin/locker.sh" &
sleep 1 && sh -c "xcompmgr" &
sleep 1 && sh -c "./lemon.sh | lemonbar -g 1366x28+0+0 -f \"Source Code Pro:size=10\" -n \"openbox\" | /bin/sh > /dev/null" &
sleep 1 && sh -c "xcape -e 'Super_L=Control_L|Shift_L|Alt_L|Super_L|D'" &
sleep 1 && tint2 &
sleep 1 && sh -c "blugon -f" &;
export QT_QPA_PLATFORMTHEME="qt5ct";
sleep 1 && lxqt-policykit-agent &;
parcellite &;
#!/bin/bash
FGCOLOR='#f5f4f0'
Clock() {
#TIME=$(date "+%S seconds past %H%M")
TIME=$(date "+%H%M+%S")
echo -e -n " ${TIME}"
}
Cal() {
DATE=$(date "+%a, %d %B %Y")
echo -e -n " ${DATE}"
}
ActiveWindow() {
len=$(echo -n "$(xdotool getwindowfocus getwindowname)" | wc -m)
max_len=55
name=$(xdotool getwindowfocus getwindowname)
if [ "$len" -gt "$max_len" ];then
echo -n "$(echo $name | cut -c 1-$max_len)..."
else
echo -n "$(xdotool getwindowfocus getwindowname)"
fi
}
Sound() {
echo -n $(python3 ~/volume_status.py)
}
CPUTemp() {
temp=$($(echo cat "/sys/class/thermal/$(ls /sys/class/thermal/ | grep thermal_zone | tail -1)/temp") | sed s/000//)
echo -e "cpu at ${temp}C"
}
while true; do
echo -ne "%{B#9e303030}%{l}"\
"%{B#F92672}%{F#303030}%{A:xdotool windowclose $(xdotool getwindowfocus getactivewindow):} c%{A}"\
"%{B#FD971F}%{A:xdotool windowminimize $(xdotool getwindowfocus getactivewindow):} m%{A}"\
"%{B#A6e22e}%{A:wmctrl -r \:ACTIVE\: -b toggle,maximized_vert,maximized_horz:} r%{A}"\
"%{F$FGCOLOR}%{B#9e303030} $(ActiveWindow) %{c}$(Clock) %{r}$(Cal)"\
"|%{A:gnome-system-monitor:} $(CPUTemp) %{A}|"\
"%{A:pamixer -t:}%{A4:pamixer --allow-boost -i 5:}%{A5:pamixer -d 5:}$(Sound)%{A} %{A} %{A}"
sleep 0.1s
done
#!/bin/bash
find ~/wallpapers -type f | shuf -n 1
#!/bin/sh
a=$(~/randomWallpaper.sh)
nitrogen --set-scaled $a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment