Use conflicting systemd units for color mode
This commit is contained in:
@@ -30,4 +30,4 @@ Wants=touchpad.service
|
|||||||
Wants=xresources.service
|
Wants=xresources.service
|
||||||
Wants=yubikey-touch-detector.service
|
Wants=yubikey-touch-detector.service
|
||||||
Wants=kdeconnect.service
|
Wants=kdeconnect.service
|
||||||
|
Wants=color-theme-dark.service
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ command_state = "[[ $($HOME/.i3/scripts/presentation-mode status) == on ]] && ec
|
|||||||
block = "toggle"
|
block = "toggle"
|
||||||
format = " $icon "
|
format = " $icon "
|
||||||
command_on = "systemctl --user start color-theme-light"
|
command_on = "systemctl --user start color-theme-light"
|
||||||
command_off = "systemctl --user stop color-theme-light"
|
command_off = "systemctl --user start color-theme-dark"
|
||||||
command_state = "[[ $(systemctl --user is-active color-theme-light) == active ]] && echo active"
|
command_state = "[[ $(systemctl --user is-active color-theme-light) == active ]] && echo active"
|
||||||
|
|
||||||
[[block]]
|
[[block]]
|
||||||
|
|||||||
9
services/color-theme-dark.service
Normal file
9
services/color-theme-dark.service
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
After=windowmanager.target
|
||||||
|
Conflicts=color-theme-light.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/bin/env switch-color-mode dark
|
||||||
|
RemainAfterExit=true
|
||||||
|
PassEnvironment=DISPLAY
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
After=windowmanager.target
|
After=windowmanager.target
|
||||||
|
Conflicts=color-theme-dark.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/usr/bin/env switch-color-mode light
|
ExecStart=/usr/bin/env switch-color-mode light
|
||||||
ExecStop=/usr/bin/env switch-color-mode dark
|
|
||||||
RemainAfterExit=true
|
RemainAfterExit=true
|
||||||
PassEnvironment=DISPLAY
|
PassEnvironment=DISPLAY
|
||||||
|
|||||||
Reference in New Issue
Block a user