Config et script pour focus app avec raccourcis
parent
c647250db6
commit
b9f53bd348
|
|
@ -0,0 +1,53 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
app="$1"
|
||||||
|
command="$2"
|
||||||
|
|
||||||
|
# Récupère les conteneurs correspondant à l'application.
|
||||||
|
windows=$(swaymsg -t get_tree | jq -r --arg app "$app" '
|
||||||
|
recurse(.nodes[], .floating_nodes[])
|
||||||
|
| select(
|
||||||
|
(.app_id == $app) or
|
||||||
|
(.window_properties.class == $app)
|
||||||
|
)
|
||||||
|
| .id
|
||||||
|
')
|
||||||
|
|
||||||
|
# Aucune fenêtre : lancer l'application
|
||||||
|
if [ -z "$windows" ]; then
|
||||||
|
swaymsg exec "$command"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Récupère la fenêtre actuellement focalisée
|
||||||
|
focused=$(swaymsg -t get_tree | jq -r '
|
||||||
|
recurse(.nodes[], .floating_nodes[])
|
||||||
|
| select(.focused == true)
|
||||||
|
| .id
|
||||||
|
')
|
||||||
|
|
||||||
|
# Transforme la liste en tableau
|
||||||
|
set -- $windows
|
||||||
|
|
||||||
|
# Cherche la fenêtre suivante après celle qui est actuellement focus
|
||||||
|
next=""
|
||||||
|
found=0
|
||||||
|
|
||||||
|
for id in "$@"; do
|
||||||
|
if [ "$found" = 1 ]; then
|
||||||
|
next="$id"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$id" = "$focused" ]; then
|
||||||
|
found=1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Si on était sur la dernière fenêtre, revenir à la première
|
||||||
|
if [ -z "$next" ]; then
|
||||||
|
next="$1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
swaymsg "[con_id=$next] focus"
|
||||||
|
|
||||||
|
|
@ -36,5 +36,5 @@
|
||||||
#}
|
#}
|
||||||
|
|
||||||
# show/hide bar
|
# show/hide bar
|
||||||
bindsym $mad+b exec "swaymsg bar mode hide bar-0"
|
#bindsym $mad+b exec "swaymsg bar mode hide bar-0"
|
||||||
bindsym $mad+Shift+b exec "swaymsg bar mode dock bar-0"
|
#bindsym $mad+Shift+b exec "swaymsg bar mode dock bar-0"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
# You can send windows there and get them back later.
|
# You can send windows there and get them back later.
|
||||||
|
|
||||||
# launch a terminal and move it to scratch at launch
|
# launch a terminal and move it to scratch at launch
|
||||||
exec --no-startup-id "sleep 10 && $term -t scratch -a scratch -m -e 'byobu'"
|
exec --no-startup-id "sleep 10 && $term -t scratch -a scratch -m -e byobu"
|
||||||
for_window [app_id="scratch"] floating enable, move absolute position center
|
for_window [app_id="scratch"] floating enable, move absolute position center
|
||||||
for_window [app_id="scratch"] move scratchpad
|
for_window [app_id="scratch"] move scratchpad
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ bindsym $mod+ctrl+t exec $term
|
||||||
bindsym $mad+F1 exec "nakedhelp"
|
bindsym $mad+F1 exec "nakedhelp"
|
||||||
|
|
||||||
# infos system
|
# infos system
|
||||||
bindsym $mad+m exec "$term --title=btop --app-id=btop btop"
|
#bindsym $mad+m exec "$term --title=btop --app-id=btop btop"
|
||||||
bindsym $mad+i exec "$infosbox"
|
#bindsym $mad+i exec "$infosbox"
|
||||||
bindsym $mad+Shift+i exec "$infosystem"
|
#bindsym $mad+Shift+i exec "$infosystem"
|
||||||
|
|
||||||
# lockscreen
|
# lockscreen
|
||||||
bindsym $mad+Shift+l exec "$locker"
|
bindsym $mad+Shift+l exec "$locker"
|
||||||
|
|
@ -31,8 +31,19 @@ bindsym $mad+Shift+x exec "$mailer"
|
||||||
bindsym $mad+w exec "$browser"
|
bindsym $mad+w exec "$browser"
|
||||||
bindsym $mad+Shift+w exec "$browser"
|
bindsym $mad+Shift+w exec "$browser"
|
||||||
|
|
||||||
|
# Applications
|
||||||
|
bindsym $mad+f exec ~/.config/sway/app-focus "firefox" "firefox"
|
||||||
|
bindsym $mad+m exec ~/.config/sway/app-focus "Mattermost.Desktop" "mattermost"
|
||||||
|
bindsym $mad+i exec ~/.config/sway/app-focus "jetbrains-idea" "idea"
|
||||||
|
bindsym $mad+j exec ~/.config/sway/app-focus "jitsi-meet" "jitsi-meet"
|
||||||
|
bindsym $mad+v exec ~/.config/sway/app-focus "freetube" "freetube"
|
||||||
|
bindsym $mad+s exec ~/.config/sway/app-focus "Spotify" "spotify"
|
||||||
|
bindsym $mad+d exec ~/.config/sway/app-focus "discord" "discord"
|
||||||
|
bindsym $mad+t exec ~/.config/sway/app-focus "foot" "foot"
|
||||||
|
bindsym $mad+b exec ~/.config/sway/app-focus "bruno" "bruno"
|
||||||
|
|
||||||
# audio bindings
|
# audio bindings
|
||||||
bindsym $mad+v exec "$mixer"
|
#bindsym $mad+v exec "$mixer"
|
||||||
bindsym XF86AudioRaiseVolume exec --no-startup-id "amixer -q sset Master 5%+ unmute"
|
bindsym XF86AudioRaiseVolume exec --no-startup-id "amixer -q sset Master 5%+ unmute"
|
||||||
bindsym XF86AudioLowerVolume exec --no-startup-id "amixer -q sset Master 5%- unmute"
|
bindsym XF86AudioLowerVolume exec --no-startup-id "amixer -q sset Master 5%- unmute"
|
||||||
bindsym XF86AudioMute exec --no-startup-id "amixer set Master toggle"
|
bindsym XF86AudioMute exec --no-startup-id "amixer set Master toggle"
|
||||||
|
|
@ -49,7 +60,7 @@ bindsym XF86AudioPlay exec --no-startup-id "mocp --toggle-pause"
|
||||||
bindsym XF86AudioNext exec --no-startup-id "mocp --next"
|
bindsym XF86AudioNext exec --no-startup-id "mocp --next"
|
||||||
|
|
||||||
# start search
|
# start search
|
||||||
bindsym $mad+f exec "nakedlocate"
|
#bindsym $mad+f exec "nakedlocate"
|
||||||
|
|
||||||
# cleaner
|
# cleaner
|
||||||
bindsym $mad+Backspace exec "dotcleaner"
|
bindsym $mad+Backspace exec "dotcleaner"
|
||||||
|
|
@ -78,3 +89,4 @@ bindsym $mod+comma exec $ipc settings-toggle
|
||||||
#bindsym --locked XF86AudioMute exec $ipc volume-mute
|
#bindsym --locked XF86AudioMute exec $ipc volume-mute
|
||||||
#bindsym --locked XF86MonBrightnessUp exec $ipc brightness-up
|
#bindsym --locked XF86MonBrightnessUp exec $ipc brightness-up
|
||||||
#bindsym --locked XF86MonBrightnessDown exec $ipc brightness-down
|
#bindsym --locked XF86MonBrightnessDown exec $ipc brightness-down
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,24 +14,24 @@
|
||||||
# Moving around:
|
# Moving around:
|
||||||
# Move your focus around vim like
|
# Move your focus around vim like
|
||||||
bindsym $mad+$left focus left
|
bindsym $mad+$left focus left
|
||||||
bindsym $mad+$down focus down
|
#bindsym $mad+$down focus down
|
||||||
bindsym $mad+$up focus up
|
#bindsym $mad+$up focus up
|
||||||
bindsym $mad+$right focus right
|
bindsym $mad+$right focus right
|
||||||
# Or use $mod+[up|down|left|right]
|
# Or use $mod+[up|down|left|right]
|
||||||
bindsym $mad+Left focus left
|
bindsym $mad+Left focus left
|
||||||
bindsym $mad+Down focus down
|
#bindsym $mad+Down focus down
|
||||||
bindsym $mad+Up focus up
|
#bindsym $mad+Up focus up
|
||||||
bindsym $mad+Right focus right
|
bindsym $mad+Right focus right
|
||||||
|
|
||||||
# Move the focused window with the same, but add Shift
|
# Move the focused window with the same, but add Shift
|
||||||
bindsym $mod+Shift+$left move left
|
bindsym $mod+Shift+$left move left
|
||||||
bindsym $mod+Shift+$down move down
|
#bindsym $mod+Shift+$down move down
|
||||||
bindsym $mod+Shift+$up move up
|
#bindsym $mod+Shift+$up move up
|
||||||
bindsym $mod+Shift+$right move right
|
bindsym $mod+Shift+$right move right
|
||||||
# Ditto, with arrow keys
|
# Ditto, with arrow keys
|
||||||
bindsym $mod+Shift+Left move left
|
bindsym $mod+Shift+Left move left
|
||||||
bindsym $mod+Shift+Down move down
|
#bindsym $mod+Shift+Down move down
|
||||||
bindsym $mod+Shift+Up move up
|
#bindsym $mod+Shift+Up move up
|
||||||
bindsym $mod+Shift+Right move right
|
bindsym $mod+Shift+Right move right
|
||||||
# window switcher Alt+Tab
|
# window switcher Alt+Tab
|
||||||
bindsym $mod+Tab workspace back_and_forth
|
bindsym $mod+Tab workspace back_and_forth
|
||||||
|
|
|
||||||
|
|
@ -1,42 +1,42 @@
|
||||||
# sway # modes
|
# sway # modes
|
||||||
|
|
||||||
# Resizing containers:
|
# Resizing containers:
|
||||||
set $mode_resize "<b>Resize</b>(<b>←↑↓→</b>) <b>Gaps</b>(<b>+/-</b>)"
|
#set $mode_resize "<b>Resize</b>(<b>←↑↓→</b>) <b>Gaps</b>(<b>+/-</b>)"
|
||||||
mode --pango_markup $mode_resize {
|
#mode --pango_markup $mode_resize {
|
||||||
# resize windows vimlike
|
# # resize windows vimlike
|
||||||
bindsym $left resize shrink width 10px
|
# bindsym $left resize shrink width 10px
|
||||||
bindsym $down resize grow height 10px
|
# bindsym $down resize grow height 10px
|
||||||
bindsym $up resize shrink height 10px
|
# bindsym $up resize shrink height 10px
|
||||||
bindsym $right resize grow width 10px
|
# bindsym $right resize grow width 10px
|
||||||
# with arrow keys
|
# # with arrow keys
|
||||||
bindsym Left resize shrink width 10px
|
# bindsym Left resize shrink width 10px
|
||||||
bindsym Down resize grow height 10px
|
# bindsym Down resize grow height 10px
|
||||||
bindsym Up resize shrink height 10px
|
# bindsym Up resize shrink height 10px
|
||||||
bindsym Right resize grow width 10px
|
# bindsym Right resize grow width 10px
|
||||||
# resize window Gaps with +/-
|
# # resize window Gaps with +/-
|
||||||
bindsym minus gaps inner current minus 5px
|
# bindsym minus gaps inner current minus 5px
|
||||||
bindsym plus gaps inner current plus 5px
|
# bindsym plus gaps inner current plus 5px
|
||||||
# Return to default mode
|
# # Return to default mode
|
||||||
bindsym Return mode "default"
|
# bindsym Return mode "default"
|
||||||
bindsym Escape mode "default"
|
# bindsym Escape mode "default"
|
||||||
}
|
#}
|
||||||
# launch resize mode (Alt+r)
|
## launch resize mode (Alt+r)
|
||||||
bindsym $mod+r mode $mode_resize
|
#bindsym $mod+r mode $mode_resize
|
||||||
|
#
|
||||||
# Audio menu
|
## Audio menu
|
||||||
set $mode_audio "<b>Audio</b>(<b>↑/↓/m</b>) <b>Micro</b>(<b>+/-/n</b>)"
|
#set $mode_audio "<b>Audio</b>(<b>↑/↓/m</b>) <b>Micro</b>(<b>+/-/n</b>)"
|
||||||
mode --pango_markup $mode_audio {
|
#mode --pango_markup $mode_audio {
|
||||||
# volume control
|
# # volume control
|
||||||
bindsym Up exec --no-startup-id "amixer -q sset Master 1%+ unmute"
|
# bindsym Up exec --no-startup-id "amixer -q sset Master 1%+ unmute"
|
||||||
bindsym Down exec --no-startup-id "amixer -q sset Master 1%- unmute"
|
# bindsym Down exec --no-startup-id "amixer -q sset Master 1%- unmute"
|
||||||
bindsym m exec --no-startup-id "amixer set Master toggle"
|
# bindsym m exec --no-startup-id "amixer set Master toggle"
|
||||||
# micro control
|
# # micro control
|
||||||
bindsym minus exec --no-startup-id "amixer -q sset Capture 1%- cap"
|
# bindsym minus exec --no-startup-id "amixer -q sset Capture 1%- cap"
|
||||||
bindsym plus exec --no-startup-id "amixer -q sset Capture 1%+ cap"
|
# bindsym plus exec --no-startup-id "amixer -q sset Capture 1%+ cap"
|
||||||
bindsym n exec --no-startup-id "amixer set Capture toggle"
|
# bindsym n exec --no-startup-id "amixer set Capture toggle"
|
||||||
# Return to default mode
|
# # Return to default mode
|
||||||
bindsym Return mode "default"
|
# bindsym Return mode "default"
|
||||||
bindsym Escape mode "default"
|
# bindsym Escape mode "default"
|
||||||
}
|
#}
|
||||||
# launch audio mode (Super+s)
|
## launch audio mode (Super+s)
|
||||||
bindsym $mad+s mode $mode_audio
|
#bindsym $mad+s mode $mode_audio
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue