all repos — zenUtils @ 72ef08cc8c594ec701497ba4db4be70677fca355

misc utilities for computing zen

add riosh
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmGi/HsACgkQO3+8IhRO
Y5hQdQ//UE7lVWzCk9mt99e8k8jAqde3u6PeYPugwYi1n1w/2az+bYT9g+VSOz4A
xI4wjSC6jismTYt/gcb+4wBGpaqfL+lsrIndtFg667zkVK6Yvu598jnghU8zZsxr
MnzvSRJtMKS/H4qFcQL2caaDaJeLyS4wxnppyKHvMhka1zRXxCBZPNOHbAKV6XNC
HmVSNpt11RRmwtsQdZudc4feOElrCBX9rZm0TC6Gp+k98bw22wZAT7fTi1wSDRzY
VzZXyqkEJNBmR3BVhf4apdiG4vDrxkDxMljWQxyVy4qbkv2STquSMWQaInTQPQ7l
Ipu3CqpYC02YIjcWOGKuQzOjd1jVs5ydVuv/IoSTufIvxOUCfLnzwb0Lt1YaOs93
CxEs6EKf5D1jrNX7YZgAdVxgTQp1jbyA5kYzzDjv2RLeLenmWC1yWsU2lcmgHleq
lSDuTsA8bnqtocEivUBNQ+vH+Y+5p4ziIU9WqaWCpzberteX3Hg5RrP51A34599S
07wSVeqW0w6ltU4g3GPWyQn2ln07GbxcyHSs/m2nw7AKd9ujcFgcJaRw6eTabwoF
sS2gdVglahha8ntLfIx9TPoLdfSjt82prf9Mwv4+y35sk6QtxnHee3kr5ggzCK2F
9U1LUz3u/REt/CVEpAL1FL+X+rageKmJXDRIOYi4y8Nkhk1/7Pc=
=FLSx
-----END PGP SIGNATURE-----
commit

72ef08cc8c594ec701497ba4db4be70677fca355

parent

6668809aff0eff01aa65f901c0c62e29c25c125c

3 files changed, 72 insertions(+), 24 deletions(-)

jump to
M README.mdREADME.md

@@ -1,11 +1,12 @@

# [[ zenUtils ]] -### --refined UI helper scripts-- +### --refined UI/workflow helper scripts-- #### Derek Stevens <nilix@nilfm.cc> ## About This is a simple collection of helper scripts to round out my two common desktop sessions: + * ryudo * fluxbox

@@ -32,6 +33,10 @@

### ztabelle Generate a timesheet for a given month by manipulating the output from `zeit` + +### riosh + +Shell script to loosley emulate `rio` behavior in a EWMH-compliant WM ## License
A rio.sh

@@ -0,0 +1,66 @@

+#!/bin/sh + +termcmd="alacritty --option geometry=" +movebind="super+v" + +delete() +{ + wmctrl -c :SELECT: +} + +new() +{ + geom=$(slop -t 0 -f %x,%y,%w,%h) + x=$(echo $geom | awk -F , '{print $1}') + y=$(echo $geom | awk -F , '{print $2}') + + wl=$(mktemp .windowlistXXX) + + wmctrl -l >> $wl + + ${termcmd}80x24+${x}+${y}& + + while true; do + lastCreatedID=$(wmctrl -l | tail -n 1 | awk '{print $1}') + if [ "$lastCreatedID" != "$(tail -n 1 $wl | awk '{print $1}')" ]; then + break + fi + done + + wmctrl -i -r $lastCreatedID -e 0,$geom + rm $wl +} + +resize() +{ + wid=$(slop -t 9999999 -f %i) + geom=$(slop -t 0 -f %x,%y,%w,%h) + wmctrl -i -r $wid -b remove,maximized_vert,maximized_horz + wmctrl -i -r $wid -e 0,$geom +} + +move() +{ + wid=$(slop -t 9999999 -f %i) + wmctrl -a $wid + xdotool key $movebind +} + +hide() +{ + wid=$(slop -t 9999999 -f %i) + wmctrl -i -r $wid -b add,hidden +} + +case $1 in + delete) + delete;; + new) + new;; + resize) + resize;; + move) + move;; + hide) + hide;; +esac
D sleepy.sh

@@ -1,23 +0,0 @@

-#!/bin/sh - -# this is a simple replacmeent for an ACPI handler script -# put it somewhere accessible for single-user mode and make a runit script for it -# copyleft 2020 Derek Stevens <drkste@zoho.com> -# MIT License -- do whatever you want - -acpi_listen | { - while read event; do - - # if no external monitor - # if [ ! -z "$(xrandr | grep HDMI | grep disconnected)" ]; then - - # if AC is offline - if [ ! -z "$(acpi -a | grep off-line)" ]; then - - if [ "${event}" = "button/lid LID close" ]; then - zzz - fi - fi - # fi - done -}