The officially official Devuan Forum!

You are not logged in.

#1 2026-07-11 20:36:55

tux_99
Member
Registered: 2025-06-17
Posts: 123  

How can I make "xhost +" the default at every boot?

I run some X11-apps as a different user than the user with which i log on to the desktop (XFCE) so after a reboot I always have to type "xhost +" in a terminal before being able to launch these X11-apps as a different user.

So how can I make "xhost +" the default at every boot?

In which config file do I have to set this to avoid having to type it manually each time?

Last edited by tux_99 (2026-07-11 20:39:50)


Either the users control the program – or the program controls the users” Richard Stallman

Offline

#2 2026-07-11 22:25:37

tux_99
Member
Registered: 2025-06-17
Posts: 123  

Re: How can I make "xhost +" the default at every boot?

BTW, I already tried creating /etc/X0.hosts with relevant entries (see below) as indicated in the xhost manpage but that doesn't seem to have any effect.

$ more /etc/X0.hosts
+SI:localuser:username1
+SI:localuser:username2

Either the users control the program – or the program controls the users” Richard Stallman

Offline

#3 2026-07-11 23:30:00

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,941  

Re: How can I make "xhost +" the default at every boot?

Another approach would be to only use 'xhost +' when you want to be the other user and then 'xhost -' when you're done. Put the following script in your path, make it executable and use it like this. I'm calling it 'swu'. You can call it whatever you like.

Open a terminal.

swu <otheruser>
(run some commands as the other user)
exit

Here's the magic sauce:

#!/usr/bin/env bash
# swu

otheruser="$1"

xhost +
su "$otheruser" 
xhost -

exit 0

Offline

#4 Today 16:40:34

tux_99
Member
Registered: 2025-06-17
Posts: 123  

Re: How can I make "xhost +" the default at every boot?

Thanks, that could be a feasible workaround but surely there must be a X11 config file that gets read each time X11 is started (i.e. when logging in) in which I could put the xhost command?


Either the users control the program – or the program controls the users” Richard Stallman

Offline

Board footer