LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   how to implement a icon in dmenu file manager (https://www.linuxquestions.org/questions/programming-9/how-to-implement-a-icon-in-dmenu-file-manager-4175694330/)

pnotz17 04-26-2021 09:16 PM

how to implement a icon in dmenu file manager
 
im trying to figure out how to implement a icon in dmenu on the left side of each dir/file not the prompt, i know it can be done with echo sed or awk print could anyone give me a example?

#!/bin/bash

while true; do
open=$(ls -1a --group-directories-first --file-type | dmenu -fn Symbola -c -g 1 -p 'Navigate:' "$@")
if [[ -d "$open" ]]; then
cd "$open"
else
if [[ "$open" != "" ]]; then
xdg-open "$open"
fi
exit 0
fi
done

ondoho 04-27-2021 01:17 AM

Quote:

Originally Posted by pnotz17 (Post 6245314)
im trying to figure out how to implement a icon in dmenu on the left side of each dir/file not the prompt, i know it can be done with echo sed or awk print could anyone give me a example?

Code:

#!/bin/bash

while true; do
    open=$(ls -1a --group-directories-first --file-type | dmenu  -fn Symbola -c -g 1 -p 'Navigate:' "$@")
    if [[ -d "$open" ]]; then
        cd "$open"
    else
        if [[ "$open" != "" ]]; then
            xdg-open "$open"
        fi
        exit 0
    fi
done


^ I added code tags to your code. Much more readable, wouldn't you say?
Running this script, all I get is an error from dmenu.
It has neither -c nor -g options.
Generally speaking, dmenu does not support any sort of icons, text only. You might work around that by using some sort of unicode symbols, but it won't just magically happen; you'd have to massage 'ls' output quite a bit.

pnotz17 04-27-2021 08:06 AM

Quote:

Originally Posted by ondoho (Post 6245352)
^ I added code tags to your code. Much more readable, wouldn't you say?
Running this script, all I get is an error from dmenu.
It has neither -c nor -g options.
Generally speaking, dmenu does not support any sort of icons, text only. You might work around that by using some sort of unicode symbols, but it won't just magically happen; you'd have to massage 'ls' output quite a bit.

hmm -c is centered -g is grid column -l is list im still trying to understand why i can never get the -i flag to work which case insensitive which mine is already like that, maybe im doing something wrong here are my dots https://github.com/pnotz17/dotfiles

pnotz17 04-27-2021 08:32 AM

i guess in the man page it doesn't have -c -g flag, i guess the patches create that, my dmenu is by far not vanilla but why do i always get an error when -i flag is applied, anyway back to the question i had found a rofi-dmenu script https://github.com/Chrysostomus/rofi...rofi-finder.sh that implemented icons with sed, to my understanding it can be done with echo and awk printf ,im no programmer but i can follow code but i cant find an example to what i want to do, sorry for the way im posting im still learning how to quote and there's no code thing to post scripts in a nice way btw where do i get replies in this like something in the corner that says 1 or 2 messages anyways il figure it out


All times are GMT -5. The time now is 01:59 PM.