The goal is to have my screen rotate to normal and start Barrier (keyboard and mouse share software) on boot up.

So, i have a laptop laying on top of my desktop monitor that i use kinda like a second monitor. But it boots up with the display sideways and i have to login to be able to use mouse and keyboard from my desktop.

I have tried everything to get a systemd service to handle those problems. But no luck, i think the service isnt running properly on boot. Please help me out.

Let me know if there is a better community to post to or if additional info is needed. Thanks.

  • mystuffdoesntwork@discuss.tchncs.deOP
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Its odd because i dont know what im doing, i sudo everything lol. So, i also tried what @[email protected] said. Changed the shellscript.service to use commands instead of a script and then checking status in terminal after a restart.

    With xrandr it failed with “cant open display” which is what youre talking about. Is what youre saying is that i cant run xrandr before login?

    With barrier it failed because “The Barrier GUI requires a display”. So, same thing, it cant be done before login??

    • glibg10b@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      Is what youre saying is that i cant run xrandr before login?

      So, same thing, it cant be done before login??

      Yes and yes

    • dragnucs@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      You can set your service to start after the graphical session starts by adding this line to the [unit] section:

      After=graphical-session.target
      

      You can also add a require with same target.

      If you still need a value for an environment variable, you can set it with “Environment=”.

      Also as others said, you don’t nedd sudo. Systems should manage all of that. Starting, stopping, reload, environment, dependencies and user context.