From b9d1dd8eb17e326fa40b6671fba004f9c8a8564c Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Mon, 30 May 2022 21:50:33 -0700 Subject: [PATCH] Add initial set of configuration presets --- sway/50-fedora.conf | 11 ++++++++++ sway/config | 20 +------------------ .../30-bindings-brightness-light.conf | 15 ++++++++++++++ .../config.d/30-bindings-media-playerctl.conf | 17 ++++++++++++++++ sway/config.d/30-bindings-volume-pactl.conf | 11 ++++++++++ sway/config.d/50-mode-passthrough.conf | 6 ++++++ sway/config.d/60-windows-browser.conf | 15 ++++++++++++++ .../60-windows-lxqt-policykit-agent.conf | 4 ++++ sway/config.d/90-bar-swaybar.conf | 17 ++++++++++++++++ sway/config.d/90-bar-waybar.conf | 9 +++++++++ .../95-autostart-lxqt-policykit-agent.conf | 1 + 11 files changed, 107 insertions(+), 19 deletions(-) create mode 100644 sway/50-fedora.conf create mode 100644 sway/config.d/30-bindings-brightness-light.conf create mode 100644 sway/config.d/30-bindings-media-playerctl.conf create mode 100644 sway/config.d/30-bindings-volume-pactl.conf create mode 100644 sway/config.d/50-mode-passthrough.conf create mode 100644 sway/config.d/60-windows-browser.conf create mode 100644 sway/config.d/60-windows-lxqt-policykit-agent.conf create mode 100644 sway/config.d/90-bar-swaybar.conf create mode 100644 sway/config.d/90-bar-waybar.conf create mode 100644 sway/config.d/95-autostart-lxqt-policykit-agent.conf diff --git a/sway/50-fedora.conf b/sway/50-fedora.conf new file mode 100644 index 0000000..aec0178 --- /dev/null +++ b/sway/50-fedora.conf @@ -0,0 +1,11 @@ +# Enable some configuration snippets by default +include /usr/share/sway/config.d/30-bindings-brightness-light.conf +include /usr/share/sway/config.d/30-bindings-media-playerctl.conf +include /usr/share/sway/config.d/30-bindings-volume-pactl.conf + +include /usr/share/sway/config.d/60-windows-browser.conf +include /usr/share/sway/config.d/60-windows-lxqt-policykit-agent.conf + +include /usr/share/sway/config.d/90-bar-waybar.conf + +include /usr/share/sway/config.d/95-autostart-lxqt-policykit-agent.conf diff --git a/sway/config b/sway/config index a769dc8..1a9b4ae 100644 --- a/sway/config +++ b/sway/config @@ -23,7 +23,7 @@ set $menu dmenu_path | dmenu | xargs swaymsg exec -- ### Output configuration # # Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) -output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill +output * bg /usr/share/backgrounds/default.png fill # # Example configuration: # @@ -196,22 +196,4 @@ mode "resize" { } bindsym $mod+r mode "resize" -# -# Status Bar: -# -# Read `man 5 sway-bar` for more information about this section. -bar { - position top - - # When the status_command prints a new line to stdout, swaybar updates. - # The default just shows the current date and time. - status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done - - colors { - statusline #ffffff - background #323232 - inactive_workspace #32323200 #32323200 #5c5c5c - } -} - include /etc/sway/config.d/* diff --git a/sway/config.d/30-bindings-brightness-light.conf b/sway/config.d/30-bindings-brightness-light.conf new file mode 100644 index 0000000..a6f701f --- /dev/null +++ b/sway/config.d/30-bindings-brightness-light.conf @@ -0,0 +1,15 @@ +# Key bindings for monitor brightness control with `light` +# Displays a notification with the current value if /usr/bin/notify-send is available +# +# Requires: light +# Recommends: libnotify + +bindsym XF86MonBrightnessDown exec light -U 5 && \ + command -v notify-send >/dev/null && \ + notify-send -h string:x-canonical-private-synchronous:brightness \ + -h int:value:$(light) -t 800 brightness + +bindsym XF86MonBrightnessUp exec light -A 5 && \ + command -v notify-send >/dev/null && \ + notify-send -h string:x-canonical-private-synchronous:brightness \ + -h int:value:$(light) -t 800 brightness diff --git a/sway/config.d/30-bindings-media-playerctl.conf b/sway/config.d/30-bindings-media-playerctl.conf new file mode 100644 index 0000000..1e2f59f --- /dev/null +++ b/sway/config.d/30-bindings-media-playerctl.conf @@ -0,0 +1,17 @@ +# Key bindings for media player control via MPRIS D-Bus interface +# +# Requires: playerctl + +# Allow Play and Stop bindings even if the screen is locked +bindsym --locked { + XF86AudioPlay exec playerctl play-pause + XF86AudioStop exec playerctl stop +} + +bindsym { + XF86AudioForward exec playerctl position +10 + XF86AudioNext exec playerctl next + XF86AudioPause exec playerctl pause + XF86AudioPrev exec playerctl previous + XF86AudioRewind exec playerctl position -10 +} diff --git a/sway/config.d/30-bindings-volume-pactl.conf b/sway/config.d/30-bindings-volume-pactl.conf new file mode 100644 index 0000000..ff75159 --- /dev/null +++ b/sway/config.d/30-bindings-volume-pactl.conf @@ -0,0 +1,11 @@ +# Key bindings for pipewire and pulseaudio volume control +# +# Requires: pulseaudio-utils + +# Allow volume controls even if the screen is locked +bindsym --locked { + XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% + XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% + XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle + XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle +} diff --git a/sway/config.d/50-mode-passthrough.conf b/sway/config.d/50-mode-passthrough.conf new file mode 100644 index 0000000..ce298f8 --- /dev/null +++ b/sway/config.d/50-mode-passthrough.conf @@ -0,0 +1,6 @@ +# A special mode for passing any keybindings to the focused application + +mode "passthrough" { + bindsym $mod+Pause mode default +} +bindsym $mod+Pause mode "passthrough" diff --git a/sway/config.d/60-windows-browser.conf b/sway/config.d/60-windows-browser.conf new file mode 100644 index 0000000..58517c7 --- /dev/null +++ b/sway/config.d/60-windows-browser.conf @@ -0,0 +1,15 @@ +# apply mark for Xwayland and wayland native browser windows +for_window [class="Chromium-browser"] mark Browser +for_window [class="firefox"] mark Browser +for_window [app_id="Chromium-browser"] mark Browser +for_window [app_id="firefox"] mark Browser + +# inhibit scrensaver for fullscreen browser windows +for_window [con_mark="Browser"] { + inhibit_idle fullscreen +} + +# firefox wayland screensharing indicator +for_window [app_id="firefox" title="Firefox — Sharing Indicator"] { + floating enable +} diff --git a/sway/config.d/60-windows-lxqt-policykit-agent.conf b/sway/config.d/60-windows-lxqt-policykit-agent.conf new file mode 100644 index 0000000..88ff754 --- /dev/null +++ b/sway/config.d/60-windows-lxqt-policykit-agent.conf @@ -0,0 +1,4 @@ +for_window [app_id="lxqt-policykit-agent"] { + floating enable + move position center +} diff --git a/sway/config.d/90-bar-swaybar.conf b/sway/config.d/90-bar-swaybar.conf new file mode 100644 index 0000000..6cf0064 --- /dev/null +++ b/sway/config.d/90-bar-swaybar.conf @@ -0,0 +1,17 @@ +# +# Status Bar: +# +# Read `man 5 sway-bar` for more information about this section. +bar { + position top + + # When the status_command prints a new line to stdout, swaybar updates. + # The default just shows the current date and time. + status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done + + colors { + statusline #ffffff + background #323232 + inactive_workspace #32323200 #32323200 #5c5c5c + } +} diff --git a/sway/config.d/90-bar-waybar.conf b/sway/config.d/90-bar-waybar.conf new file mode 100644 index 0000000..f584dbf --- /dev/null +++ b/sway/config.d/90-bar-waybar.conf @@ -0,0 +1,9 @@ +# +# Status Bar: +# +# Read `man 5 sway-bar` for more information about this section. +bar { + position top + + swaybar_command waybar +} diff --git a/sway/config.d/95-autostart-lxqt-policykit-agent.conf b/sway/config.d/95-autostart-lxqt-policykit-agent.conf new file mode 100644 index 0000000..3817ec9 --- /dev/null +++ b/sway/config.d/95-autostart-lxqt-policykit-agent.conf @@ -0,0 +1 @@ +exec /usr/libexec/lxqt-policykit-agent