~zenomat/scripts

266921ddaa9e2dd3fbcc9ea541494bea3c09c2b4 — zenomat 1 year, 9 months ago aa02c3d
updated scripts, added some
5 files changed, 75 insertions(+), 8 deletions(-)

A fehbg
M startup
A status
M statusbar/posture.sh
M statusbar/timer
A fehbg => fehbg +2 -0
@@ 0,0 1,2 @@
#!/bin/sh
feh --no-fehbg --bg-scale '/root/docs/wallpapers/0240.jpg' 

M startup => startup +8 -5
@@ 1,12 1,15 @@
#!/bin/sh

setxkbmap -option ctrl:nocaps
picom &
~/.fehbg &
/root/scripts/statusbar/posture.sh &
/root/.config/polybar/launch_polybar.sh &
xrandr --output DVI-D-0 --left-of HDMI-0
setxkbmap -option ctrl:nocaps
$HOME/scripts/statusbar/posture.sh &
sxhkd &
mpd &
xset s off
xset -dpms
picom &
#$HOME/.config/polybar/launch_polybar.sh &
#$HOME/scripts/fehbg &
hsetroot -solid \#1c1a20
hydroxide imap &
hydroxide smtp &

A status => status +62 -0
@@ 0,0 1,62 @@
#!/bin/sh

NOTIFICATION=herbe

function volume() {
    pkill herbe
    device=Master
    devicecontextlines=4
    vol=$(amixer | grep $device -A $devicecontextlines | tail -n1 | awk -F ' ' '{{print $4}}' | sed 's/\[//' | sed 's/\]//')
    $NOTIFICATION $vol
}

function datetime() {
    pkill herbe
    $NOTIFICATION $(date "+%T - %d.%m.%Y")
}

function weather() {
    pkill herbe
    $NOTIFICATION $($HOME/.config/polybar/weather.sh)
}

function posture() {
    pkill herbe
    $NOTIFICATION $(date -d@$(cat $HOME/scripts/statusbar/timer) -u +%H:%M:%S)
}

function music() {
    pkill herbe
    playstatus=$(mpc | head -n2 | tail -n1 | awk '{{print $1}}')
    case $playstatus in
	*play*)
	    playstatus='>'
	    ;;
	*pause*)
	    playstatus='||'
	    ;;
    esac
    $NOTIFICATION "$playstatus $(mpc | head -n1)\
    \
    [$(mpc | head -n2 | tail -n1 | awk -F ' ' '{{print $3}}')]"
}

case "$1" in
    volume)
	volume
	;;
    date)
	datetime
	;;
    weather)
	weather
	;;
    posture)
	posture
	;;
    music)
	music
	;;
esac

exit 0

M statusbar/posture.sh => statusbar/posture.sh +2 -2
@@ 1,9 1,9 @@
#!/bin/sh

timerpath=/root/scripts/statusbar/timer
timerpath=$HOME/scripts/statusbar/timer

while true; do
	timer=$(cat /root/scripts/statusbar/timer)
	timer=$(cat $HOME/scripts/statusbar/timer)
	timer=$((timer - 1))
	echo $timer > $timerpath
	if [[ $timer -eq 0 || $timer -lt 0 ]]; then

M statusbar/timer => statusbar/timer +1 -1
@@ 1,1 1,1 @@
125
568