PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Command Line Accessible PowerToys Settings

Open SirWobbyTheFirst opened this issue 5 years ago • 25 comments

Summary of the new feature/enhancement

Currently, PowerToys Settings can only be accessed by right-clicking the icon in the notification tray and choosing Settings. This creates a context switch for users who predominantly use the keyboard as they are required to reach for the mouse. I'd like to see a command-line option to access the PowerToys settings to accommodate these types of users. It also opens the option of using PowerToys without the need to have File Explorer running.

Proposed technical implementation details (optional)

The primary option of fulfilling this request would be to make a simple executable available that invokes the PowerToys Settings applet but an alternative option may be to reuse the relaunch functionality of PowerToys to display the settings applet instead of currently displaying an error that an existing instance is already running.

SirWobbyTheFirst avatar Jul 01 '20 12:07 SirWobbyTheFirst

what settings are you in constant need to toggle?

crutkas avatar Jul 02 '20 16:07 crutkas

Well I personally make heavy use of Fancy Zones so being able to toggle the different settings is useful, I'm sure others may make heavy use of the Keyboard Manager tweak or Shortcut Manager tweak. But this is a "nice to have" feature request, it would be nice to see it implemented because there are still people who use alternative shells in Windows, some of these may not have access to the notification area.

Me personally, I spend a lot of time with PowerShell open and choose to use that instead of Explorer as my main shell. Again it's a nice to have and adds more use to the relaunch functionality than just an error message.

SirWobbyTheFirst avatar Jul 02 '20 17:07 SirWobbyTheFirst

what settings are you constantly toggling however. To me, that is the interesting questions.

For KBM, i'm hearing profiles For FancyZones, maybe quick toggle layouts? (hot swapping layouts is #1035)

crutkas avatar Jul 02 '20 18:07 crutkas

Well, why not both? Hot swapping layouts as well as a way to launch the Settings app from the command-line?

SirWobbyTheFirst avatar Jul 03 '20 12:07 SirWobbyTheFirst

fyi, you can just click on the icon in systray as well :)

crutkas avatar Jul 28 '20 23:07 crutkas

fyi, you can just click on the icon in systray as well :)

Is there a way to activate the icon from PowerShell?

SirWobbyTheFirst avatar Jul 29 '20 14:07 SirWobbyTheFirst

no

crutkas avatar Jul 31 '20 04:07 crutkas

if you feel this is a must have feature, we're open source, lets chat about implementation but as of now, it is not something we're planning to implement

crutkas avatar Jul 31 '20 04:07 crutkas

there are some games/apps i can't change keys, so i activate powertoys keyboard manager before opening and leave powertoys window open (to not forget to disble later) then after closing the software i go there and disable.

would be nice to have some command line options so i could create a task to toggle when game starts and ends (or at least create a shortcut and keyboard keys to toggle).

andre-mr avatar Jul 24 '21 02:07 andre-mr

Would love some way of setting FancyZone profile 'programmaticly'. Either through some api, some cli or whatever. This would make it possible to make a stream deck plugin to quick switch between named profiles and have the windows reorganize. Nice for streaming where you might want to quickly switch between window layouts.

vegar avatar Oct 19 '21 19:10 vegar

as they are required to reach for the mouse

Win+B sets focus to the tray so you can navigate it with the keyboard

sredna avatar Oct 19 '21 23:10 sredna

@vegar already possible with a quick keystroke. https://docs.microsoft.com/en-us/windows/powertoys/fancyzones#quickly-changing-between-layouts

crutkas avatar Oct 20 '21 00:10 crutkas

yea. Found another issue summing up dozen of similar request, including reference to the release note enabling the shorcut. That's good.
Still - I would prefer a more 'explicit' way. Being able to use the command line to tell what named profile to use open up a whole new box of automations. Like auto-setting a given layout when a specific application launches.

vegar avatar Oct 20 '21 07:10 vegar

basic commands like powertoys.exe --version would be nice, too

YSCohen avatar Jan 28 '22 00:01 YSCohen

Not to mention powertoys.exe --restore-settings "settings.json". Makes for building a new PC much smoother because I can leave it unattended.

TheBrenny avatar Jan 18 '23 03:01 TheBrenny

Looking for a way to do this myself, I noticed that there is a backup/restore settings option under general. This restores not only things like saved keybinds but states of whether or not a setting (like keyboard manager) was enabled at the time of the backup.

Would there be a straightforward way to invoke named backups from the commandline? Might try to look at it myself but I've never really delved into anything open source before :)

My specific use case is that I'm a predominantly Mac user, so I have my keybinds on my work computer (a windows machine) all set up to be familiar to the mac equivalents (swapped control/alt/windows around). However I work hybrid remote/in office, so about 2-3 times a week I need to enable/disable my remaps and other settings when I'm connecting remotely through Parsec.

mibryy avatar Mar 29 '23 20:03 mibryy

Would be nice for automated backup and restores

hubertnguyen avatar Jul 09 '23 02:07 hubertnguyen

Would also be nice to enable and disable awake without the command window popping up everytime

artistro08 avatar Aug 08 '23 00:08 artistro08

Not to mention powertoys.exe --restore-settings "settings.json". Makes for building a new PC much smoother because I can leave it unattended.

+1 for this

welpdx avatar Aug 09 '23 15:08 welpdx

there are some games/apps i can't change keys, so i activate powertoys keyboard manager before opening and leave powertoys window open (to not forget to disble later) then after closing the software i go there and disable.

would be nice to have some command line options so i could create a task to toggle when game starts and ends (or at least create a shortcut and keyboard keys to toggle).

here for the same reason. it would be cool to be able to easily toogle between profiles, or just being able to switch on/off keyboard mapping with a single command without having to open power toys settings every time

MarcoAntolini avatar Sep 20 '23 14:09 MarcoAntolini

I would like a way to reset mouse without borders when it goes wrong (which is regularly), unfortunately the 'reconnect' option doesn't fix the issues that disabling and re-enabling does.

I figured if there was a command line interface I could set up a shortcut to run a script to do the reset.

SharpRT avatar Oct 06 '23 09:10 SharpRT

I was hoping to write a script that would install and configure PowerToys with settings like which tools were enabled and their configurations. The lack of CLI options does make this inconvenient, and they're definitely something I think would make for a worthwhile addition!

AdreKiseque avatar Jan 12 '25 04:01 AdreKiseque

Not to mention powertoys.exe --restore-settings "settings.json". Makes for building a new PC much smoother because I can leave it unattended.

Yes please! Not to mention a powertoys.exe --backup-settings "backup.ptb" ... Right now we have to use the GUI to manually click the backup to save the backup.ptb file. Would be great to be able to just script it as part of a computer's backup process.

starfishpatkhoo avatar Feb 20 '25 02:02 starfishpatkhoo

I'm also interested in some CLI options for PowerToys. I'd like to write a script that toggles awake automatically based on the time of day so my screens don't stay on all night when I forget to turn it off.

jennifer-grodner avatar Mar 07 '25 16:03 jennifer-grodner

In trying to remap the Copilot+ key back to Ctrl on my new laptop, I found that it's quite nuanced. I came a cross a reddit thread that mentioned how to do so in PowerToys, but many people were bashing it because it involved several steps that were easy to get wrong.

At the same time, they mentioned AutoHotKey and provided strings that could simply be used to config in the correct way.

For PowerToys, I'd expect that the data is persisted to a config file in a human-readable format and that the CLI could be used to add/update the values in addition to manual editing of the config file (without needing to restart PowerToys or Windows).

For those who are interested, this is the aforementioned reddit thread: https://www.reddit.com/r/LenovoLegion/comments/1csqiiw/comment/mgmvkx4/?context=3

GaTechThomas avatar Mar 08 '25 16:03 GaTechThomas

what settings are you constantly toggling however. To me, that is the interesting questions.

For KBM, i'm hearing profiles

Because currently, profiles are not implemented (see #1881), I personally use multiple JSON files in C:\Users\USER\AppData\Local\Microsoft\PowerToys\Keyboard Manager. When I want to change my mappings, I have to manually rename one to default.json and disable/enable KBM to update to the latest config.

I would like to automate this through a small script but because PowerToys is not controllable from CLI, I still have to do the last step manually. Of course, having profiles implemented would be the best solution but again, as it is not here yet, this would be an alternative.

rose-bouchayer avatar Sep 25 '25 07:09 rose-bouchayer