rickysarraf / laptop-mode-tools

Power Savings tool for Linux
https://www.researchut.com/tags/laptop-mode-tools/
GNU General Public License v2.0
550 stars 47 forks source link

can not start a new program in exec-commands module #203

Closed jyfzh closed 1 year ago

jyfzh commented 1 year ago

Describe the bug

i hope to start polybar and picom in NOLM_AC_EXEC_COMMAND_0, but no program start when battery mode change, and i am confirm that the EXEC_COMMAND is execuated

To Reproduce

# exec-commands.conf
BATT_EXEC_COMMAND_0="echo batt >> /home/jyf/log.log && pkill -9 polybar"
LM_AC_EXEC_COMMAND_0=""
NOLM_AC_EXEC_COMMAND_0="echo ac >> /home/jyf/log.log && polybar"

exec tail -f /home/jyf/log.log to confirm the command is execuated

batt
ac
batt
ac
batt
ac
batt
ac

but polybar cant start

Important Information:

rickysarraf commented 1 year ago

What is polybar ?

s3nt fr0m a $martph0ne, excuse typ0s

On Wed, 16 Aug, 2023, 09:29 jyf, @.***> wrote:

Describe the bug

i hope to start polybar and picom in NOLM_AC_EXEC_COMMAND_0, but no program start when battery mode change, and i am confirm that the EXEC_COMMAND is execuated

To Reproduce

exec-commands.conf

BATT_EXEC_COMMAND_0="echo batt >> /home/jyf/log.log && pkill -9 polybar" LM_AC_EXEC_COMMAND_0="" NOLM_AC_EXEC_COMMAND_0="echo ac >> /home/jyf/log.log && polybar"

exec tail -f /home/jyf/log.log to confirm the command is execuated

batt ac batt ac batt ac batt ac

but polybar cant start

Important Information:

  • Distribution: manjaro
  • Linux Kernel: 6.1.44-1-MANJARO
  • Laptop Mode Tools version: 1.74
  • Desktop Environment, if any: i3wm

— Reply to this email directly, view it on GitHub https://github.com/rickysarraf/laptop-mode-tools/issues/203, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAP7SFJ2Q5PG5JFG72QCKLXVRARRANCNFSM6AAAAAA3R5KMFM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jyfzh commented 1 year ago

polybar is a status bar for i3wm.

and i have double checked my command is correct.

rickysarraf commented 1 year ago

laptop-mode-tools is run as root whereas you'd want polybar run as your current desktop user.

On X11, this could be worked around but not a recommended thing to do. On Wayland, I haven't tried.

s3nt fr0m a $martph0ne, excuse typ0s

On Wed, 16 Aug, 2023, 12:16 jyf, @.***> wrote:

[polybar](https://github.com/polybar/polybar)is a status bar for i3wm.

and i have double checked my command is correct.

— Reply to this email directly, view it on GitHub https://github.com/rickysarraf/laptop-mode-tools/issues/203#issuecomment-1680052735, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAP7SHBL57YNX3TCN6OHADXVRUC7ANCNFSM6AAAAAA3R5KMFM . You are receiving this because you commented.Message ID: @.***>

jyfzh commented 1 year ago

i see. so we can not start a GUI program in XX_EXEC_COMMAND_X as a normal user. am i right?

rickysarraf commented 1 year ago

i see. so we can not start a GUI program in XX_EXEC_COMMAND_X as a normal user. am i right?

Yes. That cannot be done. Given this is not an issue and working as designed, I'm closing this issue. Please feel free to re-open if you think otherwise.