diff --git a/.config/eww/scripts/volume2.py b/.config/eww/scripts/volume2.py index 7f4b548..3f4dcab 100755 --- a/.config/eww/scripts/volume2.py +++ b/.config/eww/scripts/volume2.py @@ -19,7 +19,9 @@ class EndpointBinding: def __init__(self, endpoint: Wp.Endpoint, callback): self.callback = callback - self.volume_binding = endpoint.connect_after("notify::volume", callback) + self.volume_binding = endpoint.connect_after( + "notify::volume", self._volume_callback + ) self.mute_binding = endpoint.connect_after("notify::mute", callback) self.id = endpoint.props.id self.endpoint = endpoint @@ -27,9 +29,16 @@ class EndpointBinding: def hash(self) -> int: return self.volume_binding + (self.mute_binding << 32) + def _volume_callback(self, endpoint, param): + if round(endpoint.props.volume * 100) > 100: + self.endpoint.set_volume(1) + else: + self.callback(endpoint, param) + def __del__(self): """Object cleanup.""" self.endpoint.disconnect_by_func(self.callback) + self.endpoint.disconnect_by_func(self._volume_callback) class AudioController(Gio.Application): @@ -95,6 +104,8 @@ class AudioController(Gio.Application): async def _do_dump(self): + await asyncio.sleep(0.1) + json.dump( { "inputs": [ diff --git a/.config/sway/swayidle##class.laptop b/.config/sway/swayidle##class.laptop index 8fd3132..069e070 100644 --- a/.config/sway/swayidle##class.laptop +++ b/.config/sway/swayidle##class.laptop @@ -1,6 +1,6 @@ # -*-conf-*- -timeout 10 'systemctl --user is-active screenlock.service && swaymsg output "*" power off' resume 'systemctl --user is-active screenlock.service && swaymsg output "*" power on' +timeout 10 'systemctl --user start screens-off.target &> /dev/null' resume 'systemctl --user stop screens-off.target' lock 'systemctl --user start screenlock.service' before-sleep 'systemctl --user start screenlock.service' unlock 'systemctl --user stop screenlock.service' diff --git a/.config/sway/workspaces.json##hostname.gathering-storm b/.config/sway/workspaces.json##hostname.ezri-laptop similarity index 99% rename from .config/sway/workspaces.json##hostname.gathering-storm rename to .config/sway/workspaces.json##hostname.ezri-laptop index fdb8fb3..b531340 100644 --- a/.config/sway/workspaces.json##hostname.gathering-storm +++ b/.config/sway/workspaces.json##hostname.ezri-laptop @@ -67,8 +67,7 @@ "index": 10, "name": "server management", "exec": "virt-manager", - "program_name": "virt-manager", - "systemd": false + "program_name": "virt-manager" }, { "index": 11, diff --git a/.config/systemd/user.conf b/.config/systemd/user.conf index 2b7a484..af09947 100644 --- a/.config/systemd/user.conf +++ b/.config/systemd/user.conf @@ -1,2 +1,2 @@ [Manager] -DefaultEnvironment=ELECTRON_OZONE_PLATFORM_HINT=wayland +DefaultEnvironment=ELECTRON_OZONE_PLATFORM_HINT=wayland ORACLE_HOME=/usr diff --git a/.config/systemd/user/logind-idlehint.service b/.config/systemd/user/logind-idlehint.service index 84ea7b6..ce1f466 100644 --- a/.config/systemd/user/logind-idlehint.service +++ b/.config/systemd/user/logind-idlehint.service @@ -12,4 +12,3 @@ Type=oneshot RemainAfterExit=yes ExecStart=busctl call org.freedesktop.login1 /org/freedesktop/login1/session/auto org.freedesktop.login1.Session SetIdleHint b 1 ExecStop=busctl call org.freedesktop.login1 /org/freedesktop/login1/session/auto org.freedesktop.login1.Session SetIdleHint b 0 -StopWhenUnneeded=yes diff --git a/.config/systemd/user/suspend-comms-apps.service b/.config/systemd/user/suspend-comms-apps.service index f0a9e44..b1729fa 100644 --- a/.config/systemd/user/suspend-comms-apps.service +++ b/.config/systemd/user/suspend-comms-apps.service @@ -8,7 +8,6 @@ Type=oneshot RemainAfterExit=yes ExecStart=bash -c 'echo 1 > /sys/fs/cgroup/user.slice/user-%U.slice/user@%U.service/app.slice/app-comms.slice/cgroup.freeze' ExecStop=bash -c 'echo 0 > /sys/fs/cgroup/user.slice/user-%U.slice/user@%U.service/app.slice/app-comms.slice/cgroup.freeze' -StopWhenUnneeded=yes [Install] WantedBy=idle.target diff --git a/.config/systemd/user/wallpaper.service b/.config/systemd/user/wallpaper.service index edb7fa0..5aaa78a 100644 --- a/.config/systemd/user/wallpaper.service +++ b/.config/systemd/user/wallpaper.service @@ -7,7 +7,7 @@ Before=sway-session.target Type=notify-reload ExecStart=%h/.local/lib/voidshell/background NotifyAccess=all -Scope=background.scope +Slice=background.slice [Install] WantedBy=sway-session.target diff --git a/.config/zsh/00-scope.zsh b/.config/zsh/00-scope.zsh index 1e03932..995d3bc 100644 --- a/.config/zsh/00-scope.zsh +++ b/.config/zsh/00-scope.zsh @@ -70,6 +70,8 @@ OPTIONS: the program from the shell's process tree, preventing the shell's job management from managing it. --env [=VALUE] - inherit the given environment variable from the shell, or set it if a value is given. --clean-env - disable the default set of inherited environment variables + --unit - set the unit name. Defaults to "invoke-@" for services, + "invoke--" for scopes. EOF return 0 ;; diff --git a/.config/zsh/alias.zsh b/.config/zsh/alias.zsh index baf809a..1ba770b 100644 --- a/.config/zsh/alias.zsh +++ b/.config/zsh/alias.zsh @@ -22,6 +22,8 @@ alias l='ls -lh' alias nuke='echo "Are you sure?"; read -q && rm -rf' +alias pkgfile='pkgfile -D $HOME/.cache/pkgfile' + alias sign='gpg --sign-with ezri@ezri.dev --detach-sign' alias verify='gpg --verify' diff --git a/.config/zsh/prompt.zsh b/.config/zsh/prompt.zsh index 7041c23..eff84b8 100644 --- a/.config/zsh/prompt.zsh +++ b/.config/zsh/prompt.zsh @@ -85,6 +85,7 @@ fi prompt_char="%(?.❯.%F{red}❯%f)" ssh_host="%F{cyan}[ %F{blue}%BRemote Console%b%f @ %F{magenta}%B${hostname}%(!.%F{red} as root.)%b%F{cyan} ]%f" localhost="%F{cyan}[ %F{magenta}%B${hostname}%(!.%F{red} as root.)%b %F{cyan}]%f" +login_shell="%F{cyan}[ %F{green}%BLogin Console%b%f @ %F{magenta}%B${hostname}%(!.%F{red} as root.)%b%F{cyan} ]%f" serial_host="%F{cyan}[ %F{magenta}${hostname}%(!.%F{red} as root.) %F{cyan}] %F{red}%y%f" container_host="%F{cyan}[ %F{blue}%B${hostname}%(!.%F{red} as root.)%b %F{cyan}]%f" returncode="%(?..%F{red}  %?%f)" @@ -102,6 +103,9 @@ elif [[ ${MACHINE_CHASSIS} == "container" ]] || [[ ${MACHINE_CHASSIS} == "vm" ]] elif [[ -v SSH_CLIENT ]]; then prompt_line2='${ssh_host}$pyenv_info_msg_0_ ${pwd}' history_line="${ssh_host}" +elif [[ -o login ]]; then + prompt_line2='${login_shell}$pyenv_info_msg_0_ ${pwd}' + history_line="${localhost}" else prompt_line2='${localhost}$pyenv_info_msg_0_ ${pwd}' history_line="${localhost}" diff --git a/.config/zsh/utils.zsh b/.config/zsh/utils.zsh index f786970..44b239e 100644 --- a/.config/zsh/utils.zsh +++ b/.config/zsh/utils.zsh @@ -138,6 +138,17 @@ function bwunlock() { } +function su { + local user + user=$1 + if [[ $user == '' ]]; then + user=root + fi + machinectl -q shell "${user}@" +} + +alias relog='exec machinectl -q shell "${USER}@"' + function urlencode { # credit to https://stackoverflow.com/a/34407620 for the jq solution local multiline=0 diff --git a/.emacs.d/settings.org b/.emacs.d/settings.org index dcf8b1c..1cf4ef5 100644 --- a/.emacs.d/settings.org +++ b/.emacs.d/settings.org @@ -653,6 +653,10 @@ Indent using tabs, render with tab-width of 2. entry (file+headline "~/org/todos.org" "Linked Tasks") "* TODO [#B] %?\n:Created: %T\n%i\n%a\nProposed Solution: " :empty-lines 0) + ("i" "Inlined To-Do" + entry (here) + "* TODO [#B] %?\n:Created: %T\n" + :empty-lines 0) ("m" "Meeting" entry (file+datetree "~/org/meetings.org") "* %? :meeting:%^g \n:Created: %T\n** Attendees\n- \n** Notes\n** Action Items\n" @@ -959,18 +963,18 @@ After installing the ~rust-analyzer~ program, the following can be used: ("C-c C-SPC" . mc/edit-lines) )) #+END_SRC -* Obsidian +* Databases +** Packages #+BEGIN_SRC emacs-lisp - ;; (use-package obsidian - ;; :ensure t - ;; :demand t - ;; :config - ;; (obsidian-specify-path "~/PersonalDocuments/Personal/TTRPG Vault") - ;; (global-obsidian-mode t) - ;; :custom - ;; :bind (:map obsidian-mode-map - ;; ("C-c C-o" . obsidian-follow-link-at-point) - ;; ("C-c C-b" . obsidian-backlink-jump) - ;; ("C-c C-l" . obsidian-insert-wikilink))) + (use-package sqlplus + :ensure t) +#+END_SRC +** SQL Connections +#+BEGIN_SRC emacs-lisp + (setq sql-connection-alist + '((zprod (sql-product 'oracle) + (sql-server "zprod.db.usu.edu") + (sql-user "Z_EZRI_BRIMHALL") + (sql-database "zprod")))) #+END_SRC diff --git a/.local/lib/voidshell/background b/.local/lib/voidshell/background index fe0420c..5e086d4 100755 --- a/.local/lib/voidshell/background +++ b/.local/lib/voidshell/background @@ -1,13 +1,40 @@ #!/usr/bin/env zsh +loglvl=() +typeset -A loglvl +loglvl[err]=3 +loglvl[warning]=4 +loglvl[notice]=5 +loglvl[info]=6 +loglvl[debug]=7 + +minlevel=$loglvl[${LOG_LEVEL:-info}] + +function writelog { + level=$loglvl[$1] + if ! (( minlevel > level )); then + return + fi + printf "<%d>%s\n" 1 "$1" 2 "$2" +} + +parserror=err + function parse-config { + + writelog debug "Checking for config file $HOME/.config/wallpaper/config" if ! [[ -f $HOME/.config/wallpaper/config ]]; then - echo "<3>Config does not exist, cannot operate." + writelog $parserror "Config does not exist, cannot operate." return 6 fi + + writelog debug "Loading config file" source $HOME/.config/wallpaper/config + IFS=' ' + + writelog debug "Config file loaded, got COLOR='$COLOR' IMAGE='$IMAGE' MODE='$MODE'" args=() @@ -16,27 +43,31 @@ function parse-config { if (( ${+COLOR} )); then args+="--color=${COLOR}" good_config=1 + writelog debug "Config is valid: COLOR is specified" fi if (( ${+IMAGE} )); then args+="--image=$IMAGE" good_config=1 + writelog debug "Config is valid: IMAGE is specified" fi if (( ${+MODE} )); then args+="--mode=$MODE" fi if ! [[ $good_config == '1' ]]; then - echo "<3>Missing COLOR or IMAGE, cannot set background." + writelog $parserror "Missing COLOR or IMAGE, cannot set background." return 78 fi + writelog debug "Arguments parsed, got args='$args'" + } function reload { systemd-notify --reloading --status "Reloading config" parse-config if (( ? != 0 )); then - echo "<3>Reload failed" + writelog err "Reload failed" systemd-notify --ready --status "Config reload failed. Background not changed." return fi @@ -45,6 +76,7 @@ function reload { } function stop { + writelog info "Received stop request, shutting down..." systemd-notify --stopping should_exit=1 kill $swaybg_pid @@ -52,6 +84,7 @@ function stop { parse-config exit_code=$? +parserror=warning if (( exit_code )); then exit $exit_code @@ -62,9 +95,11 @@ trap stop 15 should_exit=0 while [[ $should_exit == 0 ]]; do - (swaybg --output='*' $args |& awk -F" " '{$1="<6>"; $2=""; $3=""; print}') & + writelog debug "Launching swaybg" + swaybg --output='*' "$=args" & swaybg_pid=$! + writelog debug "swaybg launched with pid $swaybg_pid" sleep 0.1 - systemd-notify --ready --status "Background set" + systemd-notify --ready --status "Wallpaper set" wait done