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

@ -1,5 +1,5 @@
# Vertical Candidate List # Vertical Candidate List
Vertical Candidate List=False Vertical Candidate List=True
# Use Per Screen DPI # Use Per Screen DPI
PerScreenDPI=True PerScreenDPI=True
# Use mouse wheel to go to prev or next page # Use mouse wheel to go to prev or next page

View file

@ -30,6 +30,8 @@ inner-pad=0
[colors] [colors]
background=000000dd background=000000dd
text=ebdbb2ff text=ebdbb2ff
prompt=ebdbb2ff
input=ebdbb2ff
# match=cb4b16ff # match=cb4b16ff
selection=ebdbb2ff selection=ebdbb2ff
selection-text=000000ff selection-text=000000ff

View file

@ -109,6 +109,7 @@ function pwdterm {
function ya() { function ya() {
local tmp="$(mktemp -t "yazi-cwd.XXXXX")" local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
yazi "$@" --cwd-file="$tmp" yazi "$@" --cwd-file="$tmp"
printf "\033]0;$TERMINAL\007" # Reset terminal name
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
cd -- "$cwd" cd -- "$cwd"
fi fi

View file

@ -7,5 +7,6 @@ sel="$(man -k . | fuzzel --dmenu -i -p "Man page:")"
# $program ($num) - $desc # $program ($num) - $desc
# Need to run `man $num $program` # Need to run `man $num $program`
page="$(echo "$sel" | awk -F'[()]' '{print $2" "$1}')" 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 case $1 in
sink) sink)
section="$(echo "$audio_info" \ section="$(echo "$audio_info" \
| awk '/Sinks:/,/Sink endpoints:/ {print}')" | awk '/Sinks:/,/Sources:/ {print}')"
;; ;;
source) source)
section="$(echo "$audio_info" \ section="$(echo "$audio_info" \
| awk '/Sources:/,/Source endpoints:/ {print}')" | awk '/Sources:/,/Filters:/ {print}')"
;; ;;
*) *)
echo "Aguments must be one of (sink|source)." echo "Aguments must be one of (sink|source)."

View file

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

View file

@ -3,27 +3,26 @@
# Restart wallpaper daemon synchronously # Restart wallpaper daemon synchronously
swww kill swww kill
pkill fcitx5
# Start daemons that can turn on asynchronously # Start daemons that can turn on asynchronously
( (
foot --server & foot --server &
systemctl --user restart network-manager-applet systemctl --user restart network-manager-applet
pkill fcitx5; fcitx5 & pkill emacs; emacs --daemon
emacs --daemon
) & ) &
ags &
# Rearrange monitors # Rearrange monitors
hyprmonitors auto hyprmonitors auto
systemctl --user restart hyprland-autoname-workspaces systemctl --user restart hyprland-autoname-workspaces
# Set default workspace per monitor swww-daemon &
# hyprctl dispatch focusmonitor 1; hyprctl dispatch exec 'hyprdwm goto 1' fcitx5 &
# hyprctl dispatch focusmonitor +1; hyprctl dispatch exec 'hyprdwm goto 1' waybar &
# hyprctl dispatch focusmonitor +1; hyprctl dispatch exec 'hyprdwm goto 1'
# hyprctl dispatch focusmonitor 0
sleep 3 # Sometimes the monitor config does not want to apply properly on the first
swww init # 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 enable-ssh-support
no-allow-external-cache
pinentry-program /usr/local/bin/pinentry-wrapper pinentry-program /usr/local/bin/pinentry-wrapper