Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=artwork.git;a=commitdiff;h=270dba02da5009e359701255c72e1e7ab6a778dd
commit 270dba02da5009e359701255c72e1e7ab6a778dd Author: Devil505 <devil505li...@gmail.com> Date: Sat Apr 16 18:28:51 2011 +0200 * initial import of gnome-shell-extension-frugalware-logo Gnome shell extension to display the frugalware logo near Activities menu diff --git a/gnome-shell-extension-frugalware-logo/LICENSE b/gnome-shell-extension-frugalware-logo/LICENSE new file mode 100644 index 0000000..8274141 --- /dev/null +++ b/gnome-shell-extension-frugalware-logo/LICENSE @@ -0,0 +1,24 @@ + +gnome-shell-extension-frugalware-logo +Gnome Shell extension to display a Frugalware logo on Activities button +Copyright (C) 2011 by Frugalware Linux <ad...@frugalware.org> + +Licensed under the MIT license (copied from the http://en.wikipedia.org/wiki/MIT_License site) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/gnome-shell-extension-frugalware-logo/README b/gnome-shell-extension-frugalware-logo/README new file mode 100644 index 0000000..3e21271 --- /dev/null +++ b/gnome-shell-extension-frugalware-logo/README @@ -0,0 +1,16 @@ +Readme for gnome-shell-extension-frugalware-logo +---------- + +This is a gnome-shell extension that adds a Frugalware logo +to the Activities button of the shell. +(On right-to-left locales it appears on the top right corner, +otherwise on the top left corner.) + +The extension is supposed to work with any Gnome shell theme. +(Tested with some popular ones and the default one.) + +Special thanks to: + - Timur Kristóf for his work for Fedora logo extension + - Elad Alfassa for testing it on right-to-left locales. + - Rahul Sundaram for reviewing this package before submission. + diff --git a/gnome-shell-extension-frugalware-logo/extension.js b/gnome-shell-extension-frugalware-logo/extension.js new file mode 100644 index 0000000..04e5370 --- /dev/null +++ b/gnome-shell-extension-frugalware-logo/extension.js @@ -0,0 +1,64 @@ + +// Gnome Shell extension to display a Frugalware logo on Activities button + +// Copyright (C) 2011 by Frugalware Linux <ad...@frugalware.org> + +/* Licensed under the MIT license (copied from the http://en.wikipedia.org/wiki/MIT_License site) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +const St = imports.gi.St; +const Mainloop = imports.mainloop; +const Main = imports.ui.main; + +// This is for debugging purposes +function _debugStuff() { + // If you are debugging, change 'text' to whatever you want to check + let text = new St.Label({ text: 'text', style: 'font-size: 10px; background: #000000; color: #ffffff;' }); + let monitor = global.get_primary_monitor(); + global.stage.add_actor(text); + text.set_position(Math.floor (monitor.width / 2 - text.width / 2), Math.floor(monitor.height / 2 - text.height / 2)); + Mainloop.timeout_add(3000, function () { text.destroy(); }); +} + +// Extension initialization code - adding the Frugalware logo :) +function main() { + // The following lines can be used for debugging purposes + //Main.panel.button.connect('button-release-event', _debugStuff); + //Main.panel.actor.set_direction(St.TextDirection.RTL); + + // Getting the old style and using it as a base if it's not null + let label = Main.panel.button.get_child(); + let logo = new St.Icon({ icon_type: St.IconType.FULLCOLOR, icon_size: label.height, icon_name: 'distributor-logo' }); + let box = new St.BoxLayout(); + Main.panel.button.set_child(box); + + box.add_actor(logo); + box.add_actor(label); + + // Let's care about both RTL and LTR directions + let currentDirection = Main.panel.actor.get_direction(); + if (currentDirection == St.TextDirection.LTR) { + logo.set_style('padding-right: 10px;'); + } + else if (currentDirection == St.TextDirection.RTL) { + logo.set_style('padding-left: 10px;'); + } +} + diff --git a/gnome-shell-extension-frugalware-logo/metadata.json b/gnome-shell-extension-frugalware-logo/metadata.json new file mode 100644 index 0000000..1a518a7 --- /dev/null +++ b/gnome-shell-extension-frugalware-logo/metadata.json @@ -0,0 +1 @@ +{"shell-version": ["3.0.0.2"], "uuid": "ad...@frugalware.org", "name": "Frugalware Logo", "description": "Displays a Frugalware logo on the Activities button"}
_______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git