Skip to content

Commit 5fa03bf

Browse files
committed
feat(redshift): autostart with systemd
I had a conflict with the config file. To make `~/.config/redshift/redshift.conf` work i had to make changes to `/etc/apparmor.d/usr.bin.redshift`. Also the configfile cannot be a softlink! jonls/redshift#850 (comment) jonls/redshift#864 jonls/redshift#672
1 parent 0bee358 commit 5fa03bf

File tree

4 files changed

+34
-38
lines changed

4 files changed

+34
-38
lines changed

aspects/dotfiles/files/.config/i3status-rust/config.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ block = "xrandr"
4343
format = " $icon $brightness $resolution "
4444
interval = 5
4545

46-
[[block]]
47-
block = "hueshift"
48-
hue_shifter = "redshift"
49-
step = 50
50-
click_temp = 3500
51-
5246
[[block]]
5347
block = "memory"
5448
format = " $icon $mem_total_used_percents.eng(w:2) "

aspects/systemd/default

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
# mise alias="systemd"
66
*/
77

8-
const aspect = __dirname
8+
const aspect = __dirname;
99

10-
await spinner('create ~/.config/systemd/user', async () => {
11-
await $`mkdir -p ~/.config/systemd/user`
12-
})
10+
await spinner("create ~/.config/systemd/user", async () => {
11+
await $`mkdir -p ~/.config/systemd/user`;
12+
});
1313

14-
await spinner('set up ~/.config/systemd/user', async () => {
15-
const sourceBaseDir = path.join(aspect, 'files');
14+
await spinner("set up ~/.config/systemd/user", async () => {
15+
const sourceBaseDir = path.join(aspect, "files");
1616
const targetBaseDir = path.join(os.homedir());
1717

18-
const files = await glob('**/*', { cwd: sourceBaseDir, dot: true })
18+
const files = await glob("**/*", { cwd: sourceBaseDir, dot: true });
1919

20-
files.forEach(relPath => {
20+
files.forEach((relPath) => {
2121
const sourcePath = path.join(sourceBaseDir, relPath);
2222
const targetPath = path.join(targetBaseDir, relPath);
2323
const targetDir = path.dirname(targetPath);
@@ -33,19 +33,22 @@ await spinner('set up ~/.config/systemd/user', async () => {
3333
});
3434
});
3535

36-
await spinner('systemd daemon-reload', async () => {
37-
await $`systemctl --user daemon-reload`
38-
})
36+
await spinner("systemd daemon-reload", async () => {
37+
await $`systemctl --user daemon-reload`;
38+
});
3939

40-
await spinner('enable ssh-agent.service', async () => {
41-
await $`systemctl --user enable ssh-agent.service --now`
42-
})
40+
await spinner("enable ssh-agent.service", async () => {
41+
await $`systemctl --user enable ssh-agent.service --now`;
42+
});
4343

4444
// await spinner('enable colorscheme.timer', async () => {
4545
// await $`systemctl --user enable colorscheme.service --now`
4646
// })
4747

48-
await spinner('enable colorscheme.timer', async () => {
49-
await $`systemctl --user enable darkman.service --now`
50-
})
48+
await spinner("enable darkman.service", async () => {
49+
await $`systemctl --user enable darkman.service --now`;
50+
});
5151

52+
await spinner("enable redshift.service", async () => {
53+
await $`systemctl --user enable redshift.service --now`;
54+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[Unit]
2+
Description=Redshift display colour temperature adjustment
3+
Documentation=http://jonls.dk/redshift/
4+
After=graphical-session.target
5+
6+
[Service]
7+
ExecStart=/usr/bin/redshift -v
8+
Restart=always
9+
10+
[Install]
11+
WantedBy=graphical-session.target
12+
13+
[Install]
14+
WantedBy=default.target

bin/lightcare

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)