Skip to content

Instantly share code, notes, and snippets.

@teffalump
Last active October 7, 2015 11:58
Show Gist options
  • Save teffalump/3161454 to your computer and use it in GitHub Desktop.
Save teffalump/3161454 to your computer and use it in GitHub Desktop.
dzen + conky + ratpoison for toggleable status bar
===== .CONKYRC ======
out_to_x no
background no
cpu_avg_samples 2
net_avg_samples 2
no_buffers yes
out_to_console yes
out_to_stderr no
extra_newline no
update_interval 1.0
uppercase no
use_spacer none
# I want a single line to output to dzen2; color needs to be changed to dzen2 format, too
# can change this to whatever you want
TEXT
^fg(grey)RAM: ^fg(green)$memperc% ^fg(grey)CPU: ^fg(green)$cpu% \
^fg(grey)U: ^fg(green)${upspeedf wlan0} ^fg(grey)D: ^fg(green)${downspeedf wlan0} \
^fg(grey)TOP_PROC: ^fg(green)${top name 1}^fg(grey)M:^fg(green)${top mem 1} \
^fg(grey)C:^fg(green)${top cpu 1} ^fg(yellow)${time %a.%d.%m.%Y %R}
===== END .CONKYRC ====
===== .RATPOISONRC ====
# kill old dzen process, start the conky piping to dzen process, set padding, and initially show statusbar
addhook quit exec killall dzen2
set padding 0 16 0 0
exec conky | dzen2 -ta c -e 'sigusr1=hide;sigusr2=unhide' -h '16' -fn 'inconsolata-g' &
# script to smartly toggle dzen --> all logic there
bind z exec ~/.ratpoison/dzconky.rp
===== END .RATPOISONRC ====
===== DZCONKY.RP ====
#!/bin/bash
# ok, dzen2 can be toggled
# now we need the logic to smartly toggle the padding and the status bar
#if the padding is "0 0 0 0" == hidden, therefore show it
#and vice versa
PADDING=$( ratpoison -c "set padding")
SHOW_P="0 0 0 0"
UNSHOW_P="0 16 0 0"
#change padding and signal dzen
if [ "$PADDING" == "$SHOW_P" ]
then
pkill -SIGUSR1 dzen && ratpoison -c "set padding $HIDE_P"
else
pkill -SIGUSR1 dzen && ratpoison -c "set padding $SHOW_P"
fi
===== END DZCONKY.RP ====
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment