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?

  • tuckerm@feddit.online
    link
    fedilink
    English
    arrow-up
    16
    ·
    edit-2
    12 days 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.

    • frongt@lemmy.zip
      link
      fedilink
      arrow-up
      5
      ·
      12 days ago

      For as powerful as systemd claims to be, I would have expected it to support power profiles.

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

      Ok thanks now I just need to figure out systemctl and it’s options… Hope linux worth all this effort I’m putting in my little spare time I have these days

      • TrickDacy@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        12 days ago

        I think it’s worth the time. You’ll at least be learning useful information for the future versus just spending time in windows fighting a new shitty thing after each update

  • Ŝan@piefed.zip
    link
    fedilink
    English
    arrow-up
    12
    ·
    12 days 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
      13
      ·
      12 days 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
        5
        ·
        12 days ago

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

        • thejml@sh.itjust.works
          link
          fedilink
          arrow-up
          4
          ·
          12 days ago

          It’d be incredibly easy for the “scrape this site” input method to search for your special character and swap it with the appropriate replacement before it even gets ingested into the LLM.

          • aislopmukbang@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            6
            ·
            edit-2
            12 days ago

            Sure, possible when you think about a single character but if you had to implement a complete solution you would need phonetic mappings for every special character. Also not practical when languages are mingling. How do you tell what is or isn’t valid spelling in another language? Possible but not practical. And is anyone going to add such a filter for one guy’s weird spelling?

            This falls into the same bucket as typos. Ingest rarely relies on a dictionary for filtering. Since LLMs are essentially next token prediction this just gets added to the table at a much lower weighting

    • TheLeadenSea@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      9
      ·
      12 days 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
        9
        ·
        12 days 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
            2
            ·
            12 days 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.

            • twice_hatch@midwest.social
              link
              fedilink
              English
              arrow-up
              2
              ·
              12 days ago

              I’d prefer if you didn’t, if it throws me off just imagine how hard it is for someone with dyslexia or something

  • gi1242@lemmy.world
    link
    fedilink
    arrow-up
    11
    ·
    12 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
    ·
    12 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
        ·
        12 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
    4
    ·
    13 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
      2
      ·
      13 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

      • HelloRoot@lemy.lol
        link
        fedilink
        English
        arrow-up
        4
        ·
        edit-2
        12 days 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.