Commit a5b87d06 authored by epsi sayidina's avatar epsi sayidina

dzen2: bash examples

parent f6958966
#!/usr/bin/env bash
generated_output() {
# endless loop
while true; do
date +'%a %b %d %H:%M:%S'
sleep 1
done
}
xpos=0
ypos=0
width=640
height=24
fgcolor="#000000"
bgcolor="#ffffff"
font="-*-fixed-medium-*-*-*-12-*-*-*-*-*-*-*"
parameters=" -x $xpos -y $ypos -w $width -h $height"
parameters+=" -fn $font"
parameters+=" -ta c -bg $bgcolor -fg $fgcolor"
parameters+=" -title-name dzentop"
generated_output | dzen2 $parameters
#!/usr/bin/env bash
# include
. ~/Documents/standalone/dzen2/bash/example-02-output.sh
# dzen2
xpos=0
ypos=0
width=640
height=24
fgcolor=$colBlack
bgcolor=$colWhite
font="-*-fixed-medium-*-*-*-12-*-*-*-*-*-*-*"
parameters=" -x $xpos -y $ypos -w $width -h $height"
parameters+=" -fn $font"
parameters+=" -ta c -bg $bgcolor -fg $fgcolor"
parameters+=" -title-name dzentop"
generated_output | dzen2 $parameters &
sleep 1 && exec `(transset-df .8 -n dzentop >/dev/null 2>&1 &)` &
#!/usr/bin/env bash
# color,
colWhite='#ffffff'
colBlack='#000000'
# also using google material
colRed500='#f44336'
colYellow500='#ffeb3b'
colBlue500='#2196f3'
generated_output() {
# endless loop
while :; do
local date=$(date +'%a %b %d')
local time=$(date +'%H:%M:%S')
local text=""
text+="^bg($colBlue500)^fg($colYellow500) $date "
text+="^bg()^fg() "
text+="^bg($colRed500) $time ^bg()"
echo $text
sleep 1
done
}
#!/usr/bin/env bash
# include
. ~/Documents/standalone/dzen2/bash/example-03-output.sh
# dzen2
xpos=0
ypos=0
width=640
height=24
fgcolor=$colBlack
bgcolor=$colWhite
font="-*-fixed-medium-*-*-*-12-*-*-*-*-*-*-*"
parameters=" -x $xpos -y $ypos -w $width -h $height"
parameters+=" -fn $font"
parameters+=" -ta c -bg $bgcolor -fg $fgcolor"
parameters+=" -title-name dzentop"
generated_output | dzen2 $parameters &
sleep 1 && exec `(transset-df .8 -n dzentop >/dev/null 2>&1 &)` &
#!/usr/bin/env bash
# color,
colWhite='#ffffff'
colBlack='#000000'
# also using google material
colRed500='#f44336'
colYellow500='#ffeb3b'
colBlue500='#2196f3'
colGrey500='#9e9e9e'
# http://fontawesome.io/
FontAwesome="^fn(FontAwesome-9)"
# icon
preIcon="^fg($colYellow500)$FontAwesome"
postIcon="^fn()^fg()"
# Powerline Symbol
arrow="^fn(powerlinesymbols-14)^fn()"
generated_output() {
local iconDate="$preIcon$postIcon"
local iconTime="$preIcon$postIcon"
# endless loop
while :; do
local date=$(date +'%a %b %d')
local time=$(date +'%H:%M:%S')
local text=""
text+="^bg($colBlue500)^fg($colWhite)$arrow "
text+="^bg($colBlue500) $iconDate ^fg() $date "
text+="^bg($colWhite)^fg($colBlue500)$arrow "
text+="^bg()^fg() "
text+="^bg($colRed500)^fg($colWhite)$arrow "
text+="^bg($colRed500) $iconTime ^fg() $time ^bg()"
text+="^bg($colWhite)^fg($colRed500)$arrow "
echo -n $text
echo
sleep 1
done
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment