feat(scripts): some scripts

This commit is contained in:
Pavel Korytov 2021-02-04 20:47:16 +05:00
parent a533a06d06
commit f3b697a935
6 changed files with 37 additions and 4 deletions

View file

@ -135,6 +135,8 @@ assign [class="keepassxc"] $w10
for_window [title="VirtScreen"] floating enable
for_window [title="ncmpcpp.*"] move to workspace $w9
for_window [title="newsboat.*"] move to workspace $w9
for_window [title=".*run_wego"] move to workspace $w9
for_window [class="cinnamon-settings*"] floating enable
for_window [title="Picture-in-Picture"] sticky enable
# reload the configuration file
@ -297,6 +299,7 @@ mode "apps" {
bindsym e exec mailspring; mode default
bindsym a exec "bash /home/pavel/bin/emacs.sh"; mode default
bindsym n exec "st -e newsboat"; mode default
bindsym w exec "st /home/pavel/bin/scripts/run_wego"; mode default
# bindsym a exec emacsclient -c; mode default
# bindsym Shift+a exec emacs; mode default
}

View file

@ -28,6 +28,8 @@ declare -A BLOCKS=(
["eDP1"]="pulseaudio mpd SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP battery SEP sun aw-afk date TSEP"
)
export LOC="TMN"
pkill polybar
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
export MONITOR=$m

View file

@ -1,6 +1,18 @@
#1/bin/bash
LAT=59.9375N
LON=30.308611E
declare -A LAT_DATA=(
["TMN"]="57.15N"
["SPB"]="59.9375N"
)
declare -A LON_DATA=(
["TMN"]="65.533333E"
["SPB"]="30.308611E"
)
if [ -z "$LOC" ]; then
echo "LOC?"
exit -1
fi
LAT=${LAT_DATA[$LOC]}
LON=${LON_DATA[$LOC]}
time=$(sunwait poll daylight rise ${LAT} $LON)

View file

@ -1,2 +0,0 @@
#!/bin/bash
i3-msg "workspace 9: Music; exec 'i3-sensible-terminal -e ncmpcpp'"

2
bin/scripts/run_wego Executable file
View file

@ -0,0 +1,2 @@
#!/bin/bash
wego 7 | less -R

16
bin/scripts/sunrise-notify Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash
time=$(sunwait poll daylight rise ${LAT} $LON)
function on_sunset() {
notify-send "Sunset" "$(date)"
}
function on_sunrise() {
notify-send "Sunrise" "$(date)"
}
if [[ ${time} == 'DAY' ]]; then
sunwait wait set && on_sunset
else
sunwait wait rise && on_sunrise
fi