LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Arch
User Name
Password
Arch This Forum is for the discussion of Arch Linux.

Notices


Reply
  Search this Thread
Old 07-28-2015, 06:43 PM   #1
itscience
Member
 
Registered: May 2015
Location: Lancashire UK
Distribution: arch
Posts: 37

Rep: Reputation: Disabled
Can you customize dmenu?


Hey. I have a question :-) Can you customize dmenu? I'd like to know if there is a file or fork of dmenu that I can change it's appearance. Really I would like to change it's width to match the i3bar.

I put this under Arch because the packages might be Arch pacific:
Thanks for reading. Hope there is a way.
 
Old 07-29-2015, 09:00 AM   #2
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Arch & Debian
Posts: 1,183

Rep: Reputation: 284Reputation: 284Reputation: 284
Quote:
Originally Posted by itscience View Post
Really I would like to change it's width to match the i3bar.
To modify the height of the dmenu bar, you will have to download the source code and modify that.
Code:
git clone http://git.suckless.org/dmenu
cd dmenu
You will need to alter the paths in dmenu/config.mk to this:
Code:
# paths
PREFIX = /usr
MANPREFIX = ${PREFIX}/share/man

X11INC = /usr/include/X11
X11LIB = /usr/lib/X11
Then copy the default configuration file to a user-alterable version:
Code:
cp config.def.h config.h
Then modify config.h to your taste (the latest MASTER branch now has Xft support so you can use a fancy font if you wish).

For the bar height, modify dmenu.c
Code:
vim dmenu.c
Go to line 617 (this is specific to the current MASTER branch):
Code:
        bh = drw->fonts[0]->h + 2;
This line sets the height of the bar ("bh") to the height of the font plus two pixels ("h + 2") -- simply change "2" to whichever value you want and compile and install the package:
Code:
make
# make install
Alternatively, you could modify the version found in the repositories by using the Arch Build System and install with pacman (ie, the "correct" way) -- the line is very similar but is at a different line number.

It is also possible to use the PKGBUILD found in the ABS to install the git version with pacman.
 
Old 07-29-2015, 09:22 AM   #3
itscience
Member
 
Registered: May 2015
Location: Lancashire UK
Distribution: arch
Posts: 37

Original Poster
Rep: Reputation: Disabled
Perfect. This will give me the opportunity to learn about the Arch Build System.
Thanks for your reply. It is very helpful :-)
 
Old 07-29-2015, 09:24 AM   #4
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Arch & Debian
Posts: 1,183

Rep: Reputation: 284Reputation: 284Reputation: 284
You're welcome
 
Old 07-29-2015, 12:43 PM   #5
itscience
Member
 
Registered: May 2015
Location: Lancashire UK
Distribution: arch
Posts: 37

Original Poster
Rep: Reputation: Disabled
Hi, sorry about this but I have one last query.
I have tried the Arch way but something isn't quite working.
I have used abs to build from source:
#abs community/dmenu $mkdir $HOME/abs $cp -r /var/abs/community/dmenu ~/abs $cd ~/abs/dmenu $makepkg -s

Once it is finished I am left with folders and a dmenu-***.pkg.tar.xz file and I make the changes I wanna make in ~/abs/dmenu/src/dmenu
I $cp config.def.h config.h and edit the config.h, config.mk and dmenu.c
dmenu.c doesn't have the line you described but I found bh = dc->font.height + 2; on line 552 which I figured must be it.
next thing is I use #pacman -U dmenu-***.pkg.tar.xz and the program is installed but no changes are made.

I can only assume that the folder are irrelevant and the changes I should be making are in fact in the pkg.tar.xz file.
I'd love to know what I am missing or doing wrong. Please let me know. Thanks again :-)
 
Old 07-29-2015, 04:00 PM   #6
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Arch & Debian
Posts: 1,183

Rep: Reputation: 284Reputation: 284Reputation: 284
Quote:
Originally Posted by itscience View Post
$makepkg -s
From makepkg(8):
Quote:
-e, --noextract
Do not extract source files or run the prepare() function (if present); use whatever
source already exists in the $srcdir/ directory. This is handy if you want to go into
$srcdir/ and manually patch or tweak code, then make a package out of the result. Keep
in mind that creating a patch may be a better solution to allow others to use your
PKGBUILD.
Use:
Code:
makepkg -efi
EDIT: You also have to either update the checksums or use:
Code:
makepkg -efi --skipinteg

Last edited by Head_on_a_Stick; 07-29-2015 at 04:02 PM.
 
Old 07-30-2015, 02:37 PM   #7
itscience
Member
 
Registered: May 2015
Location: Lancashire UK
Distribution: arch
Posts: 37

Original Poster
Rep: Reputation: Disabled
Eurika! Thank you :-)

To clarify I used:
$mkdir ~/abs
$abs repository/package
$cp -r /var/abs/repository/package ~/abs
$makepkg -s (in ~/abs/package_folder)
(Made the changes I wanted/needed)
$makepkg -efi --skipinteg (again, in ~/abs/package_folder)

So far I've had no problems. I am sure I can fiddle to my hearts content should I desire it but the dmenu looks a lot smarter and matches with the i3bar perfectly :-)

Cheers, again!
 
Old 07-30-2015, 03:49 PM   #8
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Arch & Debian
Posts: 1,183

Rep: Reputation: 284Reputation: 284Reputation: 284
You're welcome, glad you got it working.

dmenu FTW!
 
  


Reply


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
[SOLVED] Dmenu michijo Slackware 21 11-03-2012 09:28 PM
Dmenu Turned Black michijo Linux - Software 0 11-02-2012 12:42 PM
Customize a new PC TigerLinux Linux - Hardware 2 03-08-2012 03:46 AM
Terminator & Dmenu spoovy Linux - Software 4 08-19-2010 04:34 AM
customize bash kpachopoulos Linux - General 2 05-27-2005 03:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Arch

All times are GMT -5. The time now is 11:31 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration