From dcc04cba2446a7bfe8af8268229f3ca28e228b13 Mon Sep 17 00:00:00 2001 From: epoch Date: Mon, 21 Nov 2016 03:08:58 -0600 Subject: added an example use of hackvr with the filebrowser dir. updated a bunch of stuff in hackvr needed to that that filebrowser working. added a multicast example what uses mcast program in my misc repo. updated obj2hackvr to require a filename as argument instead of using stdin --- filebrowser/action_to_target.sh | 2 ++ filebrowser/filebrow.sh | 16 ++++++++++++++++ filebrowser/hackvr-frontend.sh | 2 ++ filebrowser/list_to_cubes.sh | 12 ++++++++++++ filebrowser/run | 3 +++ filebrowser/zenity-frontend.sh | 2 ++ 6 files changed, 37 insertions(+) create mode 100755 filebrowser/action_to_target.sh create mode 100755 filebrowser/filebrow.sh create mode 100755 filebrowser/hackvr-frontend.sh create mode 100755 filebrowser/list_to_cubes.sh create mode 100755 filebrowser/run create mode 100755 filebrowser/zenity-frontend.sh (limited to 'filebrowser') diff --git a/filebrowser/action_to_target.sh b/filebrowser/action_to_target.sh new file mode 100755 index 0000000..a9ed806 --- /dev/null +++ b/filebrowser/action_to_target.sh @@ -0,0 +1,2 @@ +#!/bin/sh +grep --line-buffered ^epoch | stdbuf -oL cut '-d ' -f2- | grep --line-buffered ^action | stdbuf -oL cut '-d ' -f2- diff --git a/filebrowser/filebrow.sh b/filebrowser/filebrow.sh new file mode 100755 index 0000000..ef6911a --- /dev/null +++ b/filebrowser/filebrow.sh @@ -0,0 +1,16 @@ +#!/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/hackvr-frontend.sh b/filebrowser/hackvr-frontend.sh new file mode 100755 index 0000000..002ba42 --- /dev/null +++ b/filebrowser/hackvr-frontend.sh @@ -0,0 +1,2 @@ +#!/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 new file mode 100755 index 0000000..5de89a6 --- /dev/null +++ b/filebrowser/list_to_cubes.sh @@ -0,0 +1,12 @@ +#!/bin/bash +while read -r line;do + if [ "_$line" != '_' ];then +# ../tools/obj2hackvr.pl "$line" ../meshes/cube.obj + printf "%s addtriangle 1 0 0 0 1 0 0 0 0\n" "$line" + printf "%s move 0 %d 0 0 0 0 0 0 0\n" "$line" "$i" + i=$[i+2] + else + printf "epoch deleteallexcept epoch\n" + i=0 + fi +done diff --git a/filebrowser/run b/filebrowser/run new file mode 100755 index 0000000..d088d2e --- /dev/null +++ b/filebrowser/run @@ -0,0 +1,3 @@ +#!/bin/bash +cd "$(dirname "$0")" +./hackvr-frontend.sh diff --git a/filebrowser/zenity-frontend.sh b/filebrowser/zenity-frontend.sh new file mode 100755 index 0000000..0ba5efb --- /dev/null +++ b/filebrowser/zenity-frontend.sh @@ -0,0 +1,2 @@ +#!/bin/sh +cat p | ./filebrow.sh | tr -d '\n' | xargs -L1 zenity --list --column file > p -- cgit v1.2.3