diff --git a/randomwallpaper@iflow.productions/extension.js b/randomwallpaper@iflow.productions/extension.js new file mode 100644 index 0000000..4539924 --- /dev/null +++ b/randomwallpaper@iflow.productions/extension.js @@ -0,0 +1,53 @@ + +const St = imports.gi.St; +const Main = imports.ui.main; +const Tweener = imports.ui.tweener; + +let text, button; + +function _hideHello() { + Main.uiGroup.remove_actor(text); + text = null; +} + +function _showHello() { + if (!text) { + text = new St.Label({ style_class: 'helloworld-label', text: "Hello, world!" }); + Main.uiGroup.add_actor(text); + } + + text.opacity = 255; + + let monitor = Main.layoutManager.primaryMonitor; + + text.set_position(Math.floor(monitor.width / 2 - text.width / 2), + Math.floor(monitor.height / 2 - text.height / 2)); + + Tweener.addTween(text, + { opacity: 0, + time: 2, + transition: 'easeOutQuad', + onComplete: _hideHello }); +} + +function init() { + button = new St.Bin({ style_class: 'panel-button', + reactive: true, + can_focus: true, + x_fill: true, + y_fill: false, + track_hover: true }); + let icon = new St.Icon({ icon_name: 'system-run-symbolic', + style_class: 'system-status-icon' }); + + button.set_child(icon); + button.connect('button-press-event', _showHello); +} + +function enable() { + Main.panel._rightBox.insert_child_at_index(button, 2); +} + +function disable() { + Main.panel._rightBox.remove_child(button); +} diff --git a/randomwallpaper@iflow.productions/metadata.json b/randomwallpaper@iflow.productions/metadata.json new file mode 100644 index 0000000..f5c59ab --- /dev/null +++ b/randomwallpaper@iflow.productions/metadata.json @@ -0,0 +1,6 @@ +{ + "shell-version": ["3.12.2"], + "uuid": "randomwallpaper@iflow.productions", + "name": "Random Wallpaper", + "description": "Fetches random wallpaper from desktopper.co and sets it as desktop background" +} \ No newline at end of file diff --git a/randomwallpaper@iflow.productions/stylesheet.css b/randomwallpaper@iflow.productions/stylesheet.css new file mode 100644 index 0000000..9a2a332 --- /dev/null +++ b/randomwallpaper@iflow.productions/stylesheet.css @@ -0,0 +1,9 @@ + +.helloworld-label { + font-size: 36px; + font-weight: bold; + color: #ffffff; + background-color: rgba(10,10,10,0.7); + border-radius: 5px; + padding: .5em; +}