1
0
Fork 0

startx at login, change pipewire init, add xbps support to checkup and upgrades

This commit is contained in:
Luca Bilke 2023-05-25 18:58:01 +02:00
parent 505935bfb0
commit 515d4280eb
6 changed files with 53 additions and 34 deletions
.config
.local/bin

View file

@ -1,7 +1,2 @@
#!/bin/sh
. "$XDG_CONFIG_HOME/X11/xprofile"
run-parts "$XDG_CONFIG_HOME/X11/xinitrc.d"
exec dbus-run-session -- dwm
exec dbus-run-session -- sh $XDG_CONFIG_HOME/X11/realinit

View file

@ -6,6 +6,9 @@ start() {
xwallpaper --zoom "${XDG_DATA_HOME:-$HOME/.local/share}/bg" &
start pipewire
start pipewire -c pipewire-pulse.conf
start wireplumber
start remaps
start checkup
start playerctld daemon

View file

@ -236,13 +236,12 @@ context.exec = [
# but it is better to start it as a systemd service.
# Run the session manager with -h for options.
#
# { path = "/usr/bin/wireplumber" args = "" }
#{ path = "/usr/bin/wireplumber" args = "" }
#
# You can optionally start the pulseaudio-server here as well
# but it is better to start it as a systemd service.
# It can be interesting to start another daemon here that listens
# on another address with the -a option (eg. -a tcp:4713).
#
# { path = "/usr/bin/pipewire" args = "-c pipewire-pulse.conf" }
#{ path = "/usr/bin/pipewire" args = "-c pipewire-pulse.conf" }
]

View file

@ -61,3 +61,11 @@ export ANSIBLE_NOCOWS=1 # Stop those fucking cows in Ansible
localpath="$(find -L ~/.local/bin -type d -printf %p: | sed 's/.$//')"
export PATH="$PATH:$HOME/.local/share/npm-global/bin:$localpath"
export NVM_DIR="$HOME/.config/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]; then
exec startx
fi

View file

@ -12,12 +12,8 @@ confirmcheck() {
notify-send " Repository Sync" "Sync complete. No new packages for update."
}
failcheck() {
notify-send "Error downloading updates." "Check your internet connection, if $1 is already running, or run update manually to see errors."
}
if command -v pacman 1>/dev/null 2>&1; then
sudo pacman -Syyuw --noconfirm || failcheck pacman
sudo pacman -Syyuw --noconfirm || notify-send "Error downloading updates." "Check your internet connection, if pacman is already running, or run update manually to see errors."
if pacman -Qu | grep -v "\[ignored\]"; then
askupgrade
else
@ -26,10 +22,22 @@ if command -v pacman 1>/dev/null 2>&1; then
elif command -v apt 1>/dev/null 2>&1; then
n=$(sudo apt upgrade -dy 2>/dev/null | grep -m1 '^[0-9]\+ upgraded,' | tr -cd '0-9' | cut -c1-2)
if [ "$n" = '' ]; then
failcheck apt
notify-send "Error downloading updates." "Check your internet connection, if apt is already running, or run update manually to see errors."
elif [ "$n" = 00 ]; then
confirmcheck
else
askupgrade
fi
elif command -v xbps-install 1>/dev/null 2>&1; then
xbps-install -nuM 1>/tmp/xbps_updates 2>/tmp/xbps_errors
n="$(wc -l < /tmp/xbps_updates)"
ne="$(grep broken /tmp/xbps_errors | wc -l)"
n="$(xbps-install -M -n -u | grep -Fe update -e install | wc -l)"
if [ "$n" = "0" ] && [ "$ne" = "0" ]; then
confirmcheck
elif [ "$n" -gt 1 ] && [ "$ne" = "0" ]; then
askupgrade
else
notify-send "Error downloading updates." "$(cut -d " " -f 1,5 /tmp/xbps_errors)"
fi
fi

View file

@ -1,27 +1,9 @@
#!/bin/sh
printf "Beginning upgrade.\\n"
if command -v paru 1>/dev/null 2>&1; then
paru -Syu
elif command -v yay 1>/dev/null 2>&1; then
yay -Syu
elif command -v pacman 1>/dev/null 2>&1; then
pacman -Syu
fi
command -v apt 1>/dev/null 2>&1 && sudo apt upgrade
# This pkill is already handled by apt/pacman hooks:
# pkill -RTMIN+8 "${STATUSBAR:-dwmblocks}"
# apt
# create the file /etc/apt/apt.conf.d/80statusbar containing the following
# DPkg::Post-Invoke {"/usr/bin/pkill -RTMIN+8 dwmblocks";};
# pacman
# pacman --------------------------------------------------------------------------
# create the file /usr/share/libalpm/hooks/statusbar.hook containing the following
# [Trigger]
@ -33,6 +15,30 @@ command -v apt 1>/dev/null 2>&1 && sudo apt upgrade
# When = PostTransaction
# Exec = /usr/bin/pkill -RTMIN+8 dwmblocks
printf "Beginning upgrade.\\n"
if command -v paru 1>/dev/null 2>&1; then
paru -Syu
elif command -v yay 1>/dev/null 2>&1; then
yay -Syu
elif command -v pacman 1>/dev/null 2>&1; then
pacman -Syu
fi
# apt -----------------------------------------------------------------------------
# create the file /etc/apt/apt.conf.d/80statusbar containing the following
# DPkg::Post-Invoke {"/usr/bin/pkill -RTMIN+8 dwmblocks";};
command -v apt 1>/dev/null 2>&1 && sudo apt upgrade
# void ----------------------------------------------------------------------------
# Void doesn't have post-install hooks at all, and including pkills in the package hooks isn't feasible
# Instead pkill is called in this script. Manually running updates will cause the status bar to desync
command -v xbps-install 1>/dev/null 2>&1 && sudo xbps-install -Syu && pkill -RTMIN+8 "${STATUSBAR:-dwmblocks}"
printf "\\nUpgrade complete.\\nPress <Enter> to exit window.\\n\\n"
read -r _
exit