Smart Auto Move learns the size and position of your application windows and restores them to the correct place on subsequent launches. Supports GNOME Wayland.

Overview

smart-auto-move

smart-auto-move is a Gnome Shell extension which keeps track of all application windows and restores them to the previous position, size, and workspace on restart. Supports Wayland.

Get it on GNOME Extensions

screenshots

screenshot: saved windows preferences

screenshot: overrides preferences

limitations

terminals which include the current directory in the title may not reach the match threshold when restarted if they do not preserve the working directory across restarts.

behavior

because there is no way to uniquely distinguish individual windows from an application across restarts, smart-auto-move uses a heuristic to uniquely identify them. this is primarily based on startup order and title. in cases where there are multiple windows with the same title, they are restored based on relative startup sequence.

titles are matched using Levenstein distance. the match bonus for title is calculated based on (title length - distance) / title length.

settings

most settings can be modified from the preferences GUI. this section documents all of the dconf values and is only recommended for advanced users.

enable debug logging:

$ dconf write /org/gnome/shell/extensions/smart-auto-move/debug-logging true

set the minimum window/title match threshold to 50%:

$ dconf write /org/gnome/shell/extensions/smart-auto-move/match-threshold 0.5

set the window synchronization (update/restore) frequency to 50ms:

$ dconf write /org/gnome/shell/extensions/smart-auto-move/sync-frequency 50

default to ignoring windows unless explicitly defined. restore all windows of the gnome-calculator app, all firefox windows except for the profile chooser, and Nautilus only if the window title is "Downloads":

$ dconf write /org/gnome/shell/extensions/smart-auto-move/sync-mode "'IGNORE'"
$ dconf write /org/gnome/shell/extensions/smart-auto-move/overrides '{"gnome-calculator": [{"action":1}], "firefox": [{"query": {"title": "Firefox - Choose User Profile"}, "action": 0}, {"action": 1}],"org.gnome.Nautilus":[{"query":{"title":"Downloads"},"action":1}]}'

default to restoring all windows, but ignore the firefox profile chooser and any nautilus windows:

$ dconf write /org/gnome/shell/extensions/smart-auto-move/sync-mode "'RESTORE'"
$ dconf write /org/gnome/shell/extensions/smart-auto-move/overrides '{"firefox": [{"query": {"title": "Firefox - Choose User Profile"}, "action": 0}], "org.gnome.Nautilus": [{"action":0}]}'

show all saved firefox windows (N.B. jq will fail if window title contains \):

$ dconf read /org/gnome/shell/extensions/smart-auto-move/saved-windows | sed "s/^'//; s/'$//" | jq -C .firefox | less -SR

there are example configs in the examples/ dir which can be loaded (N.B. while extension is disabled) with:

$ dconf load /org/gnome/shell/extensions/smart-auto-move/ < ./examples/default-restore.dconf

you can backup your config (restore is the same as above):

$ dconf dump /org/gnome/shell/extensions/smart-auto-move/ > smart-auto-move.dconf

the gsettings tool can also be used to manipulate these values:

$ gsettings --schemadir ./[email protected]/schemas/ set org.gnome.shell.extensions.smart-auto-move sync-mode 'RESTORE'

development

NOTE: this process has only been tested with GNOME running on wayland.

clone this repository and run make start.

this will do the following:

  • build the extension pack .zip
  • install the extension pack
  • launch a nested wayland Gnome-Shell session

after the nested instance is running, you will need to enable the extension:

$ gnome-extensions enable [email protected]

if you make a change to the source code, you will need to exit the session and start a new one.

manual tests

calculator

  • open calculator
  • move calculator position
  • resize calculator
  • close calculator
  • open calculator
  • quickly close calculator
  • open calculator

files

  • open Places => Home
  • open a second Places => Home
  • tile first window to the left
  • move second Home window
  • close first Home window
  • change second Home window to Downloads
  • close Downloads window
  • open Places -> Downloads
  • open Places -> Home
  • move Downloads to workspace 2
  • tile Downloads to the right

firefox

  • launch firefox
  • navigate to Wikipedia.org
  • open second window
  • navigate to Mozilla.org
  • move first window to workspace 2
  • tile first window to left
  • tile second window to right
  • firefox Menu -> Quit
  • launch firefox
  • open new tab in Mozilla window
  • navigate to Google.com
  • firefox Menu -> Quit
  • launch firefox
Comments
  • add ability to include or exclude specific apps

    add ability to include or exclude specific apps

    For example, i am using extension https://extensions.gnome.org/extension/3780/ddterm/.

    And smart-auto-move always move it to the first workspace, but I need it in the current.

    This is super extension, but black list would make it superior.

    enhancement 
    opened by GDXbsv 6
  • [BUG] unable to open settings

    [BUG] unable to open settings

    Hey, first things first, thanks for such a great extension! Although the extension is working I'm unable to open the settings, this is what I get.

    Do you know what should I do to overcome this situation?

    P.S: I'm running it on Linux:

    NAME="Ubuntu"
    VERSION="20.04.4 LTS (Focal Fossa)"
    

    The settings of extension [email protected] had an error:

    Gtk.BuilderError: /home/gabriel-tosta/.local/share/gnome-shell/extensions/[email protected]/ui/prefs-gtk4.ui:22:33 Invalid property: GtkNotebook.focusable
    

    Stack trace:

    buildPrefsWidget@/home/gabriel-tosta/.local/share/gnome-shell/extensions/[email protected]/prefs.js:41:13
    _init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:207:40
    OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
    asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13
    run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20
    main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
    run@resource:///org/gnome/gjs/modules/script/package.js:222:19
    start@resource:///org/gnome/gjs/modules/script/package.js:206:5
    @/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
    

    Thanks! =)

    duplicate 
    opened by Gtosta96 4
  • '!window->override_redirect' failed spam

    '!window->override_redirect' failed spam

    After enabling the extension, my log is spammed with the following message :

    meta_window_move_resize_frame: assertion '!window->override_redirect' failed and meta_window_change_workspace: assertion '!window->override_redirect' failed I'm on Archlinux, GNOME 41.2.

    bug question 
    opened by terencode 4
  • Using this to restore a session after reboot?

    Using this to restore a session after reboot?

    This is an awesome extension, in it's current state it is already rather useful. Thanks for working on this :)

    For my use case, I find it would be helpful if the applications that were previously opened to be reopened after reboot.

    Since the window positions are already remembered, in theory the missing piece is to 1) record all open windows before logging out and 2) somehow autostarting all the previously open apps at login. A hack to copy desktop files to ~/.config/autostart maybe?

    I realize this is difficult because you can't distinguish windows from the application...

    enhancement wontfix 
    opened by vchernin 4
  • tag and publish releases on github

    tag and publish releases on github

    Hey, thank you for your amazing extension.

    I'd like to propose to tag releases and publish them here on GitHub, so users can easily get notified and see what is the latest version.

    Thanks :)

    meta 
    opened by saibotk 3
  • implement basic extension preferences GUI

    implement basic extension preferences GUI

    key preferences to support:

    • [x] simple toggle for debug logging
    • [x] ability to "forget" a saved window
    • [x] switch sync mode between IGNORE and RESTORE
    enhancement 
    opened by khimaros 3
  • add a preference to freeze

    add a preference to freeze "writes" and only restore

    after you've created the ideal setup, it might be nice to not have to worry about things being saved anymore.

    this can help to workaround issues related to resolution changes (eg. when plugging/unplugging an external monitor).

    enhancement 
    opened by khimaros 1
  • firefox tooltips are stored as saved windows

    firefox tooltips are stored as saved windows

    when firefox displays a tooltip, it creates a new meta window actor.

    smart-auto-move then considers these windows which it should track.

    most of these have a height between 46 and 63 pixels. a naive solution would be to filter those.

    however, there is probably other window metadata we could rely on.

    bug 
    opened by khimaros 1
  • option to not restore workspace

    option to not restore workspace

    I am using your extension because I have a multi monitor setup and this keeps things on the right monitor. however it is also insanely annoying when it restores apps to different workspaces. I feel an option to restore to a location regardless of workspace would be great. In fact it would make this extension perfect. so to make it clear what I am asking... .. an option that switches from the current operation to only restoring position without concern for workspace. .. this mean with that option on the window is not put on a particular workspace but instead just on the current workspace but in the position it would have been on the original workspace.

    duplicate enhancement 
    opened by APTISteve 1
  • Add a possibility to resize name column width in

    Add a possibility to resize name column width in "Saved windows" window

    Preferences content doesn't resize to the the window and in my case looks like this: image

    With many apps I'm not able to recognize the app, eg. "Org.gno..." - there are 4 instances, 4 apps and no idea which is which. Another example - I use lot of PWA apps based on chrome. Now, all of those are "Google-c...".

    Maybe it's related to #19 ?

    opened by ekasprzak 0
  • Automatically activate the new window's workspace

    Automatically activate the new window's workspace

    I found this old issue https://github.com/khimaros/smart-auto-move/issues/20, which was closed as completed but there doesn't seem to be any such option and I couldn't find any code for workspace activation in the current codebase.

    I imagine this feature would have the same usability issues I discovered while looking into such feature for auto-move-windows. I have already proposed the solution I'm currently using in their issue tracker (which you can read on the last comment in the original issue). I still haven't heard back from the auto-move-windows devs and I'd really rather work on an existing extension rather than creating my own. If the feature interests you in any capacity I'd gladly put in the work to have the feature in smart-auto-move.

    opened by rockerbacon 0
  • Listen for signals instead of polling

    Listen for signals instead of polling

    I took a quick look at the code and it seems that the extension frequently polls the windows and applies the updates. I was curious if there was any specific reason for doing it like that instead of listening for the app's windows-changed signal, for example.

    One difference I can notice between this extension and auto-move-windows - which does use the aforementioned signal - is that that extension moves windows very quickly, before they're visible. With smart-auto-move, the windows sometimes flicker on the currently active workspace before being moved to their proper location. I haven't modified the code to confirm whether the polling is the cause but I strongly suspect that it is.

    opened by rockerbacon 0
  • How to Set

    How to Set "IGNORE" for All Thunderbird Compose Windows

    There doesn't seem to be a way, or I am completely missing it, to set Smart Auto Move to always ignore the Thunderbird compose window and allow it to remain at the default location; that is, for some reason the compose window snaps to the right side of my screen, becomes unmovable unless I maximize it, and turning off the extension completely allows it to behave normally. In "Overrides," there's no way to add anything like "Thunderbird Write" and there is a different listing for each compose window I've ever used in the "Saved Windows" tab.

    I appreciate any help.

    Fedora 36 with GNOME Shell 42.5, Wayland, and Kernel 5.19.16-200.fc36.x86_64.

    opened by moore-bryan 4
  • Brave browser windows as PWA aren't restored

    Brave browser windows as PWA aren't restored

    There seems to be some issue with PWA created by Brave browser, see here for an explanation how to create them.

    Those PWA windows only appear in "saved windows", if they aren't maximized, but sometimes you even have to restart Gnome (by alt+f2 and then "r") in order to be seen by your add-on. After adding the chosen PWA windows to "overrides" with "restore" enabled (default sync mode is "ignored"), they aren't restored, like all the other windows from different apps are, so my conclusion is that it has something to do with the Brave browser and the way it creates those PWAs.

    Is this a known bug or limitation?

    Happens on Ubuntu 22.04 with Gnome 42.2 on X11 (can't use Wayland, because of technical issues).

    question unconfirmed 
    opened by sojusnik 2
Releases(v17)
  • v17(Nov 1, 2022)

  • v16(Jun 12, 2022)

  • v15(Mar 5, 2022)

  • v14(Feb 26, 2022)

  • v13(Feb 20, 2022)

  • v12(Feb 20, 2022)

    preferences fixes

    - default to global match threshold when adding override
    - fix creating individual window overrides
    

    Full Changelog: https://github.com/khimaros/smart-auto-move/compare/v11...v12

    Source code(tar.gz)
    Source code(zip)
  • v11(Feb 19, 2022)

    ux improvements and code cleanup

    • simplify override flow when default IGNORE
    • remove confusing toggle button
    • save windows even when ignored, just don't restore

    Full Changelog: https://github.com/khimaros/smart-auto-move/compare/v10...v11

    Source code(tar.gz)
    Source code(zip)
  • v10(Jan 19, 2022)

    preferences ui improvements:
    
    - add switch to show "occupied" state in saved window list
    - allow switching to "DEFAULT" action for overrides
    - add threshold override spin button for apps
    - add an "IGNORE (ANY)" button to ignore entire window class
    

    Full Changelog: https://github.com/khimaros/smart-auto-move/compare/v9...v10

    Source code(tar.gz)
    Source code(zip)
  • v9(Jan 18, 2022)

    testing and stability improvements
    
    - fix prefs crash on empty query
    - refactor modules to make testing easier
    - add unit tests for window/override matching
    - allow threshold overrides per-app (dconf only)
    

    Full Changelog: https://github.com/khimaros/smart-auto-move/compare/v8...v9

    Source code(tar.gz)
    Source code(zip)
  • v8(Jan 17, 2022)

    What's Changed

    • add preferences gui by @khimaros in https://github.com/khimaros/smart-auto-move/pull/6

    Full Changelog: https://github.com/khimaros/smart-auto-move/commits/v8

    Source code(tar.gz)
    Source code(zip)
Owner
khimaros
a mythical beast with heads aplenty
khimaros
Movehat is a TypeScript SDK for Move on Sui built on top of Sui's TypeScript SDK and our fork of Ian Macalinao's `move-ts`.

Movehat Movehat is a TypeScript SDK for Move on Sui built on top of Sui's TypeScript SDK and our fork of Ian Macalinao's move-ts. Movehat aspires to b

Pentagon 10 Sep 30, 2022
Open apps directly in GNOME Software by clicking Install from Flathub and apps.gnome.

Flatline Open apps directly in GNOME Software by clicking Install from Flathub and apps.gnome. Load the extension in Firefox Clone the repository Open

Cleo Menezes Jr. 43 Nov 7, 2022
A simple to do list webpage where you can log the daily tasks you have to do, mark them as checked, modify them, reorder them and remove them. Made using HTML, CSS and JavaScript.

To-Do-List This Webpage is for an app called To-Do-List which helps you add, remove or check tasks you have to do. It is a simple web page which conta

Zeeshan Haider 9 Mar 12, 2022
A remote nodejs Cache Server, for you to have your perfect MAP Cache Saved and useable remotely. Easy Server and Client Creations, fast, stores the Cache before stopping and restores it again!

remote-map-cache A remote nodejs Cache Server, for you to have your perfect MAP Cache Saved and useable remotely. Easy Server and Client Creations, fa

Tomato6966 8 Oct 31, 2022
This is an unofficial front end for Hacker News, reminiscent of the Windows XP era Outlook email client on a Windows XP default desktop

Hacker XP Hacker News styled as the Windows XP Outlook email client. Try out Hacker XP here! Description This is an unofficial front end for Hacker Ne

null 19 Jul 12, 2022
Click in your components and open VSCode in the correct file and line number.

Inspect in VSCode This is a simple extension for deno/fresh projects that allows you to inspect your components' source code in VSCode. This repositor

deco 23 Nov 30, 2022
This is a Webpack based to-do-list project. With this app, users can add thier daily routine tasks to the list, mark them as complet, edit them or delete them.

To Do List This is a Webpack based to-do-list project. With this app, users can add thier daily routine tasks to the list, mark them as complet, edit

Ali Aqa Atayee 12 Oct 30, 2022
OnePiece /r/place repo to store the template and script for outlining the place to put titles

onepiece-place OnePiece /r/place repo to store the template and script for outlining the place to put titles This script & repo are cloned from Antice

Lopeh 11 Apr 9, 2022
Reddit Place Tracer is a browser based userscript for the 2022 Reddit /r/Place project

Reddit Place Tracer is a browser based userscript for the 2022 Reddit /r/Place project which adds a transparent image on top of the canvas to aid communities with drawing the same image. It shows how the canvas should look, where each pixel goes, and what color. The user must manually click on these spots. It is not an automated bot and does not break any rules.

null 3 Apr 3, 2022
The /r/place Atlas is a project aiming to catalog all the artworks created during Reddit's 2022 /r/place event.

The 2022 Place Atlas The /r/place Atlas is a project aiming to catalog all the artworks created during Reddit's 2022 /r/place event. This project was

Place Atlas 397 Dec 28, 2022
It shows an effective way to correct bus arrival information using data analytics based on Amazon Serverless such as Kiness Data Stream, Kinesis Data Firehose, S3, and Lambda.

Amazon Serverless를 이용한 실시간 버스 정보 수집 및 저장 본 github repository는 버스 정보를 주기적으로 수집하여 분석할 수 있도록, Amazon Serverless인 Amazon Kinesis Data Stream, Kinesis Data

John Park 4 Nov 13, 2022
For some realizations of the title and thinking of the book Introduction to Algorithms, if there is something wrong, please correct me.

Introduction-to-Algorithms Introduce Origin of this library Some implementations of the topics in Introduction to Algorithms and some reflections on t

biao 2 Jun 9, 2022
In this project, I built a to-do list app, which is inspired by the minimalist website. Build withHTML/CSS & JavaScript best practices: Correct use of tags, elements, properties and syntax.

Webpack Exercise In this project, I built a to-do list app, which is inspired by the minimalist website. Built With HTML/CSS & JavaScript best practic

Vanessa Oliveros 3 Oct 11, 2022
🚨 Make the case correct, PLEASE!

?? CasePolice GitHub, not Github TypeScript, not Typescript macOS, not MacOS VS Code, not Vscode ... Make the case correct, PLEASE! Usage Make sure yo

Anthony Fu 944 Dec 26, 2022
Library to download binary files from GitHub releases detecting the correct platform.

Dbin TypeScript library to download binary files from GitHub releases detecting the correct platform. Example: import dbin from "https://deno.land/x/d

Óscar Otero 7 Oct 4, 2022
A to-do-list project is about keeping the track of all the daily task. This application can add move or delete task.

TO-DO LIST This is a project that create a simple todo tool that help you organize your day. This is build using ES6 and webpack. Built With HTML CSS

suzana marsela 8 Oct 26, 2022
JellyChain1 is a blockchain network platform that supports smart contracts and can act as a payment system/cryptocurrency

JellyChain1 is an experimental blockchain network, that will serve as a starter blockchain test network and scale out database software and other applications. JellyChain1 is created to cut energy costs when mining transactions on the blockchain.

JellyChain 10 Dec 1, 2022