Writing Python Applets for the budgie-desktop


Well here is my first budgie-desktop applet:

ubuntu xenial [Running] - Oracle VM VirtualBox : 1_027

Seen this before?  Well yes – this is the Indicator SysMonitor app-indicator which has been updated to support budgie-desktop.

In-fact … it works much better under budgie because you don’t have to fiddle with applet ordering to stop applets jumping around with the SysMonitor label values grow/shrink in size. Just use Raven to order the applet correctly.

This is just a workout – to see what changes I need to do to get an existing python based app-indicator to natively work under budgie-desktop.

The changes were remarkably small.

Lets dive in.

First grab the source-code and install

sudo apt-get install python3-psutil curl git
mkdir -p ~/.local/share/budgie-desktop/modules
cd ~/.local/share/budgie-desktop/modules
git clone https://github.com/fossfreedom/indicator-sysmonitor.git budgiesysmonitor
nohup budgie-panel --replace &

Then use Raven to add the “Panel Sys Monitor” applet


Ok – so what did I do to convert the existing app-indicator to work under budgie?

All local installed applets need to be installed into a subfolder of ~/.local/share/budgie-desktop/modules.  An applet basically consists of two key files – “.plugin” which is the control file containing the description & Icon you see in Raven together with the name of the python module where budgie & Peas (the library that does all the clever stuff for the display of the applet) has the entry point to “run with”.

TIP: make the module name in the .plugin name the same as the folder name – its case-sensitive.  So in this case the python module is “budgiesysmonitor.py” – so the module name is “budgiesysmonitor” and the folder name containing all the source is also “budgiesysmonitor”

TIP: make the .plugin filename the same as the Class entry point in budgiesysmonitor – so the filename is “BudgieSysMonitor.plugin” and the class entrypoint is “class BudgieSysMonitor(GObject.GObject, Budgie.Plugin):

First comment out/delete the AppIndicator specifics – the gi.repository import AppIndicator statement etc.

Replace a line like “appindicator.Indicator.new(…)” with a Gtk container equivalent such as a button e.g. “button = Gtk.Button.new()

Connect the signals that updates the Button Icon and/or label – for this applet sysmonitor just changes the label – there is no icon to display.

Add a test application wrapper :

# testing
win = Gtk.Window()

...
# setup an instance with config
win.add( button )
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()

Run your new python app and make sure it works as you expect – click stuff, menu’s, display etc.

Then when you are happy, comment out the test app portion and just top and tail with the Applet specifics for Budgie i.e. the correct import:

import gi
gi.require_version('Budgie', '1.0')
from gi.repository import Budgie, GObject

The magic is this bit – two classes – the Peas entry point “BudgieSysMonitor” and the Panel Applet – our button is created here:

class BudgieSysMonitor(GObject.Object, Budgie.Plugin):
    """ This is simply an entry point into the SysMonitor applet
    Note you must always override Object, and implement Plugin.
    """

    # Good manners, make sure we have unique name in GObject type system
    __gtype_name__ = "BudgieSysMonitor"

    def __init__(self):
        """ Initialisation is important.
        """
        GObject.Object.__init__(self)

    def do_get_panel_widget(self, uuid):
        """ This is where the real fun happens. Return a new Budgie.Applet
        instance with the given UUID. The UUID is determined by the
        BudgiePanelManager, and is used for lifetime tracking.
        """
        return BudgieSysMonitorApplet(uuid)

class BudgieSysMonitorApplet(Budgie.Applet):
    """ Budgie.Applet is in fact a Gtk.Bin """

    button = None

    def __init__(self, uuid):
        Budgie.Applet.__init__(self)

        # Add a button to our UI
        self.button = Gtk.Button.new()
        self.button.set_relief(Gtk.ReliefStyle.NONE)
        self.add(self.button)
        self.show_all()

Test your new applet – you’ll need to shout at budgie-panel to make it recognise your new applet:

budgie-panel --replace &

See – easy!

P.S. before you complain – yes I should be using a Popover to display the menu when clicking the applet but that’s for another day.

Source – Ikey’s plugin examples – for C and Vala hackers there are similar example plugins in the linked github repo

 

Developing for budgie-remix


Getting started with developing with budgie-remix

budgie-remix is hosted on GitHub for development.  For anyone who wishes to contribute to the development of budgie-remix, this article is the starting point.

budgie auto.txt (~-Documents) - gedit_147

It consists of a number of sub-projects – some are still work in progress.  Obviously the number of sub-projects will grow as the project matures – below is the current structure:

budgie-desktop-environment is the starting point for the distro.  It is a meta package consists of two parts:

  • Depends: this installs all the necessary packages building upon the mini.iso  minimal Ubuntu install.
  • Recommends: this installs all the desktop packages like rhythmbox which the end-users see and use out of the box.

budgie-desktop is the upstream budgie desktop itself together with any Ubuntu specific patches

budgie-remix-lightdm-theme configures the LightDM theme and live CD autologin configuration files.

In the Debian package itself it has the gsettings override file central to budgie-remix; all the key customisation settings are done here:

  • rhythmbox
  • fonts
  • nautilus
  • screensaver and desktop background initial wallpaper

budgie-xfdashboard configures xfdashboard for budgie; defines a theme together with initial defaults per user autostarted on logon

budgie-isohelper contains stuff to create an iso:

  • reworked PinguyBuilder deb package stripped of unnecessary dependencies together with a base config file.

arc-theme is the upstream arc-theme together with the Debian package to install it.

plymouth-theme is the budgie-remix plymouth files displayed when booting

budgie-wallpapers consists of wallpaper jpegs including the key screensaver and desktop background wallpaper file itself


The whole project is built upon the mini iso

  1. Connect the downloaded ISO to virtualbox
  2. Boot and accept all the defaults – no desktop is installed
  3. Install budgie-remix as follows
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:fossfreedom/testbudgie
sudo apt-get update
sudo apt-get install -y budge-desktop-environment

The PPA testbudgie are development packages.  The PPA budgie-desktop are the release packages

That’s it – simple!

Feel free to contact me with any suggestions – contact me via google+ or hit the contact page (please use a real email address!) and I’ll reply as soon as I can.

 

budgie-remix preview 2 is available


budgie-remix tech-preview 2 is now available for download to test, get feedback etc.

Please DO read the README.  This is labeled a tech-preview – it is not production ready and should not be installed if you want to use budgie in the long-term.

Next up will be beta 1 at the end of March – this will be production ready.

So what is different from tech-preview 1?

Well this has been correctly engineered – the previous effort was all hand-cranked.  Tech-preview 2  is all been debianized – built by launchpad and most importantly – can be reproducibly built for now and the long-term.

ubuntu budgie [Running] - Oracle VM VirtualBox_135

For this tech-preview budgie-remix is using lightdm as the login-manager.  The picture shows what budgie-remix could look like.

Help needed – we need a logo for the login box

The previous tech-preview could not  be installed.  Tech-preview 2 can be – please refer to the README on how you can do this.

ubuntu budgie [Running] - Oracle VM VirtualBox_136

On logging in by default the wallpaper is the same as the login screen:

Help-needed – we need public domain/ cc attribution licensed wallpaper (that allows distribution) – guidance (taken from Ubuntu Flickr):

We’re looking for photographic wallpapers: lovely backgrounds that greet the user on budgie-remix welcome screen and at login, and complements the arc-theme. Like Ubuntu call for action – We’re also looking for an illustrative wallpaper that plays off the theme “xenial xerus”.

* Images shouldn’t be too busy and filled with too many shapes and colors, a similar tone throughout is a good rule of thumb.
* A single point of focus, a single area that draws the eye into the image, can also help you avoid something too cluttered.
* Try your image at different aspect ratios to make sure something important isn’t cropped out on smaller/ larger screens at different resolutions.
* Take a look at the wallpapers guidance on the Ubuntu Wiki regarding the size of images. Our target resolution is 3840 x 2400.

Break all the rules except the resolution one! 😀

Network Monitor applet now appears correctly:

ubuntu budgie [Running] - Oracle VM VirtualBox_138

As this is a tech-preview budgie-remix has included with the live cd the gnome-shell like dashboard xfdashboard

ubuntu budgie [Running] - Oracle VM VirtualBox_139

You can see all your apps running very easily…

ubuntu budgie [Running] - Oracle VM VirtualBox_140

… and you can switch between workspaces simply – dragging apps from the main pane to the workspace as well.

Help-needed: Somone who can help out integrating xfdashboard i.e. theme it, set the key-combination on first logon)

Look at the README how to hook this up to a keyboard combination e.g. CTRL+TAB.  If there is sufficient good feedback, budgie-remix will include this as default in the upcoming beta correctly integrated.

Plymouth is the default boot loader: Help needed – we need someone who can change “Ubuntu 16.04” to “budgie-remix 16.04”

Hidden in the background is printer support – hplip dependency has been added.

Help-needed: testing this

We also want feedback as to what other back-end software should be included out of the box

The next article will describe where the project is hiding on the interweb, how you can contribute.

My first distro package…


My surprise today to wakeup to find-out that a package I have written has just been released right up-front in a linux distribution.

How happy am I?!

im happy

The Solus Project have announced Rhythmbox-Alternative-Toolbar is being used by default.

Screenshot from 2016-03-01 04-22-38

Massively proud 😀

Whilst not installed by default – Ubuntu Rhythmbox users can install my software straight out of the repository from 16.04

sudo apt-get install rhythmbox-plugin-alternative-toolbar

“Budgie-Remix” is born


“Ubuntu Budgie” is  a thing  – its not real – well not yet.

So what will such a thing look like? Enter “Budgie-Remix”.

Ubuntu’s trademark restrictions would not allow some random person or team just to claim their spin as “Ubuntu” – so for the moment I’ve code-named this project Budgie-Remix.

If that sounds spooky – well Ubuntu Gnome in its infancy was known as “gnome-remix” … and funnily enough “Ubuntu Gnome-Remix” – well … it was before Canonical “clarified” its trademark usage.

I’ve spun this out very quickly – don’t even attempt to use this in a production environment.  I’m sure it will eat all your kittens…

budgie [Running] - Oracle VM VirtualBox_127

The base is Ubuntu 15.10 mini iso uplifted to 16.04 alpha.  Look at the readme for further details.  The MD5 is there to make sure your download is successful – if you dont know what that means type in a terminal

md5sum budgie-remix.iso

Out will splurge a number – it should be exactly the same as the  contents of the .md5 text file on SourceForge.

So how was this hacked together? I’ve added my budgie PPA. Hand-cranked a wallpaper, icon and theme via directly editing some base operating files.  LightDM logon screen has been edited manually.

I’ve added Gnome-Software, Nautilus (Files), Gnome-tweak-tool and dconf-editor to the mix.

Then used the wonderful Pinguy Builder to create an ISO.

It’s 64bit only and is only to be used in Virtualbox/Gnome-Boxes etc.

login username is “live” and there is no password


 

Its purpose is for two reasons only – to demonstrate what budgie-desktop actually is and also to understand what actually needs to be done to make a real distro.

Quick – dirty – mission accomplished?

Needs to be refined – it needs some real software development techniques to be applied.

As always – I need people to help in any way they can – testing, coding, packaging – basically anything and everything.  Hit the contact button please!

Stay tuned.

“Ubuntu Budgie” needs a campaign plan


Every major software project needs a plan – a set of requirements & derived requirements, an Impact Assessment, High-Level Design, low-level designs, tech-notes, transition plans, software impact statements, interface-control-documents …

xubuntu (before rhythmbox 3.3) [Running] - Oracle VM VirtualBox_120

Yes – the software industry (which if you don’t know I’m a part of) just loves its documentation – its a wonder any software gets produced!

Does anyone actually read any of this?

 

“Ubuntu Budgie” needs a plan – a plan of what needs to be done – but it doesn’t need thousands of turgid pages of stuff to be created before someone decides on producing something real.

Here’s a plan – maybe a flight of fancy – maybe not practical in places… but a plan it is.

Have a read – what do you think?

Feel free to share – edit & comment – its an open plan so please dont abuse it…

Its quite a list – somewhat random – but such a plan needs a practical demonstration of what the key parts of the plan will actually look like.

Tomorrow’s story…

My opensource contributions Q4 2015


This quarter has been a fairly busy time updating, enhancing and collaborating with various projects.  If you like what I’ve been up-to, remember you can say thanks by buying me a beer via Flattr or Paypal

Project development

alternative-toolbar: New move-column capability added. A whole host of translation updates and other bug-fixes have taken place.  A brand-new non-bespoke installer has been merged into the project. I’m also seeking to add this to the Debian repository – more news on this hopefully soon.

indicator-sysmonitor: various fixes for the temperature sensor. The memory sensor now works with the newer kernels available in support Ubuntu versions.  General python cleanups.

rhythmbox-fullscreen: fixes for gnome-shell display issues and simplify the project dependencies

coverart-search-providers: python cleanups. Bug fix to stop crash, together with latest translation updates.

radio-browser: fix repeat download issue – solves some of the long startup issues.  Fix crash issues with the board-handler to allow feedback to the host to occur correctly/post new stations/updates etc.

remember-the-rhythm: substantially updated this with new startup options – auto play, auto pause etc.  Fix to make the plugin work with alternative-toolbar

Coverart-browser: lots of translation updates and minor version bump.

bliss: helping to test this new development to analyse music.  Should now be in a stable state for others to use.

Note: As yet, not completed – but have made progress drafting a new rhythmbox plugin using the bliss library.  Hopefully more news about this in the next quarter.

PPA Updates.

  • Rhythmbox-plugins: The following plugins/packages have had updates (some with multiple updates over the last quarter) – now-playing is a new plugin
  • Package Version Uploaded by ▾
    rhythmbox-plugin-alternative-toolbar 0.16.0-1 (2015-12-28)
    rhythmbox-plugin-drc 0.2.4-1 (2015-12-22)
    rhythmbox-plugin-fullscreen 0.7.1-1 (2015-11-15)
    rhythmbox-plugin-radio-browser 0.5.1-1~rb3 (2015-10-29)
    rhythmbox-plugin-remembertherhythm 0.2.1-1~rb3 (2015-10-26)
    rhythmbox-plugin-looper 0.4-1~rb3 (2015-10-25)
    rhythmbox-plugin-coverart-browser 2.1.1-1~rb3 (2015-10-25)
    rhythmbox-plugin-coverart-search 1.2.2-1~rb3 (2015-10-25)
    rhythmbox-plugin-complete 0.3.11-1 (2015-10-19)
    rhythmbox-plugin-now-playing 0.1-1 (2015-10-19)
    rhythmbox-plugin-parametriceq 0.2.2-1 (2015-09-14)
    mutagen 1.31.0-1 (2015-09-14)
  • Rhythmbox: For Trusty and Wily users the package version has been bumped to 3.2.1 + All GIT updates between March and Nov this year.  Notes – version is is 3.2.a1 – this was going to be bumped to 3.3 in September but upstream did not do a formal rhythmbox release this half-year.
  • System Monitor (indicator-sysmonitor): this has been updated to reflect development changes

As always – I’m always looking to work with you – whether you can translate, test or provide code enhancements.  Just drop by one of my projects, fork, raise issues etc.