Hi guys, I recently installed Linux mint on a spare laptop I had to check if I can daily drive this and since I run Syncthing Windows setup on this device before and I essentially want to replicate that setup here which means Syncthing starts up automatically on login but with the condition that the device should be connected to ac power and if it gets disconnected kill the process right away. I could easily have this in Windows setup and also in Syncthing-fork for Android with a simple toggle. How can I replicate this Linux mint as well?

  • gi1242@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    21 days ago

    what desktop are you using? on kde/plasma, go to the power settings and it gives you an option to run a script when the battery is connected/disconnected

    u can use that to systemctl --user start/stop syncthing

    i use syncthing all the time on some 100gb of data. it’s not much of a battery drain. ymmv

  • BrianTheeBiscuiteer@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    20 days ago

    If you use Docker/Podman to run Syncthing (a little tricky but possible) you can limit its CPU usage, which is usually the main source of power drain (besides GPU processes). If your usage is like mine Syncthing is idle 95% of the time and I wouldn’t notice if that 5% took longer than usual to do its thing.

      • BrianTheeBiscuiteer@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        20 days ago

        In theory, yes, but it wouldn’t be as significant as stopping it entirely (or pausing it instead of a hard start-stop). I only mention CPU limits because it’s extremely easy to implement.

  • RheumatoidArthritis@mander.xyz
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    21 days ago

    I don’t think there’s a simple toggle for that, I pasted your question into chatgpt and it gave a very reasonable bash script + systemd service for monitoring that. I’m not going to paste ai slop here though.

    • aprehendedmerlin@lemmy.dbzer0.comOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      21 days ago

      Ok so ask ChatGPT then? last time I told people here that sometimes you can use AI for answers too. They all said I’m wrong and I should ask the community and search forums for it which I did but couldn’t find anything