Compare commits
2
Commits
58749dcbdc
...
123760d643
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
123760d643 | ||
|
|
6347fdbc2a |
No files matched your search
@@ -188,7 +188,16 @@ include ~/.cache/wal/colors-kitty.conf
|
|||||||
|
|
||||||
_Next time you open Kitty, it will perfectly match your wallpaper._
|
_Next time you open Kitty, it will perfectly match your wallpaper._
|
||||||
|
|
||||||
### Example 2: Dunst (Notification Daemon)
|
### Example 2: Ghostty
|
||||||
|
|
||||||
|
Ghostty allows to link custom theme files. copy the `templates/colors-ghostty-custom` file to `~/.config/wal/templates`.
|
||||||
|
Then, in your Ghostty config file `~/.config/ghostty/config.ghostty` add this line:
|
||||||
|
```conf
|
||||||
|
config-file = ?~/.cache/wal/colors-ghostty-custom
|
||||||
|
```
|
||||||
|
Ghostty will hot reload the theme and also save it for the next time you open it.
|
||||||
|
|
||||||
|
### Example 3: Dunst (Notification Daemon)
|
||||||
|
|
||||||
Pywal doesn't generate a theme for every application, hence you have to define some templates yourself in `~/.config/wal/templates`.
|
Pywal doesn't generate a theme for every application, hence you have to define some templates yourself in `~/.config/wal/templates`.
|
||||||
In this case we will create a template for Dunst:
|
In this case we will create a template for Dunst:
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# Pywal 16-color template for Ghostty
|
||||||
|
palette = 0={color0}
|
||||||
|
palette = 1={color1}
|
||||||
|
palette = 2={color2}
|
||||||
|
palette = 3={color3}
|
||||||
|
palette = 4={color4}
|
||||||
|
palette = 5={color5}
|
||||||
|
palette = 6={color6}
|
||||||
|
palette = 7={color7}
|
||||||
|
palette = 8={color8}
|
||||||
|
palette = 9={color9}
|
||||||
|
palette = 10={color10}
|
||||||
|
palette = 11={color11}
|
||||||
|
palette = 12={color12}
|
||||||
|
palette = 13={color13}
|
||||||
|
palette = 14={color14}
|
||||||
|
palette = 15={color15}
|
||||||
|
|
||||||
|
background = {background}
|
||||||
|
foreground = {foreground}
|
||||||
|
cursor-color = {cursor}
|
||||||
|
selection-background = {color4}
|
||||||
|
selection-foreground = {background}
|
||||||
|
|
||||||
|
background-opacity = 0.85
|
||||||
@@ -207,13 +207,25 @@ async function applyTheme(wallpaperPath: string) {
|
|||||||
// 4. Keep the greetd greeter in sync with the current palette/wallpaper
|
// 4. Keep the greetd greeter in sync with the current palette/wallpaper
|
||||||
await exportGreeterTheme()
|
await exportGreeterTheme()
|
||||||
|
|
||||||
// 5. Run update script
|
// 5. Refresh the rest of the system (dunst, hyprland, ...). Deliberately not
|
||||||
try {
|
// awaited, so nothing the script does can stall the theme queue.
|
||||||
const agsDir = `${HOME}/.config/ags`
|
runUpdateScript()
|
||||||
await execAsync([`${agsDir}/update_script.sh`])
|
|
||||||
} catch (error) {
|
|
||||||
console.error("Failed to run update script:", error)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run update_script.sh detached from our stdio.
|
||||||
|
*
|
||||||
|
* execAsync resolves only once stdout/stderr reach EOF. A daemon started with
|
||||||
|
* `&` in the script would inherit those pipes and keep the promise pending
|
||||||
|
* forever, which used to block every queued theme switch after the first one.
|
||||||
|
*/
|
||||||
|
function runUpdateScript() {
|
||||||
|
const script = `${HOME}/.config/ags/update_script.sh`
|
||||||
|
return execAsync([
|
||||||
|
"bash",
|
||||||
|
"-c",
|
||||||
|
`"${script}" >/dev/null 2>&1 </dev/null`,
|
||||||
|
]).catch((error) => console.error("Failed to run update script:", error))
|
||||||
}
|
}
|
||||||
|
|
||||||
let themeQueue: Promise<void> = Promise.resolve()
|
let themeQueue: Promise<void> = Promise.resolve()
|
||||||
|
|||||||
+4
-3
@@ -1,8 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#Dunst notification daemon
|
# Dunst notification daemon.
|
||||||
|
# Detach it from this script's stdio: AGS only resolves execAsync once the
|
||||||
|
# captured pipes are closed, so an inherited fd here would stall the caller.
|
||||||
killall dunst
|
killall dunst
|
||||||
dunst &
|
setsid -f dunst >/dev/null 2>&1 </dev/null
|
||||||
|
|
||||||
hyprctl reload
|
hyprctl reload
|
||||||
|
|
||||||
Reference in new issue
Block a user