From 2549bb1880c57872a96bd87f1a8206411e777327 Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Fri, 10 Jan 2020 15:35:07 +0200 Subject: [PATCH] Move Sway to systemd Signed-off-by: Marko Korhonen --- config-home.yaml | 120 +++++++++--------- home/.config/sway/conf.d/02-bar.conf | 6 - .../conf.d/{03-input.conf => 02-input.conf} | 0 .../conf.d/{04-output.conf => 03-output.conf} | 0 ...{05-workspaces.conf => 04-workspaces.conf} | 0 .../{06-keybinds.conf => 05-keybinds.conf} | 0 ...{07-appearance.conf => 06-appearance.conf} | 2 +- home/.config/sway/conf.d/07-exec.conf | 15 +++ home/.config/sway/conf.d/08-exec.conf | 39 ------ home/.config/sway/env | 6 +- home/.config/systemd/user/autorotate.service | 10 ++ home/.config/systemd/user/autotiling.service | 10 ++ home/.config/systemd/user/clipman.service | 2 +- .../systemd/user/gnome-keyring.service | 10 ++ .../systemd/user/kdeconnect-indicator.service | 10 ++ home/.config/systemd/user/kdeconnectd.service | 10 ++ home/.config/systemd/user/mpDris2.service | 10 ++ .../.config/systemd/user/polkit-gnome.service | 10 ++ .../.config/systemd/user/redshift-gtk-service | 10 ++ home/.config/systemd/user/sway.service | 36 ++++-- .../systemd/user/telegram-desktop.service | 10 ++ home/.config/systemd/user/thunderbird.service | 10 ++ home/.config/systemd/user/wob.service | 12 ++ home/.config/systemd/user/ydotoold.service | 10 ++ home/.config/waybar/config | 22 ++-- root/etc/systemd/system/sway@.service | 25 ++++ 26 files changed, 264 insertions(+), 131 deletions(-) delete mode 100644 home/.config/sway/conf.d/02-bar.conf rename home/.config/sway/conf.d/{03-input.conf => 02-input.conf} (100%) rename home/.config/sway/conf.d/{04-output.conf => 03-output.conf} (100%) rename home/.config/sway/conf.d/{05-workspaces.conf => 04-workspaces.conf} (100%) rename home/.config/sway/conf.d/{06-keybinds.conf => 05-keybinds.conf} (100%) rename home/.config/sway/conf.d/{07-appearance.conf => 06-appearance.conf} (86%) create mode 100644 home/.config/sway/conf.d/07-exec.conf delete mode 100644 home/.config/sway/conf.d/08-exec.conf create mode 100644 home/.config/systemd/user/autorotate.service create mode 100644 home/.config/systemd/user/autotiling.service create mode 100644 home/.config/systemd/user/gnome-keyring.service create mode 100644 home/.config/systemd/user/kdeconnect-indicator.service create mode 100644 home/.config/systemd/user/kdeconnectd.service create mode 100644 home/.config/systemd/user/mpDris2.service create mode 100644 home/.config/systemd/user/polkit-gnome.service create mode 100644 home/.config/systemd/user/redshift-gtk-service create mode 100644 home/.config/systemd/user/telegram-desktop.service create mode 100644 home/.config/systemd/user/thunderbird.service create mode 100644 home/.config/systemd/user/wob.service create mode 100644 home/.config/systemd/user/ydotoold.service create mode 100644 root/etc/systemd/system/sway@.service diff --git a/config-home.yaml b/config-home.yaml index 188d609..1d1a91f 100644 --- a/config-home.yaml +++ b/config-home.yaml @@ -22,7 +22,7 @@ dotfiles: src: .config/mpv d_nvim_config: actions: - - vim-plug + - vim-plug dst: ~/.config/nvim/conf.d src: .config/nvim/conf.d d_scripts: @@ -166,79 +166,79 @@ dotfiles: profiles: Media: dotfiles: - - f_beets_config - - f_beets_whitelist - - f_abcde.conf - - d_mpv - - f_youtube-dl_config - - f_mpd.conf + - f_beets_config + - f_beets_whitelist + - f_abcde.conf + - d_mpv + - f_youtube-dl_config + - f_mpd.conf Sway: dotfiles: - - d_sway - - d_waybar - - d_rofi - - f_mako_config - - f_redshift.conf - - f_rofi-pass.conf + - d_sway + - d_waybar + - d_rofi + - f_mako_config + - f_redshift.conf + - f_rofi-pass.conf Pacman: dotfiles: - - f_yay_config.json - - f_makepkg.conf + - f_yay_config.json + - f_makepkg.conf Mirkwood: dotfiles: - - d_systemd - - f_tdesktop_lang.strings - - f_gitconfig - - f_mailcap - - f_zprofile - - f_mimeo_associations.txt - - f_mpdscribble.conf - - f_mpdris2.conf - - f_ranger_commands.py - - f_libra_config - - f_ncmpcpp_bindings - - f_zathurarc - - f_youtube-viewer.conf - - f_efm-langserver.yaml - - f_fonts.conf - - f_flashfocus.yml - - f_config - - d_efistub + - d_systemd + - f_zprofile + - f_tdesktop_lang.strings + - f_gitconfig + - f_mailcap + - f_mimeo_associations.txt + - f_mpdscribble.conf + - f_mpdris2.conf + - f_ranger_commands.py + - f_libra_config + - f_ncmpcpp_bindings + - f_zathurarc + - f_youtube-viewer.conf + - f_efm-langserver.yaml + - f_fonts.conf + - f_flashfocus.yml + - f_config + - d_efistub include: - - Terminal - - Media - - Sway - - Pacman + - Terminal + - Media + - Sway + - Pacman ReekyRaspberry: include: - - Terminal + - Terminal Rivendell: include: - - Terminal - - Media - - Pacman + - Terminal + - Media + - Pacman Terminal: dotfiles: - - f_nvimpager_init.vim - - f_ignore - - f_rtv.cfg - - d_zsh - - f_zshrc - - f_tmux.conf - - f_ranger.conf - - f_ssh.conf - - f_authorized_keys - - d_scripts - - d_nvim_config - - f_init.vim - - f_coc-settings.json - - f_gitconfig - - f_alacritty.yml + - f_nvimpager_init.vim + - f_ignore + - f_rtv.cfg + - d_zsh + - f_zshrc + - f_tmux.conf + - f_ranger.conf + - f_ssh.conf + - f_authorized_keys + - d_scripts + - d_nvim_config + - f_init.vim + - f_coc-settings.json + - f_gitconfig + - f_alacritty.yml AnittaPC: include: - - Terminal - - Pacman + - Terminal + - Pacman TakamakiPC: include: - - Terminal - - Pacman + - Terminal + - Pacman diff --git a/home/.config/sway/conf.d/02-bar.conf b/home/.config/sway/conf.d/02-bar.conf deleted file mode 100644 index 688cf91..0000000 --- a/home/.config/sway/conf.d/02-bar.conf +++ /dev/null @@ -1,6 +0,0 @@ -# vim:ft=sway - -bar { - swaybar_command waybar - output eDP-1 -} diff --git a/home/.config/sway/conf.d/03-input.conf b/home/.config/sway/conf.d/02-input.conf similarity index 100% rename from home/.config/sway/conf.d/03-input.conf rename to home/.config/sway/conf.d/02-input.conf diff --git a/home/.config/sway/conf.d/04-output.conf b/home/.config/sway/conf.d/03-output.conf similarity index 100% rename from home/.config/sway/conf.d/04-output.conf rename to home/.config/sway/conf.d/03-output.conf diff --git a/home/.config/sway/conf.d/05-workspaces.conf b/home/.config/sway/conf.d/04-workspaces.conf similarity index 100% rename from home/.config/sway/conf.d/05-workspaces.conf rename to home/.config/sway/conf.d/04-workspaces.conf diff --git a/home/.config/sway/conf.d/06-keybinds.conf b/home/.config/sway/conf.d/05-keybinds.conf similarity index 100% rename from home/.config/sway/conf.d/06-keybinds.conf rename to home/.config/sway/conf.d/05-keybinds.conf diff --git a/home/.config/sway/conf.d/07-appearance.conf b/home/.config/sway/conf.d/06-appearance.conf similarity index 86% rename from home/.config/sway/conf.d/07-appearance.conf rename to home/.config/sway/conf.d/06-appearance.conf index 6323d22..2e2111b 100644 --- a/home/.config/sway/conf.d/07-appearance.conf +++ b/home/.config/sway/conf.d/06-appearance.conf @@ -10,7 +10,7 @@ seat * hide_cursor 4000 ###### Borders ###### # class border backgr. text indicator child_border client.focused #8AC6F2 #8AC6F2 #292D3E #8AC6F2 #8AC6F2 -client.focused_active #292D3E #FFFFFF #FFFFFF #292D3E #292D3E +client.focused_inactive #292D3E #FFFFFF #FFFFFF #292D3E #292D3E client.unfocused #292D3E #292D3E #FFFFFF #282828 #292D3E for_window [app_id="^.*"] border pixel 4 diff --git a/home/.config/sway/conf.d/07-exec.conf b/home/.config/sway/conf.d/07-exec.conf new file mode 100644 index 0000000..4221722 --- /dev/null +++ b/home/.config/sway/conf.d/07-exec.conf @@ -0,0 +1,15 @@ +# vim:ft=sway + +exec { + systemctl --user import-environment + systemctl --user start sway-session.target +} + +exec_always { + gsettings set $gnome-schema gtk-theme 'vimix-dark-doder' + gsettings set $gnome-schema icon-theme 'Numix' + gsettings set $gnome-schema cursor-theme 'Breeze' + gsettings set $gnome-schema font-name 'Overpass 12' + gsettings set $gnome-schema document-font-name 'Overpass 12' + gsettings set $gnome-schema monospace-font-name 'Hack Nerd Font Mono 12' +} diff --git a/home/.config/sway/conf.d/08-exec.conf b/home/.config/sway/conf.d/08-exec.conf deleted file mode 100644 index dc2d8a3..0000000 --- a/home/.config/sway/conf.d/08-exec.conf +++ /dev/null @@ -1,39 +0,0 @@ -# vim:ft=sway - -exec { - {%@@ if profile == "Mirkwood" @@%} - nm-applet --indicator - redshift-gtk -m wayland - mpDris2 - evolution - telegram-desktop - syncthing-gtk -m - mako - $HOME/Scripts/swayidle.sh - {%@@ elif profile == "Rivendell" @@%} - kodi - {%@@ endif @@%} - /usr/lib/kdeconnectd - kdeconnect-indicator - /usr/bin/gnome-keyring-daemon --start --components=secrets - /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 - ydotoold - wl-paste -t text --watch clipman store - autotiling - $HOME/Scripts/autorotate.sh - squeekboard - thunderbird - mkfifo $SWAYSOCK.wob && tail -f $SWAYSOCK.wob | wob -} - -exec_always { - {%@@ if profile == "Mirkwood" @@%} - bash $HOME/.config/sway/randr/laptop.sh - {%@@ endif @@%} - gsettings set $gnome-schema gtk-theme 'vimix-dark-doder' - gsettings set $gnome-schema icon-theme 'Numix' - gsettings set $gnome-schema cursor-theme 'Breeze' - gsettings set $gnome-schema font-name 'Overpass 12' - gsettings set $gnome-schema document-font-name 'Overpass 12' - gsettings set $gnome-schema monospace-font-name 'Hack Nerd Font Mono 12' -} diff --git a/home/.config/sway/env b/home/.config/sway/env index 2456c8d..3482b7f 100644 --- a/home/.config/sway/env +++ b/home/.config/sway/env @@ -1,3 +1,5 @@ +XDG_SESSION_TYPE=wayland + # Fix java on wayland _JAVA_AWT_WM_NONREPARENTING=1 _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' @@ -15,5 +17,5 @@ MOZ_WEBRENDER=1 # Fix redshift on wlroots WLR_DRM_NO_ATOMIC=1 -# Make clutter programs use wayland -CLUTTER_BACKEND=wayland +# Use wayland in SDL2 +SDL_VIDEODRIVER=wayland diff --git a/home/.config/systemd/user/autorotate.service b/home/.config/systemd/user/autorotate.service new file mode 100644 index 0000000..00fbcc1 --- /dev/null +++ b/home/.config/systemd/user/autorotate.service @@ -0,0 +1,10 @@ +[Unit] +Description=Script for automatically rotating screen +PartOf=graphical-session.target + +[Service] +Type=simple +ExecStart=%h/Scripts/autorotate.sh + +[Install] +WantedBy=sway-session.target diff --git a/home/.config/systemd/user/autotiling.service b/home/.config/systemd/user/autotiling.service new file mode 100644 index 0000000..8fd0b22 --- /dev/null +++ b/home/.config/systemd/user/autotiling.service @@ -0,0 +1,10 @@ +[Unit] +Description=Script for sway and i3 to automatically switch the horizontal / vertical window split orientation +PartOf=graphical-session.target + +[Service] +Type=simple +ExecStart=/usr/bin/autotiling + +[Install] +WantedBy=sway-session.target diff --git a/home/.config/systemd/user/clipman.service b/home/.config/systemd/user/clipman.service index 203c749..f30738f 100644 --- a/home/.config/systemd/user/clipman.service +++ b/home/.config/systemd/user/clipman.service @@ -4,7 +4,7 @@ PartOf=graphical-session.target [Service] Type=simple -ExecStart=/usr/bin/clipman -d +ExecStart=/usr/bin/wl-paste -t text --watch clipman store [Install] WantedBy=sway-session.target diff --git a/home/.config/systemd/user/gnome-keyring.service b/home/.config/systemd/user/gnome-keyring.service new file mode 100644 index 0000000..1155975 --- /dev/null +++ b/home/.config/systemd/user/gnome-keyring.service @@ -0,0 +1,10 @@ +[Unit] +Description=Stores passwords and encryption keys +PartOf=graphical-session.target + +[Service] +Type=simple +ExecStart=/usr/bin/gnome-keyring-daemon --start --components=secrets + +[Install] +WantedBy=sway-session.target diff --git a/home/.config/systemd/user/kdeconnect-indicator.service b/home/.config/systemd/user/kdeconnect-indicator.service new file mode 100644 index 0000000..ac34729 --- /dev/null +++ b/home/.config/systemd/user/kdeconnect-indicator.service @@ -0,0 +1,10 @@ +[Unit] +Description=Indicator and UI for KDE Connect +PartOf=graphical-session.target + +[Service] +Type=simple +ExecStart=/usr/bin/kdeconnect-indicator + +[Install] +WantedBy=sway-session.target diff --git a/home/.config/systemd/user/kdeconnectd.service b/home/.config/systemd/user/kdeconnectd.service new file mode 100644 index 0000000..537b255 --- /dev/null +++ b/home/.config/systemd/user/kdeconnectd.service @@ -0,0 +1,10 @@ +[Unit] +Description=KDE Connect daemon +PartOf=graphical-session.target + +[Service] +Type=simple +ExecStart=/usr/lib/kdeconnectd + +[Install] +WantedBy=sway-session.target diff --git a/home/.config/systemd/user/mpDris2.service b/home/.config/systemd/user/mpDris2.service new file mode 100644 index 0000000..bb8eee0 --- /dev/null +++ b/home/.config/systemd/user/mpDris2.service @@ -0,0 +1,10 @@ +[Unit] +Description=MPRIS2 support for MPD +PartOf=graphical-session.target + +[Service] +Type=simple +ExecStart=/usr/bin/mpDris2 + +[Install] +WantedBy=sway-session.target diff --git a/home/.config/systemd/user/polkit-gnome.service b/home/.config/systemd/user/polkit-gnome.service new file mode 100644 index 0000000..c533f0b --- /dev/null +++ b/home/.config/systemd/user/polkit-gnome.service @@ -0,0 +1,10 @@ +[Unit] +Description=Legacy polkit authentication agent for GNOME +PartOf=graphical-session.target + +[Service] +Type=simple +ExecStart=/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 + +[Install] +WantedBy=sway-session.target diff --git a/home/.config/systemd/user/redshift-gtk-service b/home/.config/systemd/user/redshift-gtk-service new file mode 100644 index 0000000..a7d3eec --- /dev/null +++ b/home/.config/systemd/user/redshift-gtk-service @@ -0,0 +1,10 @@ +[Unit] +Description=Adjusts the color temperature of your screen according to your surroundings. +PartOf=graphical-session.target + +[Service] +Type=simple +ExecStart=/usr/bin/redshift-gtk -m wayland + +[Install] +WantedBy=sway-session.target diff --git a/home/.config/systemd/user/sway.service b/home/.config/systemd/user/sway.service index 87aef22..08ddde0 100644 --- a/home/.config/systemd/user/sway.service +++ b/home/.config/systemd/user/sway.service @@ -1,17 +1,31 @@ [Unit] Description=sway - SirCmpwn's Wayland window manager -Documentation=man:sway(5) -BindsTo=graphical-session.target -Wants=graphical-session-pre.target -After=graphical-session-pre.target [Service] -Type=simple -EnvironmentFile=-%h/.config/sway/env -ExecStart=/usr/bin/sway -Restart=on-failure -RestartSec=1 -TimeoutStopSec=10 +ExecStartPre=/usr/bin/chvt %I +ExecStart=/usr/bin/dbus-launch --exit-with-session /usr/bin/sway +TTYPath=/dev/tty%I +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes +PAMName=login +User= +WorkingDirectory=/home/ +Environment=XDG_RUNTIME_DIR=/run/user/1000 +Environment=QT_WAYLAND_FORCE_DPI=100 +Environment=QT_PLUGIN_PATH=/usr/lib/kde4/plugins/ +Environment=QT_QPA_PLATFORM=wayland +Environment=QT_AUTO_SCREEN_SCALE_FACTOR=0 +Environment=QT_QPA_PLATFORMTHEME=gtk3 +Environment=QT_WAYLAND_DISABLE_WINDOWDECORATION="1" +Environment=GDK_BACKEND=wayland +Restart=always +RestartSec=2 +StandardInput=tty +StandardError=journal +StandardOutput=journal +Nice=-5 [Install] -WantedBy=default.target +WantedBy=graphical.target +Alias=display-manager.service diff --git a/home/.config/systemd/user/telegram-desktop.service b/home/.config/systemd/user/telegram-desktop.service new file mode 100644 index 0000000..24b9efd --- /dev/null +++ b/home/.config/systemd/user/telegram-desktop.service @@ -0,0 +1,10 @@ +[Unit] +Description=Official Telegram Desktop client +PartOf=graphical-session.target + +[Service] +Type=simple +ExecStart=/usr/bin/telegram-desktop + +[Install] +WantedBy=sway-session.target diff --git a/home/.config/systemd/user/thunderbird.service b/home/.config/systemd/user/thunderbird.service new file mode 100644 index 0000000..6d6fba8 --- /dev/null +++ b/home/.config/systemd/user/thunderbird.service @@ -0,0 +1,10 @@ +[Unit] +Description=Standalone mail and news reader from mozilla.org +PartOf=graphical-session.target + +[Service] +Type=simple +ExecStart=/usr/bin/thunderbird + +[Install] +WantedBy=sway-session.target diff --git a/home/.config/systemd/user/wob.service b/home/.config/systemd/user/wob.service new file mode 100644 index 0000000..20497c4 --- /dev/null +++ b/home/.config/systemd/user/wob.service @@ -0,0 +1,12 @@ +[Unit] +Description=A lightweight overlay volume/backlight/progress/anything bar for Wayland +PartOf=graphical-session.target + +[Service] +Type=simple +ExecStartPre=/usr/bin/mkfifo /tmp/sway.wob +ExecStart=/usr/bin/tail -f /tmp/sway.wob | wob +ExecStop=/usr/bin/rm /tmp/sway.wob + +[Install] +WantedBy=sway-session.target diff --git a/home/.config/systemd/user/ydotoold.service b/home/.config/systemd/user/ydotoold.service new file mode 100644 index 0000000..9e0cda7 --- /dev/null +++ b/home/.config/systemd/user/ydotoold.service @@ -0,0 +1,10 @@ +[Unit] +Description=Generic command-line automation tool +PartOf=graphical-session.target + +[Service] +Type=simple +ExecStart=/usr/bin/ydotoold + +[Install] +WantedBy=sway-session.target diff --git a/home/.config/waybar/config b/home/.config/waybar/config index 9d7dfa2..ea82c4f 100644 --- a/home/.config/waybar/config +++ b/home/.config/waybar/config @@ -8,9 +8,8 @@ "idle_inhibitor", "pulseaudio", "custom/yay", - "cpu", + "network", "temperature", - "memory", "battery", "clock", "tray" @@ -42,6 +41,16 @@ "deactivated": "" } }, + "network": { + "format": "{ifname}", + "format-wifi": "{essid} ({signalStrength}%) ", + "format-ethernet": "{ipaddr} ", + "format-disconnected": "Disconnected ", //An empty format will hide the module. + "tooltip-format": "{ifname}", + "tooltip-format-wifi": "{ifname} {frequency}MHz ", + "tooltip-format-ethernet": "{ifname} ", + "tooltip-format-disconnected": "Disconnected" + }, "tray": { // "icon-size": 21, "spacing": 10 @@ -78,15 +87,6 @@ "battery#bat2": { "bat": "BAT2" }, - "network": { - "tooltip": false, - "interface": "wg0", - "format-ethernet": "VPN Connected", - "format-disconnected": "VPN disconnected ⚠", - "on-click": "sudo systemctl start wg-quick@wg0.service", - "on-click-right": "sudo systemctl stop wg-quick@wg0.service", - "interval": 10 - }, "pulseaudio": { "tooltip": false, //"scroll-step": 1, diff --git a/root/etc/systemd/system/sway@.service b/root/etc/systemd/system/sway@.service new file mode 100644 index 0000000..01a5976 --- /dev/null +++ b/root/etc/systemd/system/sway@.service @@ -0,0 +1,25 @@ +[Unit] +Description=sway - SirCmpwn's Wayland window manager + +[Service] +ExecStartPre=/usr/bin/chvt %I +ExecStart=/usr/bin/dbus-launch --exit-with-session /usr/bin/sway +TTYPath=/dev/tty%I +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes +PAMName=login +User=frodo +WorkingDirectory=/home/frodo +Environment=XDG_RUNTIME_DIR=/run/user/1000 +Environment=QT_PLUGIN_PATH=/usr/lib/kde4/plugins/ +Restart=always +RestartSec=2 +StandardInput=tty +StandardError=journal +StandardOutput=journal +Nice=-5 + +[Install] +WantedBy=graphical.target +Alias=display-manager.service