diff --git a/TODO.md b/TODO.md index d7dd14e..624a073 100644 --- a/TODO.md +++ b/TODO.md @@ -12,7 +12,18 @@ - Separate scripts that are used for configurations / store them somewhere aside from `~/.local/bin` -- Remove system-d stuff (don't think it's needed). - Clipse didn't work when installed on a new machine when I try to use the config in the dotfiles, but works if I use the default config. Need to explore - why. + why (current thoughts are it has to do with creating the + clipboard_history.json file and not letting clipse do it automatically). +- Set sddm login theme, currently it doesn't allow me to echo values into the + /etc/sddm.conf file, also need to edit the theme in + `/usr/share/sddm/themes/catppuccin-mocha/theme.conf` to use the wallpaper as a + background image. + - Note: The background needs to be copied into the theme's background + directory. It didn't seem to work when I just set the path to somewhere in + my home directory. +- Add script to generate yubikey authentication using the pam-u2f module + [documentation](https://wiki.archlinux.org/title/Universal_2nd_Factor). + - Note: that the directory this is stored in MUST be ~/.config/Yubico (I tried + using ~/.config/yubico and it didn't work) diff --git a/hypr/autostart.conf b/hypr/autostart.conf index b04af2c..3b6c62c 100644 --- a/hypr/autostart.conf +++ b/hypr/autostart.conf @@ -12,6 +12,5 @@ exec-once = uwsm app -- elephant exec-once = uwsm app -- swaync exec-once = uwsm app -- walker --gapplication-service & exec-once = uwsm app -- waybar -exec-once = clipse -listen - +exec-once = uwsm app -- clipse -listen diff --git a/scripts/arch/battery-monitor b/scripts/arch/battery-monitor new file mode 100755 index 0000000..8909589 --- /dev/null +++ b/scripts/arch/battery-monitor @@ -0,0 +1,32 @@ +#!/bin/zsh + +# Used with the systemd battery monitor service and timer to alert +# when the battery has dropped below the threshold and is not currently +# charging. + +THRESHOLD=20 # Notify when below 20% +NOTIFICATION_FLAG="/run/user/${UID}/user_battery_notified" + +function get-battery-percentage() { + local battery=$(upower --battery | grep percentage) + echo "${battery//[^0-9]/}" +} + +function send-battery-alert() { + notify-send -u critical \ + "Recharge battery!" "Batttery is down to ${1}" \ + -i battery-caution \ + -t 30000 +} + +battery_percentage=$(get-battery-percentage) +battery_state=$(upower --battery | grep -E state | awk '{print $2}') + +if [[ "$battery_state" == "discharging" && "$battery_percentage" -le "$THRESHOLD" ]]; then + if [ ! -f "$NOTIFICATION_FLAG" ]; then + send-battery-alert "$battery_percentage" + touch "$NOTIFICATION_FLAG" + fi +else + rm -f "$NOTIFICATION_FLAG" +fi diff --git a/scripts/enable-services.sh b/scripts/enable-services.sh index d77713c..c060c20 100755 --- a/scripts/enable-services.sh +++ b/scripts/enable-services.sh @@ -6,3 +6,4 @@ espanso service register sudo setcap "cap_dac_override+p" $(which espanso) systemctl --user enable --now logout-task.service +systemctl --user enable --now batter-monitor.timer diff --git a/scripts/install-pkg-arch.sh b/scripts/install-pkg-arch.sh index c389a6f..cbaf3e2 100755 --- a/scripts/install-pkg-arch.sh +++ b/scripts/install-pkg-arch.sh @@ -19,6 +19,7 @@ yay -S --noconfirm --needed \ bc \ btop \ catppuccin-gtk-theme-mocha \ + sddm-theme-catppuccin \ eza \ fastfetch \ fzf \ @@ -34,6 +35,7 @@ yay -S --noconfirm --needed \ nodejs \ npm \ nwg-look \ + pam-u2f \ pcsc-tools \ starship \ swaync \ diff --git a/scripts/link-config.sh b/scripts/link-config.sh index b5adef0..87a2a54 100755 --- a/scripts/link-config.sh +++ b/scripts/link-config.sh @@ -13,6 +13,7 @@ ln -sfv ~/.dotfiles/systemd ~/.config ln -sfv ~/.dotfiles/tree-sitter ~/.config ln -sfv ~/.dotfiles/walker ~/.config ln -sfv ~/.dotfiles/waybar ~/.config +ln -sfv ~/.dotfiles/yubico ~/.config # Espanso espanso service stop diff --git a/systemd/user/battery-monitor.service b/systemd/user/battery-monitor.service new file mode 100644 index 0000000..0b0cdcb --- /dev/null +++ b/systemd/user/battery-monitor.service @@ -0,0 +1,8 @@ +[Unit] +Description=Battery Monitor Service +After=graphical-session.target + +[Service] +Type=oneshot +ExecStart=%h/.local/bin/battery-monitor +Environment=DISPLAY=:0 diff --git a/systemd/user/battery-monitor.timer b/systemd/user/battery-monitor.timer new file mode 100644 index 0000000..ecf7b90 --- /dev/null +++ b/systemd/user/battery-monitor.timer @@ -0,0 +1,11 @@ +[Unit] +Description=Battery Monitor Timer +Requires=battery-monitor.service + +[Timer] +OnBootSec=1min +OnUnitActiveSec=30sec +AccuracySec=10sec + +[Install] +WantedBy=timers.target diff --git a/waybar/style.css b/waybar/style.css index 6ecd8bc..15bef35 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -6,6 +6,7 @@ @define-color yellow #f9e2af; @define-color peach #fab387; @define-color maroon #eba0ac; +@define-color green #a6e3a1; * { font-family: JetbrainsMono Nerd Font; @@ -93,15 +94,15 @@ #battery { border-radius: 10px 0px 0px 10px; - color: #a6d189; -} - -#battery.charging { - color: #a6d189; + color: @green; } #battery.warning:not(.charging) { - color: #e78284; + color: @yellow; +} + +#battery.critical:not(.charging) { + color: @red; } #backlight {