diff options
Diffstat (limited to '.wmii')
-rwxr-xr-x | .wmii/wmiirc | 269 | ||||
-rwxr-xr-x | .wmii/wmiirc_local | 29 | ||||
-rw-r--r-- | .wmii/wmiirc_solarized | 16 | ||||
-rw-r--r-- | .wmii/wmiirc_solarized_dark | 8 |
4 files changed, 322 insertions, 0 deletions
diff --git a/.wmii/wmiirc b/.wmii/wmiirc new file mode 100755 index 0000000..d41f392 --- /dev/null +++ b/.wmii/wmiirc @@ -0,0 +1,269 @@ +#!/bin/dash -f +# -*- mode: sh; -*- + +# Configure wmii +wmiiscript=wmiirc # For wmii.sh +. wmii.sh + +export WMII_FONT='xft:Monospace-8' +export WMII_TERM=x-terminal-emulator + +. $HOME/.wmii/wmiirc_local + +# Configuration Variables +UP=p +DOWN=n +LEFT=b +RIGHT=f + +# Bars +noticetimeout=5 +noticebar=/rbar/!notice + +# Colors tuples: "<text> <background> <border>" +. $HOME/.wmii/wmiirc_solarized_dark + +# Menu history +hist="${WMII_CONFPATH%%:*}/history" +histnum=5000 + +# Column Rules +wmiir write /colrules <<! +/gimp/ -> 17+83+41 +/.*/ -> 62+38 # Golden Ratio +! + +# Tagging Rules +wmiir write /tagrules <<! +/MPlayer|VLC/ -> ~ +/Gimp/ -> ~+gimp +/Emacs|Navigator/ -> +sel +! + +local_events() { true; } +wi_runconf -s wmiirc_local + +echo $WMII_NORMCOLORS | wmiir create $noticebar + +# Event processing +events() { + events_events + events_menus + events_actions + events_keybindings +} +events_events() { + cat <<'!' +# Events +Event CreateTag + echo "$WMII_NORMCOLORS" "$@" | wmiir create "/lbar/$@" +Event DestroyTag + wmiir remove "/lbar/$@" +Event FocusTag + wmiir xwrite "/lbar/$@" "$WMII_FOCUSCOLORS" "$@" +Event UnfocusTag + wmiir xwrite "/lbar/$@" "$WMII_NORMCOLORS" "$@" +Event UrgentTag + shift + wmiir xwrite "/lbar/$@" "*$@" +Event NotUrgentTag + shift + wmiir xwrite "/lbar/$@" "$@" +Event LeftBarClick LeftBarDND + shift + wmiir xwrite /ctl view "$@" +Event Unresponsive + { + client=$1; shift + msg="The following client is not responding. What would you like to do?$wi_newline" + resp=$(wihack -transient $client \ + xmessage -nearmouse -buttons Kill,Wait -print + -fn "${WMII_FONT%%,*}" "$msg $(wmiir read /client/sel/label)") + if [ "$resp" = Kill ]; then + wmiir xwrite /client/$client/ctl slay & + fi + }& +Event Notice + wmiir xwrite $noticebar $wi_arg + + kill $xpid 2>/dev/null # Let's hope this isn't reused... + { sleep $noticetimeout; wmiir xwrite $noticebar ' '; }& + xpid = $! +! +} + +events_menus() { + cat <<'!' +# Window menus +Menu Client-3-Delete + wmiir xwrite /client/$1/ctl kill +#Menu Client-3-Kill +# wmiir xwrite /client/$1/ctl slay +Menu Client-3-Fullscreen + wmiir xwrite /client/$1/ctl Fullscreen on +Event ClientMouseDown + wi_fnmenu Client $2 $1 & + +# LBar menus +Menu LBar-3-Delete + tag=$1; clients=$(wmiir read "/tag/$tag/index" | awk '/[^#]/{print $2}') + for c in $clients; do + if [ "$tag" = "$(wmiir read /client/$c/tags)" ]; then + wmiir xwrite /client/$c/ctl kill + else + wmiir xwrite /client/$c/tags -$tag + fi + if [ "$tag" = "$(wi_seltag)" ]; then + newtag=$(wi_tags | awk -v't='$tag ' + $1 == t { if(!l) getline l + print l + exit } + { l = $0 }') + wmiir xwrite /ctl view $newtag + fi + done +Event LeftBarMouseDown + wi_fnmenu LBar "$@" & +! +} + +events_actions() { + cat <<'!' +# Actions +Action showkeys + echo "$KeysHelp" | xmessage -file - -fn ${WMII_FONT%%,*} +Action quit + wmiir xwrite /ctl quit +Action exec + wmiir xwrite /ctl exec "$@" +Action rehash + wi_proglist $PATH >$progsfile +Action status + set +xv + if wmiir remove /rbar/status 2>/dev/null; then + sleep 2 + fi + echo "$WMII_NORMCOLORS" | wmiir create /rbar/status + while status | wmiir write /rbar/status; do + sleep 1 + done +! +} + +events_keybindings() { + cat <<'!' +# Key Bindings +KeyGroup Moving around +Key $MODKEY-$LEFT # Select the client to the left + wmiir xwrite /tag/sel/ctl select left +Key $MODKEY-$RIGHT # Select the client to the right + wmiir xwrite /tag/sel/ctl select right +Key $MODKEY-$UP # Select the client above + wmiir xwrite /tag/sel/ctl select up +Key $MODKEY-$DOWN # Select the client below + wmiir xwrite /tag/sel/ctl select down + +Key $MODKEY-space # Toggle between floating and managed layers + wmiir xwrite /tag/sel/ctl select toggle + +KeyGroup Moving clients around +Key $MODKEY-Shift-$LEFT # Move selected client to the left + wmiir xwrite /tag/sel/ctl send sel left +Key $MODKEY-Shift-$RIGHT # Move selected client to the right + wmiir xwrite /tag/sel/ctl send sel right +Key $MODKEY-Shift-$UP # Move selected client up + wmiir xwrite /tag/sel/ctl send sel up +Key $MODKEY-Shift-$DOWN # Move selected client down + wmiir xwrite /tag/sel/ctl send sel down + +Key $MODKEY-Shift-space # Toggle selected client between floating and managed layers + wmiir xwrite /tag/sel/ctl send sel toggle + +KeyGroup Moving through stacks +Key $MODKEY-Control-$UP # Select the stack above + wmiir xwrite /tag/sel/ctl select up stack +Key $MODKEY-Control-$DOWN # Select the stack below + wmiir xwrite /tag/sel/ctl select down stack + +KeyGroup Client actions +Key $MODKEY-shift-1 # Toggle selected client's fullsceen state + wmiir xwrite /client/sel/ctl Fullscreen toggle +Key $MODKEY-shift-0 # Close client + wmiir xwrite /client/sel/ctl kill + +KeyGroup Changing column modes +Key $MODKEY-d # Set column to default mode + wmiir xwrite /tag/sel/ctl colmode sel default-max +Key $MODKEY-s # Set column to stack mode + wmiir xwrite /tag/sel/ctl colmode sel stack-max +Key $MODKEY-m # Set column to max mode + wmiir xwrite /tag/sel/ctl colmode sel stack+max + +KeyGroup Running programs +Key $MODKEY-a # Open wmii actions menu + action $(wi_actions | wimenu -h "${hist}.actions" -n $histnum) & +Key $MODKEY-x # Open program menu + eval wmiir setsid "$(wimenu -h "${hist}.progs" -n $histnum <$progsfile)" & +Key $MODKEY-Return # Launch a terminal + eval wmiir setsid $WMII_TERM & + +KeyGroup Other +Key $MODKEY-Control-t # Toggle all other key bindings + case $(wmiir read /keys | wc -l | tr -d ' \t\n') in + 0|1) + echo -n "$Keys" | wmiir write /keys + wmiir xwrite /ctl grabmod $MODKEY;; + *) + wmiir xwrite /keys $MODKEY-Control-t + wmiir xwrite /ctl grabmod Mod3;; + esac + +KeyGroup Tag actions +Key $MODKEY-t # Change to another tag + (tag=$(wi_tags | wimenu -h "${hist}.tags" -n 50) && wmiir xwrite /ctl view $tag) & +Key $MODKEY-Shift-t # Retag the selected client + c=$(wi_selclient) + (tag=$(wi_tags | wimenu -h "${hist}.tags" -n 50) && wmiir xwrite /client/$c/tags $tag) & +! + for i in 0 1 2 3 4 5 6 7 8 9; do + cat <<'!' +Key $MODKEY-$i # Move to the numbered view + wmiir xwrite /ctl view "$i" +#Key $MODKEY-Shift-$i # Retag selected client with the numbered tag +# wmiir xwrite /client/sel/tags "$i" +! + done +} +wi_events events local_events + +# WM Configureation +wmiir write /ctl <<! + font $WMII_FONT + focuscolors $WMII_FOCUSCOLORS + normcolors $WMII_NORMCOLORS + grabmod $MODKEY + border 1 +! +xsetroot -solid "$WMII_BACKGROUND" & + +# Misc +progsfile="$(wmiir namespace)/.proglist" +action status & +wi_proglist $PATH >$progsfile & + +# Setup Tag Bar +IFS="$wi_newline" +wmiir rm $(wmiir ls /lbar | sed 's,^,/lbar/,') >/dev/null +seltag=$(wmiir read /tag/sel/ctl | sed 1q) +unset IFS +wi_tags | while read tag +do + if [ "$tag" = "$seltag" ]; then + echo "$WMII_FOCUSCOLORS" "$tag" + else + echo "$WMII_NORMCOLORS" "$tag" + fi | wmiir create "/lbar/$tag" +done + +wi_eventloop + diff --git a/.wmii/wmiirc_local b/.wmii/wmiirc_local new file mode 100755 index 0000000..8c1b397 --- /dev/null +++ b/.wmii/wmiirc_local @@ -0,0 +1,29 @@ +#!/bin/dash -f +# -*- mode: sh; -*- + +# wmiirc file for my HP Pavilion dv6426us laptop + +MODKEY=Mod4 + +status() { + buffer=$( + echo -n ' ' + + # CPU + # This doesn't work for me, it shows capacity + #echo -n 'Core MHz:' $(cat /proc/cpuinfo | grep 'cpu MHz' | sed 's/.*: //g; s/\..*//g;') + # This actually displays %idle + echo -n 'CPU: [ '$(tail -n3 ~/tmp/cputime|sed -u 's/ */\t/g'|cut -f3,12|sed 's/\t\(.*\)/(\1)/')' ]' + + #echo -n ' | ' + + #echo -n $(uptime | sed 's/.*://; s/,//g') + + echo -n ' | ' + + echo -n $(date) + + echo -n ' ' + ) + echo "$buffer" +} diff --git a/.wmii/wmiirc_solarized b/.wmii/wmiirc_solarized new file mode 100644 index 0000000..5dc830d --- /dev/null +++ b/.wmii/wmiirc_solarized @@ -0,0 +1,16 @@ +SOL_BASE03='#002b36' +SOL_BASE02='#073642' +SOL_BASE01='#586e75' +SOL_BASE00='#657b83' +SOL_BASE0='#839496' +SOL_BASE1='#93a1a1' +SOL_BASE2='#eee8d5' +SOL_BASE3='#fdf6e3' +SOL_YELLOW='#b58900' +SOL_ORANGE='#cb4b16' +SOL_RED='#dc322f' +SOL_MAGENTA='#d33682' +SOL_VIOLET='#6c71c4' +SOL_BLUE='#268bd2' +SOL_CYAN='#2aa198' +SOL_GREEN='#859900' diff --git a/.wmii/wmiirc_solarized_dark b/.wmii/wmiirc_solarized_dark new file mode 100644 index 0000000..4d663d2 --- /dev/null +++ b/.wmii/wmiirc_solarized_dark @@ -0,0 +1,8 @@ +# Solarized-dark + +. $HOME/.wmii/wmiirc_solarized + +# ="<text> <background> <border>" +WMII_NORMCOLORS="$SOL_BASE0 $SOL_BASE03 $SOL_BASE02" +WMII_FOCUSCOLORS="$SOL_BASE0 $SOL_BASE02 $SOL_BASE0" +WMII_BACKGROUND="$SOL_BASE02" |