LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-26-2021, 09:16 PM   #1
pnotz17
LQ Newbie
 
Registered: Apr 2021
Posts: 7

Rep: Reputation: Disabled
Smile 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

Last edited by pnotz17; 05-02-2021 at 10:45 AM.
 
Old 04-27-2021, 01:17 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,237
Blog Entries: 10

Rep: Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160
Quote:
Originally Posted by pnotz17 View Post
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.
 
1 members found this post helpful.
Old 04-27-2021, 08:06 AM   #3
pnotz17
LQ Newbie
 
Registered: Apr 2021
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
^ 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
 
Old 04-27-2021, 08:32 AM   #4
pnotz17
LQ Newbie
 
Registered: Apr 2021
Posts: 7

Original Poster
Rep: Reputation: Disabled
Smile

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
 
  


Reply

Tags
newbie, newbie coding, scripts


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Artix Linux w/ OpenRC, Awesome Window Manager... riced dmenu, librewolf, termite, fish MattMadness Linux - Member Desktop Screenshots 2 12-08-2020 12:10 AM
how to Run .sh file directly from dmenu-i3wm? rdeyvil Linux - Newbie 3 06-27-2017 04:07 PM
[SOLVED] Dmenu michijo Slackware 21 11-03-2012 08:28 PM
Dmenu Turned Black michijo Linux - Software 0 11-02-2012 11:42 AM
Terminator & Dmenu spoovy Linux - Software 4 08-19-2010 03:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration