Code Monkey home page Code Monkey logo

switcher's Introduction

Switcher

Switcher is a Gnome Shell extension for quickly switching windows by typing.

An animation of how the extension works

Installation

Download from https://extensions.gnome.org/extension/973/switcher/ or checkout to the correct place as

mkdir -p ~/.local/share/gnome-shell/extensions # only needed if this is the first extension you install
cd ~/.local/share/gnome-shell/extensions
git clone https://github.com/daniellandau/switcher.git [email protected]

Log out and back in of GNOME Shell, and you can then enable the extension with Gnome Tweaks.

How to use

Use the configured hot key (Super+wby default) to open the switcher and start typing a part of the name or current title of the window you want. Hit the Esc key to cancel and the Return key to activate the window at the top of the list.

Contributing

Contributions are welcome and I will try my best to answer quickly to all suggestions. If you start working on something mentioned in TODO.md, let me know so I don't scoop you.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Aknowledgements

As there is no really good central place to find documentation on writing Gnome Shell Extensions I'll list here where I got information from.

The icon is based on the "Restore Window" icon by Lloyd Humphreys from the Noun Project, used under a CC-BY version 3.0 license.

I thank my employer Futurice for providing monetary sponsorship for this work through the Spice Program

switcher's People

Contributors

bluemancz avatar braedon avatar daniellandau avatar emmanueltouzery avatar flimm avatar goodwillcoding avatar ilazaridis avatar jonnius avatar landas avatar leducvin avatar markonius avatar mgalgs avatar nevesnunes avatar peetcamron avatar unixfox avatar wbolster-eiq avatar wilcus 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

switcher's Issues

optionaly use super as shortcut

triggering "switcher" with "super" would be cool. This would imply to have vanilla "activities overview" with something else , eg "super+a".

seems there is a mutter setting : /apps/mutter/general/overlay_key

i guess switcher extension could help the user going this way
Also one advantage is that the day you deactivate switcher (eg it is temporarily broken =) , super comes back to standard.

search english names as well

it would be nice if the application search also used the original (untranslated) application name. the overview search bar seems to do this already. additionally, also use the Exec=... value. all of these are in the .desktop files.

Switcher not working on Gnome 3.30

Hi, switcher not working on gnome 3.30 but app launcher is working and I'm using Arch Linux. Thanks

I think need to change this part on switcher.js:

let currentWorkspace = global.screen.get_active_workspace_index();

to

let workspaceManager = global.workspace_manager;
let currentWorkspace = workspaceManager.get_active_workspace();

Weighted scoring of the search results?

Would you consider adding some sort of weighted heuristic for sorting the search results?

For example, when I launch an application from my terminal, the terminal title gets updated to contain the application name, so it shows up in my filtered results when I search for the application. I'd really like the application itself to rank higher than the terminal it was launched from. An easy way to get that would be to rank results higher if the match was at the beginning of the candidate string.

Can't bind Switcher to Super + Tab (or Alt + Tab)

I would like to bind the Switcher to Super+Tab but am unable to. I've also noticed I cannot bind it to Alt+Tab either.

I've tried unbinding these in the Gnome settings keyboard shortcuts and am still unable to bind them to the Switcher.

Feature Request: Fixed position ordering criteria

Is it possible to have position of windows fixed within the switcher. Currently both ordering criteria ("Most relevant" and "last focused") move the window position up the switcher as you select them. This is less efficient for me since I tend to remember the position of windows mentally. A new option "Fixed" can be added in ordering criteria which will not alter window positions at all. Any new opened window can be added to the bottom of the switcher list. Thanks.

Disabling "Tipp of the day" notification

After each reboot, a notification, which shows a hint about the extension's usage, is shown. I don't want this notification to be shown again. But even if I click the notification's "do not show again" button, another hint is shown after the next reboot. I've not found an option to permanently disable the notifications in the extension's settings either. I would really appreciate such an option to be available. Thank you!

Switcher doesn't disappear when clicking on secondary screen

From issue #2. I have two screens horizontally placed, and the order is: Main, Secondary. They're exactly the same, resolution 1920x1200. I'm using Gnome 3.14 on Debian Jessie.

The switcher opens in the main screen, then if I click anywhere on the secondary screen nothing happens. Secondary screen seems frozen and main screen stays with the switcher on.

toggle when global shortcut is pressed twice

currently, ctrl-tab and ctrl-space switch between apps/window selection.

it would be great if pressing the global shortcut twice would toggle between the two as well. right now this doesn't do anything.

Tips notifications spam

Heyo! Thanks for writing this plugin. I'm just moving over from MacOS to Gnome 3 and was missing Alfred a bit; switcher is a pretty good stopgap!

I'm getting a bit of notification spam from switcher tips. I don't know how to turn these off (I did not see a setting to disable tips) and instead I have to disable each one as it shows up. Also, each one shows up in my notifications list in triplicate.

As I'm already working full time on Gnome 3 and have calendar events and such, these extra notifications are quite noisy. Can these be turned off somehow?

screenshot from 2017-02-14 12-53-25
screenshot from 2017-02-14 16-23-24

I am using switcher installed from https://extensions.gnome.org/extension/973/switcher/ on Ubuntu GNOME 16.04.2

Thanks!

Additional theme

Just created additional theme for Manjaro Gnome Ediotion.
You can find it here.
Sorry if i posted it non GitHub way - i'm more graphic designer than developer.
I can provide Polish translation too.
Feel free to catch me on [email protected]

Input box is completely transparent

I'm running this extension in Debian Jessie, Gnome 3.14, and I don't see the input box background black, it's totally transparent and I just can barely see what I'm typing.

I like the extension, I hate the way Alt-Tab works but haven't found a good alternative until maybe now. Congratulations.

Add option to only switch windows on active workspace

I tend to have a large list of windows open and generally I work between windows on a single workspace at a time as I'm jumping between code and terminals on one workspace and browsers on another. It's really frustrating when I accidentally select a browser while I'm on my workspace with my code and it switches to a different workspace. It would be nice to have an option to only show and switch between windows on the active workspace.

Script launching feature

Hello. Your extension looks great!
I was searching for something like rofi but with wayland support and came across your extension. Unfortunatelly, it only support app launching as for now. Could you also add script launching feature? Simply find and suggest scripts from certain directories, much as rofi does.
Thanks!

fade in/out

my eyes would be very happy if the popup quickly fades in and out instead of suddenly obscuring a big part of my screen.

ace jump like behaviour

this extension is incredibly useful, & you might maybe optimize a bit : once super+w is hit, "switcher" could automatically assign for each window one letter : first window a, second window b, third window c.

User just hit the relevant letter, so unless one has more than 26 windows it's always a one letter hit to open the right window.

This is an enhancement request. Please state it it if not interested, thanks !!

Open Switcher on active monitor instead of always the primary one

I work with two identical monitors. The left is the primary one (where I have different workspaces) and the right is the secondary one.

Right now, when I invoke Switcher the popup is always on the primary monitor. It would be much better for me if it popped up on the monitor containing the currently focused window because that's where I am looking at.

Other than that, Switcher is really, really nice. Keep up the good work!

Do not fallback to application launcher

I recently upgraded the extension to version 14. I noticed that once it fails to find matching window, it switches to application launcher. Can this behavior is disabled?

even faster switching with hotkey

if the sorting of applications doesn't change within one session (if I understand bug #5 properly, the apps are sorted by the time they were opened so for sure the sorting wouldn't change in a session), what could be done is the following: when you display the list of apps, you could add a number of each app, for instance in a new column on the right.
Currently the columns are the icon then the window title. So we would add a new column, with a number.
Now we probably want to allow the users to type in digits to filter windows, so maybe then we use the F keys.. So let's say you want to switch with the app with number "6". You would just press "F6" and it would do the switching. Something like that.
And if the sorting is stable, you can remember for this session, this window is win-w f6. That one is win-w f4. That would be much faster than typing in the window title until the filtering is reduced to one window.
I'm wondering if you'd be considering implementing it or worst-case (for me ;-) ) accepting a PR to that effect?

No screen blackout

Most/all similar extensions (see the Howdoi extension) blackout all screens when showing the main dialog. I'm working with two monitors and when the window selector is shown, it's not obvious that the screens are locked. It would be a big visual improvement that all screens were obscured when the dialog is shown.

absolutely massive on 4k screen (and no close)

Most applications on 4k screens are way to small; This however takes up 1/5 the screen (and with no easy Super + w again) to close is very intrusive (although otherwise a great feature)

Double modifier activation

Saw this point on the TODO but didn't quite get the combinations you want. However, the solution should be this:

On addShortcut() you have the variable "mods", which is enum GdkModifierType. So to detect the combos you can try making bitwise conditions with GDK_CONTROL_MASK, GDK_SHIFT_MASK, etc..

use key-press-event instead of key-release-event

it would be better to use key-press-event instead of key-release-event.

by doing so, keys repeat while holding them down. this means it becomes to possible to hold down ctrl-n or ctrl-p (or arrow keys) to navigate the list.

also, the whole interaction becomes much snappier. with key-release-event there's a clearly perceptible delay that just does not feel right. it's hard to explain, try it! :)

note that there is one feature that somehow stops working when switching to key-press-event: numeric shortcut keys no longer result in selection; instead the numbers appear in the text entry.

Support clicking on a window list item

Directly clicking on a window in the list appears to just close the list. It should switch to the clicked window instead. This is both the intuitively expected behavior and more efficient than keyboard navigation eg. after narrowing down a long list of windows with a search.

This problem aside, the extension is awesome. Thanks.

Undocumented shortcuts

There are very useful shortcuts available in the extensions but they are not documented.

  • C-j for enter,
  • C-m for switching between mode
  • C-h for backspace
  • C-p and C-n for up and down

These shortcuts are very useful and should be mentioned in the doc.

If we agree I would also like to create a PR to map C-j and C-k to up and down, and C-g to enter.

Launch applications doesn't use any Ordering Criteria

Currently neither option in Ordering Criteria change the first 10 results.

Would be great if the initial list consisted of the last opened applications.

edit: i couldn't find anything recent that used a list of recent apps. But i did find an alternative: show the list of favorite apps when the launcher opens

const AppFavorites = imports.ui.appFavorites;
[...]
AppFavorites.getAppFavorites().getFavorites()...

would this be feasible to implement?

'amp;' in app title after ampersand

Happens with the Ubuntu app 'Software & Updates', I'm sure this affects any app that has '&' in the title.
screenshot from 2017-11-28 19-41-31

I was able to fix by removing the occurrences of .replace(/&/g, '&'); in util.js, modes/launcher.js and modes/switcher.js.

screenshot from 2017-11-28 19-49-20

Closing window from the list

Could be nice if it would be possible to close a window.
Something like clicking delete key to close.

Amazing extension. thanks

Chinese input method support

When type with Chinese input method(ibus-rime-1.3.0), press Enter just go to the first window directly. But I want letters should be shown in Switcher.

A workaround: press Shift or switch to English input method before typing any character.

Switcher Quick View

Is it possible that the switcher will have a "quick peak" option?
By that I mean that when you scroll the open apps list in the switcher, the selected app will be shown in the background.
If I press "Return" the app is going to the foreground, and if not i will be returned to my currently open app

This idea came to me because I use Sublime Text, and there is a great features in the editor, where you can peak a file by pressing Ctrl+P and iterating though the list.

I imagine this is very hard and maybe impossible to accomplish on a desktop environment, yet it could be a very cool and productive for work environments - where you sometimes iterate through a lot of open programs

Thank you in advance

Browser Tab support

First of all this is a great extension.

Would it be possible to expand the search to opened tabs in browsers such as Chromium and Firefox?
The background is, if you have multiple windows with lots of tabs each, it would be great to just type the tab title and the corresponding window would be focused and the tab selected.

I think it will need a browser extension, so WebExtensions should be a good starting point to search and implement a little helper to get all opened tabs and select them programmatically.

Styling suggestions

This is a suggestion for enhancement.

While the text in the input box is pretty small, the window titles are really big on my screen. I think I'd like it better if the title texts a little smaller. They would fit better too, some titles are long and I like having the title shown there.

Also, I normally use the icons to quickly identify the window I want to switch to, and just in case there's more than one I will look for the title. I'd like that the icons were a bit bigger and grouping the windows by app would make it easier for me to visually find what I want.

Best regards.

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.