I know how to do it in the battery section through the GUI, but I’d like to set it up through a command, for automation purposes, and particularly for KDE Connect commands.

  • dbx12@programming.dev
    link
    fedilink
    arrow-up
    4
    arrow-down
    1
    ·
    2 months ago

    Not KDE but might be similar: For the MATE desktop it is mate-screensaver-command --inhibit. I would expect something similar for KDE.

  • jpetso@lemmy.kde.social
    link
    fedilink
    arrow-up
    3
    ·
    2 months ago

    There is kde-inhibit --screenSaver <command> provided by KDE.

    But these days, I would just recommend everyone to use systemd-inhibit --what=idle --why=<because> --who=<myself> <command> instead. Works across desktops and does the same thing.

      • jpetso@lemmy.kde.social
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        2 months ago

        Anything that runs as long as you want the block to be. Usually sleep is a good one, use sleep infinity if you want the blocker to never go away until the systemd-inhibit process is killed manually.

  • pixeled@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    2 months ago

    I don’t know if this fits your use case (you didn’t describe what you want to achieve in detail), but commands that can possible help if the screen did lock (or turn off):

    • Unlock the lockscreen: loginctl unlock-screen
    • Turn on the screen: kscreen-doctor --dpms on
    • unknowing8343OP
      link
      fedilink
      arrow-up
      2
      ·
      2 months ago

      Wasn’t that. I want to keep the screen on. No sleep, no lockscreen, no blackscreen, etc.