The officially official Devuan Forum!

You are not logged in.

#1 Yesterday 20:36:55

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

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 (Yesterday 20:39:50)


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

Offline

#2 Yesterday 22:25:37

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

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 Yesterday 23:30:00

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

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

Board footer