You are not logged in.
I writed a basic command and this solved my problem:
#!/bin/sh
#If [--output DP-1 = off]; then
#sleep 1
xrandr --output DP-1 --off &&
#elif [ output DP-1 = on] then
xrandr --output DP-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI-1 --mode 1366x768 --pos 1920x0 --rotate normal --output DP-2 --off --output DP-3 --off
#fi "If commands" didn't work because I don't know how to know monitor on or off. If I execute this file, It's totaly solving my problem.(xrandr commands only.)
How can be handled automatically when computer wake up?
Last edited by m2arch (2022-09-25 18:00:09)
English is not my native language. Please excuse my typing errors. You free to correct me.
Offline
Offline
Thanks. I tried to add this:
[Unit]
Description=Local system resume actions
After=suspend.target
[Service]
Type=simple
ExecStartPost=/usr/bin/sleep 1
ExecStart=~/Desktop/hdmi_right-upper.sh
[Install]
WantedBy=suspend.targetNothing changed. Also, I haven't screensaver for lock my screen after suspend. I tried to install If solve this issue but It didn't and I deleted screensaver.
English is not my native language. Please excuse my typing errors. You free to correct me.
Offline
As per linked wiki, "Environment=DISPLAY=:0" is gonna be REALLY important here.
So will mostl likely be "User=%I" (and the "@" thing)…
And also see https://gist.github.com/AladW/de1c5676d93d05a5a0e1
Offline
As per linked wiki, "Environment=DISPLAY=:0" is gonna be REALLY important here.
So will mostl likely be "User=%I" (and the "@" thing)…
And also see https://gist.github.com/AladW/de1c5676d93d05a5a0e1
Nope, noting worked;
[Unit]
Description=Local system resume actions
After=suspend.target
[Service]
Type=simple
User=%I
Environment=DISPLAY=:0
ExecStartPost=/usr/bin/sleep 1
ExecStart=/home/arch/Desktop/hdmi_right-upper.sh
[Install]
WantedBy=suspend.target
Also, I didn't understand what you were talking about for @thing.
Is there any problem solve documentation for my issue? Maybe, I am taking this issue for my setup because I installed and uninstalled so much de,wm -kde,xfce,qtile,dwm,awesome-. I am deleted all of that except xfce but some .config file and some packages still on my system but I didn't found how to clean my arch.
Last edited by m2arch (2022-09-25 15:33:22)
English is not my native language. Please excuse my typing errors. You free to correct me.
Offline
Also, I didn't understand what you were talking about for @thing.
Enable the suspend@user
…
/etc/systemd/system/suspend@.service
[Unit]
Description=User suspend actions
Before=sleep.target[Service]
User=%I
Type=forking
Environment=DISPLAY=:0
ExecStartPre= -/usr/bin/pkill -u %u unison ; /usr/local/bin/music.sh stop
ExecStart=/usr/bin/sflock
ExecStartPost=/usr/bin/sleep 1[Install]
WantedBy=sleep.target
Edit: though of course for the resume action.
You may also have to "ExecStartPre=sleep whatever" in case there's a race condition.
Last edited by seth (2022-09-25 15:52:34)
Offline
Also, I didn't understand what you were talking about for @thing.
The wiki wrote:Enable the suspend@user
…
/etc/systemd/system/suspend@.service
[Unit]
Description=User suspend actions
Before=sleep.target[Service]
User=%I
Type=forking
Environment=DISPLAY=:0
ExecStartPre= -/usr/bin/pkill -u %u unison ; /usr/local/bin/music.sh stop
ExecStart=/usr/bin/sflock
ExecStartPost=/usr/bin/sleep 1[Install]
WantedBy=sleep.targetEdit: though of course for the resume action.
You may also have to "ExecStartPre=sleep whatever" in case there's a race condition.
Thank you. I appreciate it.
If someone need to do this to:
Do not forget to add +x execute permission and enabling via systemctl.
English is not my native language. Please excuse my typing errors. You free to correct me.
Offline