diff --git a/roles/desktop/files/sway.d/keybindings.conf b/roles/desktop/files/sway.d/keybindings.conf index cddc72c..4ab7036 100644 --- a/roles/desktop/files/sway.d/keybindings.conf +++ b/roles/desktop/files/sway.d/keybindings.conf @@ -123,3 +123,8 @@ bindsym XF86AudioRaiseVolume exec wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5 bindsym XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- bindsym XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle bindsym XF86AudioMicMute exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle + +bindsym Print exec grim - | wl-copy +bindsym Shift+Print exec grim -g "$(slurp)" - | wl-copy +bindsym $mod+Print exec grim ~/Pictures/screenshots/$(date +%FT%T).png +bindsym $mod+Shift+Print exec grim -g "$(slurp)" ~/Pictures/screenshots/$(date +%FT%T).png diff --git a/roles/desktop/tasks/sway.yml b/roles/desktop/tasks/sway.yml index 85cbff2..bbea1c3 100644 --- a/roles/desktop/tasks/sway.yml +++ b/roles/desktop/tasks/sway.yml @@ -1,8 +1,11 @@ -- name: Install sway +- name: Install sway, grim, slurp and wl-clipboard become: true ansible.builtin.apt: pkg: - sway + - grim + - slurp + - wl-clipboard - name: Create sway config dir ansible.builtin.file: path: "{{ ansible_env.HOME }}/.config/sway" @@ -18,3 +21,8 @@ src: files/sway.d/ dest: "{{ ansible_env.HOME }}/.config/sway/config.d/" mode: '1770' +- name: Create directory for screenshots + ansible.builtin.file: + path: "{{ ansible_env.HOME }}/Pictures/screenshots" + state: directory + mode: '1770'