i3 exit script the Slackware way? Do I build Dbus, or do Slackers do it differently?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
# Start DBUS session bus:
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
eval \$(dbus-launch --sh-syntax --exit-with-session)
fi
OK, I now have stable, up to date Slackware64 14.2 systems on both my laptop and my tower computer, but your suggestion, unfortunately doesn't work either.
Your post lacks critical information so it's not clear what the problem is, what works and what doesn't work.
Does the dbus-send command not work? Does it work on clean new user profile? Does it work with another non-i3 window manager?
Your post lacks critical information so it's not clear what the problem is, what works and what doesn't work.
Does the dbus-send command not work? Does it work on clean new user profile? Does it work with another non-i3 window manager?
This has been added to /usr/bin/start_i3 as suggested by elcore, earlier in the thread. The script has been made executable. The entire system is new, so no, it doesn't work on a new user profile. Not sure how this would be tested with a non-i3 window manager as the steps are to 1) change mode and then 2) execute one of the options in the i3exit script that I posted. These are all dependent on i3wm.
Not using i3, but if dbus-send works in another wm, then your i3 is misconfigured and not the base.
Basically, it's as simple as this:
Code:
#!/bin/sh
# contents of /usr/bin/start_your_wm
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
eval `dbus-launch --sh-syntax --exit-with-session`
fi
/usr/local/bin/your_script_here.sh &&
/usr/bin/your_wm_here
And then you just add dbus-send commands to your user profile menu, like:
Not using i3, but if dbus-send works in another wm, then your i3 is misconfigured and not the base.
Basically, it's as simple as this:
Code:
#!/bin/sh
# contents of /usr/bin/start_your_wm
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
eval `dbus-launch --sh-syntax --exit-with-session`
fi
/usr/local/bin/your_script_here.sh &&
/usr/bin/your_wm_here
OK, thanks for the post. Things are getting slightly clearer, but that raises more questions:
I can confirm that everything for i3wm is in /usr/bin. I also know that I can run the individual section of my i3exit script from the command line, and it works. Unfortunately, it doesn't work in i3 "system mode". I know that "system mode" works under Devuan (and other .deb based versions of Linux).
Why doesn't i3 "system mode" appear to work with Slackware64 14.2?
The i3wm I am using is the latest Slackbuilds version. Could it be something about the way i3wm is compiled by the SlackBuild script?
For clarification, my i3exit script resides in ~/.i3/
I am not sure what you are doing here: /usr/local/bin/your_script_here.sh && is this to test if the script works outside of i3 "system mode"?
For clarification, here is my i3config entry again:
Code:
# System Actions
set $mode_system System (l) Logout, (r) Reboot, (s) Shutdown
mode "$mode_system" {
bindsym l exec --no-startup-id ~/.i3/i3exit logout, mode "default"
bindsym r exec --no-startup-id ~/.i3/i3exit reboot, mode "default"
bindsym s exec --no-startup-id ~/.i3/i3exit shutdown, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Ctrl+s mode "$mode_system"
Quote:
Originally Posted by elcore
And then you just add dbus-send commands to your user profile menu, like:
This is how it works for other wm, like flux. No idea why it wouldn't work for i3.
As an example, I searched for "slackware xfce4 profile menu", but I am not really coming up with anything. What is a "profile menu"? Is that DE/WM specific? I already know that the individual section of the script works (from the command line) on my system, is this step necessary?
I am not sure what you are doing here: /usr/local/bin/your_script_here.sh && is this to test if the script works outside of i3 "system mode"?
Yes, this is where you put whatever script you want, and if it succeeds then the wm is started. Just make sure startwm calls wm binary at the end, and not another startwm script.
Frankly, I'm not qualified to answer the rest because I'm not really familiar with i3 code, and I don't even know what "system mode" does.
Quote:
Originally Posted by globetrotterdk
As an example, I searched for "slackware xfce4 profile menu", but I am not really coming up with anything. What is a "profile menu"? Is that DE/WM specific? I already know that the individual section of the script works (from the command line) on my system, is this step necessary?
This is flux specific, just a configuration file for the menu.. [exec] (name) {path/binary/command}
Just a thought - maybe you need ConsoleKit to run too, like this:
Quote:
if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
ck-launch-session dbus-launch --exit-with-session
else
dbus-launch --exit-with-session
fi
Just a thought - maybe you need ConsoleKit to run too, like this:
I am now in contact with the maintainer of the i3 SlackBuild script. He suggested to try to run i3wm with logging to see if we can nail this down. I will post any news here, and I always have your suggestion as a plan B, thanks Loomx
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.