Mayour changes.

This commit is contained in:
#root_informatica 2024-02-23 01:57:42 -03:00
parent eba0ec307a
commit 51c1794ea7
4 changed files with 97 additions and 0 deletions

15
editor.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
## check if there is an open Emacs window ##
## dependencies: wname, lsw.
XECMD="emacsclient -c --alternate-editor="""
# search for editor window open.
TARGET=$(for wid in $(lsw -a); do
printf '%s\n' "$wid $(atomx WM_CLASS $wid)"
done | grep $XENAME | cut -d ' ' -f1)
# if editor window is open, focus it; else, start editor.
[ $TARGET ] && wms_mainrole.sh $TARGET \
|| $XECMD

61
session.sh Executable file
View File

@ -0,0 +1,61 @@
#!/bin/sh
## manage session and some more things ##
[ -t 0 ] && MENU="fzy" \
|| MENU="xmenu.sh"
# keybindings reload.
KBRELOAD="pkill -usr1 -x sxhkd"
# lock screen monitor.
LOCK="slock"
# poweroff monitor.
MOFF="xset dpms force off"
# suspend to ram.
SP="doas zzz -z"
# hibernate.
HB="doas zzz -Z"
# reboot.
RB="doas shutdown -r now"
# poweroff.
POFF="doas shutdown -h now"
# exit session.
EXIT="pkill wew"
# litle menu.
PROMPT="reload-key\nlock\nmonitor-off\nhalt\nreboot\nsuspend\nhibernate\nexit"
option=`echo -e $PROMPT | $MENU`
if [ ${#option} -gt 0 ]; then
case $option in
reload-key)
$KBRELOAD
;;
lock)
$LOCK
;;
monitor-off)
$MOFF
;;
suspend)
$SP
;;
hibernate)
$HB
;;
halt)
$POFF
;;
reboot)
$RB
;;
exit)
$EXIT
;;
*)
;;
esac
else
exit 0
fi

12
xlauncher.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
TERMINAL="xterm"
GEOMETRY="61x12+376+241"
$TERMINAL -name 'wms_launcher' \
-g $GEOMETRY \
-e bash -c 'cmd=$(compgen -c | sort -u | grep -v fzy | fzy); \
setsid -f $cmd'
# -e bash -c

9
xmenu.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
TERMINAL="xterm"
GEOMETRY="61x12+376+241"
$TERMINAL -name "xmenu" \
-g $GEOMETRY \
-e "fzy < /proc/$$/fd/0 > /proc/$$/fd/1"