Giter VIP home page Giter VIP logo

dockwin's Introduction

Abandoned

I've since switched to primarely use linux, thus I can't maintain this script anymore.

Please feel free to fork this repository and continue on.

DockWin

Autohotkey(https://autohotkey.com/) Script to save and restore positions of windows.

Used to replace windows after switching monitor arrangement, un/docking a notebook etc.

Hotkeys

  • [Win]+0 = Restore window positions from ./WinPos.txt
  • [Win]+[Shift]+0 = Save window positions to ./WinPos.txt

Menu

DockWin sits quietly in the tool tray and can be right clicked to edit WinPos.txt or initiate a capture or restore.

WinPos.txt

SECTION: Monitors=2,MonitorPrimary=1; Desktop size:0,0,4480,1440
Title="Sublime Text",x=-8,y=-8,width=2576,height=1416,maximized=1,path=""
Title="sshsession@server:Default",x=3520,y=18,width=960,height=1062,maximized=0,path=""

Saved

Original Source

https://autohotkey.com/board/topic/112113-dockwin-storerecall-window-positions/page-3

dockwin's People

Contributors

rwese 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dockwin's Issues

Apps open upon saving

Hi! Very nice script! Thank you!

When saving window positions on Windows 10, the following apps open by themselves:

  • Calculator
  • Settings
  • Microsoft Store

And this is what gets written into the WinPos.txt:
Title="Calculator",x=,y=,width=,height=,maximized=0,path="" Title="Calculator",x=1228,y=178,width=352,height=517,maximized=0,path="" Title="Backup and Sync",x=0,y=0,width=0,height=0,maximized=0,path="" Title="Microsoft Text Input Application",x=1920,y=0,width=1920,height=1200,maximized=0,path="" Title="Settings",x=,y=,width=,height=,maximized=0,path="" Title="Settings",x=-8,y=-8,width=1936,height=1184,maximized=0,path="" Title="Microsoft Store",x=,y=,width=,height=,maximized=0,path="" Title="Microsoft Store",x=-8,y=-8,width=1936,height=1184,maximized=1,path=""

Programs with variable names

Hi,

tools like Discord and foobar2000 have dynamic window titles and your tool doesn't recognizes them.

An idea would be to check, if the window is not found, for all words alone, if they are in window titles. But that could create other issues...

Multiple sections and restoring them by an assignable hotkey

I've never worked with AHK before but is something like this possible?

Things work normally as is, but a new property is introduced to the WinPos.txt file where you can assign a hotkey to a specific section which defaults to [Win] + 0.

Something like this (I know the key binding is not the correct syntax):

SECTION: Monitors=1,MonitorPrimary=1; Desktop size:0,0,2560,1440; Key:[Win]+[Shift]+1

Then, when you press that key combo it would launch that section's window layout.

Use case:

When you want to have 4 or 5 different layouts for different things and you want to jump between using them without having to manually copy / paste things around in the WinPos.txt file.

Workaround for now:

From what I gathered, the only way to do this now would be to:

  1. Duplicate the current AHK script.

  2. Assign a different key combo for the duplicate script (1 instead of 0 for example for save / restore).

  3. Change WinPos.txt to be uniquely named (append a _1 or something to it).

  4. Do business as usual and pick the layout you want on demand.

That's kind of a lot of duplication!

Minimized windows not recorded

In short, this script isn't capturing/recording when windows are minimized, but not having much experience with AHK, I don't know how to fix it.

When I "capture screens" on my Win7x64 system with AHK 1.1.23.05, the windows all cycle through (which, I guess, I would expect), but all the minimized windows open and don't re-minimize (although the ashleydawson post claims it does).

When I look at the WinPos.txt file, there are no maximized=-1 items. As I would expect, when I "restore screens", all the windows open including those that had been minimized during the capture.

If I manually edit the WinPos.txt file to set some maximized=-1 items (from maximized=0 that they are all set to), the restore does end with them minimized. (They do open, but then minimize.)

Last window in WinPos.txt becomes active

When I "Restore Screens", the windows cycle through opening and resizing and (if they are minimized) returning to minimal status. However, the last window in the WinPos.txt always becomes active (not the previously active window). That's not a big deal except the last one in my list happened to be minimized, so it opens, resizes, minimizes and then re-opens. If I move it to another location in the list, it stays minimized.

The code looks good to me (being inexperienced with AHK), but something is not working as intended.

SectionHeader not reliable on Win10 (Program Manager)

First, I'm new to GetHub, so I don't fully understand the process, but I wanted to help out, and I am happy to learn.

Second, thanks for the code, it saved me hours.

Third, it didn't work on my Win10 with 3 monitors. But I made the following modification and it now works. I am not sure how to get this modification into the main code (see point 1), so I am posting it here under "Issues"

DK


Original code:
WinGetPos, x, y, Width, Height, Program Manager
line:= line . "; Desktop size:" . x . "," . y . "," . width . "," . height

Revised code:
WinGetPos, x, y, Width, Height, Program Manager
line:= line . "; Desktop size:" . width . "," . height

need standalone restore routine

Hi guys!
I'm a autohotkey newbie. I tried some hours to separate the Restore subroutine in a standalone routine for starting automatically after Windows logon. But I havent luck with my work.
Plz help me

ptube

Feature request: machine "installable"

I like this project. Thanks for bringing it out of the AHK forums to a more public space.

I'd like to make this available as a Chocolatey package. The only sticking point is that packages are supposed to be "machine installs", and, currently, the WinPos.txt location is always the same as the AHK script. The recommended location for non-installed Chocolatey packages in in the Chocolatey\lib\<packagename> subfolder of %ProgramData%, but that is not writable by non-admins. The bigger problem is that there is only one WinPos.txt for the entire system regardless of the location.

I'd like to get this script using the per-user %AppData% location for the capture. It should probably check the script location first to allow for portable users and backward compatibility, but if there is no WinPos.txt in the script directory and/or the user doesn't have modify rights to it (un-elevated), then it should use something like %AppData%\DockWin\WinPos.txt.

If I ever get time to grok AHK, I'm happy to submit a PR, but I thought I'd throw this out there for anyone with more time/skill to poke at.

(Addendum: A major upgrade would be to allow multiple "sets" of Windows for each user.)

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.