recent updates to random config stuff

This commit is contained in:
agryphus 2024-12-11 15:06:14 -05:00
parent 1df0f9f5f6
commit 8b55484b02
8 changed files with 33 additions and 24 deletions

View file

@ -7,5 +7,6 @@ sel="$(man -k . | fuzzel --dmenu -i -p "Man page:")"
# $program ($num) - $desc
# Need to run `man $num $program`
page="$(echo "$sel" | awk -F'[()]' '{print $2" "$1}')"
nohup $TERMINAL -e man $page >/dev/null 2>&1 &
# nohup $TERMINAL -e man $page >/dev/null 2>&1 &
hyprctl dispatch exec [floating] "foot -W 78x38 -e man $page"

View file

@ -7,11 +7,11 @@ audio_info="$(wpctl status \
case $1 in
sink)
section="$(echo "$audio_info" \
| awk '/Sinks:/,/Sink endpoints:/ {print}')"
| awk '/Sinks:/,/Sources:/ {print}')"
;;
source)
section="$(echo "$audio_info" \
| awk '/Sources:/,/Source endpoints:/ {print}')"
| awk '/Sources:/,/Filters:/ {print}')"
;;
*)
echo "Aguments must be one of (sink|source)."

View file

@ -6,7 +6,12 @@ detatch=0
[ "$1" = "detatch" ] && detatch=1 && shift 1
# First arg must be a file
[ ! -f "$1" ] && echo "Not a file: '$1'" && exit 1
file="$1"
[ ! -f "$file" ] && echo "Not a file: '$file'" && exit 1
while [ -L "$file" ]; do
# Resolve symlinks
file=$(readlink "$file")
done
function launch_gui() {
if [ "$detatch" -eq 0 ]; then
@ -40,7 +45,7 @@ function launch_term() {
fi
}
case $(file --mime-type "$1" -b) in
case $(file --mime-type "$file" -b) in
application/javascript|\
application/json|\
application/pgp-encrypted|\
@ -50,18 +55,18 @@ case $(file --mime-type "$1" -b) in
case "${1##*.}" in
org|typ)
# Any "document" like file ought to be in emacs
launch_gui emacsclient -c "$1"
launch_gui emacsclient -c "$file"
exit
;;
esac
launch_term nvim "$1"
launch_term nvim "$file"
;;
image/*)
launch_gui nsxiv "$1"
launch_gui nsxiv "$file"
;;
video/*)
launch_gui mpv -quiet "$1"
launch_gui mpv -quiet "$file"
;;
application/epub*|\
application/octet-stream|\
@ -69,13 +74,13 @@ case $(file --mime-type "$1" -b) in
application/postscript|\
application/vnd.djvu|\
image/vnd.djvu)
launch_gui zathura "$1"
launch_gui zathura "$file"
;;
audio/*|\
video/x-ms-asf)
[ -z "$(mediainfo "$1" | grep "Cover\s*: Yes")" ] \
&& (launch_term mpv --audio-display=no "$1") \
|| (launch_gui mpv "$1")
&& (launch_term mpv --audio-display=no "$file") \
|| (launch_gui mpv "$file")
;;
application/msword|\
application/octet-stream|\
@ -92,7 +97,7 @@ case $(file --mime-type "$1" -b) in
application/vnd.openxmlformats-officedocument.presentationml.presentation|\
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet|\
application/vnd.openxmlformats-officedocument.wordprocessingml.document)
launch_gui libreoffice "$1"
launch_gui libreoffice "$file"
;;
*)
;;

View file

@ -3,27 +3,26 @@
# Restart wallpaper daemon synchronously
swww kill
pkill fcitx5
# Start daemons that can turn on asynchronously
(
foot --server &
systemctl --user restart network-manager-applet
pkill fcitx5; fcitx5 &
emacs --daemon
pkill emacs; emacs --daemon
) &
ags &
# Rearrange monitors
hyprmonitors auto
systemctl --user restart hyprland-autoname-workspaces
# Set default workspace per monitor
# hyprctl dispatch focusmonitor 1; hyprctl dispatch exec 'hyprdwm goto 1'
# hyprctl dispatch focusmonitor +1; hyprctl dispatch exec 'hyprdwm goto 1'
# hyprctl dispatch focusmonitor +1; hyprctl dispatch exec 'hyprdwm goto 1'
# hyprctl dispatch focusmonitor 0
swww-daemon &
fcitx5 &
waybar &
sleep 3
swww init
# Sometimes the monitor config does not want to apply properly on the first
# go. I then have to reload the configuration to make sure that the monitors
# are actually in their intended place.
hyprctl reload

View file

@ -1,3 +1,4 @@
enable-ssh-support
no-allow-external-cache
pinentry-program /usr/local/bin/pinentry-wrapper