Giter VIP home page Giter VIP logo

gnome-shell-extensions-negesti's Introduction

Put Window

An gnome-shell extension that makes window movement a lot easier.

Friend of GNOME

Installation

As you ended up here, I assume the installation from extensions.gnome.org didn't work :)

If you want to contribute or go the 'git way' just clone this extension and link it to the .local extension folder. This way you can always update the extension using git pull.

 ln -s "PATH_TO_YOUR_CLONE" ~/.local/share/gnome-shell/extensions/[email protected]

Wayland & Wnck

For application based configuration the extension relies on the X11 library wnck.

  • Suse: sudo zypper in libwnck-devel
  • Arch: pacman -S libwnck3
  • Fedora:
    • sudo yum install libwnck3
    • sudo dnf install libwnck3
  • Debian/Ubuntu: apt-get install gir1.2-wnck-3.0

Because of this dependency and the different concepts of wayland and X11 to identify applications (wm_class vs. application_id) Wayland is not supported!

As wayland is no real alternative for me until global keyboard/mouse grab is supported, I don't plan to switch to wayland and will not actively work on wayland support.

For more details please check the associated issues

Configuration

The extension can be configured using the gnome prefs tool.

  • East/West widths, North/South heights
  • Keybindings
  • Change width and height when moving to corner (Always, only height, only width)
  • Use multiple widths even if moving to other screen is possible
  • Move focus using the keyboard
    • move-focus-north/east/south/west using super + i/l/k/j (default)
  • Application based config (hit the save button)

Multi screen setup support

The extension works well with mutliple screens.

Moving windows from one screen to another is currently only possible in horizontal setup. e.g. a window that is a the left or right side of one screen, can be moved to the next screen using keyboard shortcuts.

  • Move to left screen: default binding: Left
  • Move to right screen: default binding: Right

The keyboard settings can be changed using the preferences.

Contributors

  • krlmr - Move to other display
  • 73 - Move focus
  • Anthony25 - gnome-shell 3.12 support
  • airtonix - gnome-shell 3.5 support
  • zara86 - gnome-shell 3.16 support
  • cleverlycoding - gnome-shell 3.18 support
  • wdoekes - cleanup, improve move to center
  • eddy-geek - gnome-shell 3.30 support

License

Copyright (c) 2011-2022 negesti

This program is free software; you can redistribute it and/or modify it under the terms of VERSION 3 of the GNU General Public License as published by the Free Software Foundation provided that the above copyright notice is included.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Go to http://www.gnu.org/licenses/gpl-3.0.html to get a copy of the license (or check the licence file)

gnome-shell-extensions-negesti's People

Contributors

airtonix avatar aruhier avatar crittico avatar domdomegg avatar drannex42 avatar edayers avatar eddy-geek avatar escargotprodige avatar freddyw avatar gbrova avatar grantpmcw avatar jhakonen avatar jose1711 avatar mgoo avatar negesti avatar nesnesgb avatar pdecat avatar peterryan avatar ricitron avatar wdoekes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gnome-shell-extensions-negesti's Issues

Additional size when moving to side

in the compiz plugin, multiple keystrokes to the same direction toggle between 66%, 50% and 33% of the screen, which was very useful for distributing more space to primary windows and leaving less space for secondary ones etc...

Problem

Moving between multiple screens would require resizing the window to 66, 55, 33 and moving, instead of 50 move.

Solution

  • Moving between screens is done with a new keyboard binding (super + Left/Right)
  • The user can configure 3 widths for left and right side (defaults to left: 50-66-33, right 50-34-66)
  • It is possible to disable widths when moving to other screen is possible e.g. The window is moved to the other screen if possible and resized to 50-33-66 if no screen is available

Moving between screens error.

Typo on line 98:

let winHeight = this._primary!=sIndex ? pos.height + this._topBarHeight : pos.height;

should be

let winHeight = this._primary==sIndex ? pos.height + this._topBarHeight : pos.height;

(note the '==' vs '!=')

Otherwise you can only move TO the primary monitor, but never off it.

GnomeShell 3.6.1 Compatibility, Ubuntu 12.10

I'm considering upgrading from Ubuntu 12.04 to 12.10, I tested on a VM that your extension cant be installed up to now. Believe or not, not having your extension is a stopper for my dist-upgrade.

Is it compatible or could you make it compatible with latest Gnome Shell please

Thanks in advance!!!

X and Y-position Doesn't Modify Window Location.

If I set an application based location setting it doesn't seem to have an effect. I tested on gnome-terminal and it still opened in the top-left despite an x & y position of 50 (or any x/y position for that matter). Tried with other windows and see the same behavior.

Running Arch w/ gtk3 3.10.6

Keep size when moving to corner

  Chaosmaster



One thing is missing for me: could you please add option to move window to a corner
   without changing it size? I would like to be able to move gnome-terminal keeping it width at 
   80 symbols. But with default setting 50%, width becomes 79. And if make it
   51%, width becomes 81.


dotsdl

  ...but would it be possible to add an option for NO changes to window dimensions on 
  move? As it stands, it looks like you can make it change only the 'width,' only
  the 'height,' or 'both,' but not 'neither.' That additional functionality would make
  it PERFECT!

unclear for me:

  • configure this on a per app base (only gnome-terminal)?
  • what happens if you move to south-east multiple times?
  • only when moved to corner or always?
  • maybe it's "enough" if you can define the size/position in pixel?

Moving maximized window to other display

When a maximized window is moved to another monitor ("Move to the left/right screen" shortcuts, Super+Left/Right by default), it somehow remains attached to the original monitor: If it is then restored to normal size, it is moved back to the original monitor.

This is unpleasant, because the moving back to the original monitor is sometimes triggered by other events, e.g., typing into Chromium's Omnibox.

Steps to reproduce

  1. Choose a maximizable window, move it in un-maximized, un-centered state to the left screen
  2. Maximize it using Super+Up
  3. Move it to the right screen using Super+Right
  4. Un-maximize it using Super+Down

Expected: Window is un-maximized stays on the right screen

Observed: Window is un-maximized, but moved back to the left screen

Tested with Chromium and RStudio.

Workaround

Before step 3, un-maximize the window, and maximize it after step 3.

Related issues

The same behavior occurs when moving a window using Ctrl+Alt+Num 5/Num 7.

[F] Move window when created

From extensions.gnome.org (l300lvl):
Is there a way to make it force a certain window always to a certain position for instance the right edge? I only need to do it for pretty much one app.

Add a possibility to auto move and resize new windows.

TODO.

Why/Usecase

  • move the ***** app on startup
  • makes issue#4 (additional sizes) obsolete (together with restore size)

Disable Resize

from extensions.gnome.org


dotsdl:
Hey Nesta, thanks for the fantastic extension! This makes my Compiz withdrawals bearable in GNOME. I do have one request: could you add an checkbox option to NEVER change the size or proportions of windows on move? That's the behavior I remember from Put on Compiz, and it was useful given that some windows just don't scale as well as others. Excellent stuff!


Nesta:
For "move to corner" you can already set this (Settings-Main-Moving to corner). Do you want to completely disable resize or on a per app base?


How to use outside of Gnome shell

First off, incredible extension.

For a number of reasons, I've recently switched from Gnome-shell to Elementary OS. All is well, except for the lack of a proper method for moving around windows with the keyboard. Any ideas on how to implement your extension on Elementary, or any other Ubuntu based distro? Might I suggest packaging it into an app? I'd gladly pay for it.

Add aditional "sizes"

Why:
always resizing my console on the second screen to fit nice with my instance messenger is anoying.

What:

  • "move_to_e" and "move_to_w" should be able to move the window to 10% 50% and 90%
    not only 50%.
  • easy way to configure ratio (10/50/..../90) (min > 50px, make sure sum < 100%)
  • maybe add a modifier to move to 10 and 90% (depends on mutter 3.3.2 custom keybinding)

Google Chrome left and right position too tall

For some reason, Google Chrome resizes incorrectly when moving to left or right. I have not yet found another application that behaves this way, and other positions work correctly.

Here's an example of Chrome put in the bottom left corner: http://imgur.com/q4wsJ
Everything's a-ok here.

Here's the same window put on the left side: http://imgur.com/vm7eK
There should be a visible horizontal scrollbar at the bottom.

Hot corner activation (drag a window to resize to the adjacent quadrant of the screen)

With a moths delay (after posting about it on extensions.gnome.org) I'm opening the issue to discuss an idea - to add a feature to resize windows not only by shortcuts , but with moving to the corners and sides too. Simple example : drag a window to the top left corner , and it resizes to the top left quadrant of the screen . Much like now dragging to the left or right side resizes a window to the left or right half of the screen .
I will try to write the code myself , but first I want to get some feedback on the idea + any tips on where to integrate it with the existing code.

Move to corner does not give a window with width2 and height3

When I move a window to corner I am able to cycle through window sizes like:
width1 x height1 (e.g. 50x50)
width2 x height2 (e.g. 30x30)
width3 x height3 (e.g. 70x70)
which leaves me unable do place a window with 30x70 below one with 30x30;

I would like to propose to cycle through all combinations of width and height.

Screenshot from 2013-04-05 08:51:17

Gnome 3.4 crashes when trying to move Chromium

The 'develop' branch works well on Gnome 3.4, but when I try to move the Chromium window Gnome Shell is reloaded, and on the second attempt it crashes. This is perhaps because Chromium does not use window decoration.

does not work with v3.4

The extension does not work anymore in gnome-shell 3.4; simply modifying the shell-version in metadata.json crashes the whole shell.

Move window to the above/below screen (feature request/bug)

if i set my second monitor "above" the first (xrandr --output HDMI1 --auto --above eDP1C) and try to move the window to screen "right", nothing happens, with moving to screen "left" the window moves left on the current screen and reduces width.

is it possible to add the function move window to screen above/below beside left/right, or cycle through all monitors with the current option?

ty

Extension doesn't work on Gnome 3.10 and Arch Linux

This is the message error:

Error: Requiring Wnck, version none: Requiring namespace 'Gtk' version '2.0', but '3.0' is already loaded

Stack trace:
@/home/kbryd/.local/share/gnome-shell/extensions/[email protected]/prefs.js:7
Application<._getExtensionPrefsModule@/usr/share/gnome-shell/js/extensionPrefs/main.js:84
wrapper@/usr/share/gjs-1.0/lang.js:213
Application<._selectExtension@/usr/share/gnome-shell/js/extensionPrefs/main.js:99
wrapper@/usr/share/gjs-1.0/lang.js:213
Application<._extensionSelected@/usr/share/gnome-shell/js/extensionPrefs/main.js:119
wrapper@/usr/share/gjs-1.0/lang.js:213
Application<._selectExtension@/usr/share/gnome-shell/js/extensionPrefs/main.js:110
wrapper@/usr/share/gjs-1.0/lang.js:213
Application<._extensionsLoaded@/usr/share/gnome-shell/js/extensionPrefs/main.js:219
wrapper@/usr/share/gjs-1.0/lang.js:213
_emit@/usr/share/gjs-1.0/signals.js:124
ExtensionFinder<._extensionsLoaded@/usr/share/gnome-shell/js/misc/extensionUtils.js:178
wrapper@/usr/share/gjs-1.0/lang.js:213
done@/usr/share/gnome-shell/js/misc/fileUtils.js:33
@/usr/share/gnome-shell/js/misc/fileUtils.js:51
onNextFileComplete@/usr/share/gnome-shell/js/misc/fileUtils.js:21
main@/usr/share/gnome-shell/js/extensionPrefs/main.js:276
@:1

Maximizing by dragging to top on secondary monitor breaks future movement.

Gnome-Shell 3.8.3

To reproduce:

Have two side by side monitors, with the left one set to primary. (same resolution)

Open a window, make sure it's unmaximized.
Click and drag the title bar to the top of the right hand (non primary) screen until it maximizes.
Release the mouse.
Attempt to move the window left or right using extension shortcuts.

Expected: Window should resize to take up half of right hand monitor (left or right depending on shortcut)
Actual: Window jumps slightly in place, shadow of window appears on left monitor (as though it was unmaximized), but no movement happens. Future shortcuts have no effect until window is unmaximized by mouse.
Workaround: After this occurs, you can hit the maximize/centre shortcut, and things will start working again.

Note: If you maximize with extension shortcuts, then things are fine, as they are if you double click title bar to maximize (instead of drag)

Notify on conflicts with main settings.

I was about to report a bug, but realized it was due to a conflict with the default gnome bindings.
Is it possible to notify when a setting conflicts with a default gnome binding? Causes strange issues otherwise (eg. Super left assigned to move to left, but also assigned to the main setting 'view split on left')

Gnome 3.8 error

Running the latest devel git on gnome 3.8 gets the following in the log.

JS LOG: Extension "[email protected]" had error: Error: Expected type interface for Argument 'settings' but got type 'undefined' (nil)

The extensions settings will load, but the extension itself does not.

Additionally the following error occurs when opening the settings:
JS ERROR: !!! WARNING: 'assignment to undeclared variable name'
JS ERROR: !!! WARNING: file '/home/louis/.local/share/gnome-shell/extensions/[email protected]/prefs.js' line 265 exception 0 number 156

Option to not resize when moved to corner

What would make this extension more useful for me is to move windows without resizing them, just at the Compiz plugin allowed. Could you add a 'Never' option to the Both, Width, and Height resize options?

Thank you

New feature - Multiple sizes

It would be nice if we could get a key combination to cycle though various sizes.

For example, if move_to_side_e cycled though 50%, 25%, 33%, 20% that would be awesome.

A nice extension to this wold be to make those percentages user definable.

Don't focus hidden on hidden windows

Tile a few windows horizontally--make sure you're able to focus between windows using Super+H and Super+L (I remapped to Vim movement keys).

HIde one of the windows (Super+I, default is Super+H). Continue focusing horizontally and notice that the hidden window appears again. Focusing should only occur on workspace windows that are NOT hidden.

Move the focus to the right/left screen (feature request)

Hello,
I've just discovered your extension because I was looking for an easier way to navigate between my monitors without the mouse (and without changing for a tiling DE), and I would like to do a feature request : If it's possible, could you add some keybinds to move the focus between the monitors ? Exactly like the keybinds to move a window between screens, but now with the focus.
I don't know if it's possible, but it would be a really great feature (in my opinion) !

Thank you for your work !

Gnome keyboard shortcuts stop working while Super pressed

This is a really small issue--please close it/wontfix if fix is ugly, complicated, etc

First of all. I LOVE this plugin--I barely use the mouse now since I can focus/move windows all using the keyboard--this is great for a tmux/vim users like me.

Part of my workflow now involves cycling through the various 'visible' (not-hidden) windows (either using Super+O, or Focus left-right & up-down). I'll hold down the Super key (WIN) and repeatedly press 'O' until I get to the window that I want. If there is a window that I no longer want visible I'll use Super+H (gnome keyboard shortcut) to Hide the window.

Unfortunately, Super+H doesn't do anything if the Super key was pressed from a previous focus command (e.g: Super+O). To make it work, users have to release the Super key, press it again and then press 'H' to hide the window.

I don't know Gnome/Mutter implemented it, but after the Super+H (Hide), I can continue holding Super and just press 'O' to cycle the remaining visible windows. It would be great if this plugin could do the same in reverse, like mentioned above. Thanks.

Move window to next workspace

Add the possibility to move a window to the next workspace (up/down)
e.g.
Similar to the 2 Screen horizontal setup. Move a window to the next workspace if it is
@south and south is pressed again.

changing window size in one direction changes sizes in both directions

hey i just found this extension and i think its awesome, definitely will help my productivity on a large high res screen. that said:

Is there a way when moving the screen horizontally or vertically to not change the size of the other axis as well?

Lets say I have a window at 50% width, 100% height which i moved to the center of my screen. and i press super+8 to adjust its height so it is on the top 50% of my screen(still centered horizontally). I would expect the width to stay the same 50% and the height to decrease to 50%, instead the width goes to 100%, and the height goes to 50%. This makes it difficult when i just want to change the height keeping the current width without snapping the window to a corner.

Error spam in log

Getting the following message during init (many times) when doing a gnome-shell --replace

(gnome-shell:6615): Gjs-WARNING **: JS ERROR: TypeError: this._windowTracker.is_window_interesting is not a function
MoveWindow.prototype._moveConfiguredWhenCreated@~/.local/share/gnome-shell/extensions/[email protected]/extension.js:577

Shell version update

My Arch install just updated Gnome Shell - Now

metadata.json needs 3.2.2 added to versions.

Alternatively, couldn't you just use 3.2, as most of my other extensions seem to use?

Cannot set tiling width to make my terminal tile to 80 columns

Since the widths are saved as ints rather than floats, I am unable to set up widths precisely enough to get my terminal to be 80 columns.

Should be an easy fix, just change all of the percents to be stored as floats. I can submit a pull request when I have the time to do it myself.

move focus keybindings do not work anymore

Hi,

I'm on gnome-shell 3.8.1 now. When starting the shell I get:

Window manager warning: Trying to remove non-existent keybinding "move-focus-north".
Window manager warning: Trying to remove non-existent keybinding "move-focus-east".
Window manager warning: Trying to remove non-existent keybinding "move-focus-south".
Window manager warning: Trying to remove non-existent keybinding "move-focus-west".
Window manager warning: Trying to remove non-existent keybinding "move-focus-north".
Window manager warning: Trying to remove non-existent keybinding "move-focus-east".
Window manager warning: Trying to remove non-existent keybinding "move-focus-south".
Window manager warning: Trying to remove non-existent keybinding "move-focus-west".
Window manager warning: Trying to remove non-existent keybinding "move-focus-north".
Window manager warning: Trying to remove non-existent keybinding "move-focus-east".
Window manager warning: Trying to remove non-existent keybinding "move-focus-south".
Window manager warning: Trying to remove non-existent keybinding "move-focus-west".
Window manager warning: Trying to remove non-existent keybinding "move-focus-north".
Window manager warning: Trying to remove non-existent keybinding "move-focus-east".
Window manager warning: Trying to remove non-existent keybinding "move-focus-south".
Window manager warning: Trying to remove non-existent keybinding "move-focus-west".

The hotkeys (no matter to what I set them) don't work. Keybindings for moving still work.
Any ideas on debugging?

When moving window from side to bottom keep the current side (move to bottom side)

I use your application with wmii keybindings. When I move a window to the side, e.g. Left, then to the bottom, I expect the window to be on the same side, e.g. Bottom Left.

Right now the application moves the window to the bottom using the entire screen. It would be nice to keep the side width and only use the full screen width the second time the user presses the keybinding.

Disable certain features

It would be nice to select which actions that should be used in the keyboard shortcuts.
Is this possible?

In the normal keyboard shortcuts, it is possible to deactivate an action with backspace.

Moving tiled windows not possible

When a window is tiled with the mouse (by
moving it to the edge), you can't move it with the keyboard.

Thanks to Thanasis for reporting this problem (i am not using the mouse very often : ) )

Default gnome maximize keyboard shortcut fails

To reproduce:

  • Have put windows installed
  • Set the default Gnome maximize shortcut to something (Super + Up for me)
  • Have two windows open.
  • Alt tab from one window to another
  • Press Super + Up (expected: window maximizes, actual: nothing)
  • Press Super twice (overview and back again)
  • Press Super + Up (expected: window maximizes, actual: window maximizes)

This double super press after an alt tab is rather annoying, likely a difficult one to track down.

Alternatively, I'd be happy if the order of the 'Move to center / maximize' keyboard shortcut of Put Windows, was maximize > center instead of the reverse.

wm_class name containing dots

The auto move feature stores the config as a json String inside gsettings. Applications using dots in their wm_class name are not handled correct.

  • LibreOffice 3.5

Fix: replace "." in the wm_class with a "non keyword" (replace(/./g, "foobar")

[Feature Req] More complex keyboard shortcuts?

Would it be possible to allow more complex keyboard shortcuts, such as Super+Right+Up to move a window to the top right corner? I think this would be much more intuitive than Super+.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.