From 35617beae2afa21ae4aa34cedeb47f8f86eba47f Mon Sep 17 00:00:00 2001 From: Sheldon Lee Date: Tue, 19 Jul 2022 05:20:52 +0800 Subject: [PATCH 1/3] Added script to start Discord profile in firefox. --- .config/scripts/bin/discord-ff | 1 + .config/scripts/firefox/discord-ff | 2 ++ 2 files changed, 3 insertions(+) create mode 120000 .config/scripts/bin/discord-ff create mode 100755 .config/scripts/firefox/discord-ff diff --git a/.config/scripts/bin/discord-ff b/.config/scripts/bin/discord-ff new file mode 120000 index 0000000..354d803 --- /dev/null +++ b/.config/scripts/bin/discord-ff @@ -0,0 +1 @@ +../firefox/discord-ff \ No newline at end of file diff --git a/.config/scripts/firefox/discord-ff b/.config/scripts/firefox/discord-ff new file mode 100755 index 0000000..367fde8 --- /dev/null +++ b/.config/scripts/firefox/discord-ff @@ -0,0 +1,2 @@ +#!/bin/sh +firefox --name="Discord Firefox" -P Discord From 188d45b432214bb048e767c0f6c5a7b452925acb Mon Sep 17 00:00:00 2001 From: Sheldon Lee Date: Tue, 19 Jul 2022 05:38:37 +0800 Subject: [PATCH 2/3] Added mic toggle script. --- .config/scripts/bin/toggle-mic-notify | 1 + .config/scripts/wm/toggle-mic-notify | 6 ++++++ 2 files changed, 7 insertions(+) create mode 120000 .config/scripts/bin/toggle-mic-notify create mode 100755 .config/scripts/wm/toggle-mic-notify diff --git a/.config/scripts/bin/toggle-mic-notify b/.config/scripts/bin/toggle-mic-notify new file mode 120000 index 0000000..980ec53 --- /dev/null +++ b/.config/scripts/bin/toggle-mic-notify @@ -0,0 +1 @@ +../wm/toggle-mic-notify \ No newline at end of file diff --git a/.config/scripts/wm/toggle-mic-notify b/.config/scripts/wm/toggle-mic-notify new file mode 100755 index 0000000..7e996e7 --- /dev/null +++ b/.config/scripts/wm/toggle-mic-notify @@ -0,0 +1,6 @@ +#!/bin/sh +amixer set Capture toggle @> /dev/null + +str=$(grep '\[on\]\|\[off\]' <<< $(amixer get Capture) | awk '{print $5}') +echo $str +notify-send "Microphone: $str" From 604970e48de94f5d9f56c80a2480dfd3b0c8712b Mon Sep 17 00:00:00 2001 From: Sheldon Lee Date: Tue, 19 Jul 2022 05:38:55 +0800 Subject: [PATCH 3/3] Changed config. Added keybind to toggle mute mic. Updated more strict window rules to avoid accidental moves to trash workspace. --- .config/sway/config | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.config/sway/config b/.config/sway/config index 6b618fa..7917a27 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -231,6 +231,10 @@ exec swayidle -w \ # If there are multiple scratchpad windows, this command cycles through them. bindsym $mod+minus scratchpad show # +# Microphone: +# + bindsym $mod+Tab exec toggle-mic-notify +# # Resizing containers: # mode "resize" { @@ -315,25 +319,29 @@ exec dunst exec alacritty exec firefox -exec flatpak run com.discordapp.Discord +exec discord-ff +exec signal-desktop + # # Application rules: # # Xwayland applications tend to use 'class=', whereas wayland applications use 'appid=' assign [app_id="firefox"] workspace 2:r -#for_window [title="^Discord — Mozilla Firefox"] move container to workspace 3:s -for_window [class="discord"] move container to workspace 3:s +assign [app_id="Discord Firefox"] workspace 3:s +for_window [title="^Discord — Mozilla Firefox$"] fullscreen disable +assign [class="Signal"] workspace 3:s assign [class="Steam"] workspace 4:t -# Inhibit swayidle when discord is focused. Usefull when watching stream. -for_window [class="discord"] inhibit_idle focus # Space Games, as joystick usage without mouse and keyboard count as idle. for_window [class="steam_app_359320"] inhibit_idle focus for_window [class="starcitizen.exe"] inhibit_idle focus # Floating windows -for_window [title="Firefox — Sharing Indicator"] floating enable, move position 50ppt 0px; -for_window [class="genshinimact.exe"] floating enable; -for_window [class=".*.exe"] floating enable; +for_window [title="^Firefox — Sharing Indicator$"] floating enable, move position 50ppt 0px; +for_window [class="^Steam$"] floating enable +for_window [class="^Steam$" title="^Steam$"] floating disable +for_window [class="genshinimact.exe"] floating enable +for_window [class=".*.exe$"] floating enable # Move windows to trash workspace -for_window [title="Origin"] floating enable, move container to workspace trash; +for_window [title="^Origin$"] floating enable, move container to workspace trash; +for_window [title="^Wine System Tray$"] move container to workspace trash; include /etc/sway/config.d/*