nathanielsimard / overview-navigation

Make window navigation fast and easy using overview.
https://extensions.gnome.org/extension/1702/overview-navigation/
GNU General Public License v2.0
37 stars 7 forks source link

Labels using home row keys instead of alphabetical #13

Closed sendmmsg closed 5 years ago

sendmmsg commented 5 years ago

Hi,

I made a little patch using a lookup table to change the ordering of the labels of the windows. This way the keys are a bit quicker to find IMHO, and similar to how e.g. https://github.com/abo-abo/avy jumps around, perhaps something to consider for future releases.

In windowSelector.js:

this.maptbl = {
  "0": 0, "1": 18, "2": 3, "3": 5, "4": 6, "5": 16,
  "6": 22, "7": 4, "8": 17, "9": 19, "10": 25, "11": 23,
  "12": 2, "13": 21, "14": 1, "15": 24,
  "16": 7, "17": 13,  "18": 20, "19": 9,
  "20": 12, "21": 8, "22": 10, "23": 11,
  "24": 14, "25": 15
};

[snip] const mod1 = index % this.numberOfDifferentKeys var mod = parseInt(this.maptbl[mod1])