summaryrefslogtreecommitdiff
path: root/share/hackvr/examples/filebrowser/backend-filebrowser.sh
blob: 7fdfc2e3694b1fd37c2c2c149eaad90e36e30068 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env 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 ..
  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