47
submitted 5 months ago* (last edited 5 months ago) by flork@lemy.lol to c/linux@lemmy.ml

I have a laptop that spends some of it's time docked to a monitor and keyboard/mouse. I would like to know how to change some settings depending on if it's connected to the dock or not. Is there a program that can help with this?

Some possible use-cases include:

  • Changing size of the taskbar to smaller/bigger
  • Changing the behavior of the taskbar to auto-hide
  • Changing the font size smaller/bigger
  • Changing power settings performance/battery saver
  • Enabling/disabling auto brightness
  • Enabling/disabling keyboard backlight

These are just a few things I can think of but can provide more.

Something like Android's Tasker but for Linux would be great.

you are viewing a single comment's thread
view the rest of the comments
[-] flork@lemy.lol 7 points 5 months ago* (last edited 5 months ago)

A bash script is like a shell script in Windows. It is a text file that runs multiple commands in order. As if you opened the terminal and typed them in yourself.

Udev rules I need to learn about but based on context I have to assume it's a tool for running scripts when specific events happen (like a monitor being plugged in)

[-] squid_slime@lemm.ee 5 points 5 months ago* (last edited 5 months ago)

indeed udev rules will monitor devices and on device change a action can be set, what desktop manager are you using? udev quick how to guide / a more in-depth

[-] Gormadt@lemmy.blahaj.zone 6 points 5 months ago

I've also got to thank you for those guides

I'm going to use the hell out of Udev now that I know it exists

[-] olympicyes@lemmy.world 4 points 5 months ago

I’d suggest editing these scripts with a tool like VS Code so you can remember exactly what you did.

[-] Gormadt@lemmy.blahaj.zone 3 points 5 months ago

Half the fun of fixing my code later is trying to figure out what the hell I was thinking when I wrote my code lol

[-] golden_zealot@lemmy.ml 1 points 5 months ago

You might also be interested in cron/crontab. You can schedule scripts/software to run at specific times of day, week, month, year etc.

Also if you want to learn more about the linux command line, three super useful commands for you are 'man', 'help' and 'apropos'.

man followed by a command, like 'man find' will show you the manual pages for the command 'find', showing you how to use it.

In some cases man wont work for some commands, in those cases try 'help theCommandThatDidntWorkWithMan'.

apropos followed by a query like 'apropos network' will show you any commands that have 'network' in their short description to help you find commands that you might want to use for something.

[-] flork@lemy.lol 4 points 5 months ago

I'm using GNOME thanks that link looks helpful

[-] squid_slime@lemm.ee 2 points 5 months ago

gnome might be tricky to interface with over shell commands, and sadly i use sway so i am limited with advice, checking ubuntu forums would be a good start for you though.

[-] Gormadt@lemmy.blahaj.zone 2 points 5 months ago

I never knew that was called bash, not sure how I missed the name up to this point lol

And Udev sounds like something I'm going to get a hell of a lot of use out of given my love of Tasker on Android (basically have it set to do specific things when certain triggers occur (like connecting or disconnecting to or from specific Bluetooth devices, reading specific NFC tags, etc)). I just never thought of trying to set something up like that on my desktops.

this post was submitted on 19 May 2024
47 points (96.1% liked)

Linux

48073 readers
763 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 5 years ago
MODERATORS