You are not logged in.

#1 2020-10-02 14:26:45

Savant
Member
Registered: 2017-03-14
Posts: 8

Bemenu scripting problem

Hello,

I have a problem with via scripts. I'm using it with bemenu. It works fine when run from urxvt with zsh but breaks when run from shortcut on i3. Here are slightly modified versions of that scripts:

via-menu

#!/bin/bash

bemenu -H 18 --fn "AcPlus IBM VGA 9x16" --tb="#458588" --tf='#EBDBB2' --fb='#282828' --ff="#EBDBB2" --nb='#282828' --nf='#EBDBB2' --hb='#458588' --hf='#EBDBB2' --sb='#282828' --sf='#EBDBB2' -p "via" -i -l 5

via-feed

#!/bin/bash

cache="$HOME/.cache/via"

if [[ "$1" == "-r" ]] || [[ ! -e "$cache" ]]; then
        cat "$HOME/.config/via/shortcuts" > "$cache"
        cat "$HOME/.config/via/websites" >> "$cache"
        find "/home/savant/" -mindepth 1 \( -name ".cache" -o -path "$HOME/code/*" -o -name ".cargo" -o -name ".local" -o -name ".rustup" -o -name ".npm" \) -prune -o -print | sort >> "$cache" 
fi

cat "$cache"

via-open

#!/bin/bash

exec &> /dev/null

while read arg; do
        # first try matching by filename or pathname
        case "${arg,,}" in
                http*)
                        $BROWSER "$arg" &
                        ;;
                [^/]*) # doesn't start with '/'
                        sh -c "$arg"
                        ;;
                *.txt)
                        $TERMINAL -e $EDITOR "$arg" &
                        ;;
                *.pdf | *.epub)
                        mupdf "$arg" &
                        ;;
                *.mp3)
                        $TERMINAL -e mpg123 -opulse "$arg" &
                        ;;
                *.od[tsp]|*.doc|*.docx|*.ppt|*.pptx|*.xls|*.xlsx)
                        libreoffice "$arg" &
                        ;;
                *)
                        # then try matching by mimetype
                        mimetype=$(file -Lb --mime-type "$arg")
                        case "$mimetype" in
                                text/html)
                                        $BROWSER "$arg" &
                                        ;;
                                text/* | inode/x-empty | message/rfc822)
                                        $TERMINAL -e $EDITOR "$arg" &
                                        ;;
                                inode/directory)
                                        $TERMINAL -e ranger "$arg" &
                                        ;;
                                image/*)
                                        sxiv "$arg" &
                                        ;;
                                video/*)
                                        mpv "$arg" &
                                        ;;
                                *)
                                        exit 1
                                        ;;
                        esac
                        ;;
        esac
done

Offline

#2 2020-10-02 16:24:57

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,468

Re: Bemenu scripting problem

Have you installed bemenu-x11 ?

Offline

#3 2020-10-02 16:26:21

Savant
Member
Registered: 2017-03-14
Posts: 8

Re: Bemenu scripting problem

Yes, I did

Offline

#4 2020-10-02 16:31:59

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,468

Re: Bemenu scripting problem

Can you post the shortcut used in i3 ?

Offline

#5 2020-10-02 16:47:47

Savant
Member
Registered: 2017-03-14
Posts: 8

Re: Bemenu scripting problem

Here it is

bindsym $mod+d exec bemenu-run -H 18 --fn "AcPlus IBM VGA 9x16" --tb="#458588" --tf='#EBDBB2' --fb='#282828' --ff="#EBDBB2" --nb='#282828' --nf='#EBDBB2' --hb='#458588' --hf='#EBDBB2' --sb='#282828' --sf='#EBDBB2' --prompt='run' 
bindsym $mod+s exec zsh -c via

Offline

#6 2020-10-02 17:01:35

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,468

Re: Bemenu scripting problem

1. is "via" in path ?
2.  have you tried running only 'bemenu-run' without all arguments ? Probably it is failing due to multiple arguments. You can make a shell script with all the arguments and use that script in i3 config.

Offline

#7 2020-10-02 17:08:17

Savant
Member
Registered: 2017-03-14
Posts: 8

Re: Bemenu scripting problem

Docbroke wrote:

1. is "via" in path ?
2.  have you tried running only 'bemenu-run' without all arguments ? Probably it is failing due to multiple arguments. You can make a shell script with all the arguments and use that script in i3 config.

1. It is
2. I tried, also when I run it from terminal It works.

Offline

#8 2020-10-05 13:33:05

Savant
Member
Registered: 2017-03-14
Posts: 8

Re: Bemenu scripting problem

Bumping

Offline

#9 2020-10-05 13:50:37

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Bemenu scripting problem

Don't do that.
CoC - Bumping


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

Board footer

Powered by FluxBB