Mailinglist Archive: opensuse-factory (188 mails)

< Previous Next >
Re: [opensuse-factory] Start displaymanager only if monitor is connected
On Mon, 3 Dec 2018 at 14:05, Joachim Wagner <jwagner@xxxxxxxxxxxxxxxx> wrote:

Generally, I'd say it's a bug in KDE if widget placement gets messed up just
because one forgets to switch on the screen.

Indeed this is a bug. If this bug wasn't there, I wouldn't have been
trying out this complicated scheme.

[...] I have not figured out a way to boot to graphical target
automatically when monitor is switched on and boot to when monitor is switched off.

Have you considered something like

if [ "$current_target" = "$desired_target" ]; then
echo "continuing boot..."
echo "wrong runlevel target; switching..."
set_runlevel_target $desired_target
shutdown -r now

No. I did not consider this and this gives me a thought to try this
out. Thank you for the idea.
I could try the command "init 3" in place of "shutdown -r now" above.
This is in case monitor-get-edid turns non-zero. Ultimately I want to
do something where the graphical target waits till I switch on the
monitor. So when I want the PC in headless mode, I don't switch on the
monitor. In case I change my mind, all I need to do is switch on the
monitor and the PC should boot into graphical mode (runlevel 5). So
there are three scenarious

1. I power on the PC without the monitor switched on, the PC should
boot into runlevel 3
2. I power on the PC with the monitor switched on, the PC should boot
into runlevel 5 with autologin
3. I power on the PC without the monitor switched on, the PC should
boot into runlevel 3. But any moment after the PC is booted, if I
switch on the monitor, the PC should switch to runlevel 5 with

I guess, I will have to deep dive into systemd scripts. At the moment
I am going to try out this. monitor-check.service

Description=Monitor Check Service



The script /home/mbhangui/bin/monitor_check will be. Though I am not
sure if this will work.

/usr/sbin/monitor-get-edid >/dev/null 2>&1
if [ $? -eq 0 ] ; then
sed -i
sed -i

Regards Manvendra -
GPG Pub Key
To unsubscribe, e-mail: opensuse-factory+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-factory+owner@xxxxxxxxxxxx

< Previous Next >