Skip to content

Commit 2e7f305

Browse files
committed
fixes
1 parent 5f06739 commit 2e7f305

File tree

5 files changed

+44
-28
lines changed

5 files changed

+44
-28
lines changed

files/system/etc/skel/.config/flameshot/flameshot.ini

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ useGrimAdapter=true
33
autoCloseIdleDaemon=true
44
startupLaunch=true
55
saveAsFileExtension=jpg
6-
uiColor=#d0bcff
7-
contrastUiColor=#381e72
8-
drawColor=#d0bcff
9-
contrastOpacity=188
106
uiLanguage=auto
117
checkForUpdates=false
128
disabledTrayIcon=true
139
saveLastRegion=true
1410
showStartupLaunchMessage=false
1511
showAbortNotification=false
16-
showDesktopNotification=false
12+
showDesktopNotification=false
13+
uiColor=#d0bcff
14+
contrastUiColor=#381e72
15+
drawColor=#d0bcff
16+
contrastOpacity=188

files/system/usr/lib/systemd/user/dms.service

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Environment=PATH=/usr/bin
1111
Environment=XDG_SESSION_TYPE=wayland
1212
Environment=XDG_CURRENT_DESKTOP=labwc
1313
Environment=QT_QPA_PLATFORM=wayland
14+
PassEnvironment=XDG_DATA_DIRS XDG_DATA_HOME XDG_CONFIG_HOME XDG_CACHE_HOME
1415
ExecStart=/usr/bin/dms run --session
1516
ExecReload=/usr/bin/pkill -USR1 -x dms
1617
Restart=always

files/system/usr/lib/systemd/user/flameshot-theme-update.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ After=graphical-session.target
44

55
[Service]
66
Type=oneshot
7-
ExecStart=/usr/libexec/dms/flameshot-theme-update.sh
7+
ExecStart=/bin/sh /usr/libexec/dms/flameshot-theme-update.sh
88

99
[Install]
1010
WantedBy=default.target

files/system/usr/libexec/dms/flameshot-theme-update.sh

100644100755
Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,50 @@ set -e
55
config_dir="${XDG_CONFIG_HOME:-$HOME/.config}"
66
colors_json="$HOME/.cache/DankMaterialShell/dms-colors.json"
77
flameshot_ini="$config_dir/flameshot/flameshot.ini"
8-
9-
[ -f "$colors_json" ] || exit 0
8+
skel_flameshot_ini="/etc/skel/.config/flameshot/flameshot.ini"
109

1110
mkdir -p "$(dirname "$flameshot_ini")"
1211

12+
# Seed the user config from /etc/skel if it doesn't exist yet.
13+
if [ ! -f "$flameshot_ini" ] && [ -f "$skel_flameshot_ini" ]; then
14+
cp "$skel_flameshot_ini" "$flameshot_ini"
15+
fi
16+
17+
# Ensure we have a config file even if the skel copy is missing.
18+
if [ ! -f "$flameshot_ini" ]; then
19+
cat > "$flameshot_ini" <<'EOF'
20+
[General]
21+
uiLanguage=auto
22+
EOF
23+
fi
24+
25+
[ -f "$colors_json" ] || exit 0
26+
1327
primary=$(jq -r '.colors.dark.primary // empty' "$colors_json")
1428
on_primary=$(jq -r '.colors.dark.on_primary // empty' "$colors_json")
15-
surface_variant=$(jq -r '.colors.dark.surface_variant // empty' "$colors_json")
1629

1730
# Fallbacks if JSON fields are missing.
1831
[ -n "$primary" ] || primary="#d0bcff"
1932
[ -n "$on_primary" ] || on_primary="#381e72"
20-
[ -n "$surface_variant" ] || surface_variant="#49454e"
2133

22-
cat > "$flameshot_ini" <<EOF
23-
[General]
24-
useGrimAdapter=true
25-
autoCloseIdleDaemon=true
26-
startupLaunch=true
27-
saveAsFileExtension=jpg
28-
# DMS-synced colors
29-
uiColor=${primary}
30-
contrastUiColor=${on_primary}
31-
drawColor=${primary}
32-
contrastOpacity=188
33-
uiLanguage=auto
34-
# Optional accent on selection/toolbar backgrounds
35-
buttonColor=${surface_variant}
36-
EOF
34+
python3 - "$flameshot_ini" "$primary" "$on_primary" <<'PY'
35+
import sys
36+
from configparser import ConfigParser
37+
38+
ini_path, primary, on_primary = sys.argv[1:]
39+
config = ConfigParser(delimiters=('='), interpolation=None)
40+
config.optionxform = str
41+
config.read(ini_path, encoding="utf-8")
42+
43+
if "General" not in config:
44+
config["General"] = {}
45+
46+
general = config["General"]
47+
general["uiColor"] = primary
48+
general["contrastUiColor"] = on_primary
49+
general["drawColor"] = primary
50+
general["contrastOpacity"] = "188"
51+
52+
with open(ini_path, "w", encoding="utf-8") as f:
53+
config.write(f, space_around_delimiters=False)
54+
PY

recipes/recipe.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ modules:
7070
- ghostty
7171
- gnome-online-accounts-gtk
7272
- grim
73-
- i2c-tools
74-
- jq
7573
- khal
7674
- labwc
7775
- labwc-menu-generator
@@ -81,7 +79,6 @@ modules:
8179
- uv
8280
- waydroid
8381
- wayland-utils
84-
- xdg-desktop-portal
8582
- xdg-desktop-portal-wlr
8683
remove:
8784
packages:

0 commit comments

Comments
 (0)