update/cleanup
This commit is contained in:
parent
b44cc9e968
commit
6668809aff
8 changed files with 13 additions and 234 deletions
39
README.md
39
README.md
|
@ -1,28 +1,13 @@
|
||||||
# [[ zenUtils ]]
|
# [[ zenUtils ]]
|
||||||
|
|
||||||
### --refined UI helper scripts--
|
### --refined UI helper scripts--
|
||||||
#### Derek Stevens <drkste@zoho.com>
|
#### Derek Stevens <nilix@nilfm.cc>
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
This is a simple collection of helper scripts to round out my two common desktop sessions:
|
This is a simple collection of helper scripts to round out my two common desktop sessions:
|
||||||
|
|
||||||
Plasma 'lite':
|
|
||||||
* kwin
|
|
||||||
* alacritty
|
|
||||||
* plasmashell
|
|
||||||
* tint2
|
|
||||||
* dunst
|
|
||||||
* xbindkeys
|
|
||||||
|
|
||||||
Ryudo:
|
|
||||||
* ryudo
|
* ryudo
|
||||||
* alacritty
|
* fluxbox
|
||||||
* nitrogen
|
|
||||||
* xosview
|
|
||||||
* xclock
|
|
||||||
* dunst
|
|
||||||
* xbindkeys
|
|
||||||
|
|
||||||
### extdisplay
|
### extdisplay
|
||||||
|
|
||||||
|
@ -32,19 +17,6 @@ Wrapper script around `xrandr` to handle a second monitor on a laptop.
|
||||||
|
|
||||||
Wrapper script around `nmtui` to aid in network configuration in the absence of nm-applet. An alacritty config file hardcodes the colors for the `ncurses` interface.
|
Wrapper script around `nmtui` to aid in network configuration in the absence of nm-applet. An alacritty config file hardcodes the colors for the `ncurses` interface.
|
||||||
|
|
||||||
### t2stats
|
|
||||||
|
|
||||||
Status script to run in an Executor of `tint2` which gives network and battery status.
|
|
||||||
|
|
||||||
* __network__ is given as any of `offline`, `wired`, or `wifi/<network SSID>`.
|
|
||||||
* __battery__ is given as a progress/HP bar like so ` ` where each block character (``) represents approximately 20% of charge.
|
|
||||||
|
|
||||||
Battery alert notifications are handled by `tint2` natively, even when the native battery applet is hidden, so that functionality is not present in the script. Network connection/disconnection notifications are planned.
|
|
||||||
|
|
||||||
### desks
|
|
||||||
|
|
||||||
Helper script to run in an Executor of `tint2` which allows scrolling of desktops on the executor.
|
|
||||||
|
|
||||||
### logout
|
### logout
|
||||||
|
|
||||||
Dmenu script to provide session/power management menu.
|
Dmenu script to provide session/power management menu.
|
||||||
|
@ -53,13 +25,10 @@ Dmenu script to provide session/power management menu.
|
||||||
|
|
||||||
Simple script to tell you when your battery's running out when you don't have a panel.
|
Simple script to tell you when your battery's running out when you don't have a panel.
|
||||||
|
|
||||||
### sleepy
|
### sirius
|
||||||
|
|
||||||
Lightweight ACPI handler to put a laptop to sleep when you close the lid and it's not plugged in.
|
Background worker to sync an imap mailbox.
|
||||||
|
|
||||||
### transsetter
|
|
||||||
|
|
||||||
Background script to apply translucency to terminal and editor windows with `transset`, `xshove`, and `xcompmgr`
|
|
||||||
### ztabelle
|
### ztabelle
|
||||||
|
|
||||||
Generate a timesheet for a given month by manipulating the output from `zeit`
|
Generate a timesheet for a given month by manipulating the output from `zeit`
|
||||||
|
|
40
desks.sh
40
desks.sh
|
@ -1,40 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# this is a simple script to both give some semblance of eye-candy for a tint2 executor
|
|
||||||
# and to switch virtual desktops programmatically, to be invoked by button click/scroll
|
|
||||||
# on said executor.
|
|
||||||
# copyleft 2020 Derek Stevens <drkste@zoho.com>
|
|
||||||
# MIT License - do whatever you want
|
|
||||||
|
|
||||||
# if we're feeling spartan, just print a simple string for the executor
|
|
||||||
if [ -z $1 ]; then
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
# if we pass '-x', spit a few hexadecimal bytes into the executor for eye-candy
|
|
||||||
elif [ "$1" = "-x" ]; then
|
|
||||||
od -vAn -N2 -x < /dev/urandom
|
|
||||||
|
|
||||||
# otherwise switch desks
|
|
||||||
else
|
|
||||||
currentDeskNum=$(wmctrl -d | grep -n [*] | awk '{print $1}' | awk -F : '{print $1}')
|
|
||||||
numDesks=$(wmctrl -d | wc -l)
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
"-n")
|
|
||||||
if [ ${currentDeskNum} -eq ${numDesks} ]; then
|
|
||||||
newDesk=$(wmctrl -d | head -n 1 | awk '{print $1}')
|
|
||||||
else
|
|
||||||
newDesk=$(wmctrl -d | head -n $((currentDeskNum + 1)) | tail -n 1 | awk '{print $1}')
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
"-p")
|
|
||||||
if [ ${currentDeskNum} -eq 1 ]; then
|
|
||||||
newDesk=$(wmctrl -d | tail -n 1 | awk '{print $1}')
|
|
||||||
else
|
|
||||||
newDesk=$(wmctrl -d | head -n $((currentDeskNum - 1)) | tail -n 1 | awk '{print $1}')
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
wmctrl -s ${newDesk}
|
|
||||||
fi
|
|
|
@ -14,7 +14,7 @@ menu() {
|
||||||
|
|
||||||
|
|
||||||
printopts() {
|
printopts() {
|
||||||
printf "shutdown\nreboot\nsuspend\nhibernate\nlogout"
|
printf "shutdown\nreboot\nsuspend\nlogout"
|
||||||
}
|
}
|
||||||
|
|
||||||
handler() {
|
handler() {
|
||||||
|
@ -31,12 +31,10 @@ handler() {
|
||||||
logout)
|
logout)
|
||||||
if pgrep sddm-helper; then
|
if pgrep sddm-helper; then
|
||||||
killall sddm-helper
|
killall sddm-helper
|
||||||
elif pgrep plasmashell; then
|
|
||||||
killall plasmashell
|
|
||||||
elif pgrep ryudo; then
|
elif pgrep ryudo; then
|
||||||
pkill -9 -P $(pgrep startx)
|
killall ryudo
|
||||||
else
|
else
|
||||||
killall -0 Xorg
|
killall -0 Xorg
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
hibernate)
|
hibernate)
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
alacritty -e neomutt "$@"
|
|
|
@ -1,22 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
xset -b
|
|
||||||
sudo powertop -auto-tune &
|
|
||||||
redshit -x; redshift -O 6000K &
|
|
||||||
xbacklight -set 50 &
|
|
||||||
|
|
||||||
if ! pgrep offlineimap; then
|
|
||||||
offlineimap &
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! pgrep pipewire; then
|
|
||||||
pipewire & sleep 0.3
|
|
||||||
pipewire-pulse &
|
|
||||||
fi
|
|
||||||
|
|
||||||
export WINIT_X11_SCALE_FACTOR=1
|
|
||||||
export GTK_THEME=steppenwolf-dark
|
|
||||||
rm ~/.config/gtkrc*
|
|
||||||
export WINIT_X11_SCALE_FACTOR=1
|
|
||||||
xbindkeys -f ~/.xbindkeysrc.kwin
|
|
||||||
tint2&
|
|
6
sirius.sh
Executable file
6
sirius.sh
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
mbsync -a
|
||||||
|
sleep 5m
|
||||||
|
done
|
79
t2stats.sh
79
t2stats.sh
|
@ -1,79 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# t2stats:
|
|
||||||
# this is a simple network/battery status indicator to be used with tint2
|
|
||||||
# copyleft 2020 Derek Stevens <drkste@zoho.com>
|
|
||||||
# MIT License -- do whatever you want
|
|
||||||
|
|
||||||
if [ "$1" = "-l" ]; then
|
|
||||||
load=$(cat /proc/loadavg | awk '{print $1}')
|
|
||||||
memdata=$(free -h --si | grep Mem)
|
|
||||||
swapdata=$(free -h --si | grep Swap)
|
|
||||||
memused=$(echo ${memdata} | awk '{print $3}' )
|
|
||||||
swapused=$(echo ${swapdata} | awk '{print $3}')
|
|
||||||
|
|
||||||
echo " ${load} | ${memused} | ${swapused}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$1" = "-r" ]; then
|
|
||||||
|
|
||||||
# network
|
|
||||||
actives=$(nmcli connection show --active)
|
|
||||||
possiblywifi=$(echo "${actives}" | grep wifi)
|
|
||||||
possiblyeth=$(echo "${actives}" | grep Wired)
|
|
||||||
ORS=" "
|
|
||||||
|
|
||||||
if [ ! -z "${possiblyeth}" ]; then
|
|
||||||
output=wired
|
|
||||||
elif [ ! -z "${possiblywifi}" ]; then
|
|
||||||
output="wifi/$(echo ${possiblywifi} |\
|
|
||||||
awk 'BEGIN { ORS=" " }; {for (i=1; i<=(NF-3);i++) print $i}')"
|
|
||||||
else
|
|
||||||
output=offline
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -n "${output}"
|
|
||||||
|
|
||||||
# battery
|
|
||||||
powerlevel=$(cat /sys/class/power_supply/BAT*/capacity)
|
|
||||||
case $powerlevel in
|
|
||||||
0)
|
|
||||||
meter=" "
|
|
||||||
;;
|
|
||||||
1|2|3|4|5|6|7|8|9)
|
|
||||||
meter=" "
|
|
||||||
;;
|
|
||||||
10|11|12|13|14|15|16|17|18|19)
|
|
||||||
meter=" "
|
|
||||||
;;
|
|
||||||
20|21|22|23|24|25|26|27|28|29)
|
|
||||||
meter=" "
|
|
||||||
;;
|
|
||||||
30|31|32|33|34|35|36|37|38|39)
|
|
||||||
meter=" "
|
|
||||||
;;
|
|
||||||
40|41|42|43|44|45|46|47|48|49)
|
|
||||||
meter=" "
|
|
||||||
;;
|
|
||||||
50|51|52|53|54|55|56|57|58|59)
|
|
||||||
meter=" "
|
|
||||||
;;
|
|
||||||
60|61|62|63|64|65|66|67|68|69)
|
|
||||||
meter=" "
|
|
||||||
;;
|
|
||||||
70|71|72|73|74|75|76|77|78|79)
|
|
||||||
meter=" "
|
|
||||||
;;
|
|
||||||
80|81|82|83|84|85|86|87|88|89)
|
|
||||||
meter=""
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
meter=""
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if ! grep Full /sys/class/power_supply/BAT*/status > /dev/null \
|
|
||||||
&& file /sys/class/power_supply/BAT* > /dev/null; then
|
|
||||||
echo " ${meter}"
|
|
||||||
fi
|
|
||||||
fi
|
|
|
@ -1,51 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# A background script to provide terminal/editor compositing in a Ryudo
|
|
||||||
# session.
|
|
||||||
# Licensed under the MIT License -- do what you want with it.
|
|
||||||
# Copyleft 2021 Derek Stevens <drkste@zoho.com>
|
|
||||||
|
|
||||||
termprog=Alacritty
|
|
||||||
geditor=acme
|
|
||||||
opacity=0.85
|
|
||||||
|
|
||||||
setter=$(which transset)
|
|
||||||
if [ -z "$setter" ]; then
|
|
||||||
setter=$(which transset-df)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$setter" ]; then
|
|
||||||
echo "we need transset or transset-df in PATH!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#if which xcompmgr > /dev/null; then
|
|
||||||
# xcompmgr -n&
|
|
||||||
#else
|
|
||||||
# ehco "we need xcompmgr in PATH!"
|
|
||||||
# exit 1
|
|
||||||
#fi
|
|
||||||
|
|
||||||
if ! which xshove > /dev/null; then
|
|
||||||
echo "we need xshove in PATH!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
wlist=$(mktemp)
|
|
||||||
oldwlist=$(mktemp)
|
|
||||||
while true; do
|
|
||||||
xshove > $wlist
|
|
||||||
while read wprop; do
|
|
||||||
wid=$(echo ${wprop} | awk '{print $1}')
|
|
||||||
if ! grep $wid $oldwlist > /dev/null; then
|
|
||||||
wclass=$(echo ${wprop} | awk '{print $3}')
|
|
||||||
if [ "$wclass" = "${geditor}" ]; then
|
|
||||||
$setter -i 0x$wid ${opacity} > /dev/null
|
|
||||||
elif [ "${wclass}" = "${termprog}" ]; then
|
|
||||||
$setter -i 0x$wid ${opacity} > /dev/null
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done < $wlist
|
|
||||||
cat $wlist > $oldwlist;
|
|
||||||
sleep 0.2
|
|
||||||
done
|
|
Loading…
Reference in a new issue