Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
160 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.zip | ||
*.swp | ||
_build | ||
schemas/gschemas.compiled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Contributors to this repo agree to be bound by the [Pop! Code of Conduct](https://github.com/pop-os/code-of-conduct). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Retrieve the UUID from ``metadata.json`` | ||
UUID = $(shell grep -E '^[ ]*"uuid":' ./metadata.json | sed 's@^[ ]*"uuid":[ ]*"\(.\+\)",[ ]*@\1@') | ||
|
||
ifeq ($(strip $(DESTDIR)),) | ||
INSTALLBASE = $(HOME)/.local/share/gnome-shell/extensions | ||
else | ||
INSTALLBASE = $(DESTDIR)/usr/share/gnome-shell/extensions | ||
endif | ||
INSTALLNAME = $(UUID) | ||
|
||
$(info UUID is "$(UUID)") | ||
|
||
.PHONY: all clean install zip-file | ||
|
||
all: extension.js metadata.json schemas | ||
rm -rf _build | ||
mkdir -p _build | ||
cp -r $^ _build | ||
|
||
schemas: schemas/gschemas.compiled | ||
touch $@ | ||
|
||
schemas/gschemas.compiled: schemas/*.gschema.xml | ||
glib-compile-schemas schemas | ||
|
||
clean: | ||
rm -rf _build schemas/gschemas.compiled | ||
|
||
install: all | ||
rm -rf $(INSTALLBASE)/$(INSTALLNAME) | ||
mkdir -p $(INSTALLBASE)/$(INSTALLNAME) | ||
cp -r _build/* $(INSTALLBASE)/$(INSTALLNAME)/ | ||
|
||
uninstall: | ||
rm -rf $(INSTALLBASE)/$(INSTALLNAME) | ||
|
||
zip-file: all | ||
cd _build && zip -qr "../$(UUID)$(VSTRING).zip" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pop-shell (0.1.0) focal; urgency=medium | ||
|
||
* Initial release. | ||
|
||
-- Jeremy Soller <jeremy@system76.com> Thu, 14 Nov 2019 21:35:19 -0700 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Source: pop-shell | ||
Section: gnome | ||
Priority: optional | ||
Maintainer: Jeremy Soller <jeremy@system76.com> | ||
Build-Depends: debhelper (>= 10) | ||
Standards-Version: 3.9.8 | ||
Homepage: https://github.com/pop-os/shell | ||
Vcs-Git: https://github.com/pop-os/shell | ||
|
||
Package: pop-shell | ||
Architecture: all | ||
Depends: | ||
${misc:Depends} | ||
Description: Pop!_OS Shell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | ||
Upstream-Name: pop-shell | ||
Source: https://github.com/pop-os/shell | ||
|
||
Files: * | ||
Copyright: 2019 System76 | ||
License: GPL-3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/make -f | ||
# -*- makefile -*- | ||
|
||
# Uncomment this to turn on verbose mode. | ||
#export DH_VERBOSE=1 | ||
|
||
%: | ||
dh $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0 (native) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
const ExtensionUtils = imports.misc.extensionUtils; | ||
const Gio = imports.gi.Gio; | ||
const Main = imports.ui.main; | ||
const Meta = imports.gi.Meta; | ||
const Shell = imports.gi.Shell; | ||
|
||
function log(text) { | ||
global.log("pop-shell: " + text); | ||
} | ||
|
||
function settings() { | ||
const extension = ExtensionUtils.getCurrentExtension(); | ||
const schema = extension.metadata["settings-schema"]; | ||
const GioSSS = Gio.SettingsSchemaSource; | ||
const schemaDir = extension.dir.get_child("schemas"); | ||
let schemaSource = schemaDir.query_exists(null) ? | ||
GioSSS.new_from_directory(schemaDir.get_path(), GioSSS.get_default(), false) : | ||
GioSSS.get_default(); | ||
|
||
const schemaObj = schemaSource.lookup(schema, true); | ||
if (!schemaObj) | ||
throw new Error("Schema " + schema + " could not be found for extension " | ||
+ extension.metadata.uuid + ". Please check your installation."); | ||
let settings = new Gio.Settings({ settings_schema: schemaObj }); | ||
return settings; | ||
} | ||
|
||
function search() { | ||
log("search"); | ||
|
||
let tabList = global.display.get_tab_list(Meta.TabList.NORMAL, null); | ||
tabList.forEach(function(win) { | ||
let app = Shell.WindowTracker.get_default().get_window_app(win); | ||
let name = ""; | ||
try { | ||
name = app.get_name().replace(/&/g, "&"); | ||
} catch (e) { | ||
log(e); | ||
} | ||
|
||
log(name + ": " + win.get_title()); | ||
}); | ||
} | ||
|
||
function init() { | ||
log("init"); | ||
} | ||
|
||
function enable() { | ||
log("enable"); | ||
|
||
Main.wm.addKeybinding( | ||
"search", | ||
settings(), | ||
Meta.KeyBindingFlags.NONE, | ||
Shell.ActionMode.NORMAL, | ||
() => search() | ||
); | ||
} | ||
|
||
function disable() { | ||
log("disable"); | ||
|
||
Main.wm.removeKeybinding("search"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "Pop Shell", | ||
"description": "Pop Shell", | ||
"uuid": "pop-shell@system76.com", | ||
"settings-schema": "org.gnome.shell.extensions.pop-shell", | ||
"shell-version": ["3.36"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<schemalist gettext-domain="pop-shell"> | ||
<schema id="org.gnome.shell.extensions.pop-shell" path="/org/gnome/shell/extensions/pop-shell/"> | ||
<key type="as" name="search"> | ||
<default><![CDATA[['<Super>slash']]]></default> | ||
<summary>Search key combo</summary> | ||
</key> | ||
</schema> | ||
</schemalist> |