Biont / sway-launcher-desktop

TUI Application launcher with Desktop Entry support. Made for SwayWM, but runs anywhere
GNU General Public License v3.0
613 stars 29 forks source link

launch a terminal with shortcut #20

Closed chesty closed 4 years ago

chesty commented 4 years ago

I played around with getting a terminal for quick temporary sessions. It's not perfect but does the job.

meta+d to launch sway-launcher-desktop, then alt+space to launch a terminal.

diff --git a/sway-launcher-desktop.sh b/sway-launcher-desktop.sh
index 6e1d055..8c8dd22 100755
--- a/sway-launcher-desktop.sh
+++ b/sway-launcher-desktop.sh
@@ -13,6 +13,7 @@ DEL=$'\34'
 # this or override with an environment variable in your sway config
 # It would be good to move this to a config file eventually
 TERMINAL_COMMAND="${TERMINAL_COMMAND:="urxvt -e"}"
+SHELL_COMMAND="${SHELL_COMMAND:="urxvt  -geometry 55x18 -name launcher"}"
 GLYPH_COMMAND="  "
 GLYPH_DESKTOP="  "
 CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/sway-launcher-desktop"
@@ -249,6 +250,7 @@ COMMAND_STR=$(
   fzf +s -x -d '\034' --nth ..3 --with-nth 3 \
     --preview "$0 describe {2} {1}" \
     --preview-window=up:3:wrap --ansi \
+    --bind alt-space:execute:"$SHELL_COMMAND" \
     <"$FZFPIPE"
 ) || exit 1
Biont commented 4 years ago

Thank you! I will have a look soon

Biont commented 4 years ago

This really only opens a new urxvt instance, right? Why not configure that as a keymapping in the window manager?

chesty commented 4 years ago

I do, I have

for_window [class="URxvt" instance="floating"] floating enable, border pixel 2, sticky enable bindsym $mod+Shift+Return exec urxvt -geometry 80x24 -name floating

I prefer using the above, it handles workspace switches. I wanted to see if I could get sway-launder-desktop to do it, and it kind of can but doesn't handle workspace switches. I just shared it in case you were interested.