Skip to content

Commit d81682a

Browse files
committed
fix: darken linux desktop chrome
1 parent 52629ab commit d81682a

7 files changed

Lines changed: 170 additions & 27 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Fixed
66

7+
- Fixed Linux desktop theme setup so WebVNC sessions also apply dark window-manager chrome and panel styling instead of only darkening GTK apps and browser content.
78
- Fixed desktop browser launches so Linux WebVNC browser sessions inherit the dark desktop theme, advertise dark color-scheme preference to web apps, and repair older managed browser wrappers before launch.
89

910
## 0.18.0 - 2026-05-23

internal/cli/bootstrap.go

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -642,53 +642,83 @@ func cloudInitOptionalWriteFiles(cfg Config) string {
642642
home_dir="/home/$user"
643643
fi
644644
config_dir="$home_dir/.config"
645+
gtk_theme=Adwaita-dark
646+
for candidate in Greybird-dark Adwaita-dark Greybird; do
647+
if [ -d "/usr/share/themes/$candidate/gtk-3.0" ]; then
648+
gtk_theme="$candidate"
649+
break
650+
fi
651+
done
652+
xfwm_theme=Default
653+
for candidate in Greybird-dark Daloa Greybird Default; do
654+
if [ -d "/usr/share/themes/$candidate/xfwm4" ]; then
655+
xfwm_theme="$candidate"
656+
break
657+
fi
658+
done
645659
if [ "$(id -u)" -eq 0 ]; then
646660
install -d -m 0700 -o "$user" "$config_dir/xfce4/xfconf/xfce-perchannel-xml" "$config_dir/xfce4/terminal" "$config_dir/gtk-3.0"
647661
else
648662
mkdir -p "$config_dir/xfce4/xfconf/xfce-perchannel-xml" "$config_dir/xfce4/terminal" "$config_dir/gtk-3.0"
649663
chmod 0700 "$config_dir" "$config_dir/xfce4" "$config_dir/xfce4/xfconf" "$config_dir/xfce4/xfconf/xfce-perchannel-xml" "$config_dir/xfce4/terminal" "$config_dir/gtk-3.0"
650664
fi
651-
cat > "$config_dir/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml" <<'XML'
665+
cat > "$config_dir/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml" <<XML
652666
<?xml version="1.0" encoding="UTF-8"?>
653667
<channel name="xsettings" version="1.0">
654668
<property name="Net" type="empty">
655-
<property name="ThemeName" type="string" value="Adwaita-dark"/>
669+
<property name="ThemeName" type="string" value="$gtk_theme"/>
656670
<property name="IconThemeName" type="string" value="Adwaita"/>
657671
</property>
658672
<property name="Gtk" type="empty">
659673
<property name="ApplicationPreferDarkTheme" type="bool" value="true"/>
660674
</property>
661675
</channel>
662676
XML
677+
if [ ! -s "$config_dir/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml" ]; then
678+
cat > "$config_dir/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml" <<XML
679+
<?xml version="1.0" encoding="UTF-8"?>
680+
<channel name="xfwm4" version="1.0">
681+
<property name="general" type="empty">
682+
<property name="theme" type="string" value="$xfwm_theme"/>
683+
</property>
684+
</channel>
685+
XML
686+
fi
663687
cat > "$config_dir/xfce4/terminal/terminalrc" <<'EOF'
664688
[Configuration]
665689
ColorForeground=#e5e7eb
666690
ColorBackground=#111827
667691
ColorCursor=#f3f4f6
668692
MiscBell=FALSE
669693
EOF
670-
cat > "$config_dir/gtk-3.0/settings.ini" <<'EOF'
694+
cat > "$config_dir/gtk-3.0/settings.ini" <<EOF
671695
[Settings]
672-
gtk-theme-name=Adwaita-dark
696+
gtk-theme-name=$gtk_theme
673697
gtk-icon-theme-name=Adwaita
674698
gtk-application-prefer-dark-theme=1
675699
EOF
676-
cat > "$home_dir/.gtkrc-2.0" <<'EOF'
677-
gtk-theme-name="Adwaita-dark"
700+
cat > "$home_dir/.gtkrc-2.0" <<EOF
701+
gtk-theme-name="$gtk_theme"
678702
gtk-icon-theme-name="Adwaita"
679703
gtk-application-prefer-dark-theme=1
680704
EOF
681705
if [ "$(id -u)" -eq 0 ]; then
682706
chown -R "$user" "$config_dir" "$home_dir/.gtkrc-2.0"
683707
fi
684708
if [ -n "${DISPLAY:-}" ] && command -v xfconf-query >/dev/null 2>&1; then
685-
xfconf-query -c xsettings -p /Net/ThemeName -n -t string -s Adwaita-dark >/dev/null 2>&1 || true
709+
xfconf-query -c xsettings -p /Net/ThemeName -n -t string -s "$gtk_theme" >/dev/null 2>&1 || true
686710
xfconf-query -c xsettings -p /Net/IconThemeName -n -t string -s Adwaita >/dev/null 2>&1 || true
687711
xfconf-query -c xsettings -p /Gtk/ApplicationPreferDarkTheme -n -t bool -s true >/dev/null 2>&1 || true
712+
xfconf-query -c xfwm4 -p /general/theme -n -t string -s "$xfwm_theme" >/dev/null 2>&1 || true
713+
for panel in $(xfconf-query -c xfce4-panel -l 2>/dev/null | sed -n 's#^/panels/panel-\([0-9][0-9]*\)$#\1#p; s#^/panels/panel-\([0-9][0-9]*\)/.*#\1#p' | sort -u); do
714+
xfconf-query -c xfce4-panel -p "/panels/panel-$panel/background-style" -n -t int -s 1 >/dev/null 2>&1 || true
715+
xfconf-query -c xfce4-panel -p "/panels/panel-$panel/background-rgba" -n -t double -t double -t double -t double -s 0.06 -s 0.07 -s 0.09 -s 1.0 >/dev/null 2>&1 || true
716+
done
717+
xfce4-panel -r >/dev/null 2>&1 || true
688718
fi
689719
if command -v gsettings >/dev/null 2>&1; then
690720
gsettings set org.gnome.desktop.interface color-scheme prefer-dark >/dev/null 2>&1 || true
691-
gsettings set org.gnome.desktop.interface gtk-theme Adwaita-dark >/dev/null 2>&1 || true
721+
gsettings set org.gnome.desktop.interface gtk-theme "$gtk_theme" >/dev/null 2>&1 || true
692722
fi
693723
- path: /etc/systemd/system/crabbox-desktop.service
694724
permissions: '0644'

internal/cli/bootstrap_test.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,22 @@ func TestCloudInitDesktopProfile(t *testing.T) {
9595
"ExecStart=/usr/bin/startxfce4",
9696
"systemctl is-active --quiet crabbox-desktop.service",
9797
"systemctl is-active --quiet crabbox-desktop-session.service",
98-
"ThemeName\" type=\"string\" value=\"Adwaita-dark",
98+
"gtk_theme=Adwaita-dark",
99+
"for candidate in Greybird-dark Adwaita-dark Greybird",
100+
"xfwm_theme=Default",
101+
"for candidate in Greybird-dark Daloa Greybird Default",
102+
"ThemeName\" type=\"string\" value=\"$gtk_theme",
103+
"$config_dir/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml",
104+
`if [ ! -s "$config_dir/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml" ]; then`,
105+
"theme\" type=\"string\" value=\"$xfwm_theme",
99106
"gtk-application-prefer-dark-theme=1",
100107
"mkdir -p \"$config_dir/xfce4/xfconf/xfce-perchannel-xml\"",
101108
"xfconf-query -c xsettings -p /Gtk/ApplicationPreferDarkTheme",
109+
"xfconf-query -c xfwm4 -p /general/theme",
110+
"xfconf-query -c xfce4-panel -l",
111+
`s#^/panels/panel-\([0-9][0-9]*\)/.*#\1#p`,
112+
"background-rgba",
113+
"xfce4-panel -r",
102114
"gsettings set org.gnome.desktop.interface color-scheme prefer-dark",
103115
"CRABBOX_DESKTOP_USER=crabbox /usr/local/bin/crabbox-configure-desktop-theme",
104116
"CRABBOX_DESKTOP_USER=\"$(id -un)\" /usr/local/bin/crabbox-configure-desktop-theme",

internal/providers/localcontainer/backend.go

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,34 +1069,58 @@ if [ "${CRABBOX_DESKTOP:-0}" = "1" ]; then
10691069
chown "$user" /var/lib/crabbox/vnc.password /var/lib/crabbox/vnc.pass
10701070
chmod 0600 /var/lib/crabbox/vnc.password /var/lib/crabbox/vnc.pass
10711071
config_dir="$home_dir/.config"
1072+
gtk_theme=Adwaita-dark
1073+
for candidate in Greybird-dark Adwaita-dark Greybird; do
1074+
if [ -d "/usr/share/themes/$candidate/gtk-3.0" ]; then
1075+
gtk_theme="$candidate"
1076+
break
1077+
fi
1078+
done
1079+
xfwm_theme=Default
1080+
for candidate in Greybird-dark Daloa Greybird Default; do
1081+
if [ -d "/usr/share/themes/$candidate/xfwm4" ]; then
1082+
xfwm_theme="$candidate"
1083+
break
1084+
fi
1085+
done
10721086
install -d -m 0700 -o "$user" "$config_dir/xfce4/xfconf/xfce-perchannel-xml" "$config_dir/xfce4/terminal" "$config_dir/gtk-3.0"
1073-
cat > "$config_dir/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml" <<'XML'
1087+
cat > "$config_dir/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml" <<XML
10741088
<?xml version="1.0" encoding="UTF-8"?>
10751089
<channel name="xsettings" version="1.0">
10761090
<property name="Net" type="empty">
1077-
<property name="ThemeName" type="string" value="Adwaita-dark"/>
1091+
<property name="ThemeName" type="string" value="$gtk_theme"/>
10781092
<property name="IconThemeName" type="string" value="Adwaita"/>
10791093
</property>
10801094
<property name="Gtk" type="empty">
10811095
<property name="ApplicationPreferDarkTheme" type="bool" value="true"/>
10821096
</property>
10831097
</channel>
10841098
XML
1099+
if [ ! -s "$config_dir/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml" ]; then
1100+
cat > "$config_dir/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml" <<XML
1101+
<?xml version="1.0" encoding="UTF-8"?>
1102+
<channel name="xfwm4" version="1.0">
1103+
<property name="general" type="empty">
1104+
<property name="theme" type="string" value="$xfwm_theme"/>
1105+
</property>
1106+
</channel>
1107+
XML
1108+
fi
10851109
cat > "$config_dir/xfce4/terminal/terminalrc" <<'EOF'
10861110
[Configuration]
10871111
ColorForeground=#e5e7eb
10881112
ColorBackground=#111827
10891113
ColorCursor=#f3f4f6
10901114
MiscBell=FALSE
10911115
EOF
1092-
cat > "$config_dir/gtk-3.0/settings.ini" <<'EOF'
1116+
cat > "$config_dir/gtk-3.0/settings.ini" <<EOF
10931117
[Settings]
1094-
gtk-theme-name=Adwaita-dark
1118+
gtk-theme-name=$gtk_theme
10951119
gtk-icon-theme-name=Adwaita
10961120
gtk-application-prefer-dark-theme=1
10971121
EOF
1098-
cat > "$home_dir/.gtkrc-2.0" <<'EOF'
1099-
gtk-theme-name="Adwaita-dark"
1122+
cat > "$home_dir/.gtkrc-2.0" <<EOF
1123+
gtk-theme-name="$gtk_theme"
11001124
gtk-icon-theme-name="Adwaita"
11011125
gtk-application-prefer-dark-theme=1
11021126
EOF
@@ -1106,6 +1130,20 @@ EOF
11061130
set -eu
11071131
user="${CRABBOX_SSH_USER:-crabbox}"
11081132
runtime="/tmp/crabbox-runtime-$user"
1133+
gtk_theme=Adwaita-dark
1134+
for candidate in Greybird-dark Adwaita-dark Greybird; do
1135+
if [ -d "/usr/share/themes/$candidate/gtk-3.0" ]; then
1136+
gtk_theme="$candidate"
1137+
break
1138+
fi
1139+
done
1140+
xfwm_theme=Default
1141+
for candidate in Greybird-dark Daloa Greybird Default; do
1142+
if [ -d "/usr/share/themes/$candidate/xfwm4" ]; then
1143+
xfwm_theme="$candidate"
1144+
break
1145+
fi
1146+
done
11091147
install -d -m 0700 -o "$user" "$runtime"
11101148
if ! pgrep -u "$user" -f 'Xvfb :99' >/dev/null 2>&1; then
11111149
su "$user" -s /bin/sh -c "XDG_RUNTIME_DIR='$runtime' Xvfb :99 -screen 0 1920x1080x24 -nolisten tcp -ac >/tmp/crabbox-xvfb.log 2>&1 &"
@@ -1116,13 +1154,19 @@ if ! pgrep -u "$user" -f 'xfce4-session|startxfce4' >/dev/null 2>&1; then
11161154
fi
11171155
sleep 2
11181156
if command -v xfconf-query >/dev/null 2>&1; then
1119-
su "$user" -s /bin/sh -c "DISPLAY=:99 XDG_RUNTIME_DIR='$runtime' xfconf-query -c xsettings -p /Net/ThemeName -n -t string -s Adwaita-dark >/dev/null 2>&1 || true"
1157+
su "$user" -s /bin/sh -c "DISPLAY=:99 XDG_RUNTIME_DIR='$runtime' xfconf-query -c xsettings -p /Net/ThemeName -n -t string -s '$gtk_theme' >/dev/null 2>&1 || true"
11201158
su "$user" -s /bin/sh -c "DISPLAY=:99 XDG_RUNTIME_DIR='$runtime' xfconf-query -c xsettings -p /Net/IconThemeName -n -t string -s Adwaita >/dev/null 2>&1 || true"
11211159
su "$user" -s /bin/sh -c "DISPLAY=:99 XDG_RUNTIME_DIR='$runtime' xfconf-query -c xsettings -p /Gtk/ApplicationPreferDarkTheme -n -t bool -s true >/dev/null 2>&1 || true"
1160+
su "$user" -s /bin/sh -c "DISPLAY=:99 XDG_RUNTIME_DIR='$runtime' xfconf-query -c xfwm4 -p /general/theme -n -t string -s '$xfwm_theme' >/dev/null 2>&1 || true"
1161+
for panel in $(su "$user" -s /bin/sh -c "DISPLAY=:99 XDG_RUNTIME_DIR='$runtime' xfconf-query -c xfce4-panel -l 2>/dev/null" | sed -n 's#^/panels/panel-\([0-9][0-9]*\)$#\1#p; s#^/panels/panel-\([0-9][0-9]*\)/.*#\1#p' | sort -u); do
1162+
su "$user" -s /bin/sh -c "DISPLAY=:99 XDG_RUNTIME_DIR='$runtime' xfconf-query -c xfce4-panel -p /panels/panel-$panel/background-style -n -t int -s 1 >/dev/null 2>&1 || true"
1163+
su "$user" -s /bin/sh -c "DISPLAY=:99 XDG_RUNTIME_DIR='$runtime' xfconf-query -c xfce4-panel -p /panels/panel-$panel/background-rgba -n -t double -t double -t double -t double -s 0.06 -s 0.07 -s 0.09 -s 1.0 >/dev/null 2>&1 || true"
1164+
done
1165+
su "$user" -s /bin/sh -c "DISPLAY=:99 XDG_RUNTIME_DIR='$runtime' xfce4-panel -r >/dev/null 2>&1 || true"
11221166
fi
11231167
if command -v gsettings >/dev/null 2>&1; then
11241168
su "$user" -s /bin/sh -c "DISPLAY=:99 XDG_RUNTIME_DIR='$runtime' gsettings set org.gnome.desktop.interface color-scheme prefer-dark >/dev/null 2>&1 || true"
1125-
su "$user" -s /bin/sh -c "DISPLAY=:99 XDG_RUNTIME_DIR='$runtime' gsettings set org.gnome.desktop.interface gtk-theme Adwaita-dark >/dev/null 2>&1 || true"
1169+
su "$user" -s /bin/sh -c "DISPLAY=:99 XDG_RUNTIME_DIR='$runtime' gsettings set org.gnome.desktop.interface gtk-theme '$gtk_theme' >/dev/null 2>&1 || true"
11261170
fi
11271171
if command -v xfce4-terminal >/dev/null 2>&1 && ! pgrep -u "$user" -f 'xfce4-terminal.*Crabbox Desktop' >/dev/null 2>&1; then
11281172
su "$user" -s /bin/sh -c "DISPLAY=:99 XDG_RUNTIME_DIR='$runtime' xfce4-terminal --title='Crabbox Desktop' --geometry=110x32+48+48 >/tmp/crabbox-terminal.log 2>&1 &" || true

internal/providers/localcontainer/backend_test.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,21 @@ func TestBootstrapScriptUsesAccountHomeDirectory(t *testing.T) {
341341
`chown -R "$user" "$home_dir/.ssh"`,
342342
`chown -R "$user" "$home_dir/.ssh" "$work_root"`,
343343
`"$config_dir/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml"`,
344-
`ThemeName" type="string" value="Adwaita-dark"`,
344+
`gtk_theme=Adwaita-dark`,
345+
`for candidate in Greybird-dark Adwaita-dark Greybird`,
346+
`xfwm_theme=Default`,
347+
`for candidate in Greybird-dark Daloa Greybird Default`,
348+
`ThemeName" type="string" value="$gtk_theme"`,
349+
`"$config_dir/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml"`,
350+
`if [ ! -s "$config_dir/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml" ]; then`,
351+
`theme" type="string" value="$xfwm_theme"`,
345352
`gtk-application-prefer-dark-theme=1`,
346353
`xfconf-query -c xsettings -p /Gtk/ApplicationPreferDarkTheme`,
354+
`xfconf-query -c xfwm4 -p /general/theme`,
355+
`xfconf-query -c xfce4-panel -l`,
356+
`s#^/panels/panel-\([0-9][0-9]*\)/.*#\1#p`,
357+
`background-rgba`,
358+
`xfce4-panel -r`,
347359
`gsettings set org.gnome.desktop.interface color-scheme prefer-dark`,
348360
} {
349361
if !strings.Contains(bootstrapScript, want) {

worker/src/bootstrap.ts

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -630,53 +630,83 @@ function optionalWriteFiles(config: LeaseConfig): string {
630630
home_dir="/home/$user"
631631
fi
632632
config_dir="$home_dir/.config"
633+
gtk_theme=Adwaita-dark
634+
for candidate in Greybird-dark Adwaita-dark Greybird; do
635+
if [ -d "/usr/share/themes/$candidate/gtk-3.0" ]; then
636+
gtk_theme="$candidate"
637+
break
638+
fi
639+
done
640+
xfwm_theme=Default
641+
for candidate in Greybird-dark Daloa Greybird Default; do
642+
if [ -d "/usr/share/themes/$candidate/xfwm4" ]; then
643+
xfwm_theme="$candidate"
644+
break
645+
fi
646+
done
633647
if [ "$(id -u)" -eq 0 ]; then
634648
install -d -m 0700 -o "$user" "$config_dir/xfce4/xfconf/xfce-perchannel-xml" "$config_dir/xfce4/terminal" "$config_dir/gtk-3.0"
635649
else
636650
mkdir -p "$config_dir/xfce4/xfconf/xfce-perchannel-xml" "$config_dir/xfce4/terminal" "$config_dir/gtk-3.0"
637651
chmod 0700 "$config_dir" "$config_dir/xfce4" "$config_dir/xfce4/xfconf" "$config_dir/xfce4/xfconf/xfce-perchannel-xml" "$config_dir/xfce4/terminal" "$config_dir/gtk-3.0"
638652
fi
639-
cat > "$config_dir/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml" <<'XML'
653+
cat > "$config_dir/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml" <<XML
640654
<?xml version="1.0" encoding="UTF-8"?>
641655
<channel name="xsettings" version="1.0">
642656
<property name="Net" type="empty">
643-
<property name="ThemeName" type="string" value="Adwaita-dark"/>
657+
<property name="ThemeName" type="string" value="$gtk_theme"/>
644658
<property name="IconThemeName" type="string" value="Adwaita"/>
645659
</property>
646660
<property name="Gtk" type="empty">
647661
<property name="ApplicationPreferDarkTheme" type="bool" value="true"/>
648662
</property>
649663
</channel>
650664
XML
665+
if [ ! -s "$config_dir/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml" ]; then
666+
cat > "$config_dir/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml" <<XML
667+
<?xml version="1.0" encoding="UTF-8"?>
668+
<channel name="xfwm4" version="1.0">
669+
<property name="general" type="empty">
670+
<property name="theme" type="string" value="$xfwm_theme"/>
671+
</property>
672+
</channel>
673+
XML
674+
fi
651675
cat > "$config_dir/xfce4/terminal/terminalrc" <<'EOF'
652676
[Configuration]
653677
ColorForeground=#e5e7eb
654678
ColorBackground=#111827
655679
ColorCursor=#f3f4f6
656680
MiscBell=FALSE
657681
EOF
658-
cat > "$config_dir/gtk-3.0/settings.ini" <<'EOF'
682+
cat > "$config_dir/gtk-3.0/settings.ini" <<EOF
659683
[Settings]
660-
gtk-theme-name=Adwaita-dark
684+
gtk-theme-name=$gtk_theme
661685
gtk-icon-theme-name=Adwaita
662686
gtk-application-prefer-dark-theme=1
663687
EOF
664-
cat > "$home_dir/.gtkrc-2.0" <<'EOF'
665-
gtk-theme-name="Adwaita-dark"
688+
cat > "$home_dir/.gtkrc-2.0" <<EOF
689+
gtk-theme-name="$gtk_theme"
666690
gtk-icon-theme-name="Adwaita"
667691
gtk-application-prefer-dark-theme=1
668692
EOF
669693
if [ "$(id -u)" -eq 0 ]; then
670694
chown -R "$user" "$config_dir" "$home_dir/.gtkrc-2.0"
671695
fi
672696
if [ -n "\${DISPLAY:-}" ] && command -v xfconf-query >/dev/null 2>&1; then
673-
xfconf-query -c xsettings -p /Net/ThemeName -n -t string -s Adwaita-dark >/dev/null 2>&1 || true
697+
xfconf-query -c xsettings -p /Net/ThemeName -n -t string -s "$gtk_theme" >/dev/null 2>&1 || true
674698
xfconf-query -c xsettings -p /Net/IconThemeName -n -t string -s Adwaita >/dev/null 2>&1 || true
675699
xfconf-query -c xsettings -p /Gtk/ApplicationPreferDarkTheme -n -t bool -s true >/dev/null 2>&1 || true
700+
xfconf-query -c xfwm4 -p /general/theme -n -t string -s "$xfwm_theme" >/dev/null 2>&1 || true
701+
for panel in $(xfconf-query -c xfce4-panel -l 2>/dev/null | sed -n 's#^/panels/panel-\\([0-9][0-9]*\\)$#\\1#p; s#^/panels/panel-\\([0-9][0-9]*\\)/.*#\\1#p' | sort -u); do
702+
xfconf-query -c xfce4-panel -p "/panels/panel-$panel/background-style" -n -t int -s 1 >/dev/null 2>&1 || true
703+
xfconf-query -c xfce4-panel -p "/panels/panel-$panel/background-rgba" -n -t double -t double -t double -t double -s 0.06 -s 0.07 -s 0.09 -s 1.0 >/dev/null 2>&1 || true
704+
done
705+
xfce4-panel -r >/dev/null 2>&1 || true
676706
fi
677707
if command -v gsettings >/dev/null 2>&1; then
678708
gsettings set org.gnome.desktop.interface color-scheme prefer-dark >/dev/null 2>&1 || true
679-
gsettings set org.gnome.desktop.interface gtk-theme Adwaita-dark >/dev/null 2>&1 || true
709+
gsettings set org.gnome.desktop.interface gtk-theme "$gtk_theme" >/dev/null 2>&1 || true
680710
fi
681711
- path: /etc/systemd/system/crabbox-desktop.service
682712
permissions: '0644'

worker/test/bootstrap.test.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,24 @@ describe("cloud-init bootstrap", () => {
9494
expect(got).toContain("ExecStart=/usr/bin/startxfce4");
9595
expect(got).toContain("systemctl is-active --quiet crabbox-desktop.service");
9696
expect(got).toContain("systemctl is-active --quiet crabbox-desktop-session.service");
97-
expect(got).toContain('ThemeName" type="string" value="Adwaita-dark');
97+
expect(got).toContain("gtk_theme=Adwaita-dark");
98+
expect(got).toContain("for candidate in Greybird-dark Adwaita-dark Greybird");
99+
expect(got).toContain("xfwm_theme=Default");
100+
expect(got).toContain("for candidate in Greybird-dark Daloa Greybird Default");
101+
expect(got).toContain('ThemeName" type="string" value="$gtk_theme');
102+
expect(got).toContain("$config_dir/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml");
103+
expect(got).toContain(
104+
'if [ ! -s "$config_dir/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml" ]; then',
105+
);
106+
expect(got).toContain('theme" type="string" value="$xfwm_theme');
98107
expect(got).toContain("gtk-application-prefer-dark-theme=1");
99108
expect(got).toContain('mkdir -p "$config_dir/xfce4/xfconf/xfce-perchannel-xml"');
100109
expect(got).toContain("xfconf-query -c xsettings -p /Gtk/ApplicationPreferDarkTheme");
110+
expect(got).toContain("xfconf-query -c xfwm4 -p /general/theme");
111+
expect(got).toContain("xfconf-query -c xfce4-panel -l");
112+
expect(got).toContain(String.raw`s#^/panels/panel-\([0-9][0-9]*\)/.*#\1#p`);
113+
expect(got).toContain("background-rgba");
114+
expect(got).toContain("xfce4-panel -r");
101115
expect(got).toContain("gsettings set org.gnome.desktop.interface color-scheme prefer-dark");
102116
expect(got).toContain(
103117
"CRABBOX_DESKTOP_USER=crabbox /usr/local/bin/crabbox-configure-desktop-theme",

0 commit comments

Comments
 (0)