Fix indentations in scripts
This commit is contained in:
parent
cdc54edd0c
commit
2fc20cccb9
@ -4,24 +4,24 @@
|
|||||||
# Author - Cherrry9
|
# Author - Cherrry9
|
||||||
|
|
||||||
deps() {
|
deps() {
|
||||||
[ "$1" ] && {
|
[ "$1" ] && {
|
||||||
md="$(for i in $deps; do printf " - \033[31m%s\033[0m\n" "$i"; done)"
|
md="$(for i in $deps; do printf " - \033[31m%s\033[0m\n" "$i"; done)"
|
||||||
printf "\033[31mYou are missing dependencies\033[0m\n"
|
printf "\033[31mYou are missing dependencies\033[0m\n"
|
||||||
printf "%b\n" "$md"
|
printf "%b\n" "$md"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
}
|
}
|
||||||
printf "\033[34mRequired dependencies\033[0m\n"
|
printf "\033[34mRequired dependencies\033[0m\n"
|
||||||
printf " - \033[34mffmpeg\033[0m Actually recording\n"
|
printf " - \033[34mffmpeg\033[0m Actually recording\n"
|
||||||
printf " - \033[34mdmenu\033[0m Selecting the options\n"
|
printf " - \033[34mdmenu\033[0m Selecting the options\n"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf "\033[35mAt least one of these is required\033[0m\n"
|
printf "\033[35mAt least one of these is required\033[0m\n"
|
||||||
printf " - \033[35mxorg-xrandr\033[0m Selecting a display to record\n"
|
printf " - \033[35mxorg-xrandr\033[0m Selecting a display to record\n"
|
||||||
printf " - \033[35mslop\033[0m Selecting an area to record\n"
|
printf " - \033[35mslop\033[0m Selecting an area to record\n"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf "\033[32mOptional dependencies\033[0m\n"
|
printf "\033[32mOptional dependencies\033[0m\n"
|
||||||
printf " - \033[32mnotify-send\033[0m Letting the user know when the recording starts/ends\n"
|
printf " - \033[32mnotify-send\033[0m Letting the user know when the recording starts/ends\n"
|
||||||
printf " - \033[32mxdg-desktop-dir\033[0m Use directory from xdg instead \$HOME/Videos\n"
|
printf " - \033[32mxdg-desktop-dir\033[0m Use directory from xdg instead \$HOME/Videos\n"
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
# check all necessary dependencies
|
# check all necessary dependencies
|
||||||
@ -35,9 +35,9 @@ _ xrandr || _ slop || deps="$deps xorg-xrandr/slop"
|
|||||||
|
|
||||||
# output file, use $BLAZE_DIR and $BLAZE_FILE if they are set
|
# output file, use $BLAZE_DIR and $BLAZE_FILE if they are set
|
||||||
if [ ! "$BLAZE_DIR" ]; then
|
if [ ! "$BLAZE_DIR" ]; then
|
||||||
_ xdg-user-dir &&
|
_ xdg-user-dir &&
|
||||||
BLAZE_DIR=$(xdg-user-dir VIDEOS 2>/dev/null) ||
|
BLAZE_DIR=$(xdg-user-dir VIDEOS 2>/dev/null) ||
|
||||||
BLAZE_DIR="$HOME/Videos"
|
BLAZE_DIR="$HOME/Videos"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ ! -d "$BLAZE_DIR" ] && mkdir -p "$BLAZE_DIR" >/dev/null 2>&1
|
[ ! -d "$BLAZE_DIR" ] && mkdir -p "$BLAZE_DIR" >/dev/null 2>&1
|
||||||
@ -52,172 +52,172 @@ m() { ${DMENU:-dmenu} "$@"; }
|
|||||||
|
|
||||||
# find default audio device
|
# find default audio device
|
||||||
audio() {
|
audio() {
|
||||||
pacmd="$(pacmd list-sources | grep -i -B 1 output)"
|
pacmd="$(pacmd list-sources | grep -i -B 1 output)"
|
||||||
dev="$(echo "$pacmd" | grep -i '\* index' ||
|
dev="$(echo "$pacmd" | grep -i '\* index' ||
|
||||||
echo "$pacmd" | grep -i 'index' | head -n 1)"
|
echo "$pacmd" | grep -i 'index' | head -n 1)"
|
||||||
audio="-f pulse -i $(echo "$dev" | grep -o '[0-9]')"
|
audio="-f pulse -i $(echo "$dev" | grep -o '[0-9]')"
|
||||||
}
|
}
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
if [ -f "/tmp/blaze-pid" ]; then
|
if [ -f "/tmp/blaze-pid" ]; then
|
||||||
recpid="$(cat /tmp/blaze-pid)"
|
recpid="$(cat /tmp/blaze-pid)"
|
||||||
# kill with SIGTERM, allowing finishing touches.
|
# kill with SIGTERM, allowing finishing touches.
|
||||||
kill -15 "$recpid"
|
kill -15 "$recpid"
|
||||||
rm -f /tmp/blaze-pid
|
rm -f /tmp/blaze-pid
|
||||||
# even after SIGTERM, ffmpeg may still run, so SIGKILL it.
|
# even after SIGTERM, ffmpeg may still run, so SIGKILL it.
|
||||||
( sleep 3; kill -9 "$recpid" ) >/dev/null 2>&1 &
|
( sleep 3; kill -9 "$recpid" ) >/dev/null 2>&1 &
|
||||||
echo "Recording Stopped"
|
echo "Recording Stopped"
|
||||||
notify-send -t 2000 "Recording Stopped"
|
notify-send -t 2000 "Recording Stopped"
|
||||||
exit
|
exit
|
||||||
else
|
else
|
||||||
echo "Recording isn't active"
|
echo "Recording isn't active"
|
||||||
notify-send -t 2000 "Recording isn't active"
|
notify-send -t 2000 "Recording isn't active"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
printf "\033[34mOptions\033[0m\n"
|
printf "\033[34mOptions\033[0m\n"
|
||||||
printf " \033[34m-o\033[0m \033[35m[]\033[0m Specify the output file\n"
|
printf " \033[34m-o\033[0m \033[35m[]\033[0m Specify the output file\n"
|
||||||
printf " \033[34m-s\033[0m End the recording\n"
|
printf " \033[34m-s\033[0m End the recording\n"
|
||||||
printf " \033[34m-h\033[0m Display what you're reading right now\n"
|
printf " \033[34m-h\033[0m Display what you're reading right now\n"
|
||||||
printf " \033[34m-d\033[0m printf dependencies\n"
|
printf " \033[34m-d\033[0m printf dependencies\n"
|
||||||
printf " \033[34m-c\033[0m Don't ask if the user is ready to record\n"
|
printf " \033[34m-c\033[0m Don't ask if the user is ready to record\n"
|
||||||
printf " \033[34m-p\033[0m \033[35m[]\033[0m Save to and load from preset <x>\n"
|
printf " \033[34m-p\033[0m \033[35m[]\033[0m Save to and load from preset <x>\n"
|
||||||
printf " \033[34m-r\033[0m \033[35m[]\033[0m Force framerate\n"
|
printf " \033[34m-r\033[0m \033[35m[]\033[0m Force framerate\n"
|
||||||
printf " \033[34m-b\033[0m \033[35m[]\033[0m Force bitrate (in MB)\n"
|
printf " \033[34m-b\033[0m \033[35m[]\033[0m Force bitrate (in MB)\n"
|
||||||
printf " \033[34m-m\033[0m \033[35m[]\033[0m Force method (slop, display)\n"
|
printf " \033[34m-m\033[0m \033[35m[]\033[0m Force method (slop, display)\n"
|
||||||
printf " \033[34m-d\033[0m \033[35m[]\033[0m Force display (Doesn't require -m)\n"
|
printf " \033[34m-d\033[0m \033[35m[]\033[0m Force display (Doesn't require -m)\n"
|
||||||
printf " \033[34m-n\033[0m Force disable NVENC\n"
|
printf " \033[34m-n\033[0m Force disable NVENC\n"
|
||||||
printf " \033[34m-S\033[0m Options to use for slop (Needs to be quoted)\n"
|
printf " \033[34m-S\033[0m Options to use for slop (Needs to be quoted)\n"
|
||||||
printf " \033[34m-a\033[0m Record desktop audio\n"
|
printf " \033[34m-a\033[0m Record desktop audio\n"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf "To select an area, install 'slop',\n"
|
printf "To select an area, install 'slop',\n"
|
||||||
printf "to select a display, install 'xorg-xrandr'\n"
|
printf "to select a display, install 'xorg-xrandr'\n"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf "\033[35m[]\033[0m = Option requires an argument\n"
|
printf "\033[35m[]\033[0m = Option requires an argument\n"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf "\033[34mVariables\033[0m\n"
|
printf "\033[34mVariables\033[0m\n"
|
||||||
printf " \033[34mBLAZE_DIR\033[0m Location to save the video\n"
|
printf " \033[34mBLAZE_DIR\033[0m Location to save the video\n"
|
||||||
printf " \033[37mDefault: xdg-user-dir VIDEOS or \$HOME/Videos\033[0m\n"
|
printf " \033[37mDefault: xdg-user-dir VIDEOS or \$HOME/Videos\033[0m\n"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf " \033[34mBLAZE_FILE\033[0m Name of the saved video\n"
|
printf " \033[34mBLAZE_FILE\033[0m Name of the saved video\n"
|
||||||
printf " \033[37mDefault: blaze-%s.mp4\033[0m\n" "\$(date +%Y-%m-%d_%H-%M-%S)"
|
printf " \033[37mDefault: blaze-%s.mp4\033[0m\n" "\$(date +%Y-%m-%d_%H-%M-%S)"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf " \033[34mBLAZE_SLOP\033[0m Options to use for slop\n"
|
printf " \033[34mBLAZE_SLOP\033[0m Options to use for slop\n"
|
||||||
printf " \033[37mDefault: None\033[0m\n"
|
printf " \033[37mDefault: None\033[0m\n"
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
while getopts ':hdscb:m:r:nD:S:p:ao:' opt; do
|
while getopts ':hdscb:m:r:nD:S:p:ao:' opt; do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
h)
|
h)
|
||||||
help;;
|
help;;
|
||||||
d)
|
d)
|
||||||
deps;;
|
deps;;
|
||||||
s)
|
s)
|
||||||
save;;
|
save;;
|
||||||
c)
|
c)
|
||||||
ready='yes';;
|
ready='yes';;
|
||||||
b)
|
b)
|
||||||
bitrate="-b:v ${OPTARG}M";;
|
bitrate="-b:v ${OPTARG}M";;
|
||||||
m)
|
m)
|
||||||
method="$OPTARG";;
|
method="$OPTARG";;
|
||||||
r)
|
r)
|
||||||
rate="$OPTARG";;
|
rate="$OPTARG";;
|
||||||
n)
|
n)
|
||||||
nvenc=' ';;
|
nvenc=' ';;
|
||||||
D)
|
D)
|
||||||
display="$OPTARG"
|
display="$OPTARG"
|
||||||
method='display';;
|
method='display';;
|
||||||
S)
|
S)
|
||||||
sloptions="$OPTARG"
|
sloptions="$OPTARG"
|
||||||
method='selection';;
|
method='selection';;
|
||||||
p)
|
p)
|
||||||
preset="$OPTARG";;
|
preset="$OPTARG";;
|
||||||
a)
|
a)
|
||||||
audio;;
|
audio;;
|
||||||
o)
|
o)
|
||||||
output="$OPTARG";;
|
output="$OPTARG";;
|
||||||
\?)
|
\?)
|
||||||
echo "Invalid Option: -$OPTARG" 1>&2
|
echo "Invalid Option: -$OPTARG" 1>&2
|
||||||
exit 1;;
|
exit 1;;
|
||||||
:)
|
:)
|
||||||
echo "Invalid Option: -$OPTARG requires an argument" 1>&2
|
echo "Invalid Option: -$OPTARG requires an argument" 1>&2
|
||||||
exit 1;;
|
exit 1;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
shift $((OPTIND -1))
|
shift $((OPTIND -1))
|
||||||
|
|
||||||
# exit if blaze is running
|
# exit if blaze is running
|
||||||
[ -f /tmp/blaze-pid ] && {
|
[ -f /tmp/blaze-pid ] && {
|
||||||
echo "Blaze is already running, exiting."
|
echo "Blaze is already running, exiting."
|
||||||
notify-send "Blaze is already running, exiting."
|
notify-send "Blaze is already running, exiting."
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
[ "$preset" ] && {
|
[ "$preset" ] && {
|
||||||
# create preset location
|
# create preset location
|
||||||
mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}"
|
mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||||
|
|
||||||
# load preset
|
# load preset
|
||||||
preset_location="${XDG_CONFIG_HOME:-$HOME/.config}"/blaze/"$preset"
|
preset_location="${XDG_CONFIG_HOME:-$HOME/.config}"/blaze/"$preset"
|
||||||
[ -f "$preset_location" ] &&
|
[ -f "$preset_location" ] &&
|
||||||
. "$preset_location"
|
. "$preset_location"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ask the user what method they want to use
|
# ask the user what method they want to use
|
||||||
[ ! "$method" ] && {
|
[ ! "$method" ] && {
|
||||||
# Check if the user has slop and disputils
|
# Check if the user has slop and disputils
|
||||||
_ slop && s=s
|
_ slop && s=s
|
||||||
_ xrandr && d=d
|
_ xrandr && d=d
|
||||||
|
|
||||||
# if the user only has slop or disputils (But not both) use that
|
# if the user only has slop or disputils (But not both) use that
|
||||||
[ "$s" ] && method=selection
|
[ "$s" ] && method=selection
|
||||||
[ "$d" ] && method=display
|
[ "$d" ] && method=display
|
||||||
|
|
||||||
# if the user has both slop and disputils ask the user which one to use
|
# if the user has both slop and disputils ask the user which one to use
|
||||||
[ "$s" ] && [ "$d" ] &&
|
[ "$s" ] && [ "$d" ] &&
|
||||||
method="$(printf "display\nselection" | m -p "Method of recording")"
|
method="$(printf "display\nselection" | m -p "Method of recording")"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$method" = display ]; then
|
if [ "$method" = display ]; then
|
||||||
|
|
||||||
# get information about the display
|
# get information about the display
|
||||||
monitors="$(xrandr --listmonitors | awk 'NR>1 { printf $NF"\n" }')"
|
monitors="$(xrandr --listmonitors | awk 'NR>1 { printf $NF"\n" }')"
|
||||||
|
|
||||||
# if there's only one display, use that and skip asking
|
# if there's only one display, use that and skip asking
|
||||||
if [ "$(printf "%b\n" "$monitors" | wc -l)" = 1 ]; then
|
if [ "$(printf "%b\n" "$monitors" | wc -l)" = 1 ]; then
|
||||||
display="$monitors"
|
display="$monitors"
|
||||||
else # if there are other displays ask the user which one to use
|
else # if there are other displays ask the user which one to use
|
||||||
[ ! "$display" ] && display="$(printf "%b" "$monitors" | m -p "Display to record")"
|
[ ! "$display" ] && display="$(printf "%b" "$monitors" | m -p "Display to record")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -- $(xrandr -q | grep "$display" | grep -oP '\d*x\d*\+\d*\+\d*' | tr '+x' ' ')
|
set -- $(xrandr -q | grep "$display" | grep -oP '\d*x\d*\+\d*\+\d*' | tr '+x' ' ')
|
||||||
|
|
||||||
width="$1"
|
width="$1"
|
||||||
height="$2"
|
height="$2"
|
||||||
offX="$3"
|
offX="$3"
|
||||||
offY="$4"
|
offY="$4"
|
||||||
|
|
||||||
elif [ "$method" = selection ] || [ "$method" = slop ]; then
|
elif [ "$method" = selection ] || [ "$method" = slop ]; then
|
||||||
|
|
||||||
# select an area and make each number a separate word
|
# select an area and make each number a separate word
|
||||||
set -- $(slop $sloptions -f '%w %h %x %y')
|
set -- $(slop $sloptions -f '%w %h %x %y')
|
||||||
|
|
||||||
# get information about the display
|
# get information about the display
|
||||||
width="$1"
|
width="$1"
|
||||||
height="$2"
|
height="$2"
|
||||||
offX="$3"
|
offX="$3"
|
||||||
offY="$4"
|
offY="$4"
|
||||||
|
|
||||||
[ "$(( width % 2 ))" = 1 ] && width="$(( width + 1 ))"
|
[ "$(( width % 2 ))" = 1 ] && width="$(( width + 1 ))"
|
||||||
[ "$(( height % 2 ))" = 1 ] && height="$(( height + 1 ))"
|
[ "$(( height % 2 ))" = 1 ] && height="$(( height + 1 ))"
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
printf "Invalid method; exiting\n"
|
printf "Invalid method; exiting\n"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ fi
|
|||||||
|
|
||||||
# save preset
|
# save preset
|
||||||
[ "$preset_location" ] && {
|
[ "$preset_location" ] && {
|
||||||
cat >"$preset_location"<<EOF
|
cat >"$preset_location"<<EOF
|
||||||
[ ! "\$rate" ] && rate="$rate"
|
[ ! "\$rate" ] && rate="$rate"
|
||||||
[ ! "\$bitrate" ] && bitrate="$bitrate"
|
[ ! "\$bitrate" ] && bitrate="$bitrate"
|
||||||
[ ! "\$method" ] && method="$method"
|
[ ! "\$method" ] && method="$method"
|
||||||
@ -241,32 +241,32 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
[ "$ready" = yes ] && {
|
[ "$ready" = yes ] && {
|
||||||
notify-send -t 1500 "Recording Started"
|
notify-send -t 1500 "Recording Started"
|
||||||
|
|
||||||
# -loglevel error | makes ffmpeg only printf errors to the terminal
|
# -loglevel error | makes ffmpeg only printf errors to the terminal
|
||||||
# -y | don't ask to start
|
# -y | don't ask to start
|
||||||
# -draw_mouse 1 | show the mouse in the video
|
# -draw_mouse 1 | show the mouse in the video
|
||||||
# -s | specifies the size of the recording
|
# -s | specifies the size of the recording
|
||||||
# -r "$rate" | specifies the framerate of the video
|
# -r "$rate" | specifies the framerate of the video
|
||||||
# -i | the input X display (not physical monitor) and offset
|
# -i | the input X display (not physical monitor) and offset
|
||||||
# -pix_fmt yuv420p | allows the video to be played on browsers like firefox
|
# -pix_fmt yuv420p | allows the video to be played on browsers like firefox
|
||||||
# -q:v | changes the quality of the video, lower is better.
|
# -q:v | changes the quality of the video, lower is better.
|
||||||
# "$output" | file to save the recording to
|
# "$output" | file to save the recording to
|
||||||
|
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
-loglevel error \
|
-loglevel error \
|
||||||
-y \
|
-y \
|
||||||
$audio \
|
$audio \
|
||||||
-f x11grab \
|
-f x11grab \
|
||||||
-draw_mouse 1 \
|
-draw_mouse 1 \
|
||||||
-s "${width}x$height" \
|
-s "${width}x$height" \
|
||||||
-r "$rate" \
|
-r "$rate" \
|
||||||
-i "$DISPLAY.0+$offX,$offY" \
|
-i "$DISPLAY.0+$offX,$offY" \
|
||||||
$bitrate \
|
$bitrate \
|
||||||
-pix_fmt yuv420p \
|
-pix_fmt yuv420p \
|
||||||
$nvenc \
|
$nvenc \
|
||||||
-q:v 0 \
|
-q:v 0 \
|
||||||
"$output" &
|
"$output" &
|
||||||
|
|
||||||
echo $! > /tmp/blaze-pid
|
echo $! > /tmp/blaze-pid
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if [ "$(cat /etc/hostname)" = "pc" ]; then
|
if [ "$(cat /etc/hostname)" = "pc" ]; then
|
||||||
res="1920x1080"
|
res="1920x1080"
|
||||||
elif [ "$(cat /etc/hostname)" = "laptop" ]; then
|
elif [ "$(cat /etc/hostname)" = "laptop" ]; then
|
||||||
res="1366x768"
|
res="1366x768"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
find ~/.config/wallpapers/"$res"/* | shuf | sxiv - -tb
|
find ~/.config/wallpapers/"$res"/* | shuf | sxiv - -tb
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
x="$(tput op)"
|
x="$(tput op)"
|
||||||
y=$(printf %76s)
|
y=$(printf %76s)
|
||||||
for i in {0..256}; do
|
for i in {0..256}; do
|
||||||
o=00$i
|
o=00$i
|
||||||
echo -e ${o:${#o}-3:3} "$(tput setaf "$i";tput setab "$i")" "${y// /=}$x"
|
echo -e ${o:${#o}-3:3} "$(tput setaf "$i";tput setab "$i")" "${y// /=}$x"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -6,12 +6,12 @@ sym="|"
|
|||||||
cd "$HOME/.local/bin/scripts/dwmbar/" || exit 1
|
cd "$HOME/.local/bin/scripts/dwmbar/" || exit 1
|
||||||
|
|
||||||
status() {
|
status() {
|
||||||
echo "$(./torrent) $sym $(./disk) $sym $(./internet) $sym $(./lamp) $sym $(./music) $sym" \
|
echo "$(./torrent) $sym $(./disk) $sym $(./internet) $sym $(./lamp) $sym $(./music) $sym" \
|
||||||
"$(./alsa) $sym $(./packages) $sym $(./date) $sym $(./clock)"
|
"$(./alsa) $sym $(./packages) $sym $(./date) $sym $(./clock)"
|
||||||
}
|
}
|
||||||
|
|
||||||
while :; do
|
while :; do
|
||||||
xsetroot -name " $(status | tr '\n' ' ')"
|
xsetroot -name " $(status | tr '\n' ' ')"
|
||||||
|
|
||||||
sleep "$delay"
|
sleep "$delay"
|
||||||
done
|
done
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
[ "$(amixer sget Master | awk 'NR==5 { print $6 }')" = "[off]" ] && {
|
[ "$(amixer sget Master | awk 'NR==5 { print $6 }')" = "[off]" ] && {
|
||||||
echo " mut" && exit 1
|
echo " mut" && exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
level=$(amixer sget Master | awk -F"[][]" '/dB/ { print $2 }')
|
level=$(amixer sget Master | awk -F"[][]" '/dB/ { print $2 }')
|
||||||
revel="${level%?}"
|
revel="${level%?}"
|
||||||
@ -13,11 +13,11 @@ v2=""
|
|||||||
v3=""
|
v3=""
|
||||||
|
|
||||||
if [ "$revel" -lt 20 ]; then
|
if [ "$revel" -lt 20 ]; then
|
||||||
echo "$v1"
|
echo "$v1"
|
||||||
elif [ "$revel" -lt 50 ]; then
|
elif [ "$revel" -lt 50 ]; then
|
||||||
echo "$v2"
|
echo "$v2"
|
||||||
elif [ "$revel" -lt 75 ]; then
|
elif [ "$revel" -lt 75 ]; then
|
||||||
echo "$v3"
|
echo "$v3"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$level"
|
echo "$level"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
used() {
|
used() {
|
||||||
df -h "$1" | awk 'NR==2 { print $3 "/" $2 " GB" }' | sed 's/G\//\//g;s/G / /g'
|
df -h "$1" | awk 'NR==2 { print $3 "/" $2 " GB" }' | sed 's/G\//\//g;s/G / /g'
|
||||||
}
|
}
|
||||||
|
|
||||||
root="$(used /)"
|
root="$(used /)"
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if [ "$(cat /etc/hostname)" = "pc" ]; then
|
if [ "$(cat /etc/hostname)" = "pc" ]; then
|
||||||
ip="$(eth-ip)"
|
ip="$(eth-ip)"
|
||||||
echo ""
|
echo ""
|
||||||
elif [ "$(cat /etc/hostname)" = "laptop" ]; then
|
elif [ "$(cat /etc/hostname)" = "laptop" ]; then
|
||||||
ip="$(wifi-ip)"
|
ip="$(wifi-ip)"
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ping -q -c 1 1.1.1.1 >/dev/null || { echo "dis" && exit 1; }
|
ping -q -c 1 1.1.1.1 >/dev/null || { echo "dis" && exit 1; }
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
if mpc status | grep -q "playing"; then
|
if mpc status | grep -q "playing"; then
|
||||||
mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[playing\\].*//g"
|
mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[playing\\].*//g"
|
||||||
elif mpc status | grep -q "paused"; then
|
elif mpc status | grep -q "paused"; then
|
||||||
echo ""
|
echo ""
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -9,10 +9,10 @@ per="$(data | awk '{ print $2 }')"
|
|||||||
[ "${per%?}" != 100 ] && echo "$per" || echo ""
|
[ "${per%?}" != 100 ] && echo "$per" || echo ""
|
||||||
|
|
||||||
data | \
|
data | \
|
||||||
sed "
|
sed "
|
||||||
s/.*Stopped.*//g;
|
s/.*Stopped.*//g;
|
||||||
s/.*Seeding.*//g;
|
s/.*Seeding.*//g;
|
||||||
s/.*Idle.*//g;
|
s/.*Idle.*//g;
|
||||||
s/.*Uploading.*//g;
|
s/.*Uploading.*//g;
|
||||||
s/.*%.*//g
|
s/.*%.*//g
|
||||||
"
|
"
|
||||||
|
3
.local/bin/scripts/refbar
Executable file
3
.local/bin/scripts/refbar
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
pkill -SIGTRAP dbar && dbar &
|
Loading…
x
Reference in New Issue
Block a user