diff options
-rw-r--r-- | README | 12 | ||||
-rw-r--r-- | extension.js | 44 | ||||
-rw-r--r-- | metadata.json | 8 | ||||
-rw-r--r-- | stylesheet.css | 1 |
4 files changed, 65 insertions, 0 deletions
@@ -0,0 +1,12 @@ +This is a quick hack to get a panel button to show the on screen keyboard since +it's hard to activate it from the status area on a touch display. + +Installation: + +Check out the extension: + + git clone git://honk.sigxcpu.org/git/gnome-shell-oskb-extension.git ~/.local/share/gnome-shell/extensions/OnScreenKeyboardButton@sigxcpu.org + +Activate it: + + gsettings set org.gnome.shell enabled-extensions "['OnScreenKeyboardButton@sigxcpu.org'] diff --git a/extension.js b/extension.js new file mode 100644 index 0000000..ac9e4de --- /dev/null +++ b/extension.js @@ -0,0 +1,44 @@ +const Gio = imports.gi.Gio; +const GLib = imports.gi.GLib; +const Lang = imports.lang; +const St = imports.gi.St; +const Shell = imports.gi.Shell; +const Main = imports.ui.main; + +function OnScreenKeyboardButton() { + this._init(); +} + +OnScreenKeyboardButton.prototype = { + _init: function() { + label = GLib.markup_escape_text('Keyboard', -1); + this.actor = new St.Button ({ label: label }); + this.actor.connect("clicked", Lang.bind(this, this._toggleShowOnScreenKeyboard)); + this._onScreenKeyboardShown = false; + }, + + _toggleShowOnScreenKeyboard: function() { + if (this._onScreenKeyboardShown) { + Main.keyboard.hide(); + } else { + Main.keyboard.show(); + } + this._onScreenKeyboardShown = !this._onScreenKeyboardShown; + }, +}; + +let button; + +function init() { + button = new OnScreenKeyboardButton(); +} + +function enable() { + let _children = Main.panel._centerBox.get_children(); + Main.panel._centerBox.insert_actor(button.actor, _children.length - 1); + Main.panel._centerBox.add(button.actor); +} + +function disable() { + Main.panel._centerBoxBox.remove_actor(button.actor); +} diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000..eb47ab4 --- /dev/null +++ b/metadata.json @@ -0,0 +1,8 @@ +{ + "extension-id": "net.godiug.oskbutton", + "uuid": "OnScreenKeyboardButton@sigxcpu.org", + "name": "Show Onscreen Keyboard Button", + "description": "Button to show the on screen keyboard", + "shell-version": [ "3.2.2" ], + "url": "http://honk.sigxcpu.org/git/gnome-shell-oskb-extension.git" +} diff --git a/stylesheet.css b/stylesheet.css new file mode 100644 index 0000000..fbe5640 --- /dev/null +++ b/stylesheet.css @@ -0,0 +1 @@ +/* This extensions requires no custom styling */ |