From 4b298878d38693ad64a928e08ebcf39a721a7fb1 Mon Sep 17 00:00:00 2001 From: Matt Singleton Date: Sun, 30 Apr 2023 14:41:07 -0500 Subject: clean up install script --- sway-de/install.sh | 47 ++++++++++++++++++++------------ sway-de/sway/.config/sway/config | 4 --- sway-de/swaylock/.config/swaylock/config | 2 +- sway-de/waybar/.config/waybar/config | 3 +- sway-de/waybar/.config/waybar/style.css | 11 ++++++-- sway-de/wofi/.local/bin/dmenu-wl | 3 ++ 6 files changed, 45 insertions(+), 25 deletions(-) (limited to 'sway-de') diff --git a/sway-de/install.sh b/sway-de/install.sh index 9c5ff5d..b80b7dd 100755 --- a/sway-de/install.sh +++ b/sway-de/install.sh @@ -6,16 +6,21 @@ # "desktop environment" style session. Relies on systemd for running # services as much as possible. -set -eo pipefail +set -euo pipefail -if command -v stow > /dev/null; then - STOWCMD="stow" +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 [ -z "$STOWCMD" ]; then - echo "requires 'stow'. run without '--skip-packages' to install." - exit 1 + +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) @@ -28,13 +33,6 @@ while [[ $# -gt 0 ]]; do esac done -set -u - -if ! command -v dnf > /dev/null !! [ ! -f /etc/fedora-release ]; then - echo "doesn't seem to be fedora workstation" - exit 1 -fi - if [ -z "$skip_packages" ]; then # install rpmfusion if it's not already installed @@ -49,17 +47,29 @@ if [ -z "$skip_packages" ]; then sudo dnf install \ sway waybar wob wofi foot lxpolkit mako cascadia-mono-pl-fonts \ udiskie libappindicator-gtk3 duplicity python3-b2sdk pass passmenu \ - brightnessctl vlc unzip vim wget git zsh stow + brightnessctl vlc unzip vim wget git zsh stow dnf-automatic 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 /home/matt/.dotfiles/sway-de/ \ - --target /home/matt/ \ + --dir "$(pwd)" \ + --target "$HOME" \ foot lxpolkit mako sway swaylock udiskie waybar wob wofi -# enable new systemd units and start them if sway is running and +# enable new systemd units and start them if sway is running sway_active=$(systemctl --user is-active sway-session.target) for unit in lxpolkit.service mako.service udiskie.service wob.service wob.socket; do if [ "active" = "$sway_active" ]; then @@ -68,3 +78,6 @@ for unit in lxpolkit.service mako.service udiskie.service wob.service wob.socket systemctl --user enable "$(basename "$unit")" fi done + +# enable dnf automatic updates +sudo systemctl enable --now dnf-automatic-install.timer diff --git a/sway-de/sway/.config/sway/config b/sway-de/sway/.config/sway/config index daca478..7636ee0 100644 --- a/sway-de/sway/.config/sway/config +++ b/sway-de/sway/.config/sway/config @@ -255,9 +255,5 @@ include /etc/sway/config.d/*.conf for_window [app_id="firefox"] inhibit_idle fullscreen assign [app_id="firefox"] workspace number 1 -workspace 2 -exec $term -exec firefox & - bindsym $mod+comma exec PATH=~/.local/bin:$PATH /usr/bin/passmenu diff --git a/sway-de/swaylock/.config/swaylock/config b/sway-de/swaylock/.config/swaylock/config index f8ceefc..f4ee89e 100644 --- a/sway-de/swaylock/.config/swaylock/config +++ b/sway-de/swaylock/.config/swaylock/config @@ -1,2 +1,2 @@ -image=~/.local/share/backgrounds/default +image=~/.local/share/backgrounds/locked ignore-empty-password diff --git a/sway-de/waybar/.config/waybar/config b/sway-de/waybar/.config/waybar/config index 17bade2..00a08e4 100644 --- a/sway-de/waybar/.config/waybar/config +++ b/sway-de/waybar/.config/waybar/config @@ -11,7 +11,8 @@ "format": "{icon}", "format-icons": { "1": "", - "2": "" + "2": "", + "3": "" } }, "clock#local": { diff --git a/sway-de/waybar/.config/waybar/style.css b/sway-de/waybar/.config/waybar/style.css index 3866d6f..36a330d 100644 --- a/sway-de/waybar/.config/waybar/style.css +++ b/sway-de/waybar/.config/waybar/style.css @@ -44,11 +44,11 @@ label { #workspaces label { padding: 0; + font-weight: bold; } #workspaces button { padding: 0 6px; - font-weight: normal; } #workspaces button:hover { @@ -61,9 +61,16 @@ label { background: #efefef; } +#custom-reboot, #network, #pulseaudio, #battery, #temperature, #idle_inhibitor { + min-width: 18px; +} + +#clock { + font-weight: 500; +} + #idle_inhibitor { margin: 0; - padding: 2px 12px 2px 6px; } #idle_inhibitor.activated { diff --git a/sway-de/wofi/.local/bin/dmenu-wl b/sway-de/wofi/.local/bin/dmenu-wl index 7ac2273..32d60df 100755 --- a/sway-de/wofi/.local/bin/dmenu-wl +++ b/sway-de/wofi/.local/bin/dmenu-wl @@ -1,4 +1,7 @@ #!/bin/bash +# +# shim to allow wofi to pretend to be dmenu, +# to allow pass to use it set -euo pipefail -- cgit v1.2.3