Templates: add sway (implements #1633)

This commit is contained in:
Lysec
2026-02-01 12:20:03 +01:00
parent 7fef627415
commit a13374ffc6
4 changed files with 80 additions and 22 deletions
+19
View File
@@ -0,0 +1,19 @@
## Colours - Based on Material Design 3 Palette
set $primary #{{colors.primary.default.hex_stripped}}
set $on_primary #{{colors.on_primary.default.hex_stripped}}
set $secondary #{{colors.secondary.default.hex_stripped}}
set $tertiary #{{colors.tertiary.default.hex_stripped}}
set $error #{{colors.error.default.hex_stripped}}
set $surface #{{colors.surface.default.hex_stripped}}
set $on_surface #{{colors.on_surface.default.hex_stripped}}
set $on_surface_variant #{{colors.on_surface_variant.default.hex_stripped}}
set $outline #{{colors.outline.default.hex_stripped}}
## Window Colours
# class border backgr. text indicator child_border
client.focused $primary $surface $on_surface $secondary $primary
client.focused_inactive $outline $surface $on_surface_variant $outline $outline
client.unfocused $outline $surface $on_surface_variant $outline $outline
client.urgent $error $surface $on_surface $error $error
client.placeholder $surface $surface $on_surface_variant $surface $surface
client.background $surface
+21 -21
View File
@@ -143,6 +143,24 @@
"subTab": 0,
"subTabLabel": "common.appearance"
},
{
"labelKey": "panels.bar.appearance-type-label",
"descriptionKey": "panels.bar.appearance-type-description",
"widget": "NComboBox",
"tab": 4,
"tabLabel": "panels.bar.title",
"subTab": 0,
"subTabLabel": "common.appearance"
},
{
"labelKey": "panels.bar.appearance-display-mode-label",
"descriptionKey": "panels.bar.appearance-display-mode-description",
"widget": "NComboBox",
"tab": 4,
"tabLabel": "panels.bar.title",
"subTab": 0,
"subTabLabel": "common.appearance"
},
{
"labelKey": "panels.bar.appearance-use-separate-opacity-label",
"descriptionKey": "panels.bar.appearance-use-separate-opacity-description",
@@ -189,9 +207,9 @@
"subTabLabel": "common.appearance"
},
{
"labelKey": "panels.bar.appearance-type-label",
"descriptionKey": "panels.bar.appearance-type-description",
"widget": "NComboBox",
"labelKey": "panels.bar.appearance-hide-on-overview-label",
"descriptionKey": "panels.bar.appearance-hide-on-overview-description",
"widget": "NToggle",
"tab": 4,
"tabLabel": "panels.bar.title",
"subTab": 0,
@@ -260,15 +278,6 @@
"subTab": 0,
"subTabLabel": "common.appearance"
},
{
"labelKey": "panels.bar.appearance-display-mode-label",
"descriptionKey": "panels.bar.appearance-display-mode-description",
"widget": "NComboBox",
"tab": 4,
"tabLabel": "panels.bar.title",
"subTab": 0,
"subTabLabel": "common.appearance"
},
{
"labelKey": "panels.bar.appearance-auto-hide-delay-label",
"descriptionKey": "panels.bar.appearance-auto-hide-delay-description",
@@ -287,15 +296,6 @@
"subTab": 0,
"subTabLabel": "common.appearance"
},
{
"labelKey": "panels.bar.appearance-hide-on-overview-label",
"descriptionKey": "panels.bar.appearance-hide-on-overview-description",
"widget": "NToggle",
"tab": 4,
"tabLabel": "panels.bar.title",
"subTab": 0,
"subTabLabel": "common.appearance"
},
{
"labelKey": "panels.bar.monitor-override-settings",
"descriptionKey": "panels.bar.monitor-override-settings-description",
+28 -1
View File
@@ -4,7 +4,7 @@
if [ "$#" -lt 1 ]; then
# Print usage information to standard error.
echo "Error: No application specified." >&2
echo "Usage: $0 {kitty|ghostty|foot|alacritty|wezterm|fuzzel|walker|pywalfox|cava|yazi|niri|hyprland|mango} [dark|light]" >&2
echo "Usage: $0 {kitty|ghostty|foot|alacritty|wezterm|fuzzel|walker|pywalfox|cava|yazi|niri|hyprland|sway|mango|btop|zathura} [dark|light]" >&2
exit 1
fi
@@ -342,6 +342,33 @@ hyprland)
hyprctl reload
;;
sway)
echo "🎨 Applying 'noctalia' theme to Sway..."
CONFIG_DIR="$HOME/.config/sway"
CONFIG_FILE="$CONFIG_DIR/config"
INCLUDE_LINE='include ~/.config/sway/noctalia'
# Check if the config file exists.
if [ ! -f "$CONFIG_FILE" ]; then
echo "Config file not found, creating $CONFIG_FILE..."
mkdir -p "$(dirname "$CONFIG_FILE")"
echo -e "\n$INCLUDE_LINE\n" >"$CONFIG_FILE"
echo "Created new config file with noctalia theme."
else
# Check if noctalia include already exists (flexible matching)
if grep -qE 'include\s+.*noctalia' "$CONFIG_FILE"; then
echo "Theme already included, skipping modification."
else
# Add the include line to the end of the file
echo -e "\n$INCLUDE_LINE\n" >>"$CONFIG_FILE"
echo "✅ Added noctalia theme include to config."
fi
fi
# Reload sway
swaymsg reload
;;
mango)
CONFIG_DIR="$HOME/.config/mango"
MAIN_CONFIG="$CONFIG_DIR/config.conf"
+12
View File
@@ -308,6 +308,18 @@ Singleton {
],
"postProcess": () => `${templateApplyScript} niri`
},
{
"id": "sway",
"name": "Sway",
"category": "compositor",
"input": "sway",
"outputs": [
{
"path": "~/.config/sway/noctalia"
}
],
"postProcess": () => `${templateApplyScript} sway`
},
{
"id": "hyprland",
"name": "Hyprland",