aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--install-arch-system.yml3
-rw-r--r--install-arch.yml4
-rw-r--r--systemd/.enable-user.yml7
-rw-r--r--systemd/.install-system-user.yml18
-rw-r--r--systemd/.install-user.yml6
-rw-r--r--systemd/system-user/mako.service16
-rw-r--r--systemd/system-user/sway-session.target7
-rw-r--r--systemd/system-user/swayidle.service17
-rw-r--r--systemd/system-user/waybar.service12
-rw-r--r--systemd/user/battery-notify.service11
10 files changed, 101 insertions, 0 deletions
diff --git a/install-arch-system.yml b/install-arch-system.yml
new file mode 100644
index 0000000..9daceb5
--- /dev/null
+++ b/install-arch-system.yml
@@ -0,0 +1,3 @@
+stages:
+ - from_file: systemd/.install-system-user.yml
+
diff --git a/install-arch.yml b/install-arch.yml
index ef4d966..2d72484 100644
--- a/install-arch.yml
+++ b/install-arch.yml
@@ -48,3 +48,7 @@ stages:
symbolic: true
- !Shell "mkdir $HOME/bin/compiled"
+
+ - from_file: systemd/.install-user.yml
+ - from_file: systemd/.enable-user.yml
+
diff --git a/systemd/.enable-user.yml b/systemd/.enable-user.yml
new file mode 100644
index 0000000..5aa3a16
--- /dev/null
+++ b/systemd/.enable-user.yml
@@ -0,0 +1,7 @@
+name: Enable user systemd services
+steps:
+ - !Shell "systemctl enable --user battery-notify.service"
+ - !Shell "systemctl enable --user mako.service"
+ - !Shell "systemctl enable --user swaylock.service"
+ - !Shell "systemctl enable --user waybar.service"
+
diff --git a/systemd/.install-system-user.yml b/systemd/.install-system-user.yml
new file mode 100644
index 0000000..c512699
--- /dev/null
+++ b/systemd/.install-system-user.yml
@@ -0,0 +1,18 @@
+name: Install system-wide user systemd services
+steps:
+ - !Copy
+ from: "system-user/mako.service"
+ to: "/etc/systemd/user/mako.service"
+
+ - !Copy
+ from: "system-user/sway-session.target"
+ to: "/etc/systemd/user/sway-session.target"
+
+ - !Copy
+ from: "system-user/swayidle.service"
+ to: "/etc/systemd/user/swayidle.service"
+
+ - !Copy
+ from: "system-user/waybar.service"
+ to: "/etc/systemd/user/waybar.service"
+
diff --git a/systemd/.install-user.yml b/systemd/.install-user.yml
new file mode 100644
index 0000000..6c711aa
--- /dev/null
+++ b/systemd/.install-user.yml
@@ -0,0 +1,6 @@
+name: Install user systemd services
+steps:
+ - !Copy
+ from: "user/battery-notify.service"
+ to: "~/.config/systemd/user/battery-notify.service"
+
diff --git a/systemd/system-user/mako.service b/systemd/system-user/mako.service
new file mode 100644
index 0000000..0afbfb9
--- /dev/null
+++ b/systemd/system-user/mako.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Lightweight Wayland notification daemon
+Documentation=man:mako(1)
+PartOf=graphical-session.target
+After=graphical-session.target
+
+[Service]
+Type=dbus
+BusName=org.freedesktop.Notifications
+ExecCondition=/bin/sh -c '[ -n "$WAYLAND_DISPLAY" ]'
+ExecStart=/usr/bin/mako
+ExecReload=/usr/bin/makoctl reload
+
+[Install]
+WantedBy=sway-session.target
+
diff --git a/systemd/system-user/sway-session.target b/systemd/system-user/sway-session.target
new file mode 100644
index 0000000..db94967
--- /dev/null
+++ b/systemd/system-user/sway-session.target
@@ -0,0 +1,7 @@
+[Unit]
+Description=sway compositor session
+Documentation=man:systemd.special(7)
+BindsTo=graphical-session.target
+Wants=graphical-session-pre.target
+After=graphical-session-pre.target
+
diff --git a/systemd/system-user/swayidle.service b/systemd/system-user/swayidle.service
new file mode 100644
index 0000000..ce9f7e3
--- /dev/null
+++ b/systemd/system-user/swayidle.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Idle manager for Wayland
+Documentation=man:swayidle(1)
+PartOf=graphical-session.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/swayidle -w \
+ timeout 300 "notify-send 'Power' 'System will suspend very soon due to inactivity.'" \
+ timeout 315 "swaylock" \
+ timeout 320 "swaymsg 'output * power off'" resume "swaymsg 'output * power on'" \
+ before-sleep "swaylock"
+
+
+[Install]
+WantedBy=sway-session.target
+
diff --git a/systemd/system-user/waybar.service b/systemd/system-user/waybar.service
new file mode 100644
index 0000000..db1c594
--- /dev/null
+++ b/systemd/system-user/waybar.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Highly customizable Wayland bar for Sway and Wlroots based compositors.
+Documentation=https://github.com/Alexays/Waybar/wiki/
+PartOf=graphical-session.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/waybar
+
+[Install]
+WantedBy=sway-session.target
+
diff --git a/systemd/user/battery-notify.service b/systemd/user/battery-notify.service
new file mode 100644
index 0000000..9d7fff5
--- /dev/null
+++ b/systemd/user/battery-notify.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Battery notification daemon
+PartOf=graphical-session.target
+
+[Service]
+Type=simple
+ExecStart=/home/leonardo/bin/battery-notify.sh
+
+[Install]
+WantedBy=sway-session.target
+