LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-21-2018, 03:30 AM   #16
globetrotterdk
Member
 
Registered: Nov 2006
Posts: 297

Original Poster
Rep: Reputation: 16

Quote:
Originally Posted by orbea View Post
Without testing I think you want this.
Code:
# 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.
 
Old 03-21-2018, 03:47 AM   #17
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,753

Rep: Reputation: Disabled
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?
 
Old 03-21-2018, 04:10 AM   #18
globetrotterdk
Member
 
Registered: Nov 2006
Posts: 297

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by elcore View Post
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.
 
Old 03-21-2018, 04:35 AM   #19
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,753

Rep: Reputation: Disabled
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:
Code:
[exec] (reboot) {dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart}
[exec] (shutdown) {dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop}
This is how it works for other wm, like flux. No idea why it wouldn't work for i3.
 
Old 03-21-2018, 06:58 AM   #20
globetrotterdk
Member
 
Registered: Nov 2006
Posts: 297

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by elcore View Post
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:
  1. 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).
  2. Why doesn't i3 "system mode" appear to work with Slackware64 14.2?
  3. The i3wm I am using is the latest Slackbuilds version. Could it be something about the way i3wm is compiled by the SlackBuild script?
  4. For clarification, my i3exit script resides in ~/.i3/
  5. 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 View Post
And then you just add dbus-send commands to your user profile menu, like:
Code:
[exec] (reboot) {dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart}
[exec] (shutdown) {dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop}
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?
 
Old 03-21-2018, 07:34 AM   #21
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,753

Rep: Reputation: Disabled
Quote:
Originally Posted by globetrotterdk View Post
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 View Post
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}

Last edited by elcore; 03-21-2018 at 07:35 AM.
 
1 members found this post helpful.
Old 03-21-2018, 01:08 PM   #22
Loomx
Member
 
Registered: Sep 2012
Distribution: Slackware
Posts: 184

Rep: Reputation: Disabled
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
 
Old 03-21-2018, 04:41 PM   #23
globetrotterdk
Member
 
Registered: Nov 2006
Posts: 297

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by Loomx View Post
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
 
  


Reply

Tags
i3wm, logout, restart, scripting, shutdown



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware Mixxx build script Drakeo Slackware 2 12-20-2018 09:06 AM
For busy slackers who don't want to build packages Salix OS has Sourcery malekmustaq Slackware 44 12-08-2012 02:31 PM
[SOLVED] exit in script files cause konsole terminal itself to exit Star_Gazer Programming 11 04-12-2010 08:32 AM
TeXLive Build Script for Slackware rworkman Slackware 14 11-15-2009 04:47 AM
Ubuntu damaged after dbus build prushik Linux - Software 3 11-04-2009 08:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration