Skip to content
Snippets Groups Projects
Verified Commit 171edb39 authored by Andreas Gerlach's avatar Andreas Gerlach
Browse files

[sway] introduce new modes for screenshots, screen-recording

parent 3c863785
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,6 @@ Sway has up to ten different workspaces that can be freely arranged on the avail
- toggle full-screen for the current application window: **$mod** + **f**
- split the current application window vertically: **$mod** + **v**
- split the current application window horizontally: **$mod** + **b**
- enter resize mode for the current application window: **$mod** + **r** (see [Resize Mode](#Resize%20Mode))
## Changing the Container Layout
......@@ -64,9 +63,10 @@ Sway has up to ten different workspaces that can be freely arranged on the avail
After activating the Resize Mode you should see a message in the statusbar.
- enter resize mode for the current application window: **$mod** + **r**
- resize the current application window: **\<movement-key\>** (can be used together with **Shift** for larger offsets)
- increase the gaps between windows: **+** (can be used together with **Shift** for larger offsets)
- decrease the gaps between windows: **-** (can be used together with **Shift** for larger offsets)
- increase the gaps between windows: **+**
- decrease the gaps between windows: **-**
- exit the resize mode: **Enter** or **ESC**
## Scratchpad Mode
......@@ -76,11 +76,25 @@ Sway has a "scratchpad", which is a bag of holding for windows. You can send wi
- move the current application window to the Scratchpad: **$mod** + **Shift** + **Minus**
- activate the Scratchpad Mode: **$mod** + **Minus**
## Screenshots
## Screenshot Mode
- screenshot of the whole screen: **Print Screen**
- screenshot of the current application window: **$mod** + **Print Screen**
- screenshot of certain area of the screen: **$mod** + **Shift** + **Print Screen**
- enter screenshot mode: **$mod** + **Shift** + **s**
- copy screenshot of the whole screen: **f**
- save screenshot of the whole screen: **Shift** + **f**
- copy screenshot of the application window: **w**
- save screenshot of the application window: **Shift** + **w**
- copy screenshot of certain area of the screen: **r**
- save screenshot of certain area of the screen: **Shift** + **r**
- exit the resize mode: **Enter** or **ESC**
## Screenshot Recording Mode
- enter screenshot recording mode: **$mod** + **Shift** + **r**
- record the whole screen: **f**
- record the whole screen with audio: **Shift** + **f**
- record a certain area of the screen: **r**
- record a certain area of the screen with audio: **Shift** + **r**
- exit the resize mode: **Enter** or **ESC**
## Restart / Exit
......
......@@ -25,15 +25,12 @@ bindsym $mod+Shift+c reload
# Exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+e exec $logout
# Taking screenshots (full-screen, active window, or dedicated area)
bindsym Print exec grimshot save screen
bindsym $mod+Print exec grimshot save win
bindsym $mod+Shift+Print exec grimshot save area
# Media key bindings
bindsym XF86AudioLowerVolume exec amixer -q sset 'Master' 5%-
bindsym XF86AudioMute exec amixer -q sset 'Master' toggle
bindsym XF86AudioRaiseVolume exec amixer -q sset 'Master' 5%+
# Screen brightness bindings
bindsym XF86MonBrightnessDown exec light -U 5
bindsym XF86MonBrightnessUp exec light -A 5
......
set $mode_recording "<span foreground='$base0A'>雷</span> \
<span foreground='$base05'><b>Screen</b></span> <span foreground='$base0A'>(<b>w</b>)</span> \
<span foreground='$base01'>—</span> \
<span foreground='$base05'><b>Screen (+ Mic)</b></span> <span foreground='$base0A'>(<b>Shift+w</b>)</span> \
<span foreground='$base01'>—</span> \
<span foreground='$base05'><b>Region</b></span> <span foreground='$base0A'>(<b>r</b>)</span> \
<span foreground='$base01'>—</span> \
<span foreground='$base05'><b>Region (+ Mic)</b></span> <span foreground='$base0A'>(<b>Shift+r</b>)</span>"
set $mode_recording_on "<span foreground='$base0A'>壘</span> \
<span foreground='$base05'><b>Exit</b></span> <span foreground='$base0A'>(<b>ESC</b>)</span>"
mode --pango_markup $mode_recording_on {
bindsym Escape exec killall -s SIGINT wf-recorder, mode "default"
}
mode --pango_markup $mode_recording {
bindsym w exec killall -s SIGINT wf-recorder || wf-recorder --audio=0 -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') \
-f ~/Videos/recording-$(date +'%Y-%m-%d-%H%M%S').mp4, mode $mode_recording_on
bindsym Shift+w exec killall -s SIGINT wf-recorder || wf-recorder --audio -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') \
-f ~/Videos/recording-$(date +'%Y-%m-%d-%H%M%S').mp4, mode $mode_recording_on
bindsym r exec killall -s SIGINT wf-recorder || wf-recorder --audio=0 -g "$(slurp -d)" \
-f ~/Videos/recording-$(date +'%Y-%m-%d-%H%M%S').mp4, mode $mode_recording_on
bindsym Shift+r exec killall -s SIGINT wf-recorder || wf-recorder --audio -g "$(slurp -d)" \
-f ~/Videos/recording-$(date +'%Y-%m-%d-%H%M%S').mp4, mode $mode_recording_on
# Return to default mode.
bindsym Escape mode "default"
bindsym Return mode "default"
}
bindsym $mod+Shift+r mode $mode_recording
#
# Resizing containers:
#
mode "resize" {
set $mode_resize "<span foreground='$base0A'></span> \
<span foreground='$base05'><b>Resize</b></span> <span foreground='$base0A'>(<b>h/j/k/l</b>)</span> \
<span foreground='$base01'>—</span> \
<span foreground='$base05'><b>Increase Gaps</b></span> <span foreground='$base0A'>(<b>+</b>)</span> \
<span foreground='$base01'>—</span> \
<span foreground='$base05'><b>Decrease Gaps</b></span> <span foreground='$base0A'>(<b>-</b>)</span>"
mode --pango_markup $mode_resize {
# left will shrink the containers width
# right will grow the containers width
# up will shrink the containers height
......@@ -33,4 +37,4 @@ mode "resize" {
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
bindsym $mod+r mode $mode_resize
set $mode_screenshot "<span foreground='$base0A'></span> \
<span foreground='$base05'><b>Fullscreen</b></span> <span foreground='$base0A'>(<b>f</b>)</span> \
<span foreground='$base01'>—</span> \
<span foreground='$base05'><b>Window</b></span> <span foreground='$base0A'>(<b>w</b>)</span> \
<span foreground='$base01'>—</span> \
<span foreground='$base05'><b>Region</b></span> <span foreground='$base0A'>(<b>r</b>)</span>"
mode --pango_markup $mode_screenshot {
bindsym f exec --no-startup-id grimshot copy screen, mode "default"
bindsym Shift+f exec --no-startup-id grimshot save screen ~/Pictures/screenshot-$(date +'%Y-%m-%d-%H%M%S'), mode "default"
bindsym w exec --no-startup-id grimshot copy win, mode "default"
bindsym Shift+w exec --no-startup-id grimshot save win ~/Pictures/screenshot-$(date +'%Y-%m-%d-%H%M%S'), mode "default"
bindsym r exec --no-startup-id grimshot copy area, mode "default"
bindsym Shift+r exec --no-startup-id grimshot save area ~/Pictures/screenshot-$(date +'%Y-%m-%d-%H%M%S'), mode "default"
# Return to default mode.
bindsym Escape mode "default"
bindsym Return mode "default"
}
bindsym $mod+Shift+s mode $mode_screenshot
......@@ -132,10 +132,7 @@
}
#mode {
background: #64727D;
border-top: 2px solid #F5F7FA;
/* To compensate for the top border and still have vertical centering */
padding-bottom: 2px;
background: #222E38;
}
#network {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment