Update
This commit is contained in:
@@ -1,27 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
current_volume=$(pamixer --get-volume)
|
||||
|
||||
case $1 in
|
||||
"raise")
|
||||
(( current_volume += 5 ))
|
||||
[[ current_volume -gt 100 ]] && current_volume=100
|
||||
|
||||
pamixer --set-volume $current_volume
|
||||
notify-send -t 250 "VOL: $current_volume"
|
||||
pamixer -i 2
|
||||
notify-send -t 250 "VOL: $(pamixer --get-volume)"
|
||||
pkill -RTMIN+1 i3blocks
|
||||
;;
|
||||
"lower")
|
||||
(( current_volume -= 5 ))
|
||||
[[ current_volume -lt 0 ]] && current_volume=0
|
||||
|
||||
pamixer --set-volume $current_volume
|
||||
notify-send -t 250 "VOL: $current_volume"
|
||||
pamixer -d 2
|
||||
notify-send -t 250 "VOL: $(pamixer --get-volume)"
|
||||
pkill -RTMIN+1 i3blocks
|
||||
;;
|
||||
"toggle_mute")
|
||||
pamixer --toggle-mute
|
||||
notify-send -t 300 "MUTE: $(pamixer --get-mute)"
|
||||
notify-send -t 250 "MUTE: $(pamixer --get-mute)"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
@@ -7,16 +7,16 @@ COLS="name,type,size,mountpoint"
|
||||
|
||||
drives="$(lsblk -rpo "$COLS" | awk '$2=="part"&&$4==""{printf "%s (%s)\n",$1,$3}')"
|
||||
[ -z "$drives" ] && exit 1
|
||||
chosen="$(echo "$drives" | ~/.scripts/dmen.sh -i -p "Mount which drive?" | awk '{print $1}')"
|
||||
chosen="$(echo "$drives" | ~/.scripts/dmenu.sh -i -p "Choose drive to mount:" | awk '{print $1}')"
|
||||
[ -z "$chosen" ] && exit 1
|
||||
sudo -A mount "$chosen" && exit 0
|
||||
# You may want to change the line below for more suggestions for mounting.
|
||||
# I.e. you can increase the depth of the search, or add directories.
|
||||
# This will increase the load time briefly though.
|
||||
mp="$(find /mnt /media /mount /home -type d -maxdepth 5 2>/dev/null | ~/.scripts/dmen.sh -i -p "Type in mount point.")"
|
||||
mp="$(find /mnt /media /mount /home -type d -maxdepth 5 2>/dev/null | ~/.scripts/dmen.sh -i -p "Mount point:")"
|
||||
[ "$mp" = "" ] && exit 1
|
||||
if [ ! -d "$mp" ]; then
|
||||
mkdiryn=$(printf "No\\nYes" | ~/.scripts/dmen.sh -i -p "$mp does not exist. Create it?")
|
||||
mkdiryn=$(printf "No\\nYes" | ~/.scripts/dmenu.sh -i -p "$mp does not exist. Create it?")
|
||||
[ "$mkdiryn" = "Yes" ] && sudo -A mkdir -p "$mp"
|
||||
fi
|
||||
sudo -A mount "$chosen" "$mp" && pgrep -x dunst && notify-send "$chosen mounted to $mp."
|
||||
6
.scripts/dmenu-run.sh
Executable file
6
.scripts/dmenu-run.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
. "${HOME}/.cache/wal/colors.sh"
|
||||
|
||||
dmenu_run -nb "$color0" -nf "$color15" -sb "$color1" -sf "$color15" "$@"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
drives=$(lsblk -nrpo "name,type,size,mountpoint" | awk '$2=="part"&&$4!~/\/boot|\/home$|SWAP/&&length($4)>1{printf "%s (%s) on %s\n",$1,$3,$4}')
|
||||
[ -z "$drives" ] && exit
|
||||
chosen=$(echo "$drives" | ~/.scripts/dmen.sh -i -p "Unmount which drive?" | awk '{print $1}')
|
||||
chosen=$(echo "$drives" | ~/.scripts/dmenu.sh -i -p "Choose drive to unmount:" | awk '{print $1}')
|
||||
[ -z "$chosen" ] && exit
|
||||
sudo -A umount "$chosen" && pgrep -x dunst && notify-send "$chosen unmounted."
|
||||
|
||||
8
.scripts/dmenu-wal.sh
Executable file
8
.scripts/dmenu-wal.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
wallpapers=(~/.wallpapers/*)
|
||||
[ -z "$wallpapers" ] && exit
|
||||
chosen=$(printf "%s\n" "${wallpapers[@]}" | cut -c24-80 | ~/.scripts/dmenu.sh -i -p "Choose wallpaper:")
|
||||
[ -z "$chosen" ] && exit
|
||||
~/.scripts/wal.sh ~/.wallpapers/$chosen
|
||||
|
||||
6
.scripts/dmenu.sh
Executable file
6
.scripts/dmenu.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
. "${HOME}/.cache/wal/colors.sh"
|
||||
|
||||
dmenu -nb "$color0" -nf "$color15" -sb "$color1" -sf "$color15" "$@"
|
||||
|
||||
@@ -13,12 +13,12 @@ case $1 in
|
||||
pkill -RTMIN+2 i3blocks
|
||||
;;
|
||||
"lower")
|
||||
mpc volume -5
|
||||
mpc volume -2
|
||||
notify-send -t 250 "VOL: $(mpc volume | awk '{match($2,"[0-9]*",a)}END{print a[0]}')"
|
||||
pkill -RTMIN+2 i3blocks
|
||||
;;
|
||||
"raise")
|
||||
mpc volume +5
|
||||
mpc volume +2
|
||||
notify-send -t 250 "VOL: $(mpc volume | awk '{match($2,"[0-9]*",a)}END{print a[0]}')"
|
||||
pkill -RTMIN+2 i3blocks
|
||||
;;
|
||||
|
||||
35
.scripts/vfioswap.sh
Executable file
35
.scripts/vfioswap.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "this program requires root access"
|
||||
exit
|
||||
fi
|
||||
|
||||
kernel_modules="vfio_pci vfio vfio_iommu_type1 vfio_virqfd"
|
||||
|
||||
select choice1 in "enable vfio" "disable vfio" "exit"; do
|
||||
case $choice1 in
|
||||
"enable vfio")
|
||||
sudo echo "options vfio-pci ids=1002:67b1,1002:aac8" >> /etc/modprobe.d/vfio.conf
|
||||
sudo sed -i -e "s/MODULES=()/MODULES=($kernel_modules)/g" /etc/mkinitcpio.conf
|
||||
break;;
|
||||
"disable vfio")
|
||||
sudo rm /etc/modprobe.d/vfio.conf
|
||||
sudo sed -i -e "s/MODULES=($kernel_modules)/MODULES=()/g" /etc/mkinitcpio.conf
|
||||
break;;
|
||||
"exit")
|
||||
exit;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "regenerate the initramfs?"
|
||||
select choice2 in "yes" "no"; do
|
||||
case $choice2 in
|
||||
"yes")
|
||||
sudo mkinitcpio -p linux
|
||||
break;;
|
||||
"no")
|
||||
exit;;
|
||||
esac
|
||||
done
|
||||
|
||||
9
.scripts/wal.sh
Executable file
9
.scripts/wal.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
files=(~/.wallpapers/*)
|
||||
wal -i ${files[RANDOM % ${#files[@]}]} -a 80
|
||||
else
|
||||
wal -i $1 -a 80
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user