Skip to content
This repository has been archived by the owner on Mar 1, 2019. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bohoomil committed Jan 1, 2012
1 parent 70058c3 commit 79edfeb
Show file tree
Hide file tree
Showing 5 changed files with 268 additions and 0 deletions.
24 changes: 24 additions & 0 deletions evilwm/dzen-evil-left.sh
@@ -0,0 +1,24 @@
#!/bin/zsh
# status script for evilwm - right
SLEEP=1

BG="#000000"
FG="#8A9199"

tags(){
tg=$(xprop -root _NET_CURRENT_DESKTOP|sed 's/_NET_CURRENT_DESKTOP(CARDINAL) = //;s/0x0/ /g;s/0x/\\x/g;s/, //g;')
tgc=$(($tg + 1))
print -n "^fg(#5F87AF)[$tgc]^fg($FG)"
}

win(){
ID=$(xprop -root _NET_ACTIVE_WINDOW | sed 's/_NET_ACTIVE_WINDOW(WINDOW): window id # //')
client=$(xprop -id "$ID" | grep "_NET_WM_NAME(UTF8_STRING)" | sed 's/_NET_WM_NAME(UTF8_STRING) = //;s/^"/\[/g;s/"$/\]/g')
print -n " $client "
}

while true; do
print -n " $(tags) $(win)\n"
sleep $SLEEP
done | dzen2 -fn '-*-terminus-medium-r-*-*-12-*-*-*-*-*-iso10646-1' -bg $BG -h 15 -x 0 -y 0 -w 840 -ta l -e ''

116 changes: 116 additions & 0 deletions evilwm/dzen-evil-right.sh
@@ -0,0 +1,116 @@
#!/bin/zsh
# Status script for evilwm - left
SLEEP=1

#ICON="$HOME/.dzen/icons"
MAILDIRS="/home/data/mail/"
IFACE=wlan0
RXB=`cat /sys/class/net/${IFACE}/statistics/rx_bytes`
TXB=`cat /sys/class/net/${IFACE}/statistics/tx_bytes`
BG="#000000"
FG="#5E6875"
#SEP="^fg(#0F2133):^fg($FG)"

netmon() {
RXBN=`cat /sys/class/net/${IFACE}/statistics/rx_bytes`
TXBN=`cat /sys/class/net/${IFACE}/statistics/tx_bytes`
RXR=$(printf "%4d\n" $(echo "($RXBN - $RXB) / 1024/${SLEEP}" | bc))
TXR=$(printf "%4d\n" $(echo "($TXBN - $TXB) / 1024/${SLEEP}" | bc))
print -n "^fg($FG)UP^fg(#005999)${RXR} kB/s ^fg($FG)DOWN^fg(#4D578C)${TXR} kB/s^fg($FG)"
RXB=$RXBN
TXB=$TXBN
}

loc(){
loc=`$HOME/bin/loc.sh`
if [[ $loc == XX ]]; then
#red
print "^fg($FG)GEO ^fg(#B3354C)$loc^fg($FG)"
else
#blue
print "^fg($FG)GEO ^fg(#3987BF)$loc^fg($FG)"
fi
}

# CPU line courtesy Procyon: https://bbs.archlinux.org/viewtopic.php?pid=661592
cpu(){
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) ))")"
if [[ "$cpu" -ge 0 ]] && [[ "$cpu" -le 9 ]]; then
#green
print -n "^fg($FG)CPU ^fg(#4BA65A)$cpu%^fg($FG)"
elif [[ "$cpu" -ge 10 ]] && [[ "$cpu" -le 24 ]]; then
#cyan light
print -n "^fg($FG)CPU ^fg(#31A6A6)$cpu%^fg($FG)"
elif [[ "$cpu" -ge 25 ]] && [[ "$cpu" -le 49 ]]; then
#yellow
print -n "^fg($FG)CPU ^fg(#BFA572)$cpu%^fg($FG)"
elif [[ "$cpu" -ge 50 ]] && [[ "$cpu" -le 74 ]]; then
#magenta
print -n "^fg($FG)CPU ^fg(#A64286)$cpu%^fg($FG)"
else
#red
print -n "^fg($FG)CPU ^fg(#B3354C)$cpu%^fg($FG)"
fi
}

mem(){
mem="$(free -m |awk '/cache:/ { print $3"M" }')"
#yellow
print -n "^fg($FG)MEM ^fg(#807933)$mem^fg($FG)"
}

hdd(){
hdd1="$(df /dev/sda5 | awk '/^\/dev/{printf "%s ", $5}' | sed '$s/.$//')"
hdd2="$(df /dev/sda3 | awk '/^\/dev/{printf $5"\n"}')"
hddt="$(curl --connect-timeout 1 -fsm 3 telnet://127.0.0.1:7634 | cut -c 34-35)"
#cyan magenta
print -n "^fg($FG)HFS ^fg(#008080)$hdd2 ^fg($FG)TMP ^fg(#A64286)$hddt°C^fg($FG)"
}

eml(){
ml=`find "$MAILDIRS"/*/INBOX/new -type f | wc -l`
if [[ $ml == 0 ]]; then
#black
print -n "^fg($FG)EML ^fg(#585858)0^fg($FG)"
else
#red
print -n "^fg($FG)EML ^fg(#B3354C)$ml^fg($FG)"
fi
}

dte(){
dt=`date '+%a %d.%m, %H:%M'`
print -n "^fg(#5F87AF)$dt^fg($FG)"
}

vol(){
level="$(amixer get PCM | tail -1 | sed 's/.*\[\([0-9]*%\)\].*/\1/')"
mix=`amixer | tail -1`;
if [[ $mix == *\[off\]* ]]
then
print -n "^fg($FG)VOL ^fg(#802626)OFF^fg($FG)"
elif [[ $mix == *\[on\]* ]]
then
print -n "^fg($FG)VOL ^fg(#3F7347)$level^fg($FG)"
else
print -n "^fg($FG)VOL ^fg(#802626)---^fg($FG)"
fi
}

pkg(){
pac="$(pacman -Qu | wc -l)"
if [[ $pac == 0 ]]; then
print -n "^fg($FG)PKG 0^fg($FG)"
else
print -n "^fg($FG)PKG ^fg(#802535)$pac^fg($FG)"
fi
}

while true; do
print -n " $(loc) $(cpu) $(mem) $(hdd) $(eml) $(pkg) $(dte) $(vol) \n"
sleep $SLEEP
done | dzen2 -fn '-*-terminus-medium-r-*-*-12-*-*-*-*-*-iso10646-1' -bg $BG -h 15 -x 840 -y 0 -ta r -e ''

8 changes: 8 additions & 0 deletions evilwm/evilwmrc
@@ -0,0 +1,8 @@

term urxvt
snap 10
bw 2
fg #005577
fc #A64286
mask1 mod4
bg #001833
81 changes: 81 additions & 0 deletions evilwm/xbindkeysrc
@@ -0,0 +1,81 @@
# For the benefit of emacs users: -*- shell-script -*-
#
# Version: 1.8.5
#
# If you edit this file, do not forget to uncomment any lines
# that you change.
# The pound(#) symbol may be used anywhere for comments.
#
# To specify a key, you can use 'xbindkeys --key' or
# 'xbindkeys --multikey' and put one of the two lines in this file.
#
# The format of a command line is:
# "command to start"
# associated key
#
#
# A list of keys is in /usr/include/X11/keysym.h and in
# /usr/include/X11/keysymdef.h
# The XK_ is not needed.
#
# List of modifier:
# Release, Control, Shift, Mod1 (Alt), Mod2 (NumLock),
# Mod3 (CapsLock), Mod4, Mod5 (Scroll).
#

# The release modifier is not a standard X modifier, but you can
# use it if you want to catch release events instead of press events

# By defaults, xbindkeys does not pay attention with the modifiers
# NumLock, CapsLock and ScrollLock.
# Uncomment the lines above if you want to pay attention to them.

#keystate_numlock = enable
#keystate_capslock = enable
#keystate_scrolllock= enable

###########################
# xbindkeys configuration #
###########################

"xbindkeys_show"
control+shift + q

# specify a mouse button
"urxvtc"
control + b:2

"urxvtc -e tmux"
m:0xc + c:28

"/usr/local/bin/dmenu-dwm"
m:0x0 + c:135

"firefox"
m:0xc + c:56

"deadbeef"
m:0xc + c:40

"urxvt-term"
m:0xc + c:53

"urxvt-fm"
m:0xc + c:41

"urxvt-pad"
m:0xc + c:33

"sudo pm-suspend"
m:0x45 + c:39

"sudo shutdown -h now"
m:0x45 + c:43

"sudo shotdown -r now"
m:0x45 + c:27


##################################
# End of xbindkeys configuration #
##################################
39 changes: 39 additions & 0 deletions evilwm/xinitrc
@@ -0,0 +1,39 @@

if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/* ; do
[ -x "$f" ] && . "$f"
done
unset f
fi

/usr/bin/urxvtd -q -o -f &

xrdb -load $HOME/.Xresources

xset r rate 200 30

sh $HOME/.fehbg &

dunst &

unclutter -idle 5 &

parcellite -n &

xautolock -time 60 -locker "sudo pm-suspend" &

nvidia-settings -a GlyphCache=1
nvidia-settings -a InitialPixmapPlacement=2

## evilwm #######################################
xsetroot -cursor_name left_ptr
xbindkeys -f $HOME/.xbindkeysrc &
evilwm &
$HOME/bin/dzen-evil-left.sh &
exec $HOME/bin/dzen-evil-right.sh

## xterm ########################################
#xterm -geometry 80x60+600+0 &
#exec xterm -geometry 80x60+0+0 -name login

# vim:set ts=2 sw=2 ft=sh et:

0 comments on commit 79edfeb

Please sign in to comment.