Better hyprland swallower
This commit is contained in:
parent
33d9dc616a
commit
ad764a2eea
2 changed files with 22 additions and 5 deletions
|
|
@ -27,6 +27,10 @@ map <c-r> reload
|
||||||
map <c-s> set hidden!
|
map <c-s> set hidden!
|
||||||
map <enter> shell
|
map <enter> shell
|
||||||
|
|
||||||
|
# Spawn new terminal/lf windows
|
||||||
|
map <a-enter> $setsid -f $TERMINAL -e $SHELL >/dev/null 2>&1 &
|
||||||
|
map <a-e> $setsid -f $TERMINAL -e $SHELL -c -i "lfcd && exec $SHELL" >/dev/null 2>&1 &
|
||||||
|
|
||||||
# Opening commands
|
# Opening commands
|
||||||
map l open
|
map l open
|
||||||
map L open new_window
|
map L open new_window
|
||||||
|
|
@ -122,7 +126,7 @@ cmd open ${{
|
||||||
[ ! -z $@ ] && [ "$@" = "new_window" ] && new_window=1
|
[ ! -z $@ ] && [ "$@" = "new_window" ] && new_window=1
|
||||||
|
|
||||||
function launch {
|
function launch {
|
||||||
[ -v WAYLAND_DISPLAY ] && swallower="gobble" || swallower="devour"
|
[ -v WAYLAND_DISPLAY ] && swallower="swallow" || swallower="devour"
|
||||||
|
|
||||||
if [ ! -v new_window ]; then
|
if [ ! -v new_window ]; then
|
||||||
$swallower "$@" >/dev/null 2>&1
|
$swallower "$@" >/dev/null 2>&1
|
||||||
|
|
@ -137,10 +141,13 @@ cmd open ${{
|
||||||
application/pgp-encrypted|\
|
application/pgp-encrypted|\
|
||||||
inode/x-empty|\
|
inode/x-empty|\
|
||||||
text/*)
|
text/*)
|
||||||
if [ "${f##*.}" = "org" ]; then
|
case "${f##*.}" in
|
||||||
|
org|typ)
|
||||||
|
# Any "document" like file ought to be in emacs
|
||||||
launch emacsclient -c "$fx"
|
launch emacsclient -c "$fx"
|
||||||
exit
|
exit
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
[ -v new_window ] \
|
[ -v new_window ] \
|
||||||
&& ($TERMINAL -e $SHELL -c "$EDITOR \"$fx\"" >/dev/null 2>&1 &) \
|
&& ($TERMINAL -e $SHELL -c "$EDITOR \"$fx\"" >/dev/null 2>&1 &) \
|
||||||
|| ($EDITOR "$fx")
|
|| ($EDITOR "$fx")
|
||||||
|
|
|
||||||
10
.local/bin/swallow
Executable file
10
.local/bin/swallow
Executable file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
# Window swallower for Hyprland
|
||||||
|
|
||||||
|
pid=$(hyprctl activewindow -j | jq '.pid')
|
||||||
|
workspace=$(hyprctl activeworkspace -j | jq '.id')
|
||||||
|
|
||||||
|
hyprctl dispatch movetoworkspacesilent special
|
||||||
|
cmd=$1; shift 1; $cmd "$@"
|
||||||
|
hyprctl dispatch movetoworkspacesilent "$workspace",pid:"$pid"
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue