this post was submitted on 26 Dec 2023
24 points (92.9% liked)
Linux
48052 readers
714 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
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
The behavior you are requesting of bspwm is counter-intuitive to this rule you specifically wrote. Nonetheless, if VS Code popup windows have a different instance name, you could have a script running in the background which checks instance name of any new window and execute the command
bspc desktop -f last
when a VS Code popup appears.If the instance name is the same for VS Code main app and its popup windows, you may listen to the state of VS Code windows (using bspc subscribe; see the manpage) and execute the previous command on VS Code floating windows (because popups will be floating).
For example, apply this to all VS Code windows:
For your second question, if I understand correctly you're trying to have a given workspace moving to your external monitor when available and returning to your primary monitor if no other monitor is connected. You can look at the archwiki to learn how to setup bspwm for multi monitors. Using the same if conditions as explained in this wiki you could also have for example a rule
bspc rule -a Code follow=on desktop='^4'
when only one monitor is connected, andbspc rule -a Code follow=on desktop='^7'
when an external monitor is connected (and workspace 7 will be defined to be shown on your external monitor).Sadly, popup window name is same as for vscode itself. I will have a look on that script, that's something to begin with. I use only one monitor at time, I don't use "extended mode". And what I really want - to transfer already opened applications to workspaces from different monitor: I have vscode opened on 4th workspace on laptop, after I plug in external monitor and setup xrandr for it, than I turn it off and want to continue working with vscode on 4th workspace on latop. Right now this is not possible from the box.
If you're using only one monitor, simply duplicate and scale your laptop screen instead of using the extended approach.
To give you a rough idea, this will look to something like this:
xrandr --output eDP1 --mode 1366x768 --scale 1x1 --output HDMI1 --same-as eDP1 --mode 1920x1080 --scale 0.711x0.711
Use xrandr to find the monitors names and resolution. The scale option is simply the ratio between your 2 resolutions.