Skip to content

Commit 2342657

Browse files
mmstickjackpot51
authored andcommitted
fix(panel): Show Launcher shortcut as Super on 21.04
1 parent 9839246 commit 2342657

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

src/panel_settings.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const Me = imports.misc.extensionUtils.getCurrentExtension();
22

33
// import * as auto_tiler from 'auto_tiler';
44
import * as Utils from 'utils';
5+
import { Launcher } from './dialog_launcher';
56

67
//import type { Entity } from './ecs';
78
import type { Ext } from './extension';
@@ -170,8 +171,16 @@ function shortcuts(menu: any): any {
170171
layout_manager.set_column_spacing(30);
171172
layout_manager.attach(create_label(_('Shortcuts')), 0, 0, 2, 1);
172173

174+
let launcher_shortcut = _("Super + /")
175+
const cosmic_settings = Me.imports.settings.settings_new_id('org.gnome.shell.extensions.pop-cosmic')
176+
if (cosmic_settings) {
177+
if (cosmic_settings.get_enum('overlay-key-action') === 2) {
178+
launcher_shortcut = _("Super")
179+
}
180+
}
181+
173182
[
174-
[_('Launcher'), _('Super + /')],
183+
[_('Launcher'), launcher_shortcut],
175184
[_('Navigate Windows'), _('Super + Arrow Keys')],
176185
[_('Toggle Tiling'), _('Super + Y')],
177186
].forEach((section, idx) => {

src/utils.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function exists(path: string): boolean {
4747
}
4848

4949
/**
50-
* Parse the current background color's darkness
50+
* Parse the current background color's darkness
5151
* https://stackoverflow.com/a/41491220 - the advanced solution
5252
* @param color - the RGBA or hex string value
5353
*/
@@ -159,4 +159,18 @@ export function map_eq<K, V>(map1: Map<K, V>, map2: Map<K, V>) {
159159
}
160160

161161
return true
162+
}
163+
164+
export function os_release(): null | string {
165+
const [ok, bytes] = GLib.file_get_contents("/etc/os-release")
166+
if (! ok) return null
167+
168+
const contents: string = imports.byteArray.toString(bytes)
169+
for (const line of contents.split('\n')) {
170+
if (line.startsWith("VERSION_ID")) {
171+
return line.split('"')[1]
172+
}
173+
}
174+
175+
return null
162176
}

0 commit comments

Comments
 (0)