Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: How to execute a script on start up of i3 and i3 alone?

  1. Default How to execute a script on start up of i3 and i3 alone?

    Hi,

    I know that editing files in /etc/rc.d, or /etc/cron.d may cause a script to run on system start up, but it will do so regardless of the desktop environment/window manager being used. I would like to know a way to execute a script on start up of i3 only. The script I want to execute is ~/.xsession which includes a command that sets the desktop background using feh. I do not want this script executed for other desktop environments/window managers because they use other methods to set desktop background and I do not want the two methods to conflict. Any ideas on how to do this?

    Thanks for your time,
    Brenton
    Brenton Horne: Linux enthusiast and writer of ​The Hornery.
    Seven favourite distros
    : Arch, Fedora, Gentoo, openSUSE Tumbleweed and Void.

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,153

    Default Re: How to execute a script on start up of i3 and i3 alone?

    I admit that it may be stupid, but I never heard of i3. Looked it up in Wikipedia, thus you will understand ny knowledge is limited.

    As it seems to be (part of) the windows manager, it is NOT part of the system (as you already found out, doing things on system startup/boot is not related to what you want *) ), but it is also NOT part of the desktop. So when you talk about "other desktop environments" I am at a loss.

    OTOH, it assume it is the DE that decides what to use as background for the desktop (using the capabilities of the Windows manager). Thus I am still more confused about what you want where.

    But as I warned you above, my knowledge on i3 is very limited.

    ================

    *)
    Oh yes, as a side excursion, using /etc/rc.d and friends is SysVinit and openSUSE already for some years does not use it anymore, but went to systemd.
    Last edited by hcvv; 02-Jul-2018 at 02:55.
    Henk van Velden

  3. Default Re: How to execute a script on start up of i3 and i3 alone?

    OK, if /etc/rc.d is only for SysV init then why does that directory exist on my openSUSE Tumbleweed system?
    Brenton Horne: Linux enthusiast and writer of ​The Hornery.
    Seven favourite distros
    : Arch, Fedora, Gentoo, openSUSE Tumbleweed and Void.

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,153

    Default Re: How to execute a script on start up of i3 and i3 alone?

    Quote Originally Posted by fusion809 View Post
    OK, if /etc/rc.d is only for SysV init then why does that directory exist on my openSUSE Tumbleweed system?
    That is for backward compatibility. Systemd will still operate on it, but you are strongly discouraged to do any development (let alone create new entries) on it.

    But this was only a warning and as I said a side excursion because it has nothing to do with your question.
    Henk van Velden

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,153

    Default Re: How to execute a script on start up of i3 and i3 alone?

    I re-read your first post above. You are talking about ~/.xsession.

    Do I understand correct when I think that you want ~/.xsession to be executed when the user's X (being i3) is started?

    I do not know if i3 works the same as X11 in this respect (running xsession scripts), but today it is often the display manager that decides on the fact which DE is started if ~/.xsession is run or not because DEs might have their own mechanism of doing things at their startup.
    Henk van Velden

  6. Default Re: How to execute a script on start up of i3 and i3 alone?

    Yeah I start i3 using SDDM. But I would like xsession to be executed when an i3 session is started, but no other DEs/WMs.
    Brenton Horne: Linux enthusiast and writer of ​The Hornery.
    Seven favourite distros
    : Arch, Fedora, Gentoo, openSUSE Tumbleweed and Void.

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,153

    Default Re: How to execute a script on start up of i3 and i3 alone?

    Quote Originally Posted by fusion809 View Post
    Yeah I start i3 using SDDM. But I would like xsession to be executed when an i3 session is started, but no other DEs/WMs.
    As I said earlier, IMHO i3 is a Windows manager, NOT a DE.

    What DE are you using?
    Henk van Velden

  8. Default Re: How to execute a script on start up of i3 and i3 alone?

    I think your lack of experience of i3 is causing some confusion here. i3 isn't used by any DE. I don't think it even can be, it's a standalone WM, it even has its own .desktop file in /usr/share/xsessions. If you've ever encountered the WMs Awesome or bspwm I can say it is similar in that all three do not and to my knowledge cannot serve as a component of a DE. To be clear, I am grateful you're trying to help and I hope this does not come across as an attack as I really am grateful you're trying.
    Brenton Horne: Linux enthusiast and writer of ​The Hornery.
    Seven favourite distros
    : Arch, Fedora, Gentoo, openSUSE Tumbleweed and Void.

  9. #9
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,382
    Blog Entries
    1

    Default Re: How to execute a script on start up of i3 and i3 alone?

    Quote Originally Posted by fusion809 View Post
    I think your lack of experience of i3 is causing some confusion here. i3 isn't used by any DE. I don't think it even can be, it's a standalone WM, it even has its own .desktop file in /usr/share/xsessions. If you've ever encountered the WMs Awesome or bspwm I can say it is similar in that all three do not and to my knowledge cannot serve as a component of a DE. To be clear, I am grateful you're trying to help and I hope this does not come across as an attack as I really am grateful you're trying.
    Can you not just create an autostart script to set the desktop background? Just check the $DESKTOP_SESSION environment variable to know the i3 is the active WM.
    openSUSE Leap 15.0; KDE Plasma 5

  10. #10
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,153

    Default Re: How to execute a script on start up of i3 and i3 alone?

    It does not come across as an attack . I already said my i3 knowledge is very limited and I am trying to learn. What I basically am trying is to get clear what functionality we are talking about and the correct terms that belong to them. This will probably narrow down the number of places/hooks were a solution might be implemented.

    But it means that:
    but no other DEs/WMs
    should be read as
    but no other WMs
    because there is no DE at all when you run i3 and when a DE is started, it never uses i3.
    Henk van Velden

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •