Skip to content
arpinux edited this page Feb 3, 2012 · 23 revisions

Tips

create a custom launcher

wmfs² integrate a native prompt available with the [Super]+[p] keybind. but you can create as many launchers as you want:

  • ssh launcher: an SSH launcher enables you to start an SSH session in a new terminal window.
    To create an SSH launcher, add the following to the [launcher] section of your wmfsrc:
# ssh launcher
[launcher]
       name    = "launcher_ssh" 
       prompt  = "SSH to: " 
       command = "spawn urxvtc -e ssh"
       width   = 150
[/launcher]

to execute the launcher_ssh command, add the following to the [keys] section of your wmfsrc:

[key] mod = {"Alt", "Shift"} key = "p" func = "launcher" cmd = "launcher_ssh" [/key]

Now simply press Alt+Shift+P and enter ‘user@host’ at the prompt to launch an SSH session in a new terminal window.

  • man page launcher: a man page launcher enables you to quickly launch man pages in a temporary terminal which closes when you exit the man page.
    Add the following to the [launchers] section of your wmfsrc:
# man page launcher
[launcher]
    name = "launcher_man" 
    prompt = "Man: " 
    command = "spawn xterm -e man"
    width = 150
[/launcher]

bind a hotkey to the man page launcher by adding the following to the [keys] section:

[key] mod = {"Alt"} key = "m" func = "launcher" cmd = "launcher_man" [/key]

control mocp from the statusbar

a script is using to control mocp and conky display information about the current track.
screenshot:
status mocp
code:

#!/bin/bash
clear="#C7C7C7"
grey="#7D7D7D"
music(){
    music="$(conky -c ~/.config/wmfs/conkyrc_mocp)"
    echo "$music"
}
TIMING=5
statustext()
{
     wmfs -c status "testbar ^s[left;$clear;         mocp>](1;spawn;urxvt -e mocp)\
     ^s[left;$grey;·prev·](1;spawn;mocp -r)\
     ^s[left;$grey;play·](1;spawn;mocp -p)\
     ^s[left;$grey;next·](1;spawn;mocp -f)\
     ^s[left;$grey;pause·](1;spawn;mocp -G)\
     ^s[left;$clear;<$(music)]"
}
while true;
do
    statustext
    sleep $TIMING
done

conkyrc launched by the script.

cpubar in the statusbar

screenshot:
wmfs cpubar
code:

#!/bin/bash

##cpubar properties: edit for your configuration##
barx=“150” # bar x position
bary=“1” # bar y position
barw=“100” # bar width
barh=“12” # bar height
barc=“#AABBAA” # cpubar color
barb=“#445544” # border color
borderw=“2” # border width
label=“cpu” # text to display
labelc=“#AABBAA” # text color
offset=“20” # horizontal text offset: negative value display label inside the bar
barname=“bartest” # name of the bar to display cpubar: comment to display on default statusbar

##cpubar datas##
cpubar(){
##cpu info##
cpu="$(eval $(awk ‘/^cpu /{print “previdle=” $5 “; prevtotal=” $2+$3+$4+$5 }’ /proc/stat); sleep 0.4;
eval $(awk ‘/^cpu /{print “idle=” $5 “; total=” $2+$3+$4+$5 }’ /proc/stat);
intervaltotal=$((total-${prevtotal:-0}));
echo “$((100*( (intervaltotal) – ($idle-${previdle:-0}) ) / (intervaltotal) ))”)"
##cpubar info##
cpubarx=“$(($barx+$borderw))”
cpubary=“$(($bary+$borderw))”
cpubarh=“$(($barh – (($borderw*2)) ))”
cpubarmax=“$(($barw – (($borderw*2)) ))”
cpubarw=“$(echo $cpu*$cpubarmax/100 | bc -l)”
labelx=“$(($barx-offset))”
labely=“$(($barh-$borderw))”
##cpubar##
echo “^R[$barx;$bary;$barw;$barh;$barb]^R[$cpubarx;$cpubary;$cpubarw;$cpubarh;$barc]^s[$labelx;$labely;$labelc;$label]”
}
TIMING=1
##display cpubar##
statustext()
{
wmfs -c status “$barname $(cpubar)”
}
while true;
do
statustext
sleep $TIMING
done

transform the statusbar in a dock

the clickable statusbar feature let you integrate a dock in the wmfs² statusbar. here is an example of a “text-dock’ but you can easily disply icons with the code ^i[<position>;<dimensions>;<imagepath>].
screenshot:
status dock
code:

#!/bin/bash
#colors
clear=”#C7C7C7"
grey=“#7D7D7D”
wmfs -c status “testbar ^s[left;$clear; short>]^s[left;$grey;· todo ·](1;spawn;dmenu-todo.sh)\
^s[left;$grey; wall ·](1;spawn;randwalls_wmfs.sh)\
^s[left;$grey; home ·](1;spawn;rox-filer)\
^s[left;$grey; www ·](1;spawn;luakit)\
^s[left;$grey; vim ·](1;spawn;urxvtc -T editor -e vim)\
^s[left;$grey; irc·](1;spawn;urxvtc -T irc -e screen irssi)\
^s[left;$grey; ~git ·](1;spawn;urxvtc -e ranger /home/arp/pkgs/wmfs/)\
^s[left;$grey; ~cfg ·](1;spawn;urxvtc -e ranger /home/arp/.config/wmfs/)”
Clone this wiki locally