dotfiles/.local/bin/tools/ce
Alexander Bocken 6907760e58
various changes
modified:   .config/coc/history.json
	modified:   .config/gtk-2.0/gtkfilechooser.ini
	modified:   .config/newsboat/config
	modified:   .config/nvim/init.vim
	modified:   .config/qutebrowser/autoconfig.yml
	modified:   .config/qutebrowser/qsettings/QtProject.conf
	modified:   .config/zsh/.zshrc
	modified:   .local/bin/castscreen
	modified:   .local/bin/dmenuvpn
	modified:   .local/bin/statusbar/internet
	deleted:    .local/bin/tools/bright
	modified:   .local/bin/tools/ce
	modified:   .local/bin/tools/hover
	modified:   .local/bin/tools/ripper
	modified:   .local/bin/tools/startmpv
	modified:   .zprofile
2020-10-28 13:48:43 +01:00

19 lines
837 B
Bash
Executable File

#!/bin/bash
currentdir="$(pwd)"
#file="$( du -a ~/.config/* ~/.local/src/* ~/.local/bin/* | awk '{print $2}' | fzf -e --query="$*")"
#[ "$file" = "" ] || ( cd "$( dirname "$file" )" && $EDITOR "$file" && cd "$currentdir" )
ppid () { ps -p ${1:-$$} -o ppid=; }
shell="$(ps aux | grep $( ppid ) | head -n1 | awk '{print $11}' )"
#/bin/sh probably means we're in dmenu_run
if [ "$shell" = "/bin/sh" ]; then
file="$( du -a ~/.config/* ~/.local/src/* ~/.local/bin/* | awk '{print $2}' | dmenu -l 10 -p 'open what file?' )"
[ -z "$file" ] && exit
## NEEDS TO BE WORKED ON
cd "$( dirname "$file" )" && st $EDITOR "$file"
else
currentdir="$(pwd)"
file="$( du -a ~/.config/* ~/.local/src/* ~/.local/bin/* | awk '{print $2}' | fzf -e --query="$*")"
[ -z "$file" ] && exit
cd "$( dirname "$file" )" && rifle "$file" && cd "$currentdir"
fi