From f4b77c42ca78c5265c4754caeef5289e3841f5e9 Mon Sep 17 00:00:00 2001 From: Timmy Keller Date: Thu, 23 Dec 2021 22:20:14 -0600 Subject: some youtube dl script and dmenu runapplication and test timmywm and modified other scripts idjlol --- launch/dmenu_runapp | 4 ++++ launch/virt | 6 +++--- misc/mime | 9 +++++++-- video/ffconcat | 17 ++++++----------- video/ytdl-dlplst | 5 +++++ x11/testtimmywm | 6 ++++++ 6 files changed, 31 insertions(+), 16 deletions(-) create mode 100755 launch/dmenu_runapp create mode 100755 video/ytdl-dlplst create mode 100755 x11/testtimmywm diff --git a/launch/dmenu_runapp b/launch/dmenu_runapp new file mode 100755 index 0000000..bf0e148 --- /dev/null +++ b/launch/dmenu_runapp @@ -0,0 +1,4 @@ +#!/bin/sh +apps=/usr/share/applications +name="$(grep -rh -m1 '^Name=' $apps | cut -d'=' -f2- | sort | uniq | dmenu "$@")" +$(grep '^Exec=[^%]*' -o -m1 $(grep -rl -m1 "$name" $apps) | cut -d'=' -f2-) & diff --git a/launch/virt b/launch/virt index f1035a0..9706106 100755 --- a/launch/virt +++ b/launch/virt @@ -10,15 +10,15 @@ startvm() { -m $(halfram) \ -smp $(halfthreads) \ -net nic \ - -nographic \ - -vga none \ + -display sdl,gl=on \ -audiodev pa,id=pa1,server=/run/user/1000/pulse/native \ -soundhw all \ -boot menu=on \ -drive file="$virtdir/$1.img" \ ; } + #-vga none \ + #-nographic \ - #-display sdl,gl=on \ vms="$(ls $virtdir)" [ -n "$1" ] && vm="$1" || vm=$(echo "$vms" | sed 's/\.img//' | dmenu -p "Choose Virtual Machine Image or Enter Name for New Virtual Machine") diff --git a/misc/mime b/misc/mime index 376506b..7c6a649 100755 --- a/misc/mime +++ b/misc/mime @@ -65,6 +65,7 @@ echo # Choose subtype mtypefile="$cachedir/$mtype.csv" [ -e "$mtypefile" ] && interactiveopt "all\n$(cut -d',' -f1 "$mtypefile" | tail -n +2)" "Choose $mtype subtype: " "" col +mfiletypes=" $opt " echo # Choose program @@ -73,8 +74,12 @@ program="$opt" echo "$program" echo +#echo "$mfiletypes" | grep ' all ' && mfiletypes="$(cut -d',' -f1 "$cachedir/$mtype.csv" | tail -n +2)" + # Xdg-mime commands -#echo "All $mtype Types\n$(cut -d',' -f1 "$cachedir/image.csv" | tail -n +2)" #cut -d',' -f2 "$cachedir/image.csv" -#[ -n "$mimetype" ] && xdg-mime default $application.desktop $mimetype +for mfiletype in $(cut -d',' -f1 "$cachedir/$mtype.csv" | tail -n +2); do + echo "Changing default program for $mfiletype to $program" + xdg-mime default "$program.desktop" $mfiletype +done diff --git a/video/ffconcat b/video/ffconcat index 7e903f6..06eb066 100755 --- a/video/ffconcat +++ b/video/ffconcat @@ -1,17 +1,12 @@ #!/bin/sh -#for out; do true; done # get last argument -filelist=$(mktemp ${TMPDIR:-/tmp}/ffconcat.XXXXXX) || exit -pwd="$(pwd)" -for out; do - [ -e "$pwd/$out" ] \ - && files="$pwd/$out\n$files" \ - || ([ -e "$out" ] && files="$out\n$files") -done -echo $files | tail +2 | sed -n "s/\(.\+\)/file '\1'/p"# > $filelist +ffconcat="$(ls | sed "s/^/file '/; s/$/'/")" +echo "$ffconcat" > ffconcat ffmpeg \ -f concat \ -safe 0 \ - -i $filelist \ + -i ffconcat \ -c copy \ - $out + out.mkv + +rm ffconcat diff --git a/video/ytdl-dlplst b/video/ytdl-dlplst new file mode 100755 index 0000000..f7b4a47 --- /dev/null +++ b/video/ytdl-dlplst @@ -0,0 +1,5 @@ +#!/bin/sh +echo "Getting Video ID's..." +for id in $(youtube-dl --get-id "$1"); do + youtube-dl --newline "https://youtu.be/$id" & +done diff --git a/x11/testtimmywm b/x11/testtimmywm new file mode 100755 index 0000000..330a328 --- /dev/null +++ b/x11/testtimmywm @@ -0,0 +1,6 @@ +#!/bin/sh + +Xephyr -br -ac -reset -screen 2160x1440 :1 & +sleep 1 +export DISPLAY=:1 +timmywm & -- cgit v1.2.3