1
0
mirror of https://github.com/balkian/dotfiles.git synced 2025-08-24 00:02:19 +00:00

Multiple changes

This commit is contained in:
J. Fernando Sánchez
2018-09-12 19:04:59 +02:00
parent 6f97821cae
commit ea78b16bd9
17 changed files with 622 additions and 72 deletions

14
scripts/.bin/deshake-video.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/sh
# Encode a video in DVD quality (-crf 23) and use the video stabilization/deshaking plugin
# https://ffmpeg.org/ffmpeg-filters.html#toc-vidstabdetect-1
for VIDEO in "$@"
do
DEST=converted/$VIDEO
if [ -f $DEST ]; then
echo "File $VIDEO already converted"
continue
fi
mkdir -p converted
ffmpeg -i $VIDEO -vf vidstabdetect -f null -
ffmpeg -i $VIDEO -vf vidstabtransform=smoothing=30:input="transforms.trf" -crf 23 $DEST
done

View File

@@ -4,6 +4,11 @@ if [ "$#" -lt 1 ]; then
else
sh $HOME/.screenlayout/$1.sh
fi
if pgrep -u $UID -x polybar >/dev/null; then
sh /home/j/.bin/polybar.sh;
fi
if [ `command -v nitrogen` ]; then
nitrogen --restore
fi

49
scripts/.bin/nodistractions.sh Executable file
View File

@@ -0,0 +1,49 @@
#!/bin/sh
# If you want to allow some websites/IPs to still work
# after adding the filters, just add specific rules to
# iptables to allow it. For instance:
#
# sudo iptables --insert OUTPUT --protocol tcp --destination 138.4.0.0/16 --jump ACCEPT
#
# iptables rules are interpreted top to bottom.
# --append adds rules to the end of the file
# --insert adds rules to the top of the file
# Hence, you can either append the rule before running
# the script, or insert the rule so it takes precedence.
export SUDO_ASKPASS=/usr/lib/ssh/ssh-askpass
CMD="sudo -A iptables"
RULE="OUTPUT --protocol tcp --jump DROP --dport"
stop_filter() {
$CMD --delete $RULE 80
$CMD --delete $RULE 443
}
filter() {
stop_filter >&2 /dev/null # Avoid re-adding
$CMD --append $RULE 80
$CMD --append $RULE 443
}
help() {
echo "Usage: $0 on|off"
}
if [ "$#" -ne 1 ]; then
filter
else
case "$1" in
"on")
filter
;;
"off")
zenity --question --text="Are you sure you want to let distractions in?" && stop_filter
;;
*)
help
esac
fi

View File

@@ -2,7 +2,7 @@
if command -v rofi >/dev/null 2>&1;
then
launcher="rofi -show drun"
launcher="rofi -show combi -combi-hide-mode-prefix -combi-modi drun,run"
else
launcher="dmenu_run -fn "-*-cure-medium-*-*-*-11-*-*-*-*-*-*-*" -nb "#101010" -nf "#5f5f5f" -sb "#191919" -sf "#b72f62" -b"
fi

View File

@@ -0,0 +1,17 @@
#!/bin/bash
DEV="hci0/dev_00_A0_C6_95_DE_E8"
currentvol=`dbus-send --system --type=method_call --print-reply=literal --dest=org.bluez /org/bluez/$DEV/fd2 org.freedesktop.DBus.Properties.Get string:org.bluez.MediaTransport1 string:Volume | cut -d" " -f 12`
increment() {
newvol=$(($currentvol + 5))
dbus-send --system --type=method_call --print-reply=literal --dest=org.bluez /org/bluez/$DEV/fd2 org.freedesktop.DBus.Properties.Set string:org.bluez.MediaTransport1 string:Volume variant:uint16:$newvol
}
decrement() {
newvol=$(($currentvol - 5))
dbus-send --system --type=method_call --print-reply=literal --dest=org.bluez /org/bluez/$DEV/fd2 org.freedesktop.DBus.Properties.Set string:org.bluez.MediaTransport1 string:Volume variant:uint16:$newvol
}
$1