dotfiles/scripts/nyxtlof

38 lines
816 B
Bash
Executable file

#!/usr/bin/env bash
# Check to see if nyxt is running
if [ $(pgrep -c nyxt) -gt 0 ]; then
echo "ff running"
if [ "$XDG_SESSION_TYPE" = "x11" ]; then
#X11
ffrg=$(wmctrl -lx | rg nyxt | awk '{print $1}')
# echo $emacsrg
if [ -z $ffrg ]; then
exec nyxt
exit
else
exec wmctrl -ia $ffrg
exit
fi
else
if [ "$KDE_FULL_SESSION" = "true" ]; then
echo "KDE"
exec /home/chris/bin/ww -fa nyxt -c nyxt
exit
else
# WAYLAND
ffrg=$(hyprctl clients | rg nyxt)
ffwin=$(echo $ffrg | sed 's/.*\: //')
# echo $ffwin
exec hyprctl dispatch focuswindow nyxt
exit
fi
fi
else
exec nyxt
fi