Fixed scratchpad launcher utils

This commit is contained in:
Wryn Wagner 2021-02-24 13:32:04 -07:00
parent 4ebb6179c0
commit 9584de22d8
3 changed files with 32 additions and 15 deletions

View File

@ -0,0 +1,12 @@
CLIENT_CLASS="$1"
APPLICATION="$2"
echo "client class:'$CLIENT_CLASS'"
echo "application :'$APPLICATION'"
xdotool search --class "$CLIENT_CLASS" >/dev/null 2>&1 || {
i3-msg "exec --no-startup-id $APPLICATION;"
}
i3-msg "[class=$CLIENT_CLASS] move scratchpad";
i3-msg "[class=$CLIENT_CLASS] scratchpad show";

View File

@ -12,10 +12,9 @@ set $UTILS /home/w0ryn/.config/wryn/i3utils
set $SLACK_CLIENT_CLASS ^Slack$ set $SLACK_CLIENT_CLASS ^Slack$
set $MESSAGE_CLIENT_CLASS ^android-messages-desktop$ set $MESSAGE_CLIENT_CLASS ^android-messages-desktop$
set $MEDIA_CLIENT_CLASS ^youtubemusic-nativefier-.*$ set $MEDIA_CLIENT_CLASS ^youtubemusic-nativefier
set $DISCORD_CLIENT_CLASS ^discord$ set $DISCORD_CLIENT_CLASS ^discord$
set $EMAIL_CLIENT_CLASS ^Thunderbird$
set $EMAIL_CLIENT_INSTANCE ^Mail$
set $GAMES_CLIENT_CLASSES ^(Steam)|(dolphin-emu)|(Visualboyadvance-m)$ set $GAMES_CLIENT_CLASSES ^(Steam)|(dolphin-emu)|(Visualboyadvance-m)$
set $TERMINAL_EMULATOR_CLASSES ^(kitty)$ set $TERMINAL_EMULATOR_CLASSES ^(kitty)$
@ -101,19 +100,12 @@ floating_modifier $mod
bindsym $mod+Shift+Tab move scratchpad bindsym $mod+Shift+Tab move scratchpad
bindsym $mod+Tab scratchpad show bindsym $mod+Tab scratchpad show
bindsym $mod+Shift+d [class=$DISCORD_CLIENT_CLASS] scratchpad show bindsym $mod+Shift+d exec --no-startup-id $UTILS discord $DISCORD_CLIENT_CLASS;
for_window [class=$DISCORD_CLIENT_CLASS] move scratchpad bindsym $mod+Shift+t exec --no-startup-id $UTILS email $EMAIL_CLIENT_CLASS;
bindsym $mod+m exec --no-startup-id $UTILS media $MEDIA_CLIENT_CLASS;
bindsym $mod+Shift+m exec --no-startup-id $UTILS message $MESSAGE_CLIENT_CLASS;
bindsym $mod+Shift+s exec --no-startup-id $UTILS slack $SLACK_CLIENT_CLASS;
bindsym $mod+Shift+m [class=$MESSAGE_CLIENT_CLASS] scratchpad show
for_window [class=$MESSAGE_CLIENT_CLASS] move scratchpad
bindsym $mod+Shift+t [instance=$EMAIL_CLIENT_INSTANCE] scratchpad show
for_window [instance=$EMAIL_CLIENT_INSTANCE] move scratchpad
bindsym $mod+m [class=$MEDIA_CLIENT_CLASS] scratchpad show
for_window [class=$MEDIA_CLIENT_CLASS] move scratchpad; [class=$MEDIA_CLIENT_CLASS] scratchpad show
bindsym $mod+Shift+s [class=$SLACK_CLIENT_CLASS] scratchpad show
bindsym $mod+Shift+x [class=$GAMES_CLIENT_CLASSES] scratchpad show bindsym $mod+Shift+x [class=$GAMES_CLIENT_CLASSES] scratchpad show
bindsym $mod+x [class=$TERMINAL_EMULATOR_CLASSES] scratchpad show bindsym $mod+x [class=$TERMINAL_EMULATOR_CLASSES] scratchpad show

View File

@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
UTIL_BIN="$HOME/.wryn/bin/desktop" UTIL_BIN="$HOME/.wryn/bin/desktop"
APP_BIN="$HOME/.config/wryn/default-applications"
MEDIA__NEXT="$UTIL_BIN/youtube-music/next.sh" MEDIA__NEXT="$UTIL_BIN/youtube-music/next.sh"
MEDIA__PREV="$UTIL_BIN/youtube-music/previous.sh" MEDIA__PREV="$UTIL_BIN/youtube-music/previous.sh"
@ -16,11 +17,17 @@ BACKLIGHT__DOWN="$UTIL_BIN/xbacklight/down.sh";
LOCK_SCREEN="$UTIL_BIN/i3lock/lock.sh"; LOCK_SCREEN="$UTIL_BIN/i3lock/lock.sh";
LOG_OUT="$UTIL_BIN/i3/logout.sh"; LOG_OUT="$UTIL_BIN/i3/logout.sh";
LAUNCH_OR_SHOW="$UTIL_BIN/i3/launch-or-show-application.sh";
BG_RANDOMIZE="$UTIL_BIN/feh/randomize-background.sh" BG_RANDOMIZE="$UTIL_BIN/feh/randomize-background.sh"
ALTERNATE_TERMINAL="$UTIL_BIN/kitty/alternate-terminal.sh" ALTERNATE_TERMINAL="$UTIL_BIN/kitty/alternate-terminal.sh"
DISCORD="$APP_BIN/discord"
EMAIL="$APP_BIN/email"
MEDIA="$APP_BIN/media"
MESSAGES="$APP_BIN/messages"
SLACK="$APP_BIN/slack"
case $1 in case $1 in
next ) "$MEDIA__NEXT" ;; next ) "$MEDIA__NEXT" ;;
@ -41,4 +48,10 @@ case $1 in
bgrandomize ) "$BG_RANDOMIZE" ;; bgrandomize ) "$BG_RANDOMIZE" ;;
alternateterm ) "$ALTERNATE_TERMINAL" ;; alternateterm ) "$ALTERNATE_TERMINAL" ;;
discord ) "$LAUNCH_OR_SHOW" "$2" "$DISCORD" ;;
email ) "$LAUNCH_OR_SHOW" "$2" "$EMAIL" ;;
media ) "$LAUNCH_OR_SHOW" "$2" "$MEDIA" ;;
message ) "$LAUNCH_OR_SHOW" "$2" "$MESSAGES";;
slack ) "$LAUNCH_OR_SHOW" "$2" "$SLACK" ;;
esac esac