From af8d6da357441e2fce12608a7a8ba82fe4c1a49d Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Sat, 3 Feb 2024 01:07:23 -0800 Subject: [PATCH 01/14] waybar: install and add to the package --- Makefile | 4 ++++ sway-config-fedora.spec.rpkg | 24 +++++++++++++++++++++++- waybar/build.mk | 7 +++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 waybar/build.mk diff --git a/Makefile b/Makefile index 21cf3e2..da29fe4 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,10 @@ ifeq ($(WITH_SDDM),yes) install: install-sddm endif +ifeq ($(WITH_WAYBAR),yes) +include waybar/build.mk +endif + install: install-sway install-swaylock check: diff --git a/sway-config-fedora.spec.rpkg b/sway-config-fedora.spec.rpkg index b2e28ff..daeecf1 100644 --- a/sway-config-fedora.spec.rpkg +++ b/sway-config-fedora.spec.rpkg @@ -1,7 +1,9 @@ # vim: ft=spec %bcond initialsetup %[0%{?fedora} >= 40 || 0%{?rhel} >= 10] %bcond sddm 1 +%bcond waybar 1 %global sway_ver 1.8 +%global waybar_ver 0.9.24 Name: {{{ git_name }}} Version: {{{ git_version }}} @@ -88,6 +90,23 @@ This package contains configuration and dependencies for SDDM to use Sway for the greeter display server. %endif +%if %{with waybar} +%package -n waybar-config-fedora +Summary: Fedora Sway Spin configuration for Waybar + +Requires: waybar >= %{waybar_ver} +Provides: waybar-config = %{waybar_ver}+%{version}-%{release} +Conflicts: waybar-config + +%description -n waybar-config-fedora +%{summary}. + +%files -n waybar-config-fedora +%license LICENSE +%config(noreplace) %{_sysconfdir}/xdg/waybar/config +%config(noreplace) %{_sysconfdir}/xdg/waybar/style.css +%endif + %prep {{{ git_setup_macro path=$(git rev-parse --show-toplevel) }}} @@ -98,7 +117,10 @@ to use Sway for the greeter display server. %install -%make_install PREFIX='%{_prefix}' WITH_INITIALSETUP='%[%{with initialsetup}?"yes":"no"]' WITH_SDDM='%[%{with sddm}?"yes":"no"]' +%make_install PREFIX='%{_prefix}' \ + WITH_INITIALSETUP='%[%{with initialsetup}?"yes":"no"]' \ + WITH_SDDM='%[%{with sddm}?"yes":"no"]' \ + WITH_WAYBAR='%[%{with waybar}?"yes":"no"]' %files diff --git a/waybar/build.mk b/waybar/build.mk new file mode 100644 index 0000000..6d60675 --- /dev/null +++ b/waybar/build.mk @@ -0,0 +1,7 @@ +.PHONY: install-waybar + +install-waybar: + install -D -m 0644 -pv -t $(DESTDIR)$(SYSCONFDIR)/xdg/waybar \ + waybar/config waybar/style.css + +install: install-waybar From 3524218736ae37f7cfa6e72b4e8184126ee1410a Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Sat, 3 Feb 2024 01:12:20 -0800 Subject: [PATCH 02/14] waybar: disable most of the modules --- waybar/config | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/waybar/config b/waybar/config index daad8ab..ba7c806 100644 --- a/waybar/config +++ b/waybar/config @@ -5,9 +5,22 @@ // "width": 1280, // Waybar width "spacing": 4, // Gaps between modules (4px) // Choose the order of the modules - "modules-left": ["sway/workspaces", "sway/mode", "sway/scratchpad", "custom/media"], - "modules-center": ["sway/window"], - "modules-right": ["mpd", "idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "keyboard-state", "sway/language", "battery", "battery#bat2", "clock", "tray"], + "modules-left": [ + "sway/workspaces", + "sway/mode", + "sway/scratchpad" + ], + "modules-center": [ + "sway/window" + ], + "modules-right": [ + "idle_inhibitor", + "pulseaudio", + "sway/language", + "battery", + "clock", + "tray" + ], // Modules configuration // "sway/workspaces": { // "disable-scroll": true, From c19eeab74918c0b3f73f924fbaf53d320fa81e69 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Sun, 4 Feb 2024 15:36:09 -0800 Subject: [PATCH 03/14] waybar: change font to monospace --- waybar/style.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/waybar/style.css b/waybar/style.css index cf5c5fb..6858aac 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -1,6 +1,5 @@ * { - /* `otf-font-awesome` is required to be installed for icons */ - font-family: FontAwesome, Roboto, Helvetica, Arial, sans-serif; + font-family: 'Noto Sans Mono', 'Font Awesome 6 Free', 'Font Awesome 6 Brands', monospace; font-size: 13px; } From e176a0323179791dcabbd01501618a1fd0f07c35 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Sat, 10 Feb 2024 16:22:19 -0800 Subject: [PATCH 04/14] waybar: use moon phase emojis insted of symbols Whatever the required font is, we don't have it in the default installation. --- waybar/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/waybar/config b/waybar/config index ba7c806..6ed635f 100644 --- a/waybar/config +++ b/waybar/config @@ -117,7 +117,7 @@ "backlight": { // "device": "acpi_video1", "format": "{percent}% {icon}", - "format-icons": ["", "", "", "", "", "", "", "", ""] + "format-icons": ["🌑", "🌘", "🌗", "🌖", "🌕"] }, "battery": { "states": { From a6ac84d58b5be1ba06ea8af2a2d77390cbb59a48 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Mon, 12 Feb 2024 20:42:52 -0800 Subject: [PATCH 05/14] waybar: common rules for module margins and padding --- waybar/config | 2 +- waybar/style.css | 53 ++++++++++++++++++++++-------------------------- 2 files changed, 25 insertions(+), 30 deletions(-) diff --git a/waybar/config b/waybar/config index 6ed635f..1abd8a3 100644 --- a/waybar/config +++ b/waybar/config @@ -92,7 +92,7 @@ }, "tray": { // "icon-size": 21, - "spacing": 10 + "spacing": 5 }, "clock": { // "timezone": "America/New_York", diff --git a/waybar/style.css b/waybar/style.css index 6858aac..bada4b5 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -48,7 +48,6 @@ button:hover { } #workspaces button { - padding: 0 5px; background-color: transparent; color: #ffffff; } @@ -71,39 +70,38 @@ button:hover { border-bottom: 3px solid #ffffff; } -#clock, -#battery, -#cpu, -#memory, -#disk, -#temperature, -#backlight, -#network, -#pulseaudio, -#wireplumber, -#custom-media, -#tray, -#mode, -#idle_inhibitor, -#scratchpad, -#mpd { +/* Common module rules */ +.modules-left > widget > label, +.modules-center > widget > label, +.modules-right > widget > label { + color: inherit; + margin: 0; padding: 0 10px; - color: #ffffff; } -#window, -#workspaces { - margin: 0 4px; +.modules-left > widget > box, +.modules-center > widget > box, +.modules-right > widget > box { + color: inherit; + margin: 0; + padding: 0; } -/* If workspaces is the leftmost module, omit left margin */ -.modules-left > widget:first-child > #workspaces { +/* If the leftmost module is a box, omit left margin and padding */ +.modules-left > widget:first-child > box { margin-left: 0; + padding-left: 0; } -/* If workspaces is the rightmost module, omit right margin */ -.modules-right > widget:last-child > #workspaces { +/* If the rightmost module is a box, omit right margin and padding */ +.modules-right > widget:last-child > box { margin-right: 0; + padding-right: 0; +} + +#image { + margin: 0; + padding: 0 10px; } #clock { @@ -209,6 +207,7 @@ label:focus { #tray { background-color: #2980b9; + padding: 0 5px; } #tray > .passive { @@ -249,16 +248,12 @@ label:focus { #language { background: #00b093; color: #740864; - padding: 0 5px; - margin: 0 5px; min-width: 16px; } #keyboard-state { background: #97e1ad; color: #000000; - padding: 0 0px; - margin: 0 5px; min-width: 16px; } From e00d54be856f7c72d1b0b87da98f07814af2f7db Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Mon, 12 Feb 2024 20:48:00 -0800 Subject: [PATCH 06/14] waybar: fix vertical alignment for 'mode' --- waybar/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/waybar/style.css b/waybar/style.css index bada4b5..533d7af 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -67,7 +67,7 @@ button:hover { #mode { background-color: #64727D; - border-bottom: 3px solid #ffffff; + box-shadow: inset 0 -3px #ffffff; } /* Common module rules */ From 75d210171d53027742a842a03d5ddfb2c42446c8 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Mon, 12 Feb 2024 20:56:28 -0800 Subject: [PATCH 07/14] waybar: reset button styles --- waybar/style.css | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/waybar/style.css b/waybar/style.css index 533d7af..3b27c2c 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -34,11 +34,13 @@ window#waybar.chromium { } button { - /* Use box-shadow instead of border so the text isn't offset */ - box-shadow: inset 0 -3px transparent; - /* Avoid rounded borders under each button name */ - border: none; - border-radius: 0; + /* reset all builtin/theme styles */ + all: unset; + /* Restore some properties */ + min-height: 24px; + min-width: 16px; + padding: 0 10px; + transition: all 200ms ease-out; } /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ From cc811df6e6fa98bdc2ef5afb8d9c701ef48ea852 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Mon, 12 Feb 2024 21:22:31 -0800 Subject: [PATCH 08/14] waybar: less colorful bar --- waybar/style.css | 274 ++++++++++++++++++++++------------------------- 1 file changed, 131 insertions(+), 143 deletions(-) diff --git a/waybar/style.css b/waybar/style.css index 3b27c2c..10c0c27 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -3,8 +3,10 @@ font-size: 13px; } +@define-color inactive_module_color #a9a9a9; + window#waybar { - background-color: rgba(43, 48, 59, 0.5); + background-color: rgba(43, 48, 59, 0.8); border-bottom: 3px solid rgba(100, 114, 125, 0.5); color: #ffffff; transition-property: background-color; @@ -15,24 +17,6 @@ window#waybar.hidden { opacity: 0.2; } -/* -window#waybar.empty { - background-color: transparent; -} -window#waybar.solo { - background-color: #FFFFFF; -} -*/ - -window#waybar.termite { - background-color: #3F3F3F; -} - -window#waybar.chromium { - background-color: #000000; - border: none; -} - button { /* reset all builtin/theme styles */ all: unset; @@ -49,30 +33,10 @@ button:hover { box-shadow: inset 0 -3px #ffffff; } -#workspaces button { - background-color: transparent; - color: #ffffff; -} +/* + * Common module rules + */ -#workspaces button:hover { - background: rgba(0, 0, 0, 0.2); -} - -#workspaces button.focused { - background-color: #64727D; - box-shadow: inset 0 -3px #ffffff; -} - -#workspaces button.urgent { - background-color: #eb4d4b; -} - -#mode { - background-color: #64727D; - box-shadow: inset 0 -3px #ffffff; -} - -/* Common module rules */ .modules-left > widget > label, .modules-center > widget > label, .modules-right > widget > label { @@ -101,23 +65,62 @@ button:hover { padding-right: 0; } +/* + * Workspace state and focused window rules + */ + +/* +window#waybar.empty { + background-color: transparent; +} +window#waybar.solo { + background-color: #FFFFFF; +} + +window#waybar.termite { + background-color: #3F3F3F; +} + +window#waybar.chromium { + background-color: #000000; + border: none; +} +*/ + +/* + * Styles and colors for important states + */ + +#workspaces button { + background-color: transparent; + color: #ffffff; +} + +#workspaces button:hover { + background: rgba(0, 0, 0, 0.2); +} + +#workspaces button.focused { + background-color: #64727D; + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button.urgent { + background-color: #eb4d4b; +} + +#mode { + background-color: #64727D; + box-shadow: inset 0 -3px #ffffff; +} + #image { margin: 0; padding: 0 10px; } -#clock { - background-color: #64727D; -} - -#battery { - background-color: #ffffff; - color: #000000; -} - #battery.charging, #battery.plugged { - color: #ffffff; - background-color: #26A65B; + color: #26A65B; } @keyframes blink { @@ -128,8 +131,7 @@ button:hover { } #battery.critical:not(.charging) { - background-color: #f53c3c; - color: #ffffff; + color: #f53c3c; animation-name: blink; animation-duration: 0.5s; animation-timing-function: linear; @@ -137,78 +139,13 @@ button:hover { animation-direction: alternate; } -label:focus { - background-color: #000000; -} - -#cpu { - background-color: #2ecc71; - color: #000000; -} - -#memory { - background-color: #9b59b6; -} - -#disk { - background-color: #964B00; -} - -#backlight { - background-color: #90b1b1; -} - -#network { - background-color: #2980b9; -} - -#network.disconnected { - background-color: #f53c3c; -} - -#pulseaudio { - background-color: #f1c40f; - color: #000000; -} - -#pulseaudio.muted { - background-color: #90b1b1; - color: #2a5c45; -} - -#wireplumber { - background-color: #fff0f5; - color: #000000; -} - +#network.disconnected, +#pulseaudio.muted, #wireplumber.muted { - background-color: #f53c3c; -} - -#custom-media { - background-color: #66cc99; - color: #2a5c45; - min-width: 100px; -} - -#custom-media.custom-spotify { - background-color: #66cc99; -} - -#custom-media.custom-vlc { - background-color: #ffa000; -} - -#temperature { - background-color: #f0932b; -} - -#temperature.critical { - background-color: #eb4d4b; + color: @inactive_module_color; } #tray { - background-color: #2980b9; padding: 0 5px; } @@ -216,46 +153,46 @@ label:focus { -gtk-icon-effect: dim; } +@keyframes needs-attention { + to { + background-color: rgba(235, 77, 75, 0.5); + } +} + #tray > .needs-attention { -gtk-icon-effect: highlight; - background-color: #eb4d4b; + animation-name: needs-attention; + animation-duration: 1s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + background-color: transparent; } #idle_inhibitor { - background-color: #2d3436; + color: @inactive_module_color; } #idle_inhibitor.activated { - background-color: #ecf0f1; - color: #2d3436; -} - -#mpd { - background-color: #66cc99; - color: #2a5c45; -} - -#mpd.disconnected { - background-color: #f53c3c; + color: inherit; } +#mpd.disconnected, +#mpd.paused, #mpd.stopped { - background-color: #90b1b1; + color: @inactive_module_color; } -#mpd.paused { - background-color: #51a37a; +#cpu.high, +#temperature.critical { + color: #eb4d4b; } #language { - background: #00b093; - color: #740864; min-width: 16px; } #keyboard-state { - background: #97e1ad; - color: #000000; min-width: 16px; } @@ -274,3 +211,54 @@ label:focus { #scratchpad.empty { background-color: transparent; } + +/* + * Less important colors. + * Uncomment this if you want more colorful bar + */ +/* +#cpu { + color: #2ecc71; +} + +#memory { + color: #9b59b6; +} + +#disk { + color: #964B00; +} + +#backlight { + color: #90b1b1; +} + +#network { + color: #2980b9; +} + +#pulseaudio, +#wireplumber { + color: #f1c40f; +} + +#temperature { + color: #f0932b; +} + +#mpd { + color: #66cc99; +} + +#mpd.paused { + color: #51a37a; +} + +#language { + color: #00b093; +} + +#keyboard-state { + color: #97e1ad; +} +*/ From 543946554615caeb9b7a2f69035a4f5e9ed1ee16 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Mon, 12 Feb 2024 21:38:41 -0800 Subject: [PATCH 09/14] waybar: fix underline (box-shadow) and border positioning Thin down borders and underlines to 2px --- waybar/style.css | 59 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/waybar/style.css b/waybar/style.css index 10c0c27..5713a4f 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -7,12 +7,21 @@ window#waybar { background-color: rgba(43, 48, 59, 0.8); - border-bottom: 3px solid rgba(100, 114, 125, 0.5); + border-color: rgba(100, 114, 125, 0.5); + border-style: solid; color: #ffffff; transition-property: background-color; transition-duration: .5s; } +window#waybar:not(.bottom):not(.left):not(.right) { + border-bottom-width: 2px; +} + +window#waybar.bottom { + border-top-width: 2px; +} + window#waybar.hidden { opacity: 0.2; } @@ -30,7 +39,14 @@ button { /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ button:hover { background: inherit; - box-shadow: inset 0 -3px #ffffff; +} + +window#waybar:not(.bottom):not(.left):not(.right) button:hover{ + box-shadow: inset 0 -2px; +} + +window#waybar.bottom button:hover { + box-shadow: inset 0 2px; } /* @@ -65,6 +81,27 @@ button:hover { padding-right: 0; } +/* + * Uncomment to draw module underlines + */ +/* +window#waybar:not(.bottom):not(.left):not(.right) .modules-left > widget > label, +window#waybar:not(.bottom):not(.left):not(.right) .modules-center > widget > label, +window#waybar:not(.bottom):not(.left):not(.right) .modules-right > widget > label { + box-shadow: inset 0 -2px; +} + +window#waybar.bottom .modules-left > widget > label, +window#waybar.bottom .modules-center > widget > label, +window#waybar.bottom .modules-right > widget > label { + box-shadow: inset 0 2px; +} + +window#waybar #window { + box-shadow: none; +} +*/ + /* * Workspace state and focused window rules */ @@ -102,7 +139,14 @@ window#waybar.chromium { #workspaces button.focused { background-color: #64727D; - box-shadow: inset 0 -3px #ffffff; +} + +window#waybar:not(.bottom):not(.left):not(.right) #workspaces button.focused { + box-shadow: inset 0 -2px; +} + +window#waybar.bottom #workspaces button.focused { + box-shadow: inset 0 2px; } #workspaces button.urgent { @@ -111,7 +155,14 @@ window#waybar.chromium { #mode { background-color: #64727D; - box-shadow: inset 0 -3px #ffffff; +} + +window#waybar:not(.bottom):not(.left):not(.right) #mode { + box-shadow: inset 0 -2px; +} + +window#waybar.bottom #mode { + box-shadow: inset 0 2px; } #image { From f00bbf863839ad4f4af461b8675cf322eb946873 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Mon, 12 Feb 2024 22:18:08 -0800 Subject: [PATCH 10/14] waybar: fine-tune colors for dark background --- waybar/style.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/waybar/style.css b/waybar/style.css index 5713a4f..19acc08 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -171,7 +171,7 @@ window#waybar.bottom #mode { } #battery.charging, #battery.plugged { - color: #26A65B; + color: #32cd32; } @keyframes blink { @@ -273,7 +273,7 @@ window#waybar.bottom #mode { } #memory { - color: #9b59b6; + color: #ba55d3; } #disk { @@ -285,7 +285,7 @@ window#waybar.bottom #mode { } #network { - color: #2980b9; + color: #00bfff; } #pulseaudio, From ce747d7c2f37ef8ba6a717b1be78aa9d4da6f66a Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Thu, 22 Feb 2024 07:52:31 -0800 Subject: [PATCH 11/14] waybar: return `network` to default config --- waybar/config | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/waybar/config b/waybar/config index 1abd8a3..1938433 100644 --- a/waybar/config +++ b/waybar/config @@ -16,6 +16,11 @@ "modules-right": [ "idle_inhibitor", "pulseaudio", + "network", + // "cpu", + // "memory", + // "temperature", + // "backlight", "sway/language", "battery", "clock", From 6a81162a2b75cf746377dc9d9308e983d0aa609b Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Tue, 27 Feb 2024 19:39:20 -0800 Subject: [PATCH 12/14] sddm: sync theme with upstream 0.21.0 + PR#1876 Source: github.com/sddm/sddm@cc03fabf2f3025842cee30b5f05d20f56b6a2270 --- sddm/03-sway-fedora/Main.qml | 26 ++++++++++--------- .../{metadata.desktop => metadata.desktop.in} | 1 + 2 files changed, 15 insertions(+), 12 deletions(-) rename sddm/03-sway-fedora/{metadata.desktop => metadata.desktop.in} (92%) diff --git a/sddm/03-sway-fedora/Main.qml b/sddm/03-sway-fedora/Main.qml index 4fac9f3..17b1b8a 100644 --- a/sddm/03-sway-fedora/Main.qml +++ b/sddm/03-sway-fedora/Main.qml @@ -40,17 +40,16 @@ Rectangle { Connections { target: sddm - onLoginSucceeded: { + function onLoginSucceeded() { errorMessage.color = "steelblue" errorMessage.text = textConstants.loginSucceeded } - - onLoginFailed: { + function onLoginFailed() { password.text = "" errorMessage.color = "red" errorMessage.text = textConstants.loginFailed } - onInformationMessage: { + function onInformationMessage(message) { errorMessage.color = "red" errorMessage.text = message } @@ -58,11 +57,12 @@ Rectangle { Background { anchors.fill: parent - source: config.background + source: Qt.resolvedUrl(config.background) fillMode: Image.PreserveAspectCrop onStatusChanged: { - if (status == Image.Error && source != config.defaultBackground) { - source = config.defaultBackground + var defaultBackground = Qt.resolvedUrl(config.defaultBackground) + if (status == Image.Error && source != defaultBackground) { + source = defaultBackground } } } @@ -87,7 +87,7 @@ Rectangle { width: Math.max(320, mainColumn.implicitWidth + 50) height: Math.max(320, mainColumn.implicitHeight + 50) - source: "rectangle.png" + source: Qt.resolvedUrl("rectangle.png") Column { id: mainColumn @@ -125,7 +125,7 @@ Rectangle { KeyNavigation.backtab: rebootButton; KeyNavigation.tab: password - Keys.onPressed: { + Keys.onPressed: function (event) { if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) { sddm.login(name.text, password.text, sessionIndex) event.accepted = true @@ -152,7 +152,7 @@ Rectangle { KeyNavigation.backtab: name; KeyNavigation.tab: session - Keys.onPressed: { + Keys.onPressed: function (event) { if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) { sddm.login(name.text, password.text, sessionIndex) event.accepted = true @@ -186,7 +186,7 @@ Rectangle { width: parent.width; height: 30 font.pixelSize: 14 - arrowIcon: "angle-down.png" + arrowIcon: Qt.resolvedUrl("angle-down.png") model: sessionModel index: sessionModel.lastIndex @@ -201,6 +201,8 @@ Rectangle { spacing : 4 anchors.bottom: parent.bottom + visible: keyboard.enabled && keyboard.layouts.length > 0 + Text { id: lblLayout width: parent.width @@ -215,7 +217,7 @@ Rectangle { width: parent.width; height: 30 font.pixelSize: 14 - arrowIcon: "angle-down.png" + arrowIcon: Qt.resolvedUrl("angle-down.png") KeyNavigation.backtab: session; KeyNavigation.tab: loginButton } diff --git a/sddm/03-sway-fedora/metadata.desktop b/sddm/03-sway-fedora/metadata.desktop.in similarity index 92% rename from sddm/03-sway-fedora/metadata.desktop rename to sddm/03-sway-fedora/metadata.desktop.in index acd0fa4..8931da6 100644 --- a/sddm/03-sway-fedora/metadata.desktop +++ b/sddm/03-sway-fedora/metadata.desktop.in @@ -14,3 +14,4 @@ TranslationsDirectory=translations Email=abdurrahmanavci@gmail.com Theme-Id=maldives Theme-API=2.0 +QtVersion=@QT_MAJOR_VERSION@ From d197b89723eca3d717884de4cc90f76062410023 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Wed, 7 Aug 2024 22:03:24 -0700 Subject: [PATCH 13/14] sway: apply system keyboard configuration in live environment Fixes: SIG#36 --- sway/config.live.d/99-system-keyboard-config.conf | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sway/config.live.d/99-system-keyboard-config.conf diff --git a/sway/config.live.d/99-system-keyboard-config.conf b/sway/config.live.d/99-system-keyboard-config.conf new file mode 100644 index 0000000..c2c65eb --- /dev/null +++ b/sway/config.live.d/99-system-keyboard-config.conf @@ -0,0 +1,9 @@ +# Apply system-wide XKB configuration stored in systemd-localed. +# +# The configuration can be viewed with `localectl` and modified +# with `localectl set-x11-keymap`. +# +# In the live installer environment, Anaconda relies on the localed +# D-Bus API to update the keyboard configuration. + +exec /usr/libexec/sway-systemd/locale1-xkb-config From 32d27f88e288cf1577fd67112630c70e70386531 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Sun, 16 Feb 2025 22:18:07 -0800 Subject: [PATCH 14/14] Switch to JXL for Fedora 42 backgrounds. --- Makefile | 13 ++++++++----- sddm/03-sway-fedora/theme.conf | 2 -- sddm/03-sway-fedora/theme.conf.in | 2 ++ sway-config-fedora.spec.rpkg | 16 ++++++++++++++-- sway/config.in | 4 ++-- swaylock/{config => config.in} | 2 +- 6 files changed, 27 insertions(+), 12 deletions(-) delete mode 100644 sddm/03-sway-fedora/theme.conf create mode 100644 sddm/03-sway-fedora/theme.conf.in rename swaylock/{config => config.in} (84%) diff --git a/Makefile b/Makefile index 21cf3e2..ecb72d1 100644 --- a/Makefile +++ b/Makefile @@ -5,16 +5,19 @@ SYSCONFDIR ?= /etc BINDIR ?= $(PREFIX)/bin DATADIR ?= $(PREFIX)/share LIBEXECDIR ?= $(PREFIX)/libexec +BACKGROUND ?= $(DATADIR)/backgrounds/default.png .PHONY: build clean install check requires .DEFAULT: build -GENERATED := $(patsubst %.in,%,$(wildcard sway/*.in sway/*/*.in )) -VARIABLES := PREFIX SYSCONFDIR DATADIR LIBEXECDIR +TEMPLATES := sway/*.in sway/*/*.in swaylock/*.in sddm/03-sway-fedora/theme.conf.in +GENERATED := $(patsubst %.in,%,$(wildcard $(TEMPLATES))) +VARIABLES := PREFIX SYSCONFDIR DATADIR LIBEXECDIR BACKGROUND -sway/%: sway/%.in - sed "$(foreach var,$(VARIABLES),s^@$(var)@^$($(var))^i;)" $^ > $@ - sed '$(foreach var,$(VARIABLES),s^$$$(var)\b^$($(var))^i;)' $^ > $@ +%: %.in + sed -e "$(foreach var,$(VARIABLES),s^@$(var)@^$($(var))^i;)" \ + -e '$(foreach var,$(VARIABLES),s^$$$(var)\b^$($(var))^i;)' \ + $^ > $@ build: $(GENERATED) diff --git a/sddm/03-sway-fedora/theme.conf b/sddm/03-sway-fedora/theme.conf deleted file mode 100644 index 80ad085..0000000 --- a/sddm/03-sway-fedora/theme.conf +++ /dev/null @@ -1,2 +0,0 @@ -[General] -background=/usr/share/backgrounds/default.png diff --git a/sddm/03-sway-fedora/theme.conf.in b/sddm/03-sway-fedora/theme.conf.in new file mode 100644 index 0000000..757799e --- /dev/null +++ b/sddm/03-sway-fedora/theme.conf.in @@ -0,0 +1,2 @@ +[General] +background=@BACKGROUND@ diff --git a/sway-config-fedora.spec.rpkg b/sway-config-fedora.spec.rpkg index 208bbd7..35f5ce8 100644 --- a/sway-config-fedora.spec.rpkg +++ b/sway-config-fedora.spec.rpkg @@ -2,6 +2,7 @@ %bcond initialsetup %[0%{?fedora} >= 40 || 0%{?rhel} >= 10] %bcond sddm 1 %global sway_ver 1.8 +%global bg_format %[ 0%{?fedora} >= 42 ? "jxl" : "png" ] Name: {{{ git_name }}} Version: {{{ git_version }}} @@ -44,6 +45,9 @@ Requires: /usr/bin/pkill Requires: brightnessctl >= 0.5.1-11 Requires: desktop-backgrounds-compat Requires: grimshot +%if "%{bg_format}" == "jxl" +Requires: jxl-pixbuf-loader +%endif Requires: lxqt-policykit Requires: playerctl Requires: pulseaudio-utils @@ -80,6 +84,9 @@ Provides: sddm-greeter-displayserver Conflicts: sddm-greeter-displayserver Requires: desktop-backgrounds-compat +%if "%{bg_format}" == "jxl" +Requires: kf6-kimageformats +%endif Requires: sddm >= 0.20.0 Requires: sway >= %{sway_ver} @@ -94,11 +101,16 @@ to use Sway for the greeter display server. %build -%make_build +%make_build \ + PREFIX='%{_prefix}' \ + BACKGROUND='%{_datadir}/backgrounds/default.%{bg_format}' %install -%make_install PREFIX='%{_prefix}' WITH_INITIALSETUP='%[%{with initialsetup}?"yes":"no"]' WITH_SDDM='%[%{with sddm}?"yes":"no"]' +%make_install \ + PREFIX='%{_prefix}' \ + WITH_INITIALSETUP='%[%{with initialsetup}?"yes":"no"]' \ + WITH_SDDM='%[%{with sddm}?"yes":"no"]' %files diff --git a/sway/config.in b/sway/config.in index 6e57ce5..53b8844 100644 --- a/sway/config.in +++ b/sway/config.in @@ -30,8 +30,8 @@ set $menu $rofi_cmd -show combi -combi-modes drun#run -modes combi ### Output configuration # # Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) -# Requires: desktop-backgrounds-compat, swaybg -output * bg /usr/share/backgrounds/default.png fill +# Requires: desktop-backgrounds-compat, swaybg, jxl-pixbuf-loader +output * bg @BACKGROUND@ fill # # Example configuration: # diff --git a/swaylock/config b/swaylock/config.in similarity index 84% rename from swaylock/config rename to swaylock/config.in index ec2afc7..607bcf2 100644 --- a/swaylock/config +++ b/swaylock/config.in @@ -3,5 +3,5 @@ # # Image path supports environment variables and shell expansions, # e.g. image=$HOME/Pictures/default.png -image=/usr/share/backgrounds/default.png +image=@BACKGROUND@ scaling=fill