You are not logged in.

#1 2023-01-29 00:02:02

Laoceau
Member
Registered: 2023-01-27
Posts: 7

[SOLVED] Run command after logging back in

Hi, I'm using Xfce and lightdm slick greeter. For some reason, after switching users and logging back in, my brightness is reset to 100%. I'd like to execute a command (light -I) to restore my user's brightness after logging back in from the greeter. Where could I do this? Thanks!

Last edited by Laoceau (2023-01-29 18:41:28)

Offline

#2 2023-01-29 00:03:58

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Run command after logging back in


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2023-01-29 00:06:36

Laoceau
Member
Registered: 2023-01-27
Posts: 7

Re: [SOLVED] Run command after logging back in

Thanks. I've been using that, but the commands only execute after logging in the first time, not after switching users and logging back in.

Offline

#4 2023-01-29 00:48:33

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Run command after logging back in

Laoceau wrote:

Thanks. I've been using that, but the commands only execute after logging in the first time, not after switching users and logging back in.

So you aren't "logging back in", then. The brightness change is likely triggered by the other account.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2023-01-29 01:09:07

Laoceau
Member
Registered: 2023-01-27
Posts: 7

Re: [SOLVED] Run command after logging back in

jasonwryan wrote:
Laoceau wrote:

Thanks. I've been using that, but the commands only execute after logging in the first time, not after switching users and logging back in.

So you aren't "logging back in", then. The brightness change is likely triggered by the other account.

Thanks. Maybe I wasn't clear. What I'm doing is switching users -- not logging out. Maybe forget about the backlight brightness, it wasn't the point of my question. I'm just looking for some place where a command can be triggered after authenticating back into my logged in account. The triggers provided by the Xfce settings do not apply in this scenario.

Offline

#6 2023-01-29 08:15:21

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: [SOLVED] Run command after logging back in

That depends on what your screenlocker is and DE are - thus how you "switch users".
You're not actually "switching users" - your first session gets locked and another one gets started.
It's also gonna be relevant whether you want the action to hit when you unlock your first session or when you terminate the second one.

light-locker in particular doesn't offer to run commands on interaction, but you can sniff its communication and hook into that:
https://unix.stackexchange.com/question … ock-unlock

Offline

#7 2023-01-29 18:40:14

Laoceau
Member
Registered: 2023-01-27
Posts: 7

Re: [SOLVED] Run command after logging back in

seth wrote:

That depends on what your screenlocker is and DE are - thus how you "switch users".
You're not actually "switching users" - your first session gets locked and another one gets started.
It's also gonna be relevant whether you want the action to hit when you unlock your first session or when you terminate the second one.

light-locker in particular doesn't offer to run commands on interaction, but you can sniff its communication and hook into that:
https://unix.stackexchange.com/question … ock-unlock

Thanks! That was exactly what I was looking for. Running this seems to work:

dbus-monitor --system "type='signal',path='/org/freedesktop/login1/user/_972',interface='org.freedesktop.DBus.Properties',member='PropertiesChanged'"  | grep --line-buffered "session" | while read line; do sleep 1; light -I; done

Offline

Board footer

Powered by FluxBB