You are not logged in.
I'm on the fresh install of arch linux. .xinitrc is able to start dwm and start the sxhkd, but it won't run any scripts, not even a simple "xsetroot -name "hello" script.
I installed xorg-xinit and did everything described on the wiki.
cp /etc/X11/xinit/xinitrc ~/.xinitrc
Last edited by Stafer (2020-06-11 15:18:46)
Offline
Post it.
I'm guessing you're putting it in the wrong place in the file.
Offline
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi
if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
fi
# start some nice programs
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
statusbar &
# hello &
sxhkd &
dwmLast edited by Stafer (2020-06-11 14:33:47)
Offline
This ~/.xinitrc could use a wee bit of editing, still try exec dwm as last line,
Ancestoral Clan https://cirrus.freevar.com/mclean.html
Offline
I've already tried that without any success.
Edit: the scripts are working fine. They're in my ~/.local/bin which is in the PATH.
I can run the scripts without any issues from the terminal.
Last edited by Stafer (2020-06-11 14:34:50)
Offline
You don't have that running xsetroot. What's the problem?
Offline
The problem isn't the xsetroot but that it won't run any scripts. That was just an example. Sorry if i wasn't clear.
I was just saying that it won't even run this:
#!/bin/bash
xsetroot -name "hello"What i want to run is just this:
#!/bin/bash
xinput set-prop 12 "libinput Tapping Enabled" 1
xinput set-prop 12 "libinput Natural Scrolling Enabled" 1
statusbar &Last edited by Stafer (2020-06-11 14:39:10)
Offline
And *how* are you trying to run these?
Offline
By adding "autostart &" before "exec dwm".
The example above has "statusbar" instead of "autostart" because i'm just trying various things to see what happens. But nothing happens.
Edit: i've tried putting exec autostart & but the wiki says exec is ignored so obviously that didn't work.
Last edited by Stafer (2020-06-11 14:45:22)
Offline
Forget it. I'm done playing 20 questions. Post full information and maybe someone else will come along and attempt to help.
Offline
By adding "autostart &" before "exec dwm".
And what the hell is "autostart"? (edit: is that the name of your script? We can't read your mind).
If you put those scripts in xinitrc (before any 'exec' line) they will run. But you seem to expect xinit to read your mind and know that you want things to run. That will not happen.
What i want to run is just this: ...
Then why haven't you put that in your xinitrc?
Last edited by Trilby (2020-06-11 14:51:53)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Here since you can't just guess. That's exactly what i was doing.
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi
if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
fi
# start some nice programs
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
autostart &
sxhkd &
exec dwmThe problem is that ~/.xinitrc won't run any scripts no matter the name.
Last edited by Stafer (2020-06-11 14:53:45)
Offline
~/.xinitrc is just:
cp /etc/X11/xinit/xinitrc ~/.xinitrc
That would not be expected to work. Xinit cannot read your mind any better than we can. You need to put the commands you want to run into xinitrc.
EDIT: ok, you've just editted your post and included completely contradictory information to what was there 30 seconds ago. I give up too.
Last edited by Trilby (2020-06-11 14:55:44)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
My god. People warned me about arch forums but did't expect they would be this bad.
Can you see this:
autostart &
sxhkd &
exec dwmAt the end? I'm not telling it to read my mind, i'm telling to exactly what to do but it isn't doing that.
Offline
I can see it now. I couldn't see it when that post had something else. You also haven't clearly said what "autostart" is. I guessed it was the three line script you posted - but that's not been entirely clear.
How do you start x?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Stafer wrote:~/.xinitrc is just:
cp /etc/X11/xinit/xinitrc ~/.xinitrcThat would not be expected to work. Xinit cannot read your mind any better than we can. You need to put the commands you want to run into xinitrc.
EDIT: ok, you've just editted your post and included completely contradictory information to what was there 30 seconds ago. I give up too.
The point of me saying that i cp /etc/X11/xinit/xinitrc ~/.xinitrc was to say that i didn't fuck up the .xinitrc since i did what wiki said.
Offline
This last file you've shown now should relevantly work, by what measure do you surmise that it doesn't? This last file you've shown now should relevantly work, by what measure do you surmise that it doesn't? But really, as you are spawning a seperate shell here you really should not add a & to the autostart. That will be killed as soon as the exec is reached, let that run normally.
Last edited by V1del (2020-06-11 15:01:03)
Offline
you really should not add a & to the autostart
Better yet, just put the commands you want to run in .xinitrc rather than some additional script.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
How *exactly* do you start your X11 session?
xinit, startx, GDM, …?
Online
This last file you've shown now should relevantly work, by what measure do you surmise that it doesn't? This last file you've shown now should relevantly work, by what measure do you surmise that it doesn't? But really, as you are spawning a seperate shell here you really should not add a & to the autostart. That will be killed as soon as the exec is reached, let that run normally.
It still won't run the script. I've already tried every way possible but just won't run any script.
Better yet, just put the commands you want to run in .xinitrc rather than some additional script.
I'm running dwm so my autostart script also runs my statusbar script. If i have to do what you said i'd have to write the statusbar script in my .xinitrc.
Edit: Even by removing statusbar from autostart and just putting it in .xinitrc doesn't work.
Last edited by Stafer (2020-06-11 15:08:15)
Offline
How *exactly* do you start your X11 session?
xinit, startx, GDM, …?
I just use startx.
Offline
Does
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
date > /tmp/startx.date
…generate that file w/ the date in it?
Online
What's in your statusbar script? Why do you hide that information? We are 22 posts in and no one knows what is actually supposed to be executed. I'm fairly certain that the xinput lines will have ran.
Offline
Yes, it does.
[ktl@pkl ~]$ cat /tmp/startx.date
Thu Jun 11 17:20:21 CEST 2020Offline
Sorry, didn't want to hide just thought since it can be launched from the terminal without errors it won't be the cause of the problem.
#!/bin/bash
print_bat(){
capacity=$(cat /sys/class/power_supply/BAT0/capacity)
batstatus=$(cat /sys/class/power_supply/BAT0/status)
if [ $batstatus == "Charging" ]; then
echo "$capacity+"
else
echo "$capacity"
fi
}
print_date(){
date "+%r "
}
while true; do
xsetroot -name "Bat: $(print_bat) | $(print_date)"
sleep 1
doneOffline