From 4008fa4f12d6688c580a78980e4722899a84498c Mon Sep 17 00:00:00 2001 From: Matt Singleton Date: Fri, 12 Apr 2024 16:06:30 -0500 Subject: Update Makefile to manage fedora/sway-de config --- sway-de/install.sh | 85 ---------------------- .../udiskie/.config/systemd/user/udiskie.service | 15 ++++ .../.local/share/systemd/user/udiskie.service | 15 ---- .../.config/systemd/user/xdg-names.service | 14 ++++ .../.local/share/systemd/user/xdg-names.service | 14 ---- 5 files changed, 29 insertions(+), 114 deletions(-) delete mode 100755 sway-de/install.sh create mode 100644 sway-de/udiskie/.config/systemd/user/udiskie.service delete mode 100644 sway-de/udiskie/.local/share/systemd/user/udiskie.service create mode 100644 sway-de/xdg-names/.config/systemd/user/xdg-names.service delete mode 100644 sway-de/xdg-names/.local/share/systemd/user/xdg-names.service (limited to 'sway-de') diff --git a/sway-de/install.sh b/sway-de/install.sh deleted file mode 100755 index ccef98f..0000000 --- a/sway-de/install.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash -# -# Designed for Fedora Workstation -# -# Installs and configures sway and related tools to provide a richer -# "desktop environment" style session. Relies on systemd for running -# services as much as possible. - -set -euo pipefail - -script_path="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" -if [ ! "$(pwd)" = "$script_path" ]; then - echo "expects to be run from the root sway-de directory" - exit 1 -fi - -if ! command -v dnf > /dev/null !! [ ! -f /etc/fedora-release ]; then - echo "doesn't seem to be fedora workstation" - exit 1 -fi - - -# give the option to skip installing packages since dnf can be slow -skip_packages="" -while [[ $# -gt 0 ]]; do - case $1 in - --skip-packages) - skip_packages=1 - shift - ;; - *) - shift - ;; - esac -done - -if [ -z "$skip_packages" ]; then - - # install rpmfusion if it's not already installed - repos_installed="$(dnf --cacheonly repolist | tail -n+2 | cut -f1 -d' ' | awk '/(^rpmfusion-free$)|(^rpmfusion-nonfree$)/' | wc -l)" - if [ "$repos_installed" -lt "2" ]; then - sudo dnf install \ - "https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm" \ - "https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm" - fi - - # install packages - sudo dnf install \ - sway waybar rofi-wayland foot mako \ - udiskie libappindicator-gtk3 duplicity python3-b2sdk pass passmenu \ - vlc unzip vim wget git zsh stow dnf-automatic \ - grimshot pulseaudio-utils thunar pavucontrol-qt \ - network-manager-applet - -fi - -# make sure stow is installed. -# it should be at this point, so if it's not, die with a message -# to re-run without skipping the package install step. -STOWCMD="" -if command -v stow > /dev/null; then - STOWCMD="stow" -fi -if [ -z "$STOWCMD" ]; then - echo "requires 'stow'. run without '--skip-packages' to install." - exit 1 -fi - -# use stow to install config files -$STOWCMD \ - --dir "$(pwd)" \ - --target "$HOME" \ - foot mako rofi sway swaylock udiskie waybar xdg-names - -# enable new systemd units and start them if sway is running -for unit in udiskie.service xdg-names.service; do - if systemctl --user is-active sway-session.target; then - systemctl --user enable --now "$(basename "$unit")" - else - systemctl --user enable "$(basename "$unit")" - fi -done - -# enable dnf automatic updates -sudo systemctl enable --now dnf-automatic-install.timer diff --git a/sway-de/udiskie/.config/systemd/user/udiskie.service b/sway-de/udiskie/.config/systemd/user/udiskie.service new file mode 100644 index 0000000..ba7e7f0 --- /dev/null +++ b/sway-de/udiskie/.config/systemd/user/udiskie.service @@ -0,0 +1,15 @@ +[Unit] +Description=Handle automounting of usb devices +Documentation=man:udiskie(1) +PartOf=sway-session.target + +[Service] +Type=simple +ExecStart=/usr/bin/udiskie -s +ExecStop=/bin/kill -2 $MAINPID +Restart=on-failure +RestartSec=1 +TimeoutStopSec=10 + +[Install] +WantedBy=sway-session.target diff --git a/sway-de/udiskie/.local/share/systemd/user/udiskie.service b/sway-de/udiskie/.local/share/systemd/user/udiskie.service deleted file mode 100644 index ba7e7f0..0000000 --- a/sway-de/udiskie/.local/share/systemd/user/udiskie.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Handle automounting of usb devices -Documentation=man:udiskie(1) -PartOf=sway-session.target - -[Service] -Type=simple -ExecStart=/usr/bin/udiskie -s -ExecStop=/bin/kill -2 $MAINPID -Restart=on-failure -RestartSec=1 -TimeoutStopSec=10 - -[Install] -WantedBy=sway-session.target diff --git a/sway-de/xdg-names/.config/systemd/user/xdg-names.service b/sway-de/xdg-names/.config/systemd/user/xdg-names.service new file mode 100644 index 0000000..799431b --- /dev/null +++ b/sway-de/xdg-names/.config/systemd/user/xdg-names.service @@ -0,0 +1,14 @@ +[Unit] +Description=Rename Sway workspaces based on XDG metadata +PartOf=sway-session.target + +[Service] +Type=simple +ExecStart=%h/.local/bin/xdg-names.py --debug +ExecStop=/bin/kill -2 $MAINPID +Restart=on-failure +RestartSec=1 +TimeoutStopSec=10 + +[Install] +WantedBy=sway-session.target diff --git a/sway-de/xdg-names/.local/share/systemd/user/xdg-names.service b/sway-de/xdg-names/.local/share/systemd/user/xdg-names.service deleted file mode 100644 index 799431b..0000000 --- a/sway-de/xdg-names/.local/share/systemd/user/xdg-names.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Rename Sway workspaces based on XDG metadata -PartOf=sway-session.target - -[Service] -Type=simple -ExecStart=%h/.local/bin/xdg-names.py --debug -ExecStop=/bin/kill -2 $MAINPID -Restart=on-failure -RestartSec=1 -TimeoutStopSec=10 - -[Install] -WantedBy=sway-session.target -- cgit v1.2.3