retabbing
This commit is contained in:
parent
bbb1c368a0
commit
ee3ac5fbcb
11 changed files with 200 additions and 199 deletions
|
@ -8,22 +8,22 @@ start() {
|
||||||
# Set up xsecurelock
|
# Set up xsecurelock
|
||||||
xset s 300
|
xset s 300
|
||||||
env \
|
env \
|
||||||
XSECURELOCK_AUTH_BACKGROUND_COLOR="#24283b" \
|
XSECURELOCK_AUTH_BACKGROUND_COLOR="#24283b" \
|
||||||
XSECURELOCK_AUTH_FOREGROUND_COLOR="#c0caf5" \
|
XSECURELOCK_AUTH_FOREGROUND_COLOR="#c0caf5" \
|
||||||
XSECURELOCK_AUTH_WARNING_COLOR="#f7768e" \
|
XSECURELOCK_AUTH_WARNING_COLOR="#f7768e" \
|
||||||
XSECURELOCK_BACKGROUND_COLOR="#15161E" \
|
XSECURELOCK_BACKGROUND_COLOR="#15161E" \
|
||||||
XSECURELOCK_DATETIME_FORMAT="%d.%m.%Y %H:%M" \
|
XSECURELOCK_DATETIME_FORMAT="%d.%m.%Y %H:%M" \
|
||||||
XSECURELOCK_PASSWORD_PROMPT="time_hex" \
|
XSECURELOCK_PASSWORD_PROMPT="time_hex" \
|
||||||
XSECURELOCK_AUTH_TIMEOUT=5 \
|
XSECURELOCK_AUTH_TIMEOUT=5 \
|
||||||
XSECURELOCK_BLANK_TIMEOUT=30 \
|
XSECURELOCK_BLANK_TIMEOUT=30 \
|
||||||
XSECURELOCK_BLANK_DPMS_STATE="off" \
|
XSECURELOCK_BLANK_DPMS_STATE="off" \
|
||||||
XSECURELOCK_BURNIN_MITIGATION=0 \
|
XSECURELOCK_BURNIN_MITIGATION=0 \
|
||||||
XSECURELOCK_DIM_FPS=60 \
|
XSECURELOCK_DIM_FPS=60 \
|
||||||
XSECURELOCK_SHOW_DATETIME=1 \
|
XSECURELOCK_SHOW_DATETIME=1 \
|
||||||
XSECURELOCK_SAVER="/usr/libexec/xscreensaver/cubicgrid" \
|
XSECURELOCK_SAVER="/usr/libexec/xscreensaver/cubicgrid" \
|
||||||
XSECURELOCK_SHOW_USERNAME=1 \
|
XSECURELOCK_SHOW_USERNAME=1 \
|
||||||
XSECURELOCK_SHOW_HOSTNAME=1 \
|
XSECURELOCK_SHOW_HOSTNAME=1 \
|
||||||
xss-lock -n /usr/libexec/xsecurelock/dimmer -l -- sh -c "xsecurelock -- playerctl pause || kill -9 -1" &
|
xss-lock -n /usr/libexec/xsecurelock/dimmer -l -- sh -c "xsecurelock -- playerctl pause || kill -9 -1" &
|
||||||
|
|
||||||
[ -r "$XDG_CONFIG_HOME/dwm/host.sh" ] && "$XDG_CONFIG_HOME/dwm/host.sh" &
|
[ -r "$XDG_CONFIG_HOME/dwm/host.sh" ] && "$XDG_CONFIG_HOME/dwm/host.sh" &
|
||||||
|
|
||||||
|
@ -32,8 +32,9 @@ remaps -qd
|
||||||
|
|
||||||
start unclutter -noevents &
|
start unclutter -noevents &
|
||||||
start gpgconf --launch gpg-agent
|
start gpgconf --launch gpg-agent
|
||||||
start dwmblocks
|
start env PATH="$HOME/.local/libexec/statusbar:$PATH" dwmblocks
|
||||||
start picom
|
start picom
|
||||||
start pipewire
|
start pipewire
|
||||||
start dunst
|
start dunst
|
||||||
start checkup
|
start checkup
|
||||||
|
start syncthingtray
|
||||||
|
|
|
@ -3,7 +3,7 @@ msgTag="brightness" # Arbitrary but unique message tag
|
||||||
highlight="#7aa2f7"
|
highlight="#7aa2f7"
|
||||||
|
|
||||||
round() {
|
round() {
|
||||||
awk "BEGIN {printf \"%.0f\", $*}"
|
awk "BEGIN {printf \"%.0f\", $*}"
|
||||||
}
|
}
|
||||||
|
|
||||||
oldbrightness="$(cat /sys/class/backlight/*/brightness)"
|
oldbrightness="$(cat /sys/class/backlight/*/brightness)"
|
||||||
|
@ -12,23 +12,23 @@ newpercent="$(round "$oldpercent + $1")"
|
||||||
newbrightness="$(round "$newpercent * (255/100)")"
|
newbrightness="$(round "$newpercent * (255/100)")"
|
||||||
|
|
||||||
if [ "$newpercent" -gt "100" ]; then
|
if [ "$newpercent" -gt "100" ]; then
|
||||||
icon="gpm-brightness-lcd"
|
icon="gpm-brightness-lcd"
|
||||||
newpercent=100
|
newpercent=100
|
||||||
newbrightness=255
|
newbrightness=255
|
||||||
elif [ "$newpercent" -gt "50" ]; then
|
elif [ "$newpercent" -gt "50" ]; then
|
||||||
icon="gpm-brightness-lcd"
|
icon="gpm-brightness-lcd"
|
||||||
elif [ "$newpercent" -gt "0" ]; then
|
elif [ "$newpercent" -gt "0" ]; then
|
||||||
icon="gpm-brightness-lcd-disabled"
|
icon="gpm-brightness-lcd-disabled"
|
||||||
else
|
else
|
||||||
icon="gpm-brightness-lcd-disabled"
|
icon="gpm-brightness-lcd-disabled"
|
||||||
newpercent=0
|
newpercent=0
|
||||||
newbrightness=0
|
newbrightness=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# shellcheck disable=2086
|
# shellcheck disable=2086
|
||||||
round $newbrightness | sudo tee /sys/class/backlight/*/brightness
|
round $newbrightness | sudo tee /sys/class/backlight/*/brightness
|
||||||
|
|
||||||
notify-send -a "changeBrightness" -i "$icon" -u low "Brightness: ${newpercent}%" \
|
notify-send -a "changeBrightness" -i "$icon" -u low "Brightness: ${newpercent}%" \
|
||||||
-h "string:x-dunst-stack-tag:$msgTag" \
|
-h "string:x-dunst-stack-tag:$msgTag" \
|
||||||
-h "int:value:$newpercent" \
|
-h "int:value:$newpercent" \
|
||||||
-h "string:hlcolor:$highlight"
|
-h "string:hlcolor:$highlight"
|
||||||
|
|
|
@ -16,9 +16,9 @@ PDF) curl -sL "$feed" >"/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && zathu
|
||||||
sxiv) curl -sL "$feed" >"/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;;
|
sxiv) curl -sL "$feed" >"/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;;
|
||||||
vim) curl -sL "$feed" >"/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && setsid -f "$TERMINAL" -e "$EDITOR" "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;;
|
vim) curl -sL "$feed" >"/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && setsid -f "$TERMINAL" -e "$EDITOR" "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;;
|
||||||
setbg)
|
setbg)
|
||||||
curl -L "$feed" >"$XDG_CACHE_HOME/pic"
|
curl -L "$feed" >"$XDG_CACHE_HOME/pic"
|
||||||
xwallpaper --zoom "$XDG_CACHE_HOME/pic" >/dev/null 2>&1
|
xwallpaper --zoom "$XDG_CACHE_HOME/pic" >/dev/null 2>&1
|
||||||
;;
|
;;
|
||||||
browser) setsid -f "$BROWSER" "$feed" >/dev/null 2>&1 ;;
|
browser) setsid -f "$BROWSER" "$feed" >/dev/null 2>&1 ;;
|
||||||
lynx) lynx "$feed" >/dev/null 2>&1 ;;
|
lynx) lynx "$feed" >/dev/null 2>&1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -9,17 +9,17 @@ xclip_cmd="xclip -sel clip -t image/png"
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
"full")
|
"full")
|
||||||
maim -q "$dir/pic-full-${output}"
|
maim -q "$dir/pic-full-${output}"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
"current")
|
"current")
|
||||||
maim -q -i "$(xdotool getactivewindow)" "$dir/pic-window-${output}"
|
maim -q -i "$(xdotool getactivewindow)" "$dir/pic-window-${output}"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
"selected")
|
"selected")
|
||||||
maim -usq "$dir/pic-selected-${output}"
|
maim -usq "$dir/pic-selected-${output}"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in
|
case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in
|
||||||
|
|
|
@ -16,11 +16,11 @@ phones="$(simple-mtpfs -l 2>/dev/null | sed "s/^/ /")"
|
||||||
mountedphones="$(grep "simple-mtpfs" /etc/mtab)"
|
mountedphones="$(grep "simple-mtpfs" /etc/mtab)"
|
||||||
# If there are already mounted phones, remove them from the list of mountables.
|
# If there are already mounted phones, remove them from the list of mountables.
|
||||||
[ -n "$mountedphones" ] && phones="$(for phone in $phones; do
|
[ -n "$mountedphones" ] && phones="$(for phone in $phones; do
|
||||||
for mounted in $mountedphones; do
|
for mounted in $mountedphones; do
|
||||||
escphone="$(escape "$phone")"
|
escphone="$(escape "$phone")"
|
||||||
[[ "$mounted" =~ $escphone ]] && break 1
|
[[ "$mounted" =~ $escphone ]] && break 1
|
||||||
done && continue 1
|
done && continue 1
|
||||||
echo "$phone"
|
echo "$phone"
|
||||||
done)"
|
done)"
|
||||||
|
|
||||||
# Check for drives.
|
# Check for drives.
|
||||||
|
@ -34,12 +34,12 @@ filter() { sed "s/ /:/g" | awk -F':' '$7==""{printf "%s%s (%s) %s\n",$1,$3,$5,$6
|
||||||
|
|
||||||
# Get only LUKS drives that are not decrypted.
|
# Get only LUKS drives that are not decrypted.
|
||||||
unopenedluks="$(for drive in $allluks; do
|
unopenedluks="$(for drive in $allluks; do
|
||||||
uuid="${drive%% *}"
|
uuid="${drive%% *}"
|
||||||
uuid="${uuid//-/}" # This is a bashism.
|
uuid="${uuid//-/}" # This is a bashism.
|
||||||
[ -n "$decrypted" ] && for open in $decrypted; do
|
[ -n "$decrypted" ] && for open in $decrypted; do
|
||||||
[ "$uuid" = "$open" ] && break 1
|
[ "$uuid" = "$open" ] && break 1
|
||||||
done && continue 1
|
done && continue 1
|
||||||
echo " $drive"
|
echo " $drive"
|
||||||
done | filter)"
|
done | filter)"
|
||||||
|
|
||||||
# Get all normal, non-encrypted or decrypted partitions that are not mounted.
|
# Get all normal, non-encrypted or decrypted partitions that are not mounted.
|
||||||
|
@ -60,55 +60,55 @@ chosen="$(echo "$alldrives" | dmenu -p "Mount which drive?" -i)"
|
||||||
|
|
||||||
# Function for prompting user for a mountpoint.
|
# Function for prompting user for a mountpoint.
|
||||||
getmount() {
|
getmount() {
|
||||||
mp="$(find /mnt /media /mount /home -maxdepth 1 -type d 2>/dev/null | dmenu -i -p "Mount this drive where?")"
|
mp="$(find /mnt /media /mount /home -maxdepth 1 -type d 2>/dev/null | dmenu -i -p "Mount this drive where?")"
|
||||||
test -n "$mp"
|
test -n "$mp"
|
||||||
if [ ! -d "$mp" ]; then
|
if [ ! -d "$mp" ]; then
|
||||||
mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?")
|
mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?")
|
||||||
[ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp")
|
[ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp")
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
attemptmount() {
|
attemptmount() {
|
||||||
# Attempt to mount without a mountpoint, to see if drive is in fstab.
|
# Attempt to mount without a mountpoint, to see if drive is in fstab.
|
||||||
sudo -A mount "$chosen" || return 1
|
sudo -A mount "$chosen" || return 1
|
||||||
notify-send " Drive Mounted." "$chosen mounted."
|
notify-send " Drive Mounted." "$chosen mounted."
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$chosen" in
|
case "$chosen" in
|
||||||
*)
|
*)
|
||||||
chosen="${chosen%% *}"
|
chosen="${chosen%% *}"
|
||||||
chosen="${chosen:1}" # This is a bashism.
|
chosen="${chosen:1}" # This is a bashism.
|
||||||
attemptmount || getmount
|
attemptmount || getmount
|
||||||
sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)"
|
sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)"
|
||||||
notify-send " Drive Mounted." "$chosen mounted to $mp."
|
notify-send " Drive Mounted." "$chosen mounted to $mp."
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
chosen="${chosen%% *}"
|
chosen="${chosen%% *}"
|
||||||
chosen="${chosen:1}" # This is a bashism.
|
chosen="${chosen:1}" # This is a bashism.
|
||||||
# Number the drive.
|
# Number the drive.
|
||||||
while true; do
|
while true; do
|
||||||
[ -f "/dev/mapper/usb$num" ] || break
|
[ -f "/dev/mapper/usb$num" ] || break
|
||||||
num="$(printf "%02d" "$((num + 1))")"
|
num="$(printf "%02d" "$((num + 1))")"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Decrypt in a terminal window
|
# Decrypt in a terminal window
|
||||||
${TERMINAL:-st} -n floatterm -g 60x1 -e sudo cryptsetup open "$chosen" "usb$num"
|
${TERMINAL:-st} -n floatterm -g 60x1 -e sudo cryptsetup open "$chosen" "usb$num"
|
||||||
# Check if now decrypted.
|
# Check if now decrypted.
|
||||||
test -b "/dev/mapper/usb$num"
|
test -b "/dev/mapper/usb$num"
|
||||||
|
|
||||||
attemptmount || getmount
|
attemptmount || getmount
|
||||||
sudo -A mount "/dev/mapper/usb$num" "$mp" -o uid="$(id -u)",gid="$(id -g)"
|
sudo -A mount "/dev/mapper/usb$num" "$mp" -o uid="$(id -u)",gid="$(id -g)"
|
||||||
notify-send " Decrypted drive Mounted." "$chosen decrypted and mounted to $mp."
|
notify-send " Decrypted drive Mounted." "$chosen decrypted and mounted to $mp."
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
notify-send "❗Note" "Remember to allow file access on your phone now."
|
notify-send "❗Note" "Remember to allow file access on your phone now."
|
||||||
getmount
|
getmount
|
||||||
number="${chosen%%:*}"
|
number="${chosen%%:*}"
|
||||||
number="${chosen:1}" # This is a bashism.
|
number="${chosen:1}" # This is a bashism.
|
||||||
sudo -A simple-mtpfs -o allow_other -o fsname="simple-mtpfs-$(escape "$chosen")" --device "$number" "$mp"
|
sudo -A simple-mtpfs -o allow_other -o fsname="simple-mtpfs-$(escape "$chosen")" --device "$number" "$mp"
|
||||||
notify-send " Android Mounted." "Android device mounted to $mp."
|
notify-send " Android Mounted." "Android device mounted to $mp."
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -11,10 +11,10 @@ share=$(smbclient -L "$srvname" -N | grep Disk | awk '{print $1}' | dmenu -i -p
|
||||||
share2mnt=//"$srvname".local/"$share"
|
share2mnt=//"$srvname".local/"$share"
|
||||||
|
|
||||||
sharemount() {
|
sharemount() {
|
||||||
mounted=$(mount -v | grep "$share2mnt") || ([ ! -d /mnt/"$share" ] && sudo mkdir /mnt/"$share")
|
mounted=$(mount -v | grep "$share2mnt") || ([ ! -d /mnt/"$share" ] && sudo mkdir /mnt/"$share")
|
||||||
[ -z "$mounted" ] && sudo mount -t cifs "$share2mnt" -o user=nobody,password="",noperm /mnt/"$share" && notify-send "Netshare $share mounted" && exit 0
|
[ -z "$mounted" ] && sudo mount -t cifs "$share2mnt" -o user=nobody,password="",noperm /mnt/"$share" && notify-send "Netshare $share mounted" && exit 0
|
||||||
notify-send "Netshare $share already mounted"
|
notify-send "Netshare $share already mounted"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
sharemount
|
sharemount
|
||||||
|
|
|
@ -10,108 +10,108 @@
|
||||||
# If there is already a running instance, user will be prompted to end it.
|
# If there is already a running instance, user will be prompted to end it.
|
||||||
|
|
||||||
updateicon() {
|
updateicon() {
|
||||||
echo "$1" >/tmp/recordingicon
|
echo "$1" >/tmp/recordingicon
|
||||||
pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}"
|
pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}"
|
||||||
}
|
}
|
||||||
|
|
||||||
killrecording() {
|
killrecording() {
|
||||||
recpid="$(cat /tmp/recordingpid)"
|
recpid="$(cat /tmp/recordingpid)"
|
||||||
# kill with SIGTERM, allowing finishing touches.
|
# kill with SIGTERM, allowing finishing touches.
|
||||||
kill -15 "$recpid"
|
kill -15 "$recpid"
|
||||||
rm -f /tmp/recordingpid
|
rm -f /tmp/recordingpid
|
||||||
updateicon ""
|
updateicon ""
|
||||||
pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}"
|
pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}"
|
||||||
# even after SIGTERM, ffmpeg may still run, so SIGKILL it.
|
# even after SIGTERM, ffmpeg may still run, so SIGKILL it.
|
||||||
sleep 3
|
sleep 3
|
||||||
kill -9 "$recpid"
|
kill -9 "$recpid"
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
screencast() {
|
screencast() {
|
||||||
ffmpeg -y \
|
ffmpeg -y \
|
||||||
-f x11grab \
|
-f x11grab \
|
||||||
-framerate 60 \
|
-framerate 60 \
|
||||||
-s "$(xdpyinfo | awk '/dimensions/ {print $2;}')" \
|
-s "$(xdpyinfo | awk '/dimensions/ {print $2;}')" \
|
||||||
-i "$DISPLAY" \
|
-i "$DISPLAY" \
|
||||||
-f alsa -i default \
|
-f alsa -i default \
|
||||||
-r 30 \
|
-r 30 \
|
||||||
-c:v h264 -crf 0 -preset ultrafast -c:a aac \
|
-c:v h264 -crf 0 -preset ultrafast -c:a aac \
|
||||||
"$HOME/screencast-$(date '+%y%m%d-%H%M-%S').mp4" &
|
"$HOME/screencast-$(date '+%y%m%d-%H%M-%S').mp4" &
|
||||||
echo $! >/tmp/recordingpid
|
echo $! >/tmp/recordingpid
|
||||||
updateicon "ﲠ"
|
updateicon "ﲠ"
|
||||||
}
|
}
|
||||||
|
|
||||||
video() {
|
video() {
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
-f x11grab \
|
-f x11grab \
|
||||||
-s "$(xdpyinfo | awk '/dimensions/ {print $2;}')" \
|
-s "$(xdpyinfo | awk '/dimensions/ {print $2;}')" \
|
||||||
-i "$DISPLAY" \
|
-i "$DISPLAY" \
|
||||||
-c:v libx264 -qp 0 -r 30 \
|
-c:v libx264 -qp 0 -r 30 \
|
||||||
"$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" &
|
"$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" &
|
||||||
echo $! >/tmp/recordingpid
|
echo $! >/tmp/recordingpid
|
||||||
updateicon "ﲣ"
|
updateicon "ﲣ"
|
||||||
}
|
}
|
||||||
|
|
||||||
webcamhidef() {
|
webcamhidef() {
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
-f v4l2 \
|
-f v4l2 \
|
||||||
-i /dev/video0 \
|
-i /dev/video0 \
|
||||||
-video_size 1920x1080 \
|
-video_size 1920x1080 \
|
||||||
"$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" &
|
"$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" &
|
||||||
echo $! >/tmp/recordingpid
|
echo $! >/tmp/recordingpid
|
||||||
updateicon ""
|
updateicon ""
|
||||||
}
|
}
|
||||||
|
|
||||||
webcam() {
|
webcam() {
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
-f v4l2 \
|
-f v4l2 \
|
||||||
-i /dev/video0 \
|
-i /dev/video0 \
|
||||||
-video_size 640x480 \
|
-video_size 640x480 \
|
||||||
"$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" &
|
"$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" &
|
||||||
echo $! >/tmp/recordingpid
|
echo $! >/tmp/recordingpid
|
||||||
updateicon ""
|
updateicon ""
|
||||||
}
|
}
|
||||||
|
|
||||||
audio() {
|
audio() {
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
-f alsa -i default \
|
-f alsa -i default \
|
||||||
-c:a flac \
|
-c:a flac \
|
||||||
"$HOME/audio-$(date '+%y%m%d-%H%M-%S').flac" &
|
"$HOME/audio-$(date '+%y%m%d-%H%M-%S').flac" &
|
||||||
echo $! >/tmp/recordingpid
|
echo $! >/tmp/recordingpid
|
||||||
updateicon ""
|
updateicon ""
|
||||||
}
|
}
|
||||||
|
|
||||||
askrecording() {
|
askrecording() {
|
||||||
choice=$(printf "screencast\\nvideo\\nvideo selected\\naudio\\nwebcam\\nwebcam (hi-def)" | dmenu -i -p "Select recording style:")
|
choice=$(printf "screencast\\nvideo\\nvideo selected\\naudio\\nwebcam\\nwebcam (hi-def)" | dmenu -i -p "Select recording style:")
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
screencast) screencast ;;
|
screencast) screencast ;;
|
||||||
audio) audio ;;
|
audio) audio ;;
|
||||||
video) video ;;
|
video) video ;;
|
||||||
*selected) videoselected ;;
|
*selected) videoselected ;;
|
||||||
webcam) webcam ;;
|
webcam) webcam ;;
|
||||||
"webcam (hi-def)") webcamhidef ;;
|
"webcam (hi-def)") webcamhidef ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
asktoend() {
|
asktoend() {
|
||||||
response=$(printf "No\\nYes" | dmenu -i -p "Recording still active. End recording?") &&
|
response=$(printf "No\\nYes" | dmenu -i -p "Recording still active. End recording?") &&
|
||||||
[ "$response" = "Yes" ] && killrecording
|
[ "$response" = "Yes" ] && killrecording
|
||||||
}
|
}
|
||||||
|
|
||||||
videoselected() {
|
videoselected() {
|
||||||
slop -f "%x %y %w %h" >/tmp/slop
|
slop -f "%x %y %w %h" >/tmp/slop
|
||||||
read -r X Y W H </tmp/slop
|
read -r X Y W H </tmp/slop
|
||||||
rm /tmp/slop
|
rm /tmp/slop
|
||||||
|
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
-f x11grab \
|
-f x11grab \
|
||||||
-framerate 60 \
|
-framerate 60 \
|
||||||
-video_size "$W"x"$H" \
|
-video_size "$W"x"$H" \
|
||||||
-i :0.0+"$X,$Y" \
|
-i :0.0+"$X,$Y" \
|
||||||
-c:v libx264 -qp 0 -r 30 \
|
-c:v libx264 -qp 0 -r 30 \
|
||||||
"$HOME/box-$(date '+%y%m%d-%H%M-%S').mkv" &
|
"$HOME/box-$(date '+%y%m%d-%H%M-%S').mkv" &
|
||||||
echo $! >/tmp/recordingpid
|
echo $! >/tmp/recordingpid
|
||||||
updateicon "ﲣ"
|
updateicon "ﲣ"
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
|
|
@ -5,25 +5,25 @@
|
||||||
# Drives mounted at /, /boot and /home will not be options to unmount.
|
# Drives mounted at /, /boot and /home will not be options to unmount.
|
||||||
|
|
||||||
drives="$(
|
drives="$(
|
||||||
lsblk -nrpo "name,type,size,mountpoint,label" | awk -F':' '{gsub(/ /,":")}$4!~/\/boot|\/efi|\/home$|SWAP/&&length($4)>1{printf "%s (%s) %s\n",$4,$3,$5}'
|
lsblk -nrpo "name,type,size,mountpoint,label" | awk -F':' '{gsub(/ /,":")}$4!~/\/boot|\/efi|\/home$|SWAP/&&length($4)>1{printf "%s (%s) %s\n",$4,$3,$5}'
|
||||||
awk '/simple-mtpfs/ { print "", $2; }' /etc/mtab
|
awk '/simple-mtpfs/ { print "", $2; }' /etc/mtab
|
||||||
)"
|
)"
|
||||||
|
|
||||||
chosen="$(echo "$drives" | dmenu -i -p "Unmount which drive?")" || exit 1
|
chosen="$(echo "$drives" | dmenu -i -p "Unmount which drive?")" || exit 1
|
||||||
|
|
||||||
if case "$chosen" in
|
if case "$chosen" in
|
||||||
*)
|
*)
|
||||||
chosen="${chosen#📱 }"
|
chosen="${chosen#📱 }"
|
||||||
sudo -A umount -l "$chosen"
|
sudo -A umount -l "$chosen"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
chosen="${chosen% (*}"
|
chosen="${chosen% (*}"
|
||||||
sudo -A umount -l "$chosen"
|
sudo -A umount -l "$chosen"
|
||||||
;;
|
;;
|
||||||
esac then
|
esac then
|
||||||
notify-send "禍 Drive unmounted." "$chosen successfully unmounted."
|
notify-send "禍 Drive unmounted." "$chosen successfully unmounted."
|
||||||
else
|
else
|
||||||
notify-send "禍 Drive failed to unmount." "Possibly a permissions or I/O issue."
|
notify-send "禍 Drive failed to unmount." "Possibly a permissions or I/O issue."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo -A umount "$chosen" && notify-send "禍 USB unmounting" "$chosen unmounted."
|
sudo -A umount "$chosen" && notify-send "禍 USB unmounting" "$chosen unmounted."
|
||||||
|
|
|
@ -11,8 +11,8 @@ chosen=$(cut -d ';' -f1 ~/.local/share/chars/* | dmenu -i -l 30 | sed "s/ .*//")
|
||||||
# If you run this command with an argument, it will automatically insert the
|
# If you run this command with an argument, it will automatically insert the
|
||||||
# character. Otherwise, show a message that the emoji has been copied.
|
# character. Otherwise, show a message that the emoji has been copied.
|
||||||
if [ -n "$1" ]; then
|
if [ -n "$1" ]; then
|
||||||
xdotool type "$chosen"
|
xdotool type "$chosen"
|
||||||
else
|
else
|
||||||
printf "%s" "$chosen" | xclip -selection clipboard
|
printf "%s" "$chosen" | xclip -selection clipboard
|
||||||
notify-send "'$chosen' copied to clipboard." &
|
notify-send "'$chosen' copied to clipboard." &
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -7,20 +7,20 @@ volume="$(pamixer --get-volume)"
|
||||||
mute="$(pamixer --get-mute)"
|
mute="$(pamixer --get-mute)"
|
||||||
|
|
||||||
[ "$volume" -gt "100" ] &&
|
[ "$volume" -gt "100" ] &&
|
||||||
highlight="#ff768e" ||
|
highlight="#ff768e" ||
|
||||||
highlight="#7aa2f7"
|
highlight="#7aa2f7"
|
||||||
|
|
||||||
if [ "$mute" = "true" ]; then
|
if [ "$mute" = "true" ]; then
|
||||||
icon="audio-volume-muted"
|
icon="audio-volume-muted"
|
||||||
elif [ "$volume" -gt "70" ]; then
|
elif [ "$volume" -gt "70" ]; then
|
||||||
icon="audio-volume-high"
|
icon="audio-volume-high"
|
||||||
elif [ "$volume" -gt "30" ]; then
|
elif [ "$volume" -gt "30" ]; then
|
||||||
icon="audio-volume-medium"
|
icon="audio-volume-medium"
|
||||||
elif [ "$volume" -ge "0" ]; then
|
elif [ "$volume" -ge "0" ]; then
|
||||||
icon="audio-volume-low"
|
icon="audio-volume-low"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
notify-send -a "changeVolume" -i "$icon" -u low "Volume: ${volume}%" \
|
notify-send -a "changeVolume" -i "$icon" -u low "Volume: ${volume}%" \
|
||||||
-h string:x-dunst-stack-tag:$msgTag \
|
-h string:x-dunst-stack-tag:$msgTag \
|
||||||
-h int:value:$volume \
|
-h int:value:$volume \
|
||||||
-h string:hlcolor:$highlight
|
-h string:hlcolor:$highlight
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if pidof picom; then
|
if pidof picom; then
|
||||||
killall picom
|
killall picom
|
||||||
notify-send -h string:x-dunst-stack-tag:"togcom" \
|
notify-send -h string:x-dunst-stack-tag:"togcom" \
|
||||||
"Compositor Off"
|
"Compositor Off"
|
||||||
else
|
else
|
||||||
setsid -f picom
|
setsid -f picom
|
||||||
notify-send -h string:x-dunst-stack-tag:"togcom" \
|
notify-send -h string:x-dunst-stack-tag:"togcom" \
|
||||||
"Compositor On"
|
"Compositor On"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue