Skip to content

Instantly share code, notes, and snippets.

@robins35
Created January 7, 2016 14:35
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 robins35/74b1fb5cd0883d44ca1c to your computer and use it in GitHub Desktop.
Save robins35/74b1fb5cd0883d44ca1c to your computer and use it in GitHub Desktop.
#! /bin/bash
feh --bg-scale Pictures/forest-patrol.jpg &
~/.config/dwm/lemonbarstart.sh &
exec dwm
#! /bin/bash
. $(dirname $0)/panelrc
makebar() {
MAX=20
CUR=$(($1 / 5))
for v in $(seq 0 $((MAX - 1))); do
if [[ "$v" -lt "$CUR" ]]; then
bar="${bar}${yellow}${volbar}"
else
bar="${bar}${light4}${volbar}"
fi
done
echo "${bar}"
}
volume() {
echo "$(awk '/dB/ { gsub(/[\[\]]/,""); print $4}' <(amixer get Master))" | sed 's/%//'
}
volume_bar() {
echo "${yellow}\uf028 ${light2}$(makebar $(volume))"
}
calendar() {
ICON="\uf073"
echo "${green}$ICON $(date '+%a %d')"
}
clock() {
ICON="\uf017"
echo $ICON $(date '+%I:%M %P')
}
conky_stats() {
CONKY="$(conky -i 1)"
CPU1="$(echo $CONKY | ruby -e "puts STDIN.readline.split('::')[0]")"
CPU2="$(echo $CONKY | ruby -e "puts STDIN.readline.split('::')[1]")"
MEM="$(echo $CONKY | ruby -e "puts STDIN.readline.split('::')[2]")"
CPU_ICON="\uf108"
MEM_ICON="\uf0a0"
echo "${green}${CPU_ICON} $CPU1% ${CPU_ICON} $CPU2% ${blue}${MEM_ICON} $MEM%"
}
sep() {
echo " "
}
while :; do
echo -e "%{l} $(conky_stats)%{l}%{r}$(volume_bar) $(sep) $(calendar) ${light2}$(clock) %{r}"
sleep 0.2s
done
#! /bin/bash
. $(dirname $0)/panelrc
if [ $(pgrep -cx lemonbar) -gt 0 ] ; then
printf "%s\n" "The panel is already running. Killing previous one" >&2
kill $(pgrep -f "lemonbar -p")
fi
~/.config/dwm/lemonbar.sh | lemonbar -p -d -F ${FG} -B ${BG} -g ${GEOMETRY} -f ${FONT2} -f ${FONT3} -f ${FONT4} | bash
### FONTS
#FONT1="PragmataPro-14"
FONT2="Terminus:size=14:style=Bold"
FONT3="FontAwesome:size=12"
FONT4="DejaVuSans"
#FONT5="FreeMono-14"
PANEL_HEIGHT=28
GEOMETRY="1920x${PANEL_HEIGHT}+0+0"
### COLORS
FG="#CAC9C6"
BG="#2E2F33"
LIGHT1="#B8B7B5"
LIGHT2="#B8B7B5"
LIGHT3="#A2A7B5"
LIGHT4="#878B97"
YELLOW="#F7B646"
ORANGE="#EF933F"
BLUE="#4887BB"
GREEN="#98A81D"
### LEMONBAR FORMATTED
fg='%{F#ffCAC9C6}'
bg='%{F#ff2E2F33}'
orange='%{F#ffEF933F}'
yellow='%{F#ffF7B646}'
red='%{F#ffCE5239}'
green='%{F#ff98A81D}'
blue='%{F#ff4887BB}'
darkblue='%{F#ff3973A3}'
light1='%{F#ffC9C9C6}'
light2='%{F#ffB8B7B5}'
light3='%{F#ffA2A7B5}'
light4='%{F#ff878B97}'
### OTHER
volbar="━"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment