scripts: updated to cleaner logic for global variables

master
tiyn 6 days ago
parent 7322a068c2
commit c7e33b6162

@ -1,8 +1,8 @@
#!/bin/sh
[ -z "$CAPTURE_INPUT_AUDIO" ] && audio_1="easyeffects_sink.monitor" || audio_1="$CAPTURE_INPUT_AUDIO"
[ -z "$CAPTURE_OUTPUT_AUDIO" ] && audio_2="easyeffects_source" || audio_2="$CAPTURE_OUTPUT_AUDIO"
[ -z "$CAPTURE_DIR" ] && output="$HOME/downloads" || output="$CAPTURE_DIR"
audio_1=${CAPTURE_INPUT_AUDIO:-easyeffects_sink.monitor}
audio_2=${CAPTURE_OUTPUT_AUDIO:-easyeffects_source}
output=${CAPTURE_DIR:-$HOME/downloads}
window=$(xdotool getwindowfocus)
fps=60

@ -1,15 +1,15 @@
#!/bin/sh
[ -z "$CAPTURE_INPUT_AUDIO" ] && audio_1="easyeffects_sink.monitor" || audio_1="$CAPTURE_INPUT_AUDIO"
[ -z "$CAPTURE_OUTPUT_AUDIO" ] && audio_2="easyeffects_source" || audio_2="$CAPTURE_OUTPUT_AUDIO"
[ -z "$CAPTURE_DIR" ] && output_dir="$HOME/downloads" || output_dir="$CAPTURE_DIR"
audio_1=${CAPTURE_INPUT_AUDIO:-easyeffects_sink.monitor}
audio_2=${CAPTURE_OUTPUT_AUDIO:-easyeffects_source}
output=${CAPTURE_DIR:-$HOME/downloads}
window=$(xdotool getwindowfocus)
fps=30
format="mp4"
v_codec="h264"
a_codec="opus"
output="$output_dir/recording-$(date '+%Y-%m-%d_%H-%M-%S').$format"
a_codec="aac"
output="$output/recording-$(date '+%Y-%m-%d_%H-%M-%S').$format"
gpu-screen-recorder -w $window -c $format -k $v_codec -ac $a_codec -f $fps -a $audio_1 -a $audio_2 -o $output &
gpu-screen-recorder -w $window -c $format -k $v_codec -ac $a_codec -f $fps -o $output &
notify-send -u low 'Screen record' 'Recording started'

@ -3,7 +3,7 @@
# Status bar module for disk space
# $1 should be drive mountpoint
[ -z "$STATUSBAR_DISK" ] && disk="/home" || disk="$STATUSBAR_DISK"
disk=${STATUSBAR_DISK:-/home}
[ ! -z "$1" ] && disk="$1"

@ -4,7 +4,7 @@
# Based on a script by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
# Heavily extended and updated to a pipewire system
[ -z "$LOOPBACK_DEVICE" ] && device="Easy Effects Source" || device="$LOOPBACK_DEVICE"
device=${LOOPBACK_DEVICE:-Easy Effects Source}
name=$(wpctl status | sed -n '/Sources/,$p' | sed -n '/Filter/q;p' | grep "$device" | sed -e "s/*/\ /g")
id=$( echo $name | cut -d '.' -f 1 | cut -c 5-)

@ -3,8 +3,8 @@
# toggle external monitor
# by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
[ -z "$INTERNAL_MONITOR" ] && intern="LVDS1" || intern="$INTERNAL_MONITOR"
[ -z "$EXTERNAL_MONITOR" ] && extern="HDMI2" || extern="$EXTERNAL_MONITOR"
intern=${INTERNAL_MONITOR:-LVDS1}
extern=${EXTERNAL_MONITOR:-HDMI2}
case "$1" in
toggle) (xrandr | grep "$extern disconnected")

@ -3,9 +3,9 @@
# Requires maim. It lets you choose the kind of screenshot to take,
# including copying the image or even highlighting an area to copy.
[ -z "$SCREENSHOT_DIR" ] && output_dir="$HOME/downloads" || output_dir="$SCREENSHOT_DIR"
output=${SCREENSHOT_DIR:-$HOME/downloads}
output="$output_dir/screenshot-$(date '+%Y-%m-%d_%H-%M-%S').png"
output="$output/screenshot-$(date '+%Y-%m-%d_%H-%M-%S').png"
xclip_img="xclip -sel clip -t image/png"
xclip_txt="xclip -sel clip -t text/plain"

@ -2,11 +2,8 @@
# Adapted from a script by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
[ -z "$WALLPAPER_DESKTOP" ] && wall_desk="$XDG_DATA_HOME/bg" || wall_desk="$WALLPAPER_DESKTOP"
[ -z "$WALLPAPER_LOCK" ] && wall_lock="$XDG_DATA_HOME/lock" || wall_lock="$WALLPAPER_LOCK"
echo $wall_desk
echo $wall_lock
wall_desk=${WALLPAPER_DESKTOP:-$XDG_DATA_HOME/bg}
wall_lock=${WALLPAPER_LOCK:-$XDG_DATA_HOME/lock}
case "$1" in
desktop) trueloc="$(readlink -f "$2")" &&

Loading…
Cancel
Save