LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Just installed DWM from Sbo - default commands not working (https://www.linuxquestions.org/questions/slackware-14/just-installed-dwm-from-sbo-default-commands-not-working-4175678283/)

burning 07-07-2020 08:28 AM

Just installed DWM from Sbo - default commands not working
 
I'm running slackware -current and I used SBopkg to download and install dwm. Upon running it, none of the commands listed in their tutorial seem to work even though I haven't changed or edited any of the configs. The version I downloaded was 14.2 but I've heard that 14.2 applications work on current without editing. Apologies if I'm mistaken in assuming this.

It says in their tutorial here that to bring up the Terminal is [Shift]+[Alt]+[Enter].

[Alt]+[p] - dmenu for running programs like the x-www-browser

and [Alt]+[j] or [Alt]+[k] To move to another terminal.

Yet none of these commands are working. My keyboard has never had any problems like unresponsive keys or anything like that. No other commands that I've tried have worked either. To exit the X session, I had to ctrl + alt f1 and then cancel the x session.

The only commands that do seem to work are the alt + 0 and alt + space commands but seeing as I can't even get any programs to run, they're pretty much moot.

Loomx 07-07-2020 04:58 PM

Do you have dmenu installed?
Also, by default the terminal it tries to open is st, so nothing will happen if that isn't installed either.

I would recommend unpacking the source and modifying the config.def.h file yourself. It's pretty straightforward even if you know no C.
You could change the terminal to run e.g. xterm
Then just run
Code:

make install clean
as root to install dwm manually.

[Edit] The link in my signature below is an old how-to for Debian, but should be still mostly relevant for Slackware.

slac 07-07-2020 05:49 PM

Dwm is a window manager that uses st as default terminal and dmenu as a tool to execute programs and scripts right away.

St is opened with Mod + Shift + t

Dmenu is opened with Mod + p

You obviously need to have those three installed, but that is not mandatory since you can change the default behavior of dwm by editing its source code to use other programs. If you decide to do that last thing, you can change the default terminal to xterm or rxvt, both of them are included in the Slackware Official Packages (if you selected to install the x and xap series during installation, you will have them, if not, you will need to install them). That should be enough to open programs but obviously it is more handy to have dmenu installed.

In case you want to install dwm + dmenu + st, you can uninstall the SBOpkg version you have installed and execute the following script as root:

Code:

#!/bin/sh

mkdir -p $HOME/Suckless
cd $HOME/Suckless

for suck_tool in dwm dmenu st; do
  git clone https://git.suckless.org/${suck_tool}
  (cd ${suck_tool}; make clean install)
done

That should be about enough to install dwm, dmenu and st. It is not mandatory to use that script like it is, you can modify it or do things by hand.

If you want to make modifications (and you have used the previous script) just go to: $HOME/Suckless and there will be the source code. Once you have made modifications, you can reinstall by executing: make clean install

In order to execute dwm, you will have to create a file called .xinitrc at your home directory (not root):

Warning: The contents of .xinitrc will be erased.

Code:

echo "exec dwm" > $HOME/.xinitrc
If you do not want to reset the .xinitrc file you can change the ">" for ">>" in the previous command.

Then execute: startx

burning 07-07-2020 06:41 PM

Quote:

Originally Posted by Loomx (Post 6142739)
Do you have dmenu installed?
Also, by default the terminal it tries to open is st, so nothing will happen if that isn't installed either.

I would recommend unpacking the source and modifying the config.def.h file yourself. It's pretty straightforward even if you know no C.
You could change the terminal to run e.g. xterm
Then just run
Code:

make install clean
as root to install dwm manually.

[Edit] The link in my signature below is an old how-to for Debian, but should be still mostly relevant for Slackware.

Ah thanks, turns out I forgot to install dmenu and st :rolleyes:

That how-to looks really helpful, I'll check it out! :)

burning 07-07-2020 06:44 PM

Quote:

Originally Posted by slac (Post 6142759)
Dwm is a window manager that uses st as default terminal and dmenu as a tool to execute programs and scripts right away.

St is opened with Mod + Shift + t

Dmenu is opened with Mod + p

You obviously need to have those three installed, but that is not mandatory since you can change the default behavior of dwm by editing its source code to use other programs. If you decide to do that last thing, you can change the default terminal to xterm or rxvt, both of them are included in the Slackware Official Packages (if you selected to install the x and xap series during installation, you will have them, if not, you will need to install them). That should be enough to open programs but obviously it is more handy to have dmenu installed.

In case you want to install dwm + dmenu + st, you can uninstall the SBOpkg version you have installed and execute the following script as root:

Code:

#!/bin/sh

mkdir -p $HOME/Suckless
cd $HOME/Suckless

for suck_tool in dwm dmenu st; do
  git clone https://git.suckless.org/${suck_tool}
  (cd ${suck_tool}; make clean install)
done

That should be about enough to install dwm, dmenu and st. It is not mandatory to use that script like it is, you can modify it or do things by hand.

If you want to make modifications (and you have used the previous script) just go to: $HOME/Suckless and there will be the source code. Once you have made modifications, you can reinstall by executing: make clean install

In order to execute dwm, you will have to create a file called .xinitrc at your home directory (not root):

Warning: The contents of .xinitrc will be erased.

Code:

echo "exec dwm" > $HOME/.xinitrc
If you do not want to reset the .xinitrc file you can change the ">" for ">>" in the previous command.

Then execute: startx

Thank you! That helped clear things up! Would you recommend I install individual packages for ST, Dmenu and DWM separately as well? Or just the manual install like you illustrated?

edit: why exactly is the .xinitrc file erased? And what reasons would you have for wanting to/not wanting it to reset?

slac 07-07-2020 09:01 PM

Quote:

Originally Posted by burning (Post 6142775)
Would you recommend I install individual packages for ST, Dmenu and DWM separately as well? Or just the manual install like you illustrated?

I do not understand what you mean by saying that. Could you re-formulate?

Quote:

Originally Posted by burning (Post 6142775)
edit: why exactly is the .xinitrc file erased? And what reasons would you have for wanting to/not wanting it to reset?

Well... As the time passes you may want to add more content to .xinitrc in order to fit some of your needs. After that happens, the reason to do not want to reset the file will be pretty clear, won't they? Clue: You will reset your .xinitrc file.

Just to be clear, you do not have to add content to .xinitrc using > or >>, that is only a thing I do to quickly create or append content to a file. You can just use a text editor instead, vim or vi should be good. If you want to, you can give it a try to "ed", that is a pretty handy editor to add or edit text lines as well.

deNiro 07-08-2020 08:12 AM

@burning
Like the previous posters already mentioned, it's better to get dwm from git, and compile it in your homedir, since then you can easily play around with the config, change colors and what more, and quickly compile without root permissions.

just quickly how I did it.

first make sure dmenu is installed, either from sbo, or with git.

Then install dwm like this:

( I always put all my git clones in ~/git )

# cd ~/git
# git clone git://git.suckless.org/dwm
# cd dwm
# make -C ~/dwm
( by doing this , everything dwm related, like the source, the bin folder and the share folder is in ~/dwm )

then go to ~/dwm

edit the "config.mk" file
change "PREFIX = /home/henk/dwm" (obviously change my name to your username ;) )
(by doing this while compiling the bin and share dir will be placed in ~/dwm )

you might want to edit the config.h file in that dir as well:

make sure that "static const int resizehints = 0;"
(it should be, because with =1 it will mess with your lay-out)

You might wanna change (or maybe not) your modkey from alt to the win key with:
"#define MODKEY Mod4Mask"

and perhaps you want to change your terminal to something else then st terminal. In my case I use xterm:
"static const char *termcmd[] = { "xterm", NULL };"


and then you can compile it
So in that ~/dwm dir:
# make clean install
(files will be installed in your home in ~/dwm/bin and ~/dwm/share)

And obviously every time you change something to "config.h", like other colors or what not, you have to do the #make clean install


----------
my ~/.xinitrc file to start this:

# dwm statusbar - show current time and date
while true
do
xsetroot -name "$(date "+%F %R")"
sleep 1m
done &

#[ -f ~/.Xresources ] && xrdb -merge ~/.Xresources
# sh .fehbg &
# start dwm
exec /home/henk/dwm/bin/dwm
--------------------------

hope this helps

burning 07-09-2020 09:13 AM

Quote:

Originally Posted by slac (Post 6142804)
I do not understand what you mean by saying that. Could you re-formulate?

I just meant, as I understand it, doing make clean install after downloading source from git installs the program but doesn't package it. My understanding is that this would mean updating it would be more of a hassle, no? Having to manually check if an update is required and then individually updating dmenu, dwm and st etc. But seeing as I'm new to Slackware and the concept of packaging in general I'm aware that my current level of understanding on these concepts might occasionally lead me to false conclusions such as the assumption above about downloading from git and doing make clean install leading to slightly more arduous update procedures, or I might be right in that assumption but not seeing the bigger picture.


Quote:

Well... As the time passes you may want to add more content to .xinitrc in order to fit some of your needs. After that happens, the reason to do not want to reset the file will be pretty clear, won't they? Clue: You will reset your .xinitrc file.

Just to be clear, you do not have to add content to .xinitrc using > or >>, that is only a thing I do to quickly create or append content to a file. You can just use a text editor instead, vim or vi should be good. If you want to, you can give it a try to "ed", that is a pretty handy editor to add or edit text lines as well.
And forgive me, I was overthinking after not reading your previous post correctly, I forgot that > rewrites the entire file as opposed to >> which appends. :rolleyes:
I get it now

burning 07-09-2020 09:47 AM

Quote:

Originally Posted by deNiro (Post 6142987)
then go to ~/dwm

edit the "config.mk" file
change "PREFIX = /home/henk/dwm" (obviously change my name to your username ;) )
(by doing this while compiling the bin and share dir will be placed in ~/dwm )

Oh, is this just for ease of access/general organisational purposes? Where would they have been installed by default? in /bin and /share ?


Quote:

and perhaps you want to change your terminal to something else then st terminal. In my case I use xterm:
"static const char *termcmd[] = { "xterm", NULL };"
As someone who's only used xterm so far, I'm curious what some users might prefer about it over st and vice versa. What's your take on them?


Quote:

----------
my ~/.xinitrc file to start this:

# dwm statusbar - show current time and date
while true
do
xsetroot -name "$(date "+%F %R")"
sleep 1m
done &

#[ -f ~/.Xresources ] && xrdb -merge ~/.Xresources
# sh .fehbg &
# start dwm
exec /home/henk/dwm/bin/dwm
--------------------------
Could you explain what each line is doing respectively? Why the wait for one minute?

Quote:

hope this helps
Thanks! I really appreciate the in-depth explanation! Really helpful! :)

sevendogsbsd 07-09-2020 12:46 PM

So, FYI - dwm is a standalone executable so really doesn't need to be packaged. I can't speak to dmenu as I've always installed it as a package. I used to just build dwm and then use root to copy the binary to /usr/bin or wherever you normally run executables.

deNiro 07-09-2020 01:43 PM

Quote:

Originally Posted by burning (Post 6143421)
Oh, is this just for ease of access/general organisational purposes? Where would they have been installed by default? in /bin and /share ?



As someone who's only used xterm so far, I'm curious what some users might prefer about it over st and vice versa. What's your take on them?



Could you explain what each line is doing respectively? Why the wait for one minute?


Thanks! I really appreciate the in-depth explanation! Really helpful! :)


Yes, since I keep everything in my home dir, so I don't have to bother with making a package, or manually copying it to the system /bin and /share. DWM is pretty small anyway, and most important, the source file is also the config file, so that is why it is probably easier to keep it in your /home.

I hardly use any other terminal then xterm. It' already installed on slack.
if you want it a bit nicer to look at, make sure you have at least these in ~/.bashrc :
# load the system-wide environment
source /etc/profile
# for 256 colours instead of the default 8
XTerm.termName: xterm-256color

here is some info on how to configure your shell more.

The first part of that .xinitrc file is to show the date and time, and since it only shows hours and minutes, I only update every minute.
The rest is to start dwm, and setting the background with feh, which i currently have disabled. I stole that from ratfactor.com, which might have some extra usefull info.

ponce 07-09-2020 01:50 PM

Quote:

Originally Posted by burning (Post 6142535)
I'm running slackware -current and I used SBopkg to download and install dwm. Upon running it, none of the commands listed in their tutorial seem to work even though I haven't changed or edited any of the configs. The version I downloaded was 14.2 but I've heard that 14.2 applications work on current without editing. Apologies if I'm mistaken in assuming this.

It says in their tutorial here that to bring up the Terminal is [Shift]+[Alt]+[Enter].

[Alt]+[p] - dmenu for running programs like the x-www-browser

and [Alt]+[j] or [Alt]+[k] To move to another terminal.

Yet none of these commands are working. My keyboard has never had any problems like unresponsive keys or anything like that. No other commands that I've tried have worked either. To exit the X session, I had to ctrl + alt f1 and then cancel the x session.

The only commands that do seem to work are the alt + 0 and alt + space commands but seeing as I can't even get any programs to run, they're pretty much moot.

remember that you have to read the README of everything you install from SBo, also if you are using a third-party tool like sbopkg.

individual 07-09-2020 07:49 PM

If you want to play around with different terminal emulators, but don't want to change it in the config file, install something like Xfce's exo. You can set your "preferred terminal emulator". Here are a few lines from my config.h that define a "generic" file manager, terminal emulator, and web browser.
Code:

static const char *browsercmd[] = { "/usr/bin/env", "exo-open", "--launch", "WebBrowser", NULL };
static const char *filemancmd[] = { "/usr/bin/env", "exo-open", "--launch", "FileManager", NULL };
static const char *termcmd[]  = { "/usr/bin/env", "exo-open", "--launch", "TerminalEmulator", NULL };

/* Keybind section */
{ ALTKEY,          XK_Return,                spawn,          {.v = termcmd } },
{ ALTKEY,          XK_f,                    spawn, {.v = filemancmd} },
{ ALTKEY,          XK_w,                    spawn, {.v = browsercmd} },


burning 07-11-2020 05:07 PM

Quote:

Originally Posted by deNiro (Post 6142987)

# cd ~/git
# git clone git://git.suckless.org/dwm
# cd dwm
# make -C ~/dwm
( by doing this , everything dwm related, like the source, the bin folder and the share folder is in ~/dwm )

then go to ~/dwm

edit the "config.mk" file
change "PREFIX = /home/henk/dwm" (obviously change my name to your username ;) )
(by doing this while compiling the bin and share dir will be placed in ~/dwm )

you might want to edit the config.h file in that dir as well:

make sure that "static const int resizehints = 0;"
(it should be, because with =1 it will mess with your lay-out)

I ran into a bit of a snag when trying make -C /home/myusername/dwm (I would've typed the shorter file path just now using that squiggle key whose name I cannot unfortunately recall to signify my home directory but I think my keyboard map might be misconfigured. If anyone could let me know how to change it to a UK keymap, that would be very much appreciated!)

Every time I try to run it, I get this message:
Code:

make: Entering directory '/home/burning/dwm'
make: *** No targets specified and no makefile found. Stop
make: Leaving directory '/home/burning/dwm'

I edited the config.mk and config.def.h files like you recommended, but the problem still persists. I find it strange that it'd report no makefile could be found when the Makefile is clearly listed in the /home/burning/git/dwm dir.

edit: nvm, I did make ; cp dwm /home/burning/dwm to install it in /home/burning/dwm though if you run that command, you need to be in the /home/user/dwm dir when you run it.
sidenote: What exactly does setting my static const int resizehints to 0 do? Do all dwm users have to edit that file in this way before using it for the first time?

burning 07-17-2020 03:11 AM

Marking the thread as solved. I just ended up using the Slackbuild off of slackbuilds.org. It works like a charm. :)


All times are GMT -5. The time now is 09:16 AM.