Posts: 1,228
secipolla
Joined: 15 Jun 2008
#1
I like to display the keyboard shortcuts with conky so I get used to them step-by-step. Only these shortcuts are different for each window manager so I created two different conkyrc files, one for icewm and one for fluxbox.
Also I made tiny scripts for the proper conkyrc file to be loaded in accordance with the window manager.

Step 1 - you have already a ~/.conkyrc file so you create another one for the other window manager. If you're in icewm, create ~/.conkyrcflux, if you're in fluxbox, create ~/.conkyrcice.

My conkyrc for icewm

Code: Select all

alignment top_right
background yes
border_width 1
cpu_avg_samples 2
default_color 5825c9
default_outline_color 5825c9
default_shade_color red
double_buffer yes
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no
use_xft yes
xftfont DejaVu Sans Mono:size=9
gap_x 25
gap_y 65
minimum_size 5 5
net_avg_samples 2
no_buffers yes
out_to_console no
out_to_stderr no
own_window yes
own_window_transparent yes
own_window_class Conky
#own_window_colour aecee0
own_window_type desktop
stippled_borders 0
update_interval 1.0
uppercase no
use_spacer left
show_graph_scale no
show_graph_range no

TEXT
$nodename - $sysname $kernel
$hr
Uptime:$alignr $color $uptime
Frequency (in MHz):$alignr $color $freq
RAM Usage:$alignr $color $mem/$memmax - $memperc%
Swap Usage:$alignr $color $swap/$swapmax - $swapperc%
CPU Usage:$alignr $color $cpu%
Processes:$alignr $color $processes  Running:$color $running_processes
$hr
File systems:
 / $color${fs_used /} +${fs_free /} ${fs_bar 6 /}
$hr
Networking:
Up:  ${upspeed eth0}$alignr Down:  ${downspeed eth0}
$hr
Super+space$alignr Run
Super+t$alignr Terminal
Super+f$alignr File Manager
Super+u$alignr Rox
Super+e$alignr Editor
Super+m$alignr Media Player
Super+w$alignr Web Browser
Super+n$alignr Htop
Super+o$alignr Conky on/off
PrtSc$alignr Screenshot
Insert$alignr Screensaver

Alt+Shift+F2$alignr Tile Vert
Alt+Shift+F3$alignr Tile Horz

Super+r$alignr Reboot
Super+x$alignr Shutdown
My conkyrc for fluxbox

Code: Select all

alignment top_right
background yes
border_width 1
cpu_avg_samples 2
default_color 5825c9
default_outline_color 5825c9
default_shade_color red
double_buffer yes
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no
use_xft yes
xftfont DejaVu Sans Mono:size=9
gap_x 25
gap_y 65
minimum_size 5 5
net_avg_samples 2
no_buffers yes
out_to_console no
out_to_stderr no
own_window yes
own_window_transparent yes
own_window_class Conky
#own_window_colour 6F728E
own_window_type desktop
stippled_borders 0
update_interval 1.0
uppercase no
use_spacer left
show_graph_scale no
show_graph_range no

TEXT
$nodename - $sysname $kernel
$hr
Uptime:$alignr $color $uptime
Frequency (in MHz):$alignr $color $freq
RAM Usage:$alignr $color $mem/$memmax - $memperc%
Swap Usage:$alignr $color $swap/$swapmax - $swapperc%
CPU Usage:$alignr $color $cpu%
Processes:$alignr $color $processes  Running:$color $running_processes
$hr
File systems:
 / $color${fs_used /} +${fs_free /} ${fs_bar 6 /}
$hr
Networking:
Up:  ${upspeed eth0}$alignr Down:  ${downspeed eth0}
$hr
Alt+d$alignr ShowDesktop
Alt+m$alignr Minimize
Alt+f$alignr Iceweasel
Alt+t$alignr Terminal
Alt+r$alignr RootMenu
Alt+s$alignr Screenshot
Alt+h$alignr Htop
Alt+c$alignr ControlCenter
Super+t$alignr Conky On/Off
Step 2 - create a folder ~/bin/ and two scripts in it, one for icewm to load its conky and another for fluxbox to load its own.
Open a new text file, paste the following text and save as conkyice:

Code: Select all

#!/bin/bash
mv ~/.conkyrc ~/.conkyrcflux && mv ~/.conkyrcice ~/.conkyrc
Then right-click it, choose 'properties' and check execute for owner, group and world/other users.

Open another new text file, paste the following text and save as conkyflux:

Code: Select all

#!/bin/bash
mv ~/.conkyrc ~/.conkyrcice && mv ~/.conkyrcflux ~/.conkyrc
Right-click it and make it executable as well.

Now if you go from fluxbox to icewm you only need to run conkyice (Super+spacebar, and type conkyice) and if you go from icewm to fluxbox you only need to run conkyflux to set the proper conky.
Last edited by secipolla on 23 Oct 2009, 14:23, edited 1 time in total.
Posts: 1,228
secipolla
Joined: 15 Jun 2008
#2
For the scripts to run at startup of icewm and fluxbox they would have to be expanded so they wouldn't make any change when starting the same window manager as the last time.
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#3
That a lot going on for conky. A better option would be to just create two conkyrc files, one for each WM and place them in their respective folders(~/.icewm + ~/.fluxbox). Next would be to just add a line to to respective startup script.

Fluxbox:
Open /home/username/.fluxbox/startup in leafpad or your favorite text editor(as user) and add

Code: Select all

sleep 5 && conky -c ~/.fluxbox/conkyrc &
Save and close.

Icewm:
Open /home/username/.icewm/startup in leafpad or your favorite text editor(as user) and add

Code: Select all

sleep 5 && conky -c ~/.icewm/conkyrc &
Save and close.

In both WM the line must be added before the line that starts the WM itself. 'sleep 5' is added to delay conky from starting to make sure the WM is running first. The -c option tells conky which file to read. The two files can be completely different or exactly the same, it doesn't matter.
Posts: 1,228
secipolla
Joined: 15 Jun 2008
#4
Thanks.
I used .conkyrc (hidden file) just to keep the habit. Also it works without the sleep command.
For Fluxbox, I added the command to ~/.fluxbox/apps file:

Code: Select all

[startup] {conky -c ~/.fluxbox/.conkyrc}
Posts: 1,228
secipolla
Joined: 15 Jun 2008
#5
I customized conkytoggle for each wm too:
conkytoggleice -

Code: Select all

#!/bin/sh

if pidof conky | grep [0-9] > /dev/null
then
 killall conky 
else
 conky -c ~/.icewm/.conkyrc
 fi
conkytoggleflux -

Code: Select all

#!/bin/sh

if pidof conky | grep [0-9] > /dev/null
then
 killall conky 
else
 conky -c ~/.fluxbox/.conkyrc
 fi
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#6
Interesting.