added a way to launch all relevant, scratchpad applications
This commit is contained in:
parent
fd4aff372f
commit
c067614a8a
@ -1,32 +1,32 @@
|
|||||||
|
#!/usr/bin/zsh
|
||||||
|
|
||||||
APPLICATION_BIN="$HOME/.config/wryn/default-applications"
|
APPLICATION_BIN="$HOME/.config/wryn/default-applications"
|
||||||
APPLICATIONS=(
|
APPLICATION_CLASSES=(
|
||||||
'audio'
|
'audio ^Pavucontrol$'
|
||||||
'discord'
|
'discord ^discord$'
|
||||||
'email'
|
'email ^Thunderbird$'
|
||||||
'media'
|
'media ^youtubemusic-nativefier'
|
||||||
'message'
|
'message ^android-messages-desktop$'
|
||||||
'phone'
|
'phone ^google-voice-desktop'
|
||||||
'slack'
|
'slack ^Slack$'
|
||||||
)
|
)
|
||||||
|
|
||||||
CLIENT_CLASSES=(
|
for APP_CLS_STR in $APPLICATION_CLASSES; do
|
||||||
'^Pavucontrol$'
|
APPLICATION_CLASS=($(echo $APP_CLS_STR))
|
||||||
'^discord$'
|
APPLICATION=${APPLICATION_CLASS[1]}
|
||||||
'^Thunderbird$'
|
CLIENT_CLASS=${APPLICATION_CLASS[2]}
|
||||||
'^youtubemusic-nativefier'
|
|
||||||
'^android-messages-desktop$'
|
|
||||||
'^google-voice-desktop'
|
|
||||||
'^Slack$'
|
|
||||||
)
|
|
||||||
|
|
||||||
for APPLICATION in $(echo $APPLICATIONS); do
|
echo "launching $APPLICATION_BIN/$APPLICATION"
|
||||||
xdotool search --class "$CLIENT_CLASS" >/dev/null 2>&1 || {
|
xdotool search --class "$CLIENT_CLASS" >/dev/null 2>&1 && echo "found existing" || {
|
||||||
i3-msg "exec --no-startup-id $APPLICATION_BIN/$APPLICATION;"
|
i3-msg "exec --no-startup-id $APPLICATION_BIN/$APPLICATION;"
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
|
|
||||||
sleep 10;
|
sleep 10;
|
||||||
|
|
||||||
for CLIENT_CLASS in $CLIENT_CLASSES; do
|
for APP_CLS_STR in $APPLICATION_CLASSES; do
|
||||||
|
APPLICATION_CLASS=($(echo $APP_CLS_STR))
|
||||||
|
CLIENT_CLASS=${APPLICATION_CLASS[2]}
|
||||||
|
echo "hiding application $CLIENT_CLASS"
|
||||||
i3-msg "[class=$CLIENT_CLASS] move scratchpad";
|
i3-msg "[class=$CLIENT_CLASS] move scratchpad";
|
||||||
done
|
done
|
||||||
|
@ -8,11 +8,13 @@ font pango:monospace 20
|
|||||||
|
|
||||||
set $UTILS /home/w0ryn/.config/wryn/i3utils
|
set $UTILS /home/w0ryn/.config/wryn/i3utils
|
||||||
|
|
||||||
set $SLACK_CLIENT_CLASS ^Slack$
|
set $AUDIO_CLIENT_CLASS ^Pavucontrol$
|
||||||
set $MESSAGE_CLIENT_CLASS ^android-messages-desktop$
|
|
||||||
set $MEDIA_CLIENT_CLASS ^youtubemusic-nativefier
|
|
||||||
set $DISCORD_CLIENT_CLASS ^discord$
|
set $DISCORD_CLIENT_CLASS ^discord$
|
||||||
set $EMAIL_CLIENT_CLASS ^Thunderbird$
|
set $EMAIL_CLIENT_CLASS ^Thunderbird$
|
||||||
|
set $MEDIA_CLIENT_CLASS ^youtubemusic-nativefier
|
||||||
|
set $MESSAGE_CLIENT_CLASS ^android-messages-desktop$
|
||||||
|
set $PHONE_CLIENT_CLASS ^google-voice-desktop
|
||||||
|
set $SLACK_CLIENT_CLASS ^Slack$
|
||||||
|
|
||||||
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)$
|
||||||
@ -98,10 +100,14 @@ 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+a exec --no-startup-id $UTILS launchallhidden;
|
||||||
|
|
||||||
|
bindsym $mod+a exec --no-startup-id $UTILS audio $AUDIO_CLIENT_CLASS;
|
||||||
bindsym $mod+Shift+d exec --no-startup-id $UTILS discord $DISCORD_CLIENT_CLASS;
|
bindsym $mod+Shift+d exec --no-startup-id $UTILS discord $DISCORD_CLIENT_CLASS;
|
||||||
bindsym $mod+Shift+t exec --no-startup-id $UTILS email $EMAIL_CLIENT_CLASS;
|
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+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+m exec --no-startup-id $UTILS message $MESSAGE_CLIENT_CLASS;
|
||||||
|
bindsym $mod+c exec --no-startup-id $UTILS phone $PHONE_CLIENT_CLASS;
|
||||||
bindsym $mod+Shift+s exec --no-startup-id $UTILS slack $SLACK_CLIENT_CLASS;
|
bindsym $mod+Shift+s exec --no-startup-id $UTILS slack $SLACK_CLIENT_CLASS;
|
||||||
|
|
||||||
bindsym $mod+Shift+x [class=$GAMES_CLIENT_CLASSES] scratchpad show
|
bindsym $mod+Shift+x [class=$GAMES_CLIENT_CLASSES] scratchpad show
|
||||||
|
@ -20,15 +20,18 @@ 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";
|
LAUNCH_OR_SHOW="$UTIL_BIN/i3/launch-or-show-application.sh";
|
||||||
|
LAUNCH_ALL_SCRATCHPAD="$UTIL_BIN/i3/launch-all-scratchpad-applications.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"
|
||||||
|
|
||||||
|
AUDIO="$APP_BIN/audio"
|
||||||
DISCORD="$APP_BIN/discord"
|
DISCORD="$APP_BIN/discord"
|
||||||
EMAIL="$APP_BIN/email"
|
EMAIL="$APP_BIN/email"
|
||||||
MEDIA="$APP_BIN/media"
|
MEDIA="$APP_BIN/media"
|
||||||
MESSAGES="$APP_BIN/messages"
|
MESSAGES="$APP_BIN/messages"
|
||||||
|
PHONE="$APP_BIN/phone"
|
||||||
SLACK="$APP_BIN/slack"
|
SLACK="$APP_BIN/slack"
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
@ -51,9 +54,13 @@ case $1 in
|
|||||||
|
|
||||||
alternateterm ) "$ALTERNATE_TERMINAL" ;;
|
alternateterm ) "$ALTERNATE_TERMINAL" ;;
|
||||||
|
|
||||||
|
launchallhidden ) "$LAUNCH_ALL_SCRATCHPAD" ;;
|
||||||
|
|
||||||
|
audio ) "$LAUNCH_OR_SHOW" "$2" "$AUDIO" ;;
|
||||||
discord ) "$LAUNCH_OR_SHOW" "$2" "$DISCORD" ;;
|
discord ) "$LAUNCH_OR_SHOW" "$2" "$DISCORD" ;;
|
||||||
email ) "$LAUNCH_OR_SHOW" "$2" "$EMAIL" ;;
|
email ) "$LAUNCH_OR_SHOW" "$2" "$EMAIL" ;;
|
||||||
media ) "$LAUNCH_OR_SHOW" "$2" "$MEDIA" ;;
|
media ) "$LAUNCH_OR_SHOW" "$2" "$MEDIA" ;;
|
||||||
message ) "$LAUNCH_OR_SHOW" "$2" "$MESSAGES";;
|
message ) "$LAUNCH_OR_SHOW" "$2" "$MESSAGES";;
|
||||||
|
phone ) "$LAUNCH_OR_SHOW" "$2" "$PHONE" ;;
|
||||||
slack ) "$LAUNCH_OR_SHOW" "$2" "$SLACK" ;;
|
slack ) "$LAUNCH_OR_SHOW" "$2" "$SLACK" ;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user