Reply To: Independent Session Manager Script [Proposal]

Forum › Forums › antiX-development › Development › Independent Session Manager Script [Proposal] › Reply To: Independent Session Manager Script [Proposal]

#178600
anti-apXos
Member

    I did a pylint review and it complaints (error code E0602) about ‘_’ being an undefined variable.
    As a result, I will not run it in my as-is system (and I do not have any virtualised one on this PC to test it).
    Did it work for you at all (my guess is that Gemini AI messed up)?

    The python script @anticapitalX posted works fine for me. I don’t think there’s any actual error involving underscores. Probably just your robot just doesn’t understand his robot. Too bad we can’t find some actual people…

    There is an odd usage of _ in the original desktop-session-exit.py and also this one that stumped me for a bit until I looked it up and found that it’s an alias for “gettext” used to provide multilanguage translations of strings.

    set.self_title(_("Exit Session"))

    is

    set.self_title(gettext("Exit Session"))

    That’s supposed to make it easier to read, but it just makes it harder in my opinion since I’ve never seen an alias like that used in python.

    Does your pylint give the same report when you run it on /usr/local/lib/desktop-session/desktop-session-exit.py? It should because I don’t see any other odd uses of _ in the script posted here.

    Now, not a feedback on the script itself but why are there three separate files/scripts in the first place?

    It’s because desktop-session-exit is only part of a much larger desktop-session package that handles a lot more than just this pygtk panel. All default sessions in antix (e.g. “rox-icewm”, “zzz-fluxbox”, etc.) are launched using desktop-session. It handles loading the window manager and optional components, as well as other daemons and setting up the environment. It’s also what allows switching between different session types after log in. It does all this using a whole network of interdependent scripts, not just three.

    I’m surprised @anticapitalX even has a working system after purging desktop-session. The posted python script only replaces a tiny fraction of what is done. He must have already been using a custom .xinit instead of desktop-session or something. Personally, I don’t use desktop-session to log in either, but for new and less technical users, it’s a pretty indispensible part of what makes antix antix, in my opinion.

    The current way the desktop-session-exit part of desktop-session works does also allow for the same commands to be used whether in a terminal or from the pygtk GUI panel. In that sense, combining them into one python script seems like a step back. antix should always offer equivalent CLI commands if it’s possible, in my opinion. This is not just for net/core installs, either. I’m on full and using X, but I still use the terminal (or shortcut keys bound to shell commands) to do things like this all the time. The bash script part of desktop-session-exit only just in the past couple months got a more fully fleshed out TUI interface, too.

    desktop-session-exit -t

    Anyway, not trying to throw too much water on @anticapitalX’s script. I do think some changes to desktop-session-exit.py would be cool. What I’ve always wanted was an ability to modify it at the user-level. Like adding, removing, or changing buttons. Currently, the only way to do that is to modify the script itself like this, but a GUI could be made to do it without too much difficulty really. The layout is actually very flexible.

    I’ve also modified mine quite a bit, so I’ll post it here for reference as to what could be done. I’ve changed buttons, added a separate grid to control services, made some buttons into toggles with changing icons, etc. It all makes for a very useful panel when you can customize it this way.

    EDIT: derp, I forgot to post the archive. This panel is neutered, by the way, since I’m not including the bash script it uses to actually execute the commands (there would be little point since it’s so specific to my system). It can still be run to see what it looks like, though. The extra icons included in the zip also need to be moved to /usr/share/icons/antiX-papirus/ to get the full effect.

    • This reply was modified 1 year, 3 months ago by anti-apXos.
    • This reply was modified 1 year, 3 months ago by anti-apXos.

    "--"