updates and a lot of em

This commit is contained in:
Chris Cochrun 2022-04-26 12:40:23 -05:00
parent 30cd55aca8
commit bd0cf6ff9b
37 changed files with 618 additions and 96 deletions

View file

@ -1,9 +1,42 @@
#!/bin/sh
window=$(wmctrl -l | awk '{print $4}' | rg org-agenda)
active=$(xdotool getwindowfocus getwindowname)
# Check to see if an emacsclient is running
if [ $(pgrep -c emacsclient) -gt 0 ]; then
if [ $XDG_SESSION_TYPE = "x11" ]; then
#X11
window=$(wmctrl -lx | rg org-agenda | awk '{print $1}')
# echo $emacsrg
if [ -z $window ]; then
emacsclient -e '(chris/org-agenda)' &
exit
else
if [ $window = $active ]; then
wmctrl -ir $window -b toggle,hidden
else
wmctrl -ia $window
exit
fi
fi
else
if [ $KDE_FULL_SESSION = "true" ]; then
ww -f emacs -c emacsclient
exit
else
# WAYLAND
emacsrg=$(wlrctl window list | rg 'emacs:\sorg-agenda' | rg 'emacs:')
emacswin=$(echo $emacsrg | sed 's/.*\: //')
# echo $emacswin
wlrctl toplevel focus title:"$emacswin"
exit
fi
fi
if [ -z $window ]; then
wmctrl -a $window
else
emacsclient -e '(chris/org-agenda)'
emacsclient -e '(chris/org-agenda)' &
fi