LINUX.ORG.RU

xmonad+dzen2 как правильно вывести индикаторы в dzen2 ?

 ,


0

1
myWorkspaces            :: [String]
myWorkspaces = clickable . (map dzenEscape) $ ["1","2","3","4","5","6","7","8","9"] 
      where clickable l = [ "^ca(1,xdotool key super+" ++ show (n) ++ ")" ++ ws ++ "^ca()" |
                              (i,ws) <- zip [1..] l,
                              let n = i ]
-- Statusbar, traybar, monitoring, bitmaps
myTrayBar = "trayer --edge bottom --align right --widthtype pixel --heighttype pixel --expand true --align right --SetDockType true --SetPartialStrut true --tint 0x000000 --transparent true --alpha 0 --margin 0 --height 20"
myXmonadBar = "dzen2 -w 1680 -y 1034 -h 16 -ta 'l' -fg '#555753' -bg '#000000' -fn -*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*"

Есть скрипт, который выводит всё нужное:

ICONPATH=$HOME/.dzen/bitmaps
INTERFACE=ppp0
SLEEP=1
#colors
FONT='-*-terminus-*-r-normal-*-*-120-*-*-*-*-iso8859-*'
FONTCOLOR='#ccc'
BACKGROUND='#222'
BAR_FG="green3"
BAR_BG="orange3"

# BAR_H=10
# BAR_W=60
# #geometry
# WIDTH=450
# X=-450
# Y=0

# Here we remember the previous rx/tx counts
RXB=`cat /sys/class/net/${INTERFACE}/statistics/rx_bytes`
TXB=`cat /sys/class/net/${INTERFACE}/statistics/tx_bytes`

while :; do

# get new rx/tx counts
RXBN=`cat /sys/class/net/${INTERFACE}/statistics/rx_bytes`
TXBN=`cat /sys/class/net/${INTERFACE}/statistics/tx_bytes`

# calculate the rates
# format the values to 4 digit fields
RXR=$(printf "%4d\n" $(echo "($RXBN - $RXB) / 1024/${SLEEP}" | bc))
TXR=$(printf "%4d\n" $(echo "($TXBN - $TXB) / 1024/${SLEEP}" | bc))
# reset old rates
RXB=$RXBN; TXB=$TXBN

Net ()
{
	# echo -n "${INTERFACE}: ^fg(white)${RXR} kB/s^fg(green3)^p(3)^i(${ICONPATH}/net_down_03.xbm)^fg(white)${TXR} kB/s^fg(orange3)^i(${ICONPATH}/net_up_03.xbm)^fg()"    
	echo -n "${INTERFACE}: ^fg(white)${RXR} kB/s^fg(green3)^p(3)^i(${ICONPATH}/net_down_03.xbm)^fg(white)${TXR} kB/s^fg(orange3)^i(${ICONPATH}/net_up_03.xbm)^fg()"
	return
}

Vol ()
{
	ONF=$(amixer get Master | awk '/Mono.+/ {print $6=="[off]"?$6:$4}' | tr -d '[]')
	VOL=$(amixer get Master | awk '/Mono.+/ {print $6=="[off]"?$6:$4}' | tr -d '[]')
		if [[ ${ONF} == 'off' ]] ; then
		   echo -n "^fg(red3)^i($ICONPATH/spkr_01.xbm)^fg()"  $(echo "0" | gdbar -fg $BAR_FG -bg $BAR_BG -h $BAR_H -w $BAR_W -s o -ss 1 -sw 2 -nonl)
		else
		   echo -n "^fg(green3)^i($ICONPATH/spkr_01.xbm)^fg()" ${VOL} $(echo $VOL | gdbar -fg $BAR_FG -bg $BAR_BG -h $BAR_H -w $BAR_W -s o -ss 1 -sw 2 -nonl)
		fi
	return
}

Date ()
{
	TIME=$(date +"%a, %d %b %Y %T")
		echo -n "^fg(green3)^i($ICONPATH/clock.xbm)^fg(orange3) ${TIME}"
	return
}

Between ()
{
	echo -n " ^fg(#7298a9)^r(5x2)^fg() "
	return
}

# --------- End Of Functions


# Print 

Print () 
{	
	# Between
	# Vol
	# Between
	Net
	Between
	Date
	# Between
	# echo
	# return
}
echo "$(Print)"

	

sleep $SLEEP
# done | dzen2 -x $X -y $Y  -tw $WIDTH -fg $FONTCOLOR -bg $BACKGROUND -fn $FONT
# done | dzen2 -w 1680 -y 1034 -h 16 -ta 'l' -fg '#555753' -bg '#000000' -fn -*-terminus-medium-r-*-*-16-*-*-*-*-*-*-* -e ''
done

Как в одном dzen'e это всё совместить ? т.е теги слева, а мониторинг - справа.

★★★★

Последнее исправление: bryak (всего исправлений: 2)

что, никто не поможет ?

bryak ★★★★
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.