Updated some stuff, this ship may be sinking

This commit is contained in:
Ezri Brimhall 2025-09-22 11:54:41 -06:00
parent 364e7c94a2
commit 61b96b3f38
Signed by: ezri
GPG Key ID: 058A78E5680C6F24
13 changed files with 91 additions and 25 deletions

View File

@ -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": [

View File

@ -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'

View File

@ -67,8 +67,7 @@
"index": 10,
"name": "server management",
"exec": "virt-manager",
"program_name": "virt-manager",
"systemd": false
"program_name": "virt-manager"
},
{
"index": 11,

View File

@ -1,2 +1,2 @@
[Manager]
DefaultEnvironment=ELECTRON_OZONE_PLATFORM_HINT=wayland
DefaultEnvironment=ELECTRON_OZONE_PLATFORM_HINT=wayland ORACLE_HOME=/usr

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -70,6 +70,8 @@ OPTIONS:
the program from the shell's process tree, preventing the shell's job management from managing it.
--env <VAR>[=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 <UNIT> - set the unit name. Defaults to "invoke-<shell PID>@<random>" for services,
"invoke-<shell PID>-<random>" for scopes.
EOF
return 0
;;

View File

@ -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'

View File

@ -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}"

View File

@ -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

View File

@ -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

View File

@ -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