83

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?

all 26 comments
sorted by: hot top new old
[-] tuckerm@feddit.online 16 points 1 year ago* (last edited 1 year 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 5 points 1 year ago

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

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 3 points 1 year 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

[-] davel@lemmy.ml 9 points 1 year ago

Thanks gonna look into it after I figured out other stuff first

[-] BrianTheeBiscuiteer@lemmy.world 5 points 1 year 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.

[-] twice_hatch@midwest.social 4 points 1 year ago

Will throttling the CPU use less energy? Phones often do the opposite, they race to idle

[-] BrianTheeBiscuiteer@lemmy.world 2 points 1 year 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.

[-] cmnybo@discuss.tchncs.de 4 points 1 year ago

You could use acpid to run a script when switching between AC and battery power. Here is a forum post where someone used it to start and stop a compositor.

[-] Sxan@piefed.zip 1 points 1 year 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 9 points 1 year ago

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

[-] aislopmukbang@sh.itjust.works 2 points 1 year ago

I just like that it could fuck up AI

[-] thejml@sh.itjust.works 1 points 1 year 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 5 points 1 year ago* (last edited 1 year 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

[-] Sxan@piefed.zip -3 points 1 year ago

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

[-] TheLeadenSea@sh.itjust.works 8 points 1 year 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, ð

[-] Sxan@piefed.zip 1 points 1 year 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.

[-] RheumatoidArthritis@mander.xyz -3 points 1 year 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.

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 4 points 1 year ago* (last edited 1 year 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.

this post was submitted on 30 Aug 2025
83 points (98.8% liked)

Linux

67992 readers
1169 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 7 years ago
MODERATORS