diff --git a/ansible/roles/sway/files/disable_notifications.bash b/ansible/roles/sway/files/disable_notifications.bash new file mode 100644 index 0000000..598c7c0 --- /dev/null +++ b/ansible/roles/sway/files/disable_notifications.bash @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# +# Disable displaying notifications. This is useful for video conference screen sharing. +set -euo pipefail +IFS=$'\n\t' +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +makoctl set-mode do-not-disturb diff --git a/ansible/roles/sway/files/enable_notifications.bash b/ansible/roles/sway/files/enable_notifications.bash new file mode 100644 index 0000000..5618653 --- /dev/null +++ b/ansible/roles/sway/files/enable_notifications.bash @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# +# Allow mako to show notifications again. +set -euo pipefail +IFS=$'\n\t' +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +makoctl set-mode default diff --git a/ansible/roles/sway/files/xdg-desktop-portal-wlr-config b/ansible/roles/sway/files/xdg-desktop-portal-wlr-config index 63e21df..1d4966a 100644 --- a/ansible/roles/sway/files/xdg-desktop-portal-wlr-config +++ b/ansible/roles/sway/files/xdg-desktop-portal-wlr-config @@ -1,7 +1,7 @@ -# [screencast] -# output_name=HDMI-A-1 -# max_fps=30 -# exec_before=disable_notifications.sh -# exec_after=enable_notifications.sh -# chooser_type=simple -# chooser_cmd=slurp -f %o -or +[screencast] +#output_name=HDMI-A-1 +#max_fps=30 +exec_before=/usr/local/bin/disable_notifications +exec_after=/usr/local/bin/enable_notifications +chooser_type=simple +chooser_cmd=slurp -f %o -or diff --git a/ansible/roles/sway/tasks/common.yaml b/ansible/roles/sway/tasks/common.yaml index d7c1735..c5e5355 100644 --- a/ansible/roles/sway/tasks/common.yaml +++ b/ansible/roles/sway/tasks/common.yaml @@ -1,3 +1,16 @@ +- name: Install scripts + copy: + src: "files/{{ item.src }}" + dest: "{{ item.dest }}" + mode: 0755 + owner: root + group: wheel + loop: + - src: enable_notifications.bash + dest: /usr/local/bin/enable_notifications + - src: disable_notifications.bash + dest: /usr/local/bin/disable_notifications + - import_tasks: tasks/freebsd.yaml when: 'os_flavor == "freebsd"'