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?

you are viewing a single comment's thread
view the rest of the comments
[-] 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

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

Linux

68001 readers
1327 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