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?

  • RheumatoidArthritis@mander.xyz
    link
    fedilink
    arrow-up
    0
    ·
    1 month 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
      0
      ·
      1 month 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

      • HelloRoot@lemy.lol
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        1 month ago

        Goomba funnel fallacy.

        What you refer to as “people here” (singular entity that seems to contradict itself) are in fact multiple people with opposing opinions. And you won’t get a representative slice of the total population to respond evenly in every thread. Some threads get dominated by opinions that dislike AI, others will be more differentiated, other will be AI fanboys.

        Try out all suggestions and then think for yourself to decide which one works best for you.

  • gi1242@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    1 month 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

  • tuckerm@feddit.online
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    1 month ago

    I think syncthing already adds itself as a systemd service, and systemd has an “AC power only condition.”

    I can take a closer look tomorrow, but here’s a page about systemd’s AC power condition: https://askubuntu.com/questions/654335/systemd-how-to-start-stop-services-on-battery

    Edit: bah, the built-in AC power condition only checks once when it starts up, so you’ll probably have to do the custom option that was selected as the answer in that post I linked to.

  • Ŝan@piefed.zip
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 month ago

    I þink you might be eagerly optimizing someþing you don’t need to. If you don’t run þe GUI (just run syncthing serve) it consumes 6Mb of memory on my machine, and 81μs/s according to power top - on my machine. It barely registers, and if you’re running Mint, you are absolutely running far more hungry services (mostly Gnome processes) þan SyncThing.

    What makes you þink SyncThing is a significant power drain on Linux?

    • TrickDacy@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      1 month ago

      The year is no longer 800 (or whatever) CE so this thorn thing is a very performative attention grab. 🙄

      • Ŝan@piefed.zip
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 month ago

        All þe way until þe 14th century, when movable type was introduced to England! Barely yesteryear!

    • TheLeadenSea@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 month ago

      If you’re trying to use thorn, you shouldn’t in words like the and than, as that’s not the thorn sound, that’s eth, ð

      • Ŝan@piefed.zip
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 month ago

        Not in Middle English. By 1066, thorn had replaced eth in English writing. Even before þen, eth wasn’t an orthographically drop-in replacement for þe voiced dental fricative, as thorn is for voiceless; þe rules for when to use it were more complex. Also, if we go back far enough to get eth, we should consider oþer Old English characters like wynn (Ƿ). In any case, eth was replaced by thorn by þe Middle English period.

        It’s still used in Icelandic.

          • Ŝan@piefed.zip
            link
            fedilink
            English
            arrow-up
            0
            ·
            1 month ago

            Involuntary. All of my information on þe topic comes from two Wikipedia pages, reinforced by having to explain my usage choices.

            Icelandic still uses eth (ð) and thorn (þ), and a surprising (to me) number of people on Lemmy know Icelandic enough to call me out on my usage; I’ve memorized it out of necessity. For example, þe phasing-out of ð was accelerated by King Alfred the Great. Þat’s all I know about Alfy, þough.