1
0
mirror of https://github.com/balkian/dotfiles.git synced 2024-11-24 05:02:29 +00:00

Add filemenu to i3

This commit is contained in:
J. Fernando Sánchez 2016-12-15 15:35:16 +01:00
parent 619cd94874
commit 2f78d852e6
2 changed files with 34 additions and 1 deletions

View File

@ -30,7 +30,7 @@ bindsym Control+Mod1+l exec --no-startup-id i3-exit.sh lock
bindsym Control+Mod1+w exec --no-startup-id i3-one-instance firefox
bindsym Control+Mod1+g exec --no-startup-id i3-one-instance gvim
bindsym Control+Mod1+e exec --no-startup-id myemacs -c
bindsym $mod+o exec --no-startup-id winmenu.sh
bindsym $mod+Tab exec --no-startup-id winmenu.sh
bindsym $mod+p [class="Nemo"] scratchpad show
bindsym $mod+period [instance="emacs" title="^(?!myagenda$)"] scratchpad show
bindsym $mod+shift+comma exec --no-startup-id myemacs -nc --eval '(progn (find-file "~/Dropbox/Todo/org/rules.org") (org-agenda-list) (set-frame-name "myagenda"))'
@ -57,6 +57,7 @@ bindsym $mod+q kill
# start dmenu (a program launcher)
#bindsym $mod+Space exec --no-startup-id dmenu_run
bindsym $mod+space exec --no-startup-id runmenu
bindsym $mod+o exec --no-startup-id filemenu $HOME
# Arandr magic
bindsym Mod1+F5 exec --no-startup-id monitors single

32
scripts/.bin/filemenu Executable file
View File

@ -0,0 +1,32 @@
#!/bin/sh
if [ "$#" -le 0 ]; then
echo "Usage: $0 <FOLDER>"
exit 1
else
input="$@"
fi
echo "Input: "$input
if [ -f "$input" ]; then
xdg-open "$input"
exit $?
else
if [ -d "$input" ]; then
echo "This is a folder" $input
else
>&2 echo 'Invalid argument:"'$input'"'
exit 1
fi
fi
if command -v rofi >/dev/null 2>&1;
then
launcher="rofi -dmenu -i -mesg '""$input""'"
else
launcher="dmenu -fn "-*-cure-medium-*-*-*-11-*-*-*-*-*-*-*" -nb "#101010" -nf "#5f5f5f" -sb "#191
fi
# find "$input" -maxdepth 1 ! -path "$input" -print | sh -c "$launcher" | xargs $0
ls -t1 "$input" | sh -c "$launcher" | xargs -I '{}' $0 "$input/{}"