Compare commits
5 Commits
ccd6122336
...
h7-volume
| Author | SHA1 | Date | |
|---|---|---|---|
|
f6a0c39228
|
|||
|
9c97e0e0ca
|
|||
|
59a8d1f5ab
|
|||
|
e42cde1f54
|
|||
|
2dc7427936
|
@@ -206,7 +206,8 @@ uzl "unzip -l"
|
|||||||
|
|
||||||
#s "systemctl suspend"
|
#s "systemctl suspend"
|
||||||
#s "xset dpms force off"
|
#s "xset dpms force off"
|
||||||
s "~/linux-config/scripts/executable_dual-monitor-slideshow"
|
#s "~/linux-config/scripts/executable_dual-monitor-slideshow"
|
||||||
|
s "fdfind -t f -e jpg -e png -e jpeg -e gif -e webp . /mnt/linux-files-2/Pictures/hevin | shuf | sxiv -S 5 -s f -i &"
|
||||||
# sl "i3lock-fancy && systemctl suspend"
|
# sl "i3lock-fancy && systemctl suspend"
|
||||||
# so "xset dpms force off"
|
# so "xset dpms force off"
|
||||||
xx "exit"
|
xx "exit"
|
||||||
@@ -343,7 +344,7 @@ id "identify"
|
|||||||
mst "sudo rm ~/st/config.h && sudo bear make -C ~/st install"
|
mst "sudo rm ~/st/config.h && sudo bear make -C ~/st install"
|
||||||
# mst "sudo ~/st/make-st.sh"
|
# mst "sudo ~/st/make-st.sh"
|
||||||
|
|
||||||
mlf2 "sudo mount /dev/sdd1 /mnt/linux-files-2"
|
mlf2 "sudo mount /dev/sdc1 /mnt/linux-files-2"
|
||||||
bkuh "sudo rsync -PraAX --exclude-from='/home/kevin/txt/exclude-dirs-backup-full.txt' /home '/mnt/linux-files-2/arch-2/full'"
|
bkuh "sudo rsync -PraAX --exclude-from='/home/kevin/txt/exclude-dirs-backup-full.txt' /home '/mnt/linux-files-2/arch-2/full'"
|
||||||
|
|
||||||
kgpg "kill -9 gpg-agent && gpg-agent"
|
kgpg "kill -9 gpg-agent && gpg-agent"
|
||||||
@@ -1077,6 +1078,8 @@ cl "npx ts-node src/cli.ts list-nfts -p 5 -t 100"
|
|||||||
clw "watch npx ts-node src/cli.ts list-nfts -p 5 -t 100"
|
clw "watch npx ts-node src/cli.ts list-nfts -p 5 -t 100"
|
||||||
vp "vercel --prod"
|
vp "vercel --prod"
|
||||||
|
|
||||||
|
cr "~/Applications/cursor.AppImage --no-sandbox &"
|
||||||
|
|
||||||
# ]]] work #
|
# ]]] work #
|
||||||
|
|
||||||
# red-hat [[[ #
|
# red-hat [[[ #
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
. "/home/kevin/.cache/wal/colors.sh"
|
. "/home/kevin/.cache/wal/colors.sh"
|
||||||
|
|
||||||
temps="$(sensors | rg 'temp1:.*' | awk '{ print $2 }' | rg -o '\d{2}' | \
|
# Read from k10temp's Tctl sensor for AMD CPU temperature
|
||||||
sort -r | sed 's/$/°C/' | tr '\n' ' ' | xargs)"
|
temp="$(sensors | rg 'Tctl:' | awk '{ print $2 }' | rg -o '\d{2}' | sed 's/$/°C/')"
|
||||||
printf "%s\n\n%s\n" "$temps" "$color7"
|
printf "%s\n\n%s\n" "$temp" "$color7"
|
||||||
|
|||||||
@@ -92,14 +92,13 @@ done
|
|||||||
# functions {{{ #
|
# functions {{{ #
|
||||||
|
|
||||||
if [[ -z "$MIXER" ]] ; then
|
if [[ -z "$MIXER" ]] ; then
|
||||||
|
# Use the default ALSA mixer
|
||||||
MIXER="default"
|
MIXER="default"
|
||||||
if amixer -D pulse info >/dev/null 2>&1 ; then
|
|
||||||
MIXER="pulse"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "$SCONTROL" ]] ; then
|
if [[ -z "$SCONTROL" ]] ; then
|
||||||
SCONTROL=$(amixer -D "$MIXER" scontrols | sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" | head -n1)
|
# Use the 'Master' control
|
||||||
|
SCONTROL="Master"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CAPABILITY=$(amixer -D $MIXER get $SCONTROL | sed -n "s/ Capabilities:.*cvolume.*/Capture/p")
|
CAPABILITY=$(amixer -D $MIXER get $SCONTROL | sed -n "s/ Capabilities:.*cvolume.*/Capture/p")
|
||||||
@@ -142,9 +141,7 @@ esac
|
|||||||
# print_format {{{ #
|
# print_format {{{ #
|
||||||
|
|
||||||
function print_format {
|
function print_format {
|
||||||
# echo $NAME
|
|
||||||
case $NAME in
|
case $NAME in
|
||||||
# *"USB"*)
|
|
||||||
*"Fiio"*)
|
*"Fiio"*)
|
||||||
SINK_SYMB=""
|
SINK_SYMB=""
|
||||||
;;
|
;;
|
||||||
@@ -155,8 +152,7 @@ function print_format {
|
|||||||
SINK_SYMB=" "
|
SINK_SYMB=" "
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
# echo "$1" | envsubst '${SYMB}${VOL}${INDEX}${NAME}'
|
eval "echo \"$1\""
|
||||||
echo "$1" | envsubst '${SINK_SYMB}${VOL}${INDEX}${NAME}'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# }}} print_format #
|
# }}} print_format #
|
||||||
@@ -164,38 +160,25 @@ function print_format {
|
|||||||
# print_block {{{ #
|
# print_block {{{ #
|
||||||
|
|
||||||
function print_block {
|
function print_block {
|
||||||
for name in INDEX NAME VOL MUTED; do
|
# Use amixer to get volume and mute status
|
||||||
read $name
|
VOL_INFO=$(amixer -D $MIXER get $SCONTROL | grep -m1 -oE '[0-9]+%|\[on\]|\[off\]')
|
||||||
done < <(pacmd list-sinks | grep "index:\|name:\|volume: front\|muted:" | grep -A3 '*')
|
VOL=$(echo "$VOL_INFO" | grep -oE '[0-9]+%' | head -1)
|
||||||
INDEX=$(echo "$INDEX" | grep -o '[0-9]\+')
|
|
||||||
VOL=$(echo "$VOL" | grep -o "[0-9]*%" | head -1 )
|
|
||||||
VOL="${VOL%?}"
|
VOL="${VOL%?}"
|
||||||
|
MUTED=$(echo "$VOL_INFO" | grep -oE '\[on\]|\[off\]')
|
||||||
|
|
||||||
NAME=$(echo "$NAME")
|
# Default name for ALSA
|
||||||
# NAME=$(echo "$NAME" | sed \
|
NAME=$(amixer -D $MIXER scontrols | sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" | head -n1)
|
||||||
# 's/.*<.*\.\(.*\)>.*/\1/; t;'\
|
|
||||||
# 's/.*<\(.*\)>.*/\1/; t;'\
|
|
||||||
# 's/.*/unknown/')
|
|
||||||
# NAME=$(echo "$NAME" | sed \
|
|
||||||
# 's/.*<.*\.\(.*\)\..*>.*/\1/; t;')
|
|
||||||
|
|
||||||
if [[ $USE_ALSA_NAME == 1 ]] ; then
|
if [[ $USE_ALSA_NAME == 1 ]] ; then
|
||||||
ALSA_NAME=$(pacmd list-sinks |\
|
ALSA_NAME=$(amixer -D $MIXER scontrols | sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" | head -n1)
|
||||||
awk '/^\s*\*/{f=1}/^\s*index:/{f=0}f' |\
|
|
||||||
grep "alsa.name\|alsa.mixer_name" |\
|
|
||||||
head -n1 |\
|
|
||||||
sed 's/.*= "\(.*\)".*/\1/')
|
|
||||||
NAME=${ALSA_NAME:-$NAME}
|
NAME=${ALSA_NAME:-$NAME}
|
||||||
elif [[ $USE_DESCRIPTION == 1 ]] ; then
|
elif [[ $USE_DESCRIPTION == 1 ]] ; then
|
||||||
DESCRIPTION=$(pacmd list-sinks |\
|
DESCRIPTION=$(amixer -D $MIXER scontrols | sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" | head -n1)
|
||||||
awk '/^\s*\*/{f=1}/^\s*index:/{f=0}f' |\
|
|
||||||
grep "device.description" |\
|
|
||||||
head -n1 |\
|
|
||||||
sed 's/.*= "\(.*\)".*/\1/')
|
|
||||||
NAME=${DESCRIPTION:-$NAME}
|
NAME=${DESCRIPTION:-$NAME}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $MUTED =~ "no" ]] ; then
|
# Fix mute status check
|
||||||
|
if [[ $MUTED == "[on]" ]] ; then
|
||||||
SYMB=$AUDIO_HIGH_SYMBOL
|
SYMB=$AUDIO_HIGH_SYMBOL
|
||||||
[[ $VOL -le $AUDIO_MED_THRESH ]] && SYMB=$AUDIO_MED_SYMBOL
|
[[ $VOL -le $AUDIO_MED_THRESH ]] && SYMB=$AUDIO_MED_SYMBOL
|
||||||
[[ $VOL -le $AUDIO_LOW_THRESH ]] && SYMB=$AUDIO_LOW_SYMBOL
|
[[ $VOL -le $AUDIO_LOW_THRESH ]] && SYMB=$AUDIO_LOW_SYMBOL
|
||||||
@@ -222,3 +205,141 @@ if [[ $SUBSCRIBE == 1 ]] ; then
|
|||||||
print_block
|
print_block
|
||||||
done < <(pactl subscribe | stdbuf -oL grep change)
|
done < <(pactl subscribe | stdbuf -oL grep change)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Hardware Configuration
|
||||||
|
#CARD=2
|
||||||
|
#SINK="alsa_output.pci-0000_30_00.6.analog-stereo"
|
||||||
|
#FRONT="Front Playback Switch"
|
||||||
|
#REAR="Surround Playback Switch"
|
||||||
|
#FRONT_VOL="Front Playback Volume"
|
||||||
|
#REAR_VOL="Surround Playback Volume"
|
||||||
|
|
||||||
|
## Debugging output
|
||||||
|
#LOG_FILE=~/.audio-toggle.log
|
||||||
|
#echo "=== $(date) ===" >> $LOG_FILE
|
||||||
|
|
||||||
|
## Get current active output (PulseAudio fallback)
|
||||||
|
#get_active_output() {
|
||||||
|
## Get full sink info for debugging
|
||||||
|
#SINK_INFO=$(pacmd list-sinks)
|
||||||
|
#echo "Full sink info:" >> $LOG_FILE
|
||||||
|
#echo "$SINK_INFO" >> $LOG_FILE
|
||||||
|
|
||||||
|
## Try alternative port detection method
|
||||||
|
#PORT=$(echo "$SINK_INFO" | awk -v sink="$SINK" '
|
||||||
|
#$1 == "name:" && $2 == "<"sink">" {active=1}
|
||||||
|
#active && /active port:/ {
|
||||||
|
## Extract port name between angle brackets
|
||||||
|
#match($0, /<[^>]+>/)
|
||||||
|
#port = substr($0, RSTART+1, RLENGTH-2)
|
||||||
|
#print port
|
||||||
|
#exit
|
||||||
|
#}
|
||||||
|
#')
|
||||||
|
|
||||||
|
#echo "Raw port detection: $PORT" >> $LOG_FILE
|
||||||
|
|
||||||
|
#if [[ "$PORT" == "analog-output-headphones" ]]; then
|
||||||
|
#echo "front"
|
||||||
|
#elif [[ "$PORT" == "analog-output-lineout" ]]; then
|
||||||
|
#echo "rear"
|
||||||
|
#else
|
||||||
|
#echo "unknown"
|
||||||
|
#fi
|
||||||
|
#}
|
||||||
|
|
||||||
|
## Switch outputs with hardware-level control
|
||||||
|
#switch_output() {
|
||||||
|
#echo "Starting switch to $1" >> $LOG_FILE
|
||||||
|
|
||||||
|
## First disable both outputs
|
||||||
|
#echo "Disabling both outputs" >> $LOG_FILE
|
||||||
|
## ALSA controls
|
||||||
|
#amixer -c $CARD set "$FRONT" mute >/dev/null
|
||||||
|
#amixer -c $CARD set "$FRONT_VOL" 0% >/dev/null
|
||||||
|
#amixer -c $CARD set "$REAR" mute >/dev/null
|
||||||
|
#amixer -c $CARD set "$REAR_VOL" 0% >/dev/null
|
||||||
|
## PulseAudio controls
|
||||||
|
#pactl set-sink-mute "$SINK" 1 >/dev/null
|
||||||
|
#sleep 0.2
|
||||||
|
|
||||||
|
#if [[ "$1" == "front" ]]; then
|
||||||
|
#echo "Enabling front output" >> $LOG_FILE
|
||||||
|
## Check if headphones port exists
|
||||||
|
#if echo "$SINK_INFO" | grep -q "analog-output-headphones"; then
|
||||||
|
#echo "Attempting to set port to analog-output-headphones" >> $LOG_FILE
|
||||||
|
#if ! pacmd set-sink-port "$SINK" "analog-output-headphones" 2>>$LOG_FILE; then
|
||||||
|
#echo "Port switch failed, trying alternative method" >> $LOG_FILE
|
||||||
|
#pactl set-sink-port "$SINK" "analog-output-headphones" 2>>$LOG_FILE || true
|
||||||
|
#fi
|
||||||
|
#else
|
||||||
|
#echo "Headphones port not available, using hardware controls only" >> $LOG_FILE
|
||||||
|
#fi
|
||||||
|
## Additional hardware control
|
||||||
|
#amixer -c $CARD set 'Headphone' unmute >/dev/null
|
||||||
|
#amixer -c $CARD set 'Speaker' mute >/dev/null
|
||||||
|
#pactl set-sink-mute "$SINK" 0 >/dev/null
|
||||||
|
## ALSA controls
|
||||||
|
#amixer -c $CARD set "$FRONT" unmute >/dev/null
|
||||||
|
#amixer -c $CARD set "$FRONT_VOL" 100% >/dev/null
|
||||||
|
#OUTPUT=" FRONT"
|
||||||
|
#else
|
||||||
|
#echo "Enabling rear output" >> $LOG_FILE
|
||||||
|
## PulseAudio controls
|
||||||
|
#echo "Attempting to set port to analog-output-lineout" >> $LOG_FILE
|
||||||
|
#if ! pacmd set-sink-port "$SINK" "analog-output-lineout" 2>>$LOG_FILE; then
|
||||||
|
#echo "Port switch failed, trying alternative method" >> $LOG_FILE
|
||||||
|
#pactl set-sink-port "$SINK" "analog-output-lineout" 2>>$LOG_FILE || true
|
||||||
|
#fi
|
||||||
|
## Additional hardware control
|
||||||
|
#amixer -c $CARD set 'Speaker' unmute >/dev/null
|
||||||
|
#amixer -c $CARD set 'Headphone' mute >/dev/null
|
||||||
|
#pactl set-sink-mute "$SINK" 0 >/dev/null
|
||||||
|
## ALSA controls
|
||||||
|
#amixer -c $CARD set "$REAR" unmute >/dev/null
|
||||||
|
#amixer -c $CARD set "$REAR_VOL" 100% >/dev/null
|
||||||
|
#OUTPUT=" REAR"
|
||||||
|
#fi
|
||||||
|
|
||||||
|
## Reset audio pipeline
|
||||||
|
#echo "Resetting audio pipeline" >> $LOG_FILE
|
||||||
|
#{ pactl suspend-sink "$SINK" 1 && sleep 0.2 && pactl suspend-sink "$SINK" 0; } >/dev/null 2>&1
|
||||||
|
|
||||||
|
## Verify switch
|
||||||
|
#echo "Verifying switch..." >> $LOG_FILE
|
||||||
|
#CURRENT=$(get_active_output)
|
||||||
|
#echo "Current output: $CURRENT" >> $LOG_FILE
|
||||||
|
#if [[ "$CURRENT" != "$1" ]]; then
|
||||||
|
#echo "Switch verification failed!" >> $LOG_FILE
|
||||||
|
## Force hardware-level switch
|
||||||
|
#echo "Forcing hardware-level switch..." >> $LOG_FILE
|
||||||
|
#if [[ "$1" == "front" ]]; then
|
||||||
|
#amixer -c $CARD set 'Headphone' unmute >/dev/null
|
||||||
|
#amixer -c $CARD set 'Speaker' mute >/dev/null
|
||||||
|
#else
|
||||||
|
#amixer -c $CARD set 'Speaker' unmute >/dev/null
|
||||||
|
#amixer -c $CARD set 'Headphone' mute >/dev/null
|
||||||
|
#fi
|
||||||
|
#fi
|
||||||
|
|
||||||
|
#echo "Switch complete" >> $LOG_FILE
|
||||||
|
#echo "$OUTPUT" # Output to i3blocks
|
||||||
|
#}
|
||||||
|
|
||||||
|
## Main execution
|
||||||
|
#case "${BLOCK_BUTTON:-}" in
|
||||||
|
#1)
|
||||||
|
#CURRENT=$(get_active_output)
|
||||||
|
#if [[ "$CURRENT" == "front" ]]; then
|
||||||
|
#switch_output "rear"
|
||||||
|
#else
|
||||||
|
#switch_output "front"
|
||||||
|
#fi
|
||||||
|
#;;
|
||||||
|
#*)
|
||||||
|
#CURRENT=$(get_active_output)
|
||||||
|
#[[ "$CURRENT" == "front" ]] && echo " FRONT" || echo " REAR"
|
||||||
|
#;;
|
||||||
|
#esac
|
||||||
|
|
||||||
|
#exit 0
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ autocmd FileType *css,gitcommit,haskell,htmldjango,html,graphql,javascript,javas
|
|||||||
\racket,tex,text,typescript,typescriptreact,yaml set tabstop=2 shiftwidth=2
|
\racket,tex,text,typescript,typescriptreact,yaml set tabstop=2 shiftwidth=2
|
||||||
" autocmd BufNewFile,BufRead *.md set filetype=markdown
|
" autocmd BufNewFile,BufRead *.md set filetype=markdown
|
||||||
" autocmd Filetype markdown set textwidth=0
|
" autocmd Filetype markdown set textwidth=0
|
||||||
|
autocmd Filetype markdown set textwidth=55
|
||||||
" autocmd Filetype html set foldmarker=0
|
" autocmd Filetype html set foldmarker=0
|
||||||
autocmd BufNewFile,BufRead *.gd set expandtab!
|
autocmd BufNewFile,BufRead *.gd set expandtab!
|
||||||
autocmd Filetype go set noexpandtab sw=4
|
autocmd Filetype go set noexpandtab sw=4
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ case $1 in
|
|||||||
ubuntu )
|
ubuntu )
|
||||||
backup_dest="$mount_dir/ubuntu"
|
backup_dest="$mount_dir/ubuntu"
|
||||||
;;
|
;;
|
||||||
|
ubuntu-h7 )
|
||||||
|
backup_dest="$mount_dir/ubuntu-h7"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
exclude_dirs_list="/home/kevin/txt/exclude-dirs-backup.txt"
|
exclude_dirs_list="/home/kevin/txt/exclude-dirs-backup.txt"
|
||||||
exclude_dirs_list_full="/home/kevin/txt/exclude-dirs-backup-full.txt"
|
exclude_dirs_list_full="/home/kevin/txt/exclude-dirs-backup-full.txt"
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
picom &
|
picom &
|
||||||
pulseaudio --start
|
|
||||||
imwheel
|
imwheel
|
||||||
xmodmap ~/.Xmodmap
|
xmodmap ~/.Xmodmap
|
||||||
|
|
||||||
@@ -11,6 +10,9 @@ xset r rate $XSET_DELAY $XSET_RATE
|
|||||||
picom &
|
picom &
|
||||||
imwheel &
|
imwheel &
|
||||||
numlockx on &
|
numlockx on &
|
||||||
start-pulseaudio-x11 &
|
|
||||||
|
#start-pulseaudio-x11 &
|
||||||
|
#sudo alsa force-reload
|
||||||
|
#pulseaudio --start
|
||||||
|
|
||||||
wal -i $(/home/kevin/scripts/shuffler "$HOME/Pictures/Backgrounds/dim/editing") &
|
wal -i $(/home/kevin/scripts/shuffler "$HOME/Pictures/Backgrounds/dim/editing") &
|
||||||
|
|||||||
Reference in New Issue
Block a user