Merge branch 'master' of github.com:Jab2870/dotfiles

This commit is contained in:
Jonathan Hodgson 2019-05-08 08:46:56 +01:00
commit e1d3bd5bc8
5 changed files with 136 additions and 18 deletions

49
bin/createGif Executable file
View file

@ -0,0 +1,49 @@
#!/bin/bash
# Creates a gif using a list of files from stdin
tmpdir="/tmp/sxiv-gif/"
rm -rf "$tmpdir"
mkdir -p "$tmpdir"
framerate="prompt"
format="gif"
extension=""
while [[ $# -gt 0 ]]; do
case "$1" in
"-r"|"--framerate")
framerate="$2"
shift
shift
;;
"--mp4")
format="mp4"
shift
;;
esac
done
if [[ "$framerate" == "prompt" ]]; then
framerate=$(echo -e "0.25\n0.5\n0.75\n1\n2\n5\n10" | rofi -dmenu -p Timeout)
fi
i=1
while read file; do
extension="${file##*.}"
number=$(printf "%03d" $i)
echo "$number"
cp "$file" "${tmpdir}file${number}.${extension}"
i=$((i+1))
done
case "$format" in
"mp4")
ffmpeg -f image2 -framerate "$framerate" -i "${tmpdir}file%03d.${extension}" -crf 0 "${tmpdir}out.${format}"
;;
*)
ffmpeg -f image2 -framerate "$framerate" -i "${tmpdir}file%03d.${extension}" "${tmpdir}out.${format}"
esac
mv "${tmpdir}out.${format}" "$HOME/Desktop/"
notify-send "Done"

42
bin/rofi-print Executable file
View file

@ -0,0 +1,42 @@
#!/bin/bash
# printpdf - script
# usage:
# printpdf file.pdf
# printpdf file1.pdf file2.pdf
# printpdf *.pdf
# by i_magnific0
# Modified by jab2870
#COLORS=" -nb #303030 -nf khaki -sb #CCFFAA -sf #303030"
#if dmenu --help 2>&1 | grep -q '\[-rs\] \[-ni\] \[-nl\] \[-xs\]'
#then
# DMENU="dmenu -i -xs -rs -l 10" # vertical patch
#else
# DMENU="dmenu -i" # horizontal, oh well!
#fi
DMENU="rofi -dmenu"
printer=$( lpstat -p | awk '{print $2}' | $DMENU -p 'Printer:' $COLORS | perl -p -e 's/^.*?: ?//' )
set_options=$( echo -e 'No\nYes' | $DMENU -p 'Set options?' $COLORS | perl -p -e 's/^.*?: ?//' )
options=""
# standard options to lpr, not in the printer lpstat -l
standard_options="page-ranges\nlandscape"
while [ $set_options == "Yes" ]; do
custom_options=$( lpoptions -d $printer -l | grep -v NotInstalled | awk '{ print $1 }' | sed 's/:\+//g' )
option_to_set=$( echo -e "$standard_options\n$custom_options" | $DMENU -p 'Option:' $COLORS | perl -p -e 's/^.*?: ?//' )
option_value=$( lpoptions -d $printer -l | grep $option_to_set | awk 'BEGIN { FS = ": " } ; { print $2 }' | sed 's/ \+/\n/g' | sed 's/*\+//g' | $DMENU -p 'Setting:' $COLORS | perl -p -e 's/^.*?: ?//' )
option_to_set_1d=$( echo $option_to_set | awk 'BEGIN { FS = "/" } ; { print $1 }' )
if [ -z $option_value ]; then
options=$options"-o $option_to_set_1d "
else
options=$options"-o $option_to_set_1d=$option_value "
fi
set_options=$( echo -e 'No\nYes' | $DMENU -p 'Set more options?' $COLORS | perl -p -e 's/^.*?: ?//' )
done
lpr $options -P $printer $@