From e4e9e3b440bc915b15abee33aeeb23f8194dd298 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 13 Nov 2022 14:07:24 +0100 Subject: [sway+gammastep+fcitx5] start sway via systemd service on login and adjust gammastep and fcitx5 services to run after sway-session.target --- .config/fcitx5/systemd/fcitx5-systemd | 3 --- .config/fcitx5/systemd/fcitx5-user.service | 6 ++++++ .config/fcitx5/systemd/fcitx5-user.timer | 5 +++++ .config/fcitx5/systemd/fcitx5@.service | 9 --------- .config/gammastep/systemd/gammastep-systemd | 4 ---- .config/gammastep/systemd/gammastep-user.service | 10 ++++++++++ .config/gammastep/systemd/gammastep@.service | 12 ------------ .config/yadm/bootstrap | 11 +++++------ .zprofile | 3 +-- 9 files changed, 27 insertions(+), 36 deletions(-) delete mode 100755 .config/fcitx5/systemd/fcitx5-systemd create mode 100644 .config/fcitx5/systemd/fcitx5-user.service create mode 100644 .config/fcitx5/systemd/fcitx5-user.timer delete mode 100644 .config/fcitx5/systemd/fcitx5@.service delete mode 100755 .config/gammastep/systemd/gammastep-systemd create mode 100644 .config/gammastep/systemd/gammastep-user.service delete mode 100644 .config/gammastep/systemd/gammastep@.service diff --git a/.config/fcitx5/systemd/fcitx5-systemd b/.config/fcitx5/systemd/fcitx5-systemd deleted file mode 100755 index b529eff..0000000 --- a/.config/fcitx5/systemd/fcitx5-systemd +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -WAYLAND_DISPLAY=wayland-1 XDG_RUNTIME_DIR=/run/user/$(id -u) GTK_IM_MODULE=fcitx QT_IM_MODULE=fcitx XMODIFIERS=@im=fcitx /usr/bin/fcitx5 diff --git a/.config/fcitx5/systemd/fcitx5-user.service b/.config/fcitx5/systemd/fcitx5-user.service new file mode 100644 index 0000000..c077504 --- /dev/null +++ b/.config/fcitx5/systemd/fcitx5-user.service @@ -0,0 +1,6 @@ +[Unit] +Description=fcitx5 + +[Service] +ExecStart=/usr/bin/fcitx5 +Environment="GTK_IM_MODULE=fcitx" "QT_IM_MODULE=fcitx" "XMODIFIERS=@im-fcitx" diff --git a/.config/fcitx5/systemd/fcitx5-user.timer b/.config/fcitx5/systemd/fcitx5-user.timer new file mode 100644 index 0000000..614f6a2 --- /dev/null +++ b/.config/fcitx5/systemd/fcitx5-user.timer @@ -0,0 +1,5 @@ +[Timer] +OnActiveSec=5s + +[Install] +WantedBy=sway-session.target diff --git a/.config/fcitx5/systemd/fcitx5@.service b/.config/fcitx5/systemd/fcitx5@.service deleted file mode 100644 index 1ab45d9..0000000 --- a/.config/fcitx5/systemd/fcitx5@.service +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=fcitx5 - -[Service] -User=%i -ExecStart=fcitx5-systemd - -[Install] -WantedBy=graphical.target diff --git a/.config/gammastep/systemd/gammastep-systemd b/.config/gammastep/systemd/gammastep-systemd deleted file mode 100755 index 6bebc1c..0000000 --- a/.config/gammastep/systemd/gammastep-systemd +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -WAYLAND_DISPLAY=wayland-1 XDG_RUNTIME_DIR=/run/user/$(id -u) /usr/bin/gammastep - diff --git a/.config/gammastep/systemd/gammastep-user.service b/.config/gammastep/systemd/gammastep-user.service new file mode 100644 index 0000000..dadf8e0 --- /dev/null +++ b/.config/gammastep/systemd/gammastep-user.service @@ -0,0 +1,10 @@ +[Unit] +Description=gammastep + +[Service] +ExecStart=/usr/bin/gammastep +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=sway-session.target diff --git a/.config/gammastep/systemd/gammastep@.service b/.config/gammastep/systemd/gammastep@.service deleted file mode 100644 index 08f0f37..0000000 --- a/.config/gammastep/systemd/gammastep@.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=gammastep - -[Service] -User=%i -ExecStart=gammastep-systemd -Restart=on-failure -RestartSec=5 - -[Install] -WantedBy=graphical.target - diff --git a/.config/yadm/bootstrap b/.config/yadm/bootstrap index 91f2152..6ca05e9 100755 --- a/.config/yadm/bootstrap +++ b/.config/yadm/bootstrap @@ -32,9 +32,8 @@ fi # # if command -v gammastep > /dev/null 2>&1; then - sudo ln -s "$HOME/.config/gammastep/systemd/gammastep@.service" /etc/systemd/system/ - sudo ln -s "$HOME/.config/gammastep/systemd/gammastep-systemd" /usr/local/bin/ - sudo systemctl enable "gammastep@$USER" --now + sudo ln -s "$HOME/.config/gammastep/systemd/gammastep-user.service" /etc/systemd/user/ + systemctl --user enable "gammastep-user" --now fi # # @@ -42,7 +41,7 @@ fi # # if command -v fcitx5 > /dev/null 2>&1; then - sudo ln -s "$HOME/.config/fcitx5/systemd/fcitx5@.service" /etc/systemd/system/ - sudo ln -s "$HOME/.config/fcitx5/systemd/fcitx5-systemd" /usr/local/bin/ - sudo systemctl enable "fcitx5@$USER" --now + sudo ln -s "$HOME/.config/fcitx5/systemd/fcitx5-user.service" /etc/systemd/user/ + sudo ln -s "$HOME/.config/fcitx5/systemd/fcitx5-user.timer" /etc/systemd/user/ + systemctl --user enable 'fcitx5-user.timer' --now fi diff --git a/.zprofile b/.zprofile index 374fd5f..e7eb6b8 100644 --- a/.zprofile +++ b/.zprofile @@ -2,5 +2,4 @@ export XDG_CONFIG_HOME="$HOME/.config" export XDG_CACHE_HOME="$HOME/.cache" export XDG_DATA_HOME="$HOME/.local/share" -exec sway - +systemctl --user start sway.service -- cgit v1.2.3