this post was submitted on 04 Apr 2024
74 points (96.2% liked)

Linux

48330 readers
643 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
74
submitted 7 months ago* (last edited 7 months ago) by [email protected] to c/[email protected]
 

To preface this, I've used Linux from the CLI for the better part of 15 years. I'm a software engineer and my personal projects are almost always something that runs in a Linux VM or a Docker container somewhere, but I've always used a Mac to work on personal and professional projects. I have a Windows desktop that I use exclusively for gaming and my personal Macbook is finally giving out after about 10 years, so I'm trying out Linux Mint with Cinnamon on my desktop.

So far, it works shockingly well and I absolutely love being able to reach for a real Linux shell anytime I want, with no weird quirks from MacOS or WSL. The fact that Steam works at all on a Linux environment is still a little magical to me.

There are a couple things I really miss from MacOS and Rectangle is one of them. I've spent a couple hours searching and trying out various solutions, but none of them do the specific thing Rectangle did for me. You input something like ctrl+cmd+right and Rectangle fits your current window to the top right quadrant of your screen.

Before I dive into the weeds and make my own Cinnamon Spice, I figured I should just ask: is there an app/extension that functions like Rectangle for Linux? Here's the things I can say do not work:

  • Muffin hotkeys: Muffin only supports moving tiles, not absolutely positioning them. You can kind of mimic Rectangle behavior, but only with multiple keystrokes to move the windows around on the grid.
  • gTile: This is a Cinnamon Spice that I'm pretty sure has the bones of what I want in it, but the UI is the opposite of what I want.
  • gSnap: Very similar to gTile, but for Gnome. The UI for it is actually quite a bit worse, IMO; you are expected to use a mouse to drag windows.
  • zentile: On top of this only working for XFCE, it doesn't actually let me position windows with a keystroke

To be super clear: Rectangle is explicitly not a tiling window manager. It lets you set hotkeys to move/resize windows, it does not reflow your entire screen to a grid. There are a dozen tiling tools/window manager out there I've found and I've begun to think the Linux community has a weird preoccupation with them. Like, they're cool and all, but all I want is to move the current window to specific areas of my screen with a single keystroke. I don't need every window squished into frame at once or some weird artsy layout.

top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 37 points 7 months ago (3 children)

It’s funny. I have been forced to use macOS because of work, and I use rectangle to mimic what KDE plasma does out of the box. I’d suggest using KDE if you wanted something powerfully customizable and user friendly. If you find something that works with other windows decorations (non-KDE), I’d love to know about them too for when I inevitably switch back to Linux Desktop!

[–] [email protected] 13 points 7 months ago (2 children)

Yeah. I was forced to use Mac too. Rectangle didn't really help much. After a few months I convinced them to buy me a System76. I needed tiling.

[–] [email protected] 4 points 7 months ago (1 children)

Asahi Linux is shaping up nicely. I’ll probably install that soon. 👀

[–] [email protected] 1 points 7 months ago

I'm just waiting for M3 support...

[–] possiblylinux127 2 points 7 months ago (1 children)

How did you manage that? Those laptops are nice but fairly expensive

[–] [email protected] 4 points 7 months ago (1 children)

Have you seen the cost of a MacBook Pro? I doubt a system76 is actually much more expensive. May even be cheaper. Though to be honest Asahi is probably good enough now for coding work.

[–] possiblylinux127 3 points 7 months ago (1 children)

Fair point I honestly don't understand the Apple tax

[–] [email protected] 1 points 7 months ago* (last edited 7 months ago)

The laptop was $4700. I'm doing machine learning stuff, I needed the gpu. If the laptop make me 10% faster, they make their money back pretty quickly.at least that's the reason they gave me when they agreed.

[–] [email protected] 9 points 7 months ago (1 children)

At least you’re not forced to use windows

[–] [email protected] 8 points 7 months ago

True that. Small victories 🥲

[–] [email protected] -3 points 7 months ago
[–] [email protected] 24 points 7 months ago

rectangle is a built-in feature of the KDE plasma desktop lol

[–] [email protected] 22 points 7 months ago (2 children)

You'll need to specify what DE you're using. This comes built in with KDE Plasma: Meta+left and then quickly also up for top left corner, Meta+right and then quickly also down for bottom right corner etc.

I don't knowt what exact shortcuts other DEs use, but I think most that aren't Gnome support quarter tiling too

[–] [email protected] 7 points 7 months ago (5 children)

Updated to be specific, I'm using Cinnamon. Muffin is the builtin tiling window manager for Cinnamon and it does exactly what you're describing. The problem is that it moves tiles, it doesn't absolutely position them. You have to keep moving tiles around to get them where you want them, Rectangle just has hotkeys to immediately place and resize to fit the active window for each quadrant that it supports:

  • ctrl+cmd+left: top left quadrant
  • ctrl+cmd+right: top left quadrant
  • shift+ctrl+cmd+left: bottom left quadrant
  • shift+ctrl+cmd+right: bottom left quadrant
  • alt+cmd+left: left half
  • alt+cmd+right: right half
  • alt+cmd+up: top half
  • alt+cmd+left: bottom half
  • alt+cmd+f: full screen

It's hard to express how natural that feels after using it for a bit, and I'm still using a Macbook for work so the muscle memory is not going away.

[–] [email protected] 19 points 7 months ago (3 children)

I'll just second the suggestion that KDE Plasma is worth a try, as it's very adaptable once you know what you want. You don't need to install any addons for the functionality you describe, just open the Shortcuts settings, KWin category, and have at it.

load more comments (3 replies)
[–] [email protected] 7 points 7 months ago

Do you HAVE to use Cinnamon? XD its a very slowly evolving Desktop Environment, Wayland is still experimental. I would recommend to try KDE.

[–] [email protected] 6 points 7 months ago* (last edited 7 months ago) (1 children)
[–] [email protected] 0 points 7 months ago (1 children)

I saw that and tried it pretty early on. That just moves the screen, it doesn't fill the quadrant.

[–] [email protected] 1 points 7 months ago (1 children)

What do "moves the screen" vs "fills the quadrant" mean? I'm not running cinnamon, but "Move window to upper right" really sounds like it should do what you're asking, provided I understand what you're asking.

[–] [email protected] 1 points 7 months ago (1 children)

My guess is that for example if your screen is 1920x1080, and the window is 800x600 OP expects that move to right rescales it to 960x1080 and top-right to 960x540, but that shortcut might be just moving the 800x600 window without resizing.

For OP if that's what you're asking, KDE does that, not sure if Cinnamon does, it's expected to be kind of minimalist and similar to windows. KDE has had that built in for decades, it's not a new thing, so I think that if Cinnamon was going to have it it would already do.

[–] [email protected] 1 points 7 months ago (1 children)

Ohh, is that actually what it does? No resize? So if the window is already maximized, does it do nothing? I feel like resizing to 1/4 of the screen is the most intuitive thing for that operation to do, I'm surprised if it doesn't.

[–] [email protected] 1 points 7 months ago

That's my understanding from what OP said, i.e. it just moves the window doesn't fill the quadrant.

[–] [email protected] 3 points 7 months ago (1 children)

IIRC Xfce4 supports quad manual tiling like that.

[–] [email protected] 3 points 7 months ago (1 children)

It does. I use it all the time. I have various window cobtrol stuff bound to alt-keypad keys.

[–] [email protected] 2 points 7 months ago

Thanks for the clarification. I switched from Xfce4 to GNOME many years ago because the former doesn't support Wayland at that time, but I still miss the manual quarter tiling with the shortcut keys.

load more comments (1 replies)
[–] [email protected] 19 points 7 months ago (1 children)

It seems you've chosen a DE that is not particularly well-suited to this task. Cinnamon is meant to be simplistic, and offer an easy transition from Windows with its Windows-like layout. It is purposefully less customizable than many other DEs. I second the recommendation of KDE Plasma, as this is actually available as a shortcut without any extensions, but if you wish to customize your DE deeply like this, KDE is incredibly customizable. You can do essentially anything you want in it and get it to look however you want.

Since you said that you're trying out Mint, now would be a good time to switch distro so you don't get attached to something that doesn't suit your needs. Switching desktop environments can cause lots of issues, so it's often best to just pick a distro with the DE you want. My personal recommendation is Fedora's KDE spin (though there are discussions of Fedora's default workstation switching to KDE in the future). If you're invested into Debian, then I don't really have any experience with Debian-based KDE distros, but I'm sure someone else could recommend you something. To be clear, the benefit of recommending Mint as a starter distro has gradually diminished as other distros have become more user-friendly. Fedora is a perfectly fine distro for someone new to desktop Linux (especially since you're already experienced on the command line); you'll just have to look up how to install Nvidia drivers if you have an Nvidia graphics card. AMD commits their driver to the Linux kernel, so no need to do anything if you have an AMD card. Try out some distros in a VM before you commit to anything though; it's much less commitment than installing so it's far easier to test distros out and see what best suits you.

[–] [email protected] 2 points 7 months ago

I do quite like the stability of Cinnamon/Debian, and I think this problem is solvable (even if I have to solve it myself). I generally do not want to spend a lot of time futzing around with my desktop environment, but this is one thing I need to have.

[–] [email protected] 7 points 7 months ago (1 children)

by the sounds of it if you are using Gnome add the Put Windows extension. then you hit Super+ Keypad number for the screen corners. i.e. top right is Super+kp9

[–] [email protected] 2 points 7 months ago

Hitting exact same combo again after you moved it resizes through 3 options

[–] [email protected] 7 points 7 months ago

System Settings > Keyboard > Shortcuts > Windows

Although I just skimmed the Rectangle front page, I think this about covers everything you're asking for in Cinnamon...? The default shortcut is Super/Win-arrow.

[–] [email protected] 6 points 7 months ago

I also use Linux mint with cinnamon... Is this not just the Ctrl + Fn + arrow key? I think that's it, or maybe shift (not at my computer to check). Either way, I use this all the time to fit windows either on 50% of the left or right, or in one of the 4 corners. For example, if I want it in the top right, I just use the hot keys and target right then up.

[–] [email protected] 6 points 7 months ago

What Desktop are you using? GNOME and KDE, as well as prealpha COSMIC and probably more support this out of the box.

[–] possiblylinux127 6 points 7 months ago

I am not a KDE user but it sounds like KDE would be great for you. KDE should let you customize your desktop a ton including keyboard shortcuts

[–] [email protected] 5 points 7 months ago* (last edited 7 months ago) (1 children)

As a primary Linux user who wrote his own X tool to do exactly this and has been missing this functionality on Mac - thank you!

I'll send my unpublished code your way soon. It's just Go, relying on the WM (run command shortcuts) to call it. Move+Resize and Focus functionality.

It won't work on Wayland, which seems to require native compositor support - labWC is halfway there.

edit: check your PMs

[–] [email protected] 2 points 7 months ago

I can confirm labwc. You can drag windows to screen edges to trigger a snapping action that visually "tiles" the window to the half of that screen side. It's standard functionality that is set in the default/example configuration.

[–] [email protected] 4 points 7 months ago

Its not exact but KDE Plasma has the drag to the corner and get the same quadrant/full screen when you drag to the top middle.

[–] [email protected] 2 points 7 months ago

In Cinnamon you can assign the shortcut for this. It is just not defined. You can go to Settings->Keyboard->Windows and you should look for something like Positioning (I am trying to translate in English what I see). You assigned the shortcut you want and that's it

[–] [email protected] 1 points 7 months ago

It's a window manager feature. I don't know which one is used in Cinnamon by default and if it is able to do so, but you can switch to another one anyway even without changing the complete DE. E. g. xfwm4 provides such a feature. I believe that kwin also does.

I also suggest you to try some tiling WM, you may like it.

[–] [email protected] 1 points 7 months ago* (last edited 7 months ago) (1 children)

same boat. was on GNOME and used gTile over there; once the (cumbersome) setup was done, worked as expected, especially the cycle function (cycle between 1/3, 1/2, and 2/3 on repeated keypresses).

now I'm on Plasma and there isn't anything worthwhile; tried a couple of solutions but most of those are of the auto-tile kind where the WM "guesses" what you want and then you adjust it, which is beyond asinine to me. I have a huge screen and I want to send this window do this quarter and this to this sixth and this to half and so on.

anyhow, none have what I need, so I learned to live without it.

edit: found the exact one I needed - Better Quick Tiles for Plasma 6. does exactly what I need, including alternating between 1/3, 1/2, 2/3.

[–] [email protected] 2 points 7 months ago (1 children)

shameless plug, maybe my kwin script does what you want https://store.kde.org/p/2136753

[–] [email protected] 1 points 7 months ago (1 children)

thanks for reaching out. I think I tried it (tried a number of KWin scripts, including the one called Rectangle) but I'll look at it again. can I tile my workspace in six areas (top/bot + left/mid/right) and hotkey-send windows to each of those and then cycle widths on repeat keypresses?

[–] [email protected] 1 points 7 months ago

it only does left, center, and right, and cycles between sizes on repeat keypresses e.g. i press meta-ctrl-a once and my window goes left to 50% of screen, press it again and it shrinks to 33%, 25, back to 50; meta-ctrl-s to do the same in the center of the screen, etc.

you can combine it with some other plugin that gives you top-half/bottom-half to achieve the effect you want (so you'd keypress one to go top or bottom, then use yanjing to cycle x-placement and widths)

[–] [email protected] 0 points 7 months ago

Have you given any thought to using a window manager with your desktop environment? Maybe one that can be customized to provide very basic functionality? I use bspwm with XFCE, for example.

[–] [email protected] 0 points 7 months ago

Hiprland? Although Wayland has some quirks

load more comments
view more: next ›