Updated some stuff, this ship may be sinking
This commit is contained in:
parent
364e7c94a2
commit
61b96b3f38
@ -19,7 +19,9 @@ class EndpointBinding:
|
|||||||
|
|
||||||
def __init__(self, endpoint: Wp.Endpoint, callback):
|
def __init__(self, endpoint: Wp.Endpoint, callback):
|
||||||
self.callback = 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.mute_binding = endpoint.connect_after("notify::mute", callback)
|
||||||
self.id = endpoint.props.id
|
self.id = endpoint.props.id
|
||||||
self.endpoint = endpoint
|
self.endpoint = endpoint
|
||||||
@ -27,9 +29,16 @@ class EndpointBinding:
|
|||||||
def hash(self) -> int:
|
def hash(self) -> int:
|
||||||
return self.volume_binding + (self.mute_binding << 32)
|
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):
|
def __del__(self):
|
||||||
"""Object cleanup."""
|
"""Object cleanup."""
|
||||||
self.endpoint.disconnect_by_func(self.callback)
|
self.endpoint.disconnect_by_func(self.callback)
|
||||||
|
self.endpoint.disconnect_by_func(self._volume_callback)
|
||||||
|
|
||||||
|
|
||||||
class AudioController(Gio.Application):
|
class AudioController(Gio.Application):
|
||||||
@ -95,6 +104,8 @@ class AudioController(Gio.Application):
|
|||||||
|
|
||||||
async def _do_dump(self):
|
async def _do_dump(self):
|
||||||
|
|
||||||
|
await asyncio.sleep(0.1)
|
||||||
|
|
||||||
json.dump(
|
json.dump(
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# -*-conf-*-
|
# -*-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'
|
lock 'systemctl --user start screenlock.service'
|
||||||
before-sleep 'systemctl --user start screenlock.service'
|
before-sleep 'systemctl --user start screenlock.service'
|
||||||
unlock 'systemctl --user stop screenlock.service'
|
unlock 'systemctl --user stop screenlock.service'
|
||||||
|
|||||||
@ -67,8 +67,7 @@
|
|||||||
"index": 10,
|
"index": 10,
|
||||||
"name": "server management",
|
"name": "server management",
|
||||||
"exec": "virt-manager",
|
"exec": "virt-manager",
|
||||||
"program_name": "virt-manager",
|
"program_name": "virt-manager"
|
||||||
"systemd": false
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index": 11,
|
"index": 11,
|
||||||
@ -1,2 +1,2 @@
|
|||||||
[Manager]
|
[Manager]
|
||||||
DefaultEnvironment=ELECTRON_OZONE_PLATFORM_HINT=wayland
|
DefaultEnvironment=ELECTRON_OZONE_PLATFORM_HINT=wayland ORACLE_HOME=/usr
|
||||||
|
|||||||
@ -12,4 +12,3 @@ Type=oneshot
|
|||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
ExecStart=busctl call org.freedesktop.login1 /org/freedesktop/login1/session/auto org.freedesktop.login1.Session SetIdleHint b 1
|
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
|
ExecStop=busctl call org.freedesktop.login1 /org/freedesktop/login1/session/auto org.freedesktop.login1.Session SetIdleHint b 0
|
||||||
StopWhenUnneeded=yes
|
|
||||||
|
|||||||
@ -8,7 +8,6 @@ Type=oneshot
|
|||||||
RemainAfterExit=yes
|
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'
|
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'
|
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]
|
[Install]
|
||||||
WantedBy=idle.target
|
WantedBy=idle.target
|
||||||
|
|||||||
@ -7,7 +7,7 @@ Before=sway-session.target
|
|||||||
Type=notify-reload
|
Type=notify-reload
|
||||||
ExecStart=%h/.local/lib/voidshell/background
|
ExecStart=%h/.local/lib/voidshell/background
|
||||||
NotifyAccess=all
|
NotifyAccess=all
|
||||||
Scope=background.scope
|
Slice=background.slice
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=sway-session.target
|
WantedBy=sway-session.target
|
||||||
|
|||||||
@ -70,6 +70,8 @@ OPTIONS:
|
|||||||
the program from the shell's process tree, preventing the shell's job management from managing it.
|
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.
|
--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
|
--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
|
EOF
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
|
|||||||
@ -22,6 +22,8 @@ alias l='ls -lh'
|
|||||||
|
|
||||||
alias nuke='echo "Are you sure?"; read -q && rm -rf'
|
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 sign='gpg --sign-with ezri@ezri.dev --detach-sign'
|
||||||
alias verify='gpg --verify'
|
alias verify='gpg --verify'
|
||||||
|
|
||||||
|
|||||||
@ -85,6 +85,7 @@ fi
|
|||||||
prompt_char="%(?.❯.%F{red}❯%f)"
|
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"
|
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"
|
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"
|
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"
|
container_host="%F{cyan}[ %F{blue}%B${hostname}%(!.%F{red} as root.)%b %F{cyan}]%f"
|
||||||
returncode="%(?..%F{red} %?%f)"
|
returncode="%(?..%F{red} %?%f)"
|
||||||
@ -102,6 +103,9 @@ elif [[ ${MACHINE_CHASSIS} == "container" ]] || [[ ${MACHINE_CHASSIS} == "vm" ]]
|
|||||||
elif [[ -v SSH_CLIENT ]]; then
|
elif [[ -v SSH_CLIENT ]]; then
|
||||||
prompt_line2='${ssh_host}$pyenv_info_msg_0_ ${pwd}'
|
prompt_line2='${ssh_host}$pyenv_info_msg_0_ ${pwd}'
|
||||||
history_line="${ssh_host}"
|
history_line="${ssh_host}"
|
||||||
|
elif [[ -o login ]]; then
|
||||||
|
prompt_line2='${login_shell}$pyenv_info_msg_0_ ${pwd}'
|
||||||
|
history_line="${localhost}"
|
||||||
else
|
else
|
||||||
prompt_line2='${localhost}$pyenv_info_msg_0_ ${pwd}'
|
prompt_line2='${localhost}$pyenv_info_msg_0_ ${pwd}'
|
||||||
history_line="${localhost}"
|
history_line="${localhost}"
|
||||||
|
|||||||
@ -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 {
|
function urlencode {
|
||||||
# credit to https://stackoverflow.com/a/34407620 for the jq solution
|
# credit to https://stackoverflow.com/a/34407620 for the jq solution
|
||||||
local multiline=0
|
local multiline=0
|
||||||
|
|||||||
@ -653,6 +653,10 @@ Indent using tabs, render with tab-width of 2.
|
|||||||
entry (file+headline "~/org/todos.org" "Linked Tasks")
|
entry (file+headline "~/org/todos.org" "Linked Tasks")
|
||||||
"* TODO [#B] %?\n:Created: %T\n%i\n%a\nProposed Solution: "
|
"* TODO [#B] %?\n:Created: %T\n%i\n%a\nProposed Solution: "
|
||||||
:empty-lines 0)
|
:empty-lines 0)
|
||||||
|
("i" "Inlined To-Do"
|
||||||
|
entry (here)
|
||||||
|
"* TODO [#B] %?\n:Created: %T\n"
|
||||||
|
:empty-lines 0)
|
||||||
("m" "Meeting"
|
("m" "Meeting"
|
||||||
entry (file+datetree "~/org/meetings.org")
|
entry (file+datetree "~/org/meetings.org")
|
||||||
"* %? :meeting:%^g \n:Created: %T\n** Attendees\n- \n** Notes\n** Action Items\n"
|
"* %? :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)
|
("C-c C-SPC" . mc/edit-lines)
|
||||||
))
|
))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
* Obsidian
|
* Databases
|
||||||
|
** Packages
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
;; (use-package obsidian
|
(use-package sqlplus
|
||||||
;; :ensure t
|
:ensure t)
|
||||||
;; :demand t
|
#+END_SRC
|
||||||
;; :config
|
** SQL Connections
|
||||||
;; (obsidian-specify-path "~/PersonalDocuments/Personal/TTRPG Vault")
|
#+BEGIN_SRC emacs-lisp
|
||||||
;; (global-obsidian-mode t)
|
(setq sql-connection-alist
|
||||||
;; :custom
|
'((zprod (sql-product 'oracle)
|
||||||
;; :bind (:map obsidian-mode-map
|
(sql-server "zprod.db.usu.edu")
|
||||||
;; ("C-c C-o" . obsidian-follow-link-at-point)
|
(sql-user "Z_EZRI_BRIMHALL")
|
||||||
;; ("C-c C-b" . obsidian-backlink-jump)
|
(sql-database "zprod"))))
|
||||||
;; ("C-c C-l" . obsidian-insert-wikilink)))
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|||||||
@ -1,13 +1,40 @@
|
|||||||
#!/usr/bin/env zsh
|
#!/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 {
|
function parse-config {
|
||||||
|
|
||||||
|
writelog debug "Checking for config file $HOME/.config/wallpaper/config"
|
||||||
|
|
||||||
if ! [[ -f $HOME/.config/wallpaper/config ]]; then
|
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
|
return 6
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
writelog debug "Loading config file"
|
||||||
|
|
||||||
source $HOME/.config/wallpaper/config
|
source $HOME/.config/wallpaper/config
|
||||||
|
IFS=' '
|
||||||
|
|
||||||
|
writelog debug "Config file loaded, got COLOR='$COLOR' IMAGE='$IMAGE' MODE='$MODE'"
|
||||||
|
|
||||||
args=()
|
args=()
|
||||||
|
|
||||||
@ -16,27 +43,31 @@ function parse-config {
|
|||||||
if (( ${+COLOR} )); then
|
if (( ${+COLOR} )); then
|
||||||
args+="--color=${COLOR}"
|
args+="--color=${COLOR}"
|
||||||
good_config=1
|
good_config=1
|
||||||
|
writelog debug "Config is valid: COLOR is specified"
|
||||||
fi
|
fi
|
||||||
if (( ${+IMAGE} )); then
|
if (( ${+IMAGE} )); then
|
||||||
args+="--image=$IMAGE"
|
args+="--image=$IMAGE"
|
||||||
good_config=1
|
good_config=1
|
||||||
|
writelog debug "Config is valid: IMAGE is specified"
|
||||||
fi
|
fi
|
||||||
if (( ${+MODE} )); then
|
if (( ${+MODE} )); then
|
||||||
args+="--mode=$MODE"
|
args+="--mode=$MODE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [[ $good_config == '1' ]]; then
|
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
|
return 78
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
writelog debug "Arguments parsed, got args='$args'"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function reload {
|
function reload {
|
||||||
systemd-notify --reloading --status "Reloading config"
|
systemd-notify --reloading --status "Reloading config"
|
||||||
parse-config
|
parse-config
|
||||||
if (( ? != 0 )); then
|
if (( ? != 0 )); then
|
||||||
echo "<3>Reload failed"
|
writelog err "Reload failed"
|
||||||
systemd-notify --ready --status "Config reload failed. Background not changed."
|
systemd-notify --ready --status "Config reload failed. Background not changed."
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
@ -45,6 +76,7 @@ function reload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function stop {
|
function stop {
|
||||||
|
writelog info "Received stop request, shutting down..."
|
||||||
systemd-notify --stopping
|
systemd-notify --stopping
|
||||||
should_exit=1
|
should_exit=1
|
||||||
kill $swaybg_pid
|
kill $swaybg_pid
|
||||||
@ -52,6 +84,7 @@ function stop {
|
|||||||
|
|
||||||
parse-config
|
parse-config
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
|
parserror=warning
|
||||||
|
|
||||||
if (( exit_code )); then
|
if (( exit_code )); then
|
||||||
exit $exit_code
|
exit $exit_code
|
||||||
@ -62,9 +95,11 @@ trap stop 15
|
|||||||
|
|
||||||
should_exit=0
|
should_exit=0
|
||||||
while [[ $should_exit == 0 ]]; do
|
while [[ $should_exit == 0 ]]; do
|
||||||
(swaybg --output='*' $args |& awk -F" " '{$1="<6>"; $2=""; $3=""; print}') &
|
writelog debug "Launching swaybg"
|
||||||
|
swaybg --output='*' "$=args" &
|
||||||
swaybg_pid=$!
|
swaybg_pid=$!
|
||||||
|
writelog debug "swaybg launched with pid $swaybg_pid"
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
systemd-notify --ready --status "Background set"
|
systemd-notify --ready --status "Wallpaper set"
|
||||||
wait
|
wait
|
||||||
done
|
done
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user