Added parameter to i3bar_wrapper.bash and updated conkyrcs.

i3bar_wrapper.bash now takes the conkyrc for the status line as the
first argument so host specific conkyrcs can be used. Additionaly, the
conkyrcs for virtualarch and netbook were updated. Virtualarch has
hardly changed, but netbook now has a quite short statusline that fits
the screen size.
This commit is contained in:
2013-09-30 01:30:28 +02:00
parent 977f91cf22
commit 5e8b37ec69
6 changed files with 205 additions and 21 deletions

View File

@@ -35,5 +35,6 @@ bar {
} }
i3bar_command i3bar i3bar_command i3bar
status_command conky --config ~/.i3/conky/netbook.conky #status_command i3status -c ~/.i3/i3status.d/netbook.conf
status_command bash ~/.i3/i3bar_wrapper.bash ~/.i3/conky/netbook.conkyrc
} }

View File

@@ -35,7 +35,7 @@ bar {
} }
i3bar_command i3bar i3bar_command i3bar
status_command bash ~/.i3/i3bar_wrapper.bash status_command bash ~/.i3/i3bar_wrapper.bash ~/.i3/conky/virtualarch.conkyrc
} }
bar { bar {

View File

@@ -1,16 +0,0 @@
out_to_console yes
out_to_ncurses no
out_to_stderr no
out_to_x no
short_units yes
update_interval 1.0
update_interval_on_battery 1.0
xftfont Consolas
TEXT
${if_up wlp2os0}W: ${addr wlp2s0} (${wireless_link_qual_perc wlp2s0}%)${else}W down$endif | \
BAT: ${battery_short} (${battery_time}) | \
${tztime} |

131
i3/i3/conky/netbook.conkyrc Normal file
View File

@@ -0,0 +1,131 @@
# vim:set filetype=conkyrc:
# TODO: coloring of LOAD should depend on number of cpus, as it scales accordingly
out_to_console yes
out_to_ncurses no
out_to_stderr no
out_to_x no
short_units yes
double_buffer yes
update_interval 1.0
update_interval_on_battery 1.0
# pad_percents is useless without use_spacer, but the latter leads to some ugly gaps
#pad_percents 2
#use_spacer left
TEXT
[
${if_existing /sys/class/net/wlp2s0}\
{ "full_text" : " \
W: \
${if_up wlp2s0}\
${if_match "${addr wlp2s0}" != "No Address"}\
${addr wlp2s0} @ ${wireless_essid wlp2s0} (${wireless_link_qual_perc wlp2s0}%)\
${else}\
No Address\
${endif}\
${else}\
down\
${endif}\
" , "color" : "\
${if_up wlp2s0}\
${if_match "${addr wlp2s0}" != "No Address"}\
${if_match ${wireless_link_qual_perc wlp2s0} <= 25}\
\#FF0000\
${else}${if_match ${wireless_link_qual_perc wlp2s0} <= 50}\
\#FFFF00\
${else}\
\#00FF00\
${endif}\
${endif}\
${else}\#FFFF00\
${endif}\
${else}\#FF0000\
${endif}\
" },
${endif}
\
\
\
${if_existing /sys/class/net/enp0s3}
{ "full_text" : " \
E: \
${if_up enp0s3}\
${addr enp0s3}\
${else}\
down\
${endif}\
" , "color" : "\
${if_up enp0s3}\
${if_match "${addr enp0s3}" != "No Address"}\#00FF00\
${else}\#FFFF00\
${endif}\
${else}\#FF0000\
${endif}\
" },
${endif}
\
\
\
${if_existing /sys/class/net/enp1s0}
{ "full_text" : " \
E: \
${if_up enp1s0}\
${addr enp1s0}\
${else}\
down\
${endif}\
" , "color" : "\
${if_up enp1s0}\
${if_match "${addr enp1s0}" != "No Address"}\#00FF00\
${else}\#FFFF00\
${endif}\
${else}\#FF0000\
${endif}\
" },
${endif}
\
\
\
${if_existing /sys/class/net/eth0}
{ "full_text" : " \
E: \
${if_up eth0}\
${addr eth0}\
${else}\
down\
${endif}\
" , "color" : "\
${if_up eth0}\
${if_match "${addr eth0}" != "No Address"}\#00FF00\
${else}\#FFFF00\
${endif}\
${else}\#FF0000\
${endif}\
" },
${endif}
\
\
\
{ "full_text" : " VOL: \
${if_match ${mixer} == 0}\
mute\
${else}\
${mixer}%\
${endif}\
" , "color" : "\#FFFFFF" },
\
\
\
${if_existing /sys/class/power_supply/BAT0}\
{ "full_text" : " BAT: ${battery_short BAT0} " , "color" : "\#FFFFFF" },
${endif}\
\
\
\
{ "full_text" : " ${time %a %F %T} " , "short_text" : " ${time %a %T} " , "color" : "\#FFFFFF" , "name" : "time" }
],

View File

@@ -74,13 +74,59 @@ ${endif}\
\ \
\ \
\ \
${if_mounted /home}\
{ "full_text" : " \
/home: ${fs_used /home}/${fs_size /home} (${fs_used_perc /home}%)\
" , "color" : "\
${if_match ${fs_used_perc /home} <= 70}\#00FF00\
${else}${if_match ${fs_used_perc /home} <= 90}\#FFFF00\
${else}\#FF0000\
${endif}\
${endif}\
" },
${endif}\
\
\
\
${if_existing /sys/class/net/wlp2s0}\
{ "full_text" : " \
wlp2s0: \
${if_up wlp2s0}\
${if_match "${addr wlp2s0}" != "No Address"}\
${addr wlp2s0} @ ${wireless_essid wlp2s0} (${wireless_link_qual_perc wlp2s0}%)\
${else}\
No Address\
${endif}\
${else}\
down\
${endif}\
" , "color" : "\
${if_up wlp2s0}\
${if_match "${addr wlp2s0}" != "No Address"}\
${if_match ${wireless_link_qual_perc wlp2s0} <= 25}\
\#FF0000\
${else}${if_match ${wireless_link_qual_perc wlp2s0} <= 50}\
\#FFFF00\
${else}\
\#00FF00\
${endif}\
${endif}\
${else}\#FFFF00\
${endif}\
${else}\#FF0000\
${endif}\
" },
${endif}
\
\
\
${if_existing /sys/class/net/enp0s3} ${if_existing /sys/class/net/enp0s3}
{ "full_text" : " \ { "full_text" : " \
enp0s3: \ enp0s3: \
${if_up enp0s3}\ ${if_up enp0s3}\
${addr enp0s3}\ ${addr enp0s3}\
${else}\ ${else}\
E: down\ down\
${endif}\ ${endif}\
" , "color" : "\ " , "color" : "\
${if_up enp0s3}\ ${if_up enp0s3}\
@@ -94,13 +140,33 @@ ${endif}
\ \
\ \
\ \
${if_existing /sys/class/net/enp1s0}
{ "full_text" : " \
enp1s0: \
${if_up enp1s0}\
${addr enp1s0}\
${else}\
down\
${endif}\
" , "color" : "\
${if_up enp1s0}\
${if_match "${addr enp1s0}" != "No Address"}\#00FF00\
${else}\#FFFF00\
${endif}\
${else}\#FF0000\
${endif}\
" },
${endif}
\
\
\
${if_existing /sys/class/net/eth0} ${if_existing /sys/class/net/eth0}
{ "full_text" : " \ { "full_text" : " \
eth0: \ eth0: \
${if_up eth0}\ ${if_up eth0}\
${addr eth0}\ ${addr eth0}\
${else}\ ${else}\
E: down\ down\
${endif}\ ${endif}\
" , "color" : "\ " , "color" : "\
${if_up eth0}\ ${if_up eth0}\

View File

@@ -1,6 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# From http://i3wm.org/docs/user-contributed/conky-i3bar.html # From http://i3wm.org/docs/user-contributed/conky-i3bar.html
path_conkyrc="$1"
# end the header so that i3bar knows we want to use JSON: # end the header so that i3bar knows we want to use JSON:
echo '{ "version": 1 ,"stop_signal": 10, "cont_signal": 12, "click_events" : true }' echo '{ "version": 1 ,"stop_signal": 10, "cont_signal": 12, "click_events" : true }'
@@ -11,7 +13,7 @@ echo '['
echo '[],' echo '[],'
# Now send blocks with information forever: # Now send blocks with information forever:
conky -c $HOME/.i3/conky/virtualarch.conky & conky -c "$path_conkyrc"
while read input ; do while read input ; do
bash ~/.i3/i3bar_clickparser.bash "$input" bash ~/.i3/i3bar_clickparser.bash "$input"