From b4dddad64122649d9da6340032275d1756930e74 Mon Sep 17 00:00:00 2001 From: epoch Date: Fri, 9 Dec 2016 15:54:33 -0600 Subject: LOTS OF SHIT --- filebrowser/backend-filebrowser.sh | 19 +++++++++++++++++++ filebrowser/backend-gopher.sh | 14 ++++++++++++++ filebrowser/filebrow.sh | 16 ---------------- filebrowser/frontend-hackvr.sh | 2 ++ filebrowser/frontend-zenity.sh | 2 ++ filebrowser/hackvr-frontend.sh | 2 -- filebrowser/list_to_cubes.sh | 9 +++++++++ filebrowser/zenity-frontend.sh | 2 -- 8 files changed, 46 insertions(+), 20 deletions(-) create mode 100755 filebrowser/backend-filebrowser.sh create mode 100755 filebrowser/backend-gopher.sh delete mode 100755 filebrowser/filebrow.sh create mode 100755 filebrowser/frontend-hackvr.sh create mode 100755 filebrowser/frontend-zenity.sh delete mode 100755 filebrowser/hackvr-frontend.sh delete mode 100755 filebrowser/zenity-frontend.sh (limited to 'filebrowser') diff --git a/filebrowser/backend-filebrowser.sh b/filebrowser/backend-filebrowser.sh new file mode 100755 index 0000000..9cbf11a --- /dev/null +++ b/filebrowser/backend-filebrowser.sh @@ -0,0 +1,19 @@ +#!/bin/bash +#give a list of files. +#wait for a selection on stdin +#cd or start that file +#repeat. +while true;do +#not sure why this needs to be printed to show up every time. + echo .. + echo .. + find . -maxdepth 1 #| tr ' ' '\n' #wut? no? + read -r selection + if [ -f "$selection" ];then + xdg-open "$selection" #good enough? + fi + if [ -d "$selection" ];then + cd "$selection" + fi + echo +done diff --git a/filebrowser/backend-gopher.sh b/filebrowser/backend-gopher.sh new file mode 100755 index 0000000..69e1bbe --- /dev/null +++ b/filebrowser/backend-gopher.sh @@ -0,0 +1,14 @@ +#!/bin/bash +#give a list of files. +#wait for a selection on stdin +#cd or start that file +#repeat. +server=192.168.0.2 +port=70 +selection=/ +while true;do +#not sure why this needs to be printed to show up every time. + printf '%s\n' "$selection" | ncat "$server" "$port" + read -r selection + echo +done diff --git a/filebrowser/filebrow.sh b/filebrowser/filebrow.sh deleted file mode 100755 index ef6911a..0000000 --- a/filebrowser/filebrow.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -#give a list of files. -#wait for a selection on stdin -#cd or start that file -#repeat. -while true;do - echo - echo .* * | tr ' ' '\n' - read -r selection - if [ -f "$selection" ];then - xdg-open "$selection" #good enough? - fi - if [ -d "$selection" ];then - cd "$selection" - fi -done diff --git a/filebrowser/frontend-hackvr.sh b/filebrowser/frontend-hackvr.sh new file mode 100755 index 0000000..f04e534 --- /dev/null +++ b/filebrowser/frontend-hackvr.sh @@ -0,0 +1,2 @@ +#!/bin/sh +stdbuf -oL $1 < p | ./list_to_cubes.sh | ../hackvr epoch | ./action_to_target.sh > p diff --git a/filebrowser/frontend-zenity.sh b/filebrowser/frontend-zenity.sh new file mode 100755 index 0000000..acb7cd7 --- /dev/null +++ b/filebrowser/frontend-zenity.sh @@ -0,0 +1,2 @@ +#!/bin/bash +stdbuf -oL $1 < p | stdbuf -oL tr '\n' ' ' | sed -u 's/$/_/' | stdbuf -oL tr '_' '\n' | xargs -L1 zenity --list --column file > p diff --git a/filebrowser/hackvr-frontend.sh b/filebrowser/hackvr-frontend.sh deleted file mode 100755 index 002ba42..0000000 --- a/filebrowser/hackvr-frontend.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -stdbuf -oL ./filebrow.sh < p | ./list_to_cubes.sh | ../hackvr epoch | ./action_to_target.sh > p diff --git a/filebrowser/list_to_cubes.sh b/filebrowser/list_to_cubes.sh index 5de89a6..d4ad688 100755 --- a/filebrowser/list_to_cubes.sh +++ b/filebrowser/list_to_cubes.sh @@ -1,4 +1,13 @@ #!/bin/bash +# blank lines deleteallexcept epoch +# expected input format: +# +# line1 +# line2 +# line3 +# +# line1 +# line2 while read -r line;do if [ "_$line" != '_' ];then # ../tools/obj2hackvr.pl "$line" ../meshes/cube.obj diff --git a/filebrowser/zenity-frontend.sh b/filebrowser/zenity-frontend.sh deleted file mode 100755 index 0ba5efb..0000000 --- a/filebrowser/zenity-frontend.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -cat p | ./filebrow.sh | tr -d '\n' | xargs -L1 zenity --list --column file > p -- cgit v1.2.3