You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.3 KiB

#!/bin/sh
#eval "$(gpg-agent --daemon)"
#urxvtd -q -o -f && urxvtc &
#amixer -q set Headphone mute &
#feh --bg-scale docs/multimedia/images/wallpapers/006.jpg &
display -flop -backdrop -window root /home/hd215/Pictures/5WNZg.jpg
#display -window root /home/hd215/Pictures/tYmM8.jpg
#xsetroot -solid black
#sleep 3 && firefox &
wifi(){
STATUS="X`/sbin/iwgetid`"
if test "$STATUS" != "X" ; then
ESSID="`/sbin/iwgetid |awk -F ":" '{print $2}'|sed -e 's/"//g'`"
LINK="`awk '/ra0:/ {print $3}' /proc/net/wireless |sed -e 's/\.//g'`"
echo " $ESSID:$LINK"
fi
}
batt(){
FULL=`cat /sys/class/power_supply/BAT0/charge_full`
PRESENT=`cat /sys/class/power_supply/BAT0/present`
CHARGE=`cat /sys/class/power_supply/BAT0/charge_now`
STATUS=`cat /sys/class/power_supply/BAT0/status`
if test "$PRESENT" != "0" ; then
CHARGE=$((${CHARGE}*100/${FULL}))
case $STATUS in
Full)
SIGN="=";;
Charging)
SIGN="+";;
Discharging)
SIGN="-";;
esac
if test "${CHARGE}" -lt "15" & "${SIGN}" = "-" ; then
echo " LOW POWER ${CHARGE}${SIGN}"
else
echo " ${CHARGE}${SIGN}"
fi
else
echo " AC"
fi
}
volume(){
STATUS="`amixer get Master |awk '/Mono:/ {print $6}'`"
if test "$STATUS" != "[on]" ; then
echo " Mute"
else
echo " `/usr/bin/amixer get Master |awk '/Mono:/ {print $4}' | sed -e 's/\[//g'|sed -e 's/%\]//g'`v"
fi
}
cmusstats(){
if test "X`pgrep cmus`" != "X" ; then
TIME="`cmus-remote -Q |awk '/duration/ {print $2}'`"
CURR="`cmus-remote -Q |awk '/position/ {print $2}'`"
ARTIST="`cmus-remote -Q |sed -ne '/artist/s/tag artist //pg'`"
TITLE="`cmus-remote -Q |sed -ne '/title/s/tag title //pg'`"
echo "$TITLE ($ARTIST) $CURR/$TIME"
fi
}
while true; do
xsetroot -name "`cmusstats``wifi``volume``batt` `date '+%a %Y%m%d %H:%M'`"
sleep 1
done &
#export XDG_MENU_PREFIX=gnome-
#exec ck-launch-session gnome-session
#exec ck-launch-session dwm
#exec gnome-session
#exec dwm
exec ck-launch-session bash -c "dbus-launch & pulseaudio --start & dwm"
#while true; do
# Log stderror to a file
# ck-launch-session bash -c "dbus-launch & pulseaudio --start & dwm 2> ~/.dwm.log"
#dwm 2> ~/.dwm.log
# no error logging
#dwm >/dev/null 2> &1
#done