this post was submitted on 21 Jun 2023
2 points (100.0% liked)

Linux

48012 readers
859 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
 

One of my biggest gripes while using Piper has always been the lack of automatic profile switching on profile switch. I wanted to implement a band-aid to try and solve this issue, but have been having too many issues to sink more time into this:

Method 1:

  • Using a while loop that triggers every couple seconds that gets the active window id and fetches its name for a function that checks it against various regexs.
  • Problem? Well, it is rather laggy. I find my mouse stuttering every once in a while, even when using an if statement to only run code when the IDs don't match.

Method 2:

  • Using xdotool search . behave %@ focus ... to add event listeners to windows.
  • This method was WAY better in terms of performance, but doesn't apply it to windows created after script launch, which is an issue since the script would launch at session startup.

It's about time I came to the collective hive-mind for ideas, or even a complete solution that someone may have.

Here is my neofetch for system info, since I know that can impact your answers.

OS: EndeavourOS Linux x86_64 
Kernel: 6.3.8-arch1-1 
Uptime: 1 hour, 5 mins 
Packages: 1400 (pacman), 8 (flatpak) 
Shell: zsh 5.9 
Resolution: 1080x1920, 1920x1080, 1920x1080 
DE: Xfce 4.18 
WM: Xfwm4 
WM Theme: Matcha-dark-sea 
Theme: Flat-Remix-GTK-MORALES-Dark [GTK2], Arc-Darker [GTK3] 
Icons: Flat-Remix-Red-Dark [GTK2], Qogir [GTK3] 
Terminal: xfce4-terminal 
Terminal Font: Fira Code 10 
CPU: AMD Ryzen 9 5950X (32) @ 3.400GHz 
GPU: NVIDIA GeForce RTX 3080 Lite Hash Rate 
Memory: 6675MiB / 32006MiB 
no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here