All Projects → p-e-w → Plotinus

p-e-w / Plotinus

A searchable command palette in every modern GTK+ application

Programming Languages

vala
323 projects

Projects that are alternatives of or similar to Plotinus

pw3270
3270 Emulator for gtk
Stars: ✭ 38 (-95.28%)
Mutual labels:  gtk, gnome, gtk3, linux-desktop
Awesome Gtk
List of awesome GTK+ (gtk3) applications
Stars: ✭ 174 (-78.39%)
Mutual labels:  gnome, gtk, gtk3
Swiftgtk
A Swift wrapper around gtk-3.x and gtk-4.x that is largely auto-generated from gobject-introspection
Stars: ✭ 180 (-77.64%)
Mutual labels:  gnome, gtk, gtk3
Clamtk
An easy to use, light-weight, on-demand virus scanner for Linux systems
Stars: ✭ 151 (-81.24%)
Mutual labels:  linux-desktop, gtk, gtk3
Marker
🖊 A gtk3 markdown editor
Stars: ✭ 644 (-20%)
Mutual labels:  gnome, gtk, gtk3
Sunflower
Small and highly customizable twin-panel file manager for Linux with support for plugins.
Stars: ✭ 347 (-56.89%)
Mutual labels:  gnome, gtk, gtk3
Dino
Modern XMPP ("Jabber") Chat Client using GTK+/Vala
Stars: ✭ 1,637 (+103.35%)
Mutual labels:  linux-desktop, gtk, gtk3
GabTag
A gtk linux application to handle audio tags 🎵
Stars: ✭ 34 (-95.78%)
Mutual labels:  gtk, gnome, gtk3
gui-python-gtk
Repositório criado para documentar e centralizar conteúdos, dicas, tutoriais e exemplos de código sobre a construção de interfaces com a linguagem de programação Python (PyGObject) e o toolkit gráfico Gtk 4.
Stars: ✭ 85 (-89.44%)
Mutual labels:  gtk, gnome, gtk3
ThemeChanger
Theme changing utility for Linux, etc.
Stars: ✭ 14 (-98.26%)
Mutual labels:  gtk, gnome, gtk3
Node Gtk
GTK+ bindings for NodeJS (via GObject introspection)
Stars: ✭ 287 (-64.35%)
Mutual labels:  gnome, gtk, gtk3
vulcan
A minimalistic text editor designed for both ordinary use and software development
Stars: ✭ 46 (-94.29%)
Mutual labels:  gtk, gnome, gtk3
Gradio
Stars: ✭ 335 (-58.39%)
Mutual labels:  gnome, gtk, gtk3
Sweet
Light and dark colorful Gtk3.20+ theme
Stars: ✭ 703 (-12.67%)
Mutual labels:  gnome, gtk3
Macos
macOS theme for Gnome and GTK-based desktops
Stars: ✭ 641 (-20.37%)
Mutual labels:  gnome, gtk
Flat Remix Gtk
Flat Remix is a GTK application theme inspired by material design. It is mostly flat using a colorful palette with some shadows, highlights, and gradients for some depth.
Stars: ✭ 634 (-21.24%)
Mutual labels:  gnome, gtk
Spot
Native Spotify client for the GNOME desktop
Stars: ✭ 762 (-5.34%)
Mutual labels:  gnome, gtk
Glance
A visual Haskell
Stars: ✭ 620 (-22.98%)
Mutual labels:  gtk, gtk3
Gnome Layout Manager
A bash script that batch installs and tweaks GNOME extensions as well as GTK/Shell themes. There are currently three options available: Unity, Windows and macOS.
Stars: ✭ 383 (-52.42%)
Mutual labels:  linux-desktop, gnome
Gaphor
Gaphor is the simple modeling tool
Stars: ✭ 386 (-52.05%)
Mutual labels:  gnome, gtk

Only a compound can be beautiful, never anything devoid of parts; and only a whole;
the several parts will have beauty, not in themselves,
but only as working together to give a comely total.
Yet beauty in an aggregate demands beauty in details:
it cannot be constructed out of ugliness; its law must run throughout.

Plotinus, First Ennead

Plotinus

A searchable command palette in every modern GTK+ application


Have you used Sublime Text's or Atom's "Command Palette"? It's a list of everything those editors can do that opens at the press of a key and finds the action you are looking for just by typing a few letters. It's raw power at your fingertips.

Plotinus brings that power to every application on your system (that is, to those that use the GTK+ 3 toolkit). It automatically extracts all available commands by introspecting a running application, instantly adapting to UI changes and showing only relevant actions. Using Plotinus requires no modifications to the application itself!

Just press Ctrl+Shift+P (configurable) and you're in business – it feels so natural you'll soon wonder how you ever lived without it.

Nautilus screencast

gedit screencast

Installation

Prerequisites

To build Plotinus from source, you need Git, CMake, Vala, and the GTK+ 3 development files. All of these are easily obtained on most modern Linux distributions:

Fedora / RHEL / etc.

sudo dnf install git cmake vala gtk3-devel

Ubuntu / Mint / Elementary / etc.

sudo apt-get install git cmake valac libgtk-3-dev

Building

git clone https://github.com/p-e-w/plotinus.git
cd plotinus
mkdir build
cd build
cmake ..
make
sudo make install

Enabling Plotinus in applications

Because of the complexity and clumsiness surrounding Linux environment variables, Plotinus is currently not enabled automatically. The easiest way to enable Plotinus for all applications on the system is to add the line

GTK3_MODULES=[libpath]

to /etc/environment, where [libpath] is the full, absolute path of libplotinus.so, which can be found using the command

whereis -b libplotinus

Alternatively, you can try Plotinus with individual applications by running them with

GTK3_MODULES=[libpath] application

from a terminal.

Configuration

Plotinus can be configured both globally and per application. Application settings take precedence over global settings. In the commands below, [application] can be either

  • default, in which case the setting is applied globally, or
  • the path of an application executable, without the leading slash and with all other slashes replaced by periods (e.g. /usr/bin/gedit -> usr.bin.gedit).

Note that the relevant path is the path of the process executable, which is not always identical to the executable being launched. For example, all GNOME JavaScript applications run the process /usr/bin/gjs.

Enabling/disabling the command palette

gsettings set com.worldwidemann.plotinus:/com/worldwidemann/plotinus/[application]/ enabled [true/false]

Changing the keyboard shortcut

gsettings set com.worldwidemann.plotinus:/com/worldwidemann/plotinus/[application]/ hotkeys '[keys]'

[keys] must be an array of strings in the format expected by gtk_accelerator_parse, e.g. ["<Primary><Shift>P", "<Primary>P"]. Each shortcut in the array opens the command palette.

Enabling/disabling D-Bus window registration

gsettings set com.worldwidemann.plotinus:/com/worldwidemann/plotinus/[application]/ dbus-enabled [true/false]

See the following section for details.

D-Bus API

Plotinus provides a simple but complete D-Bus API for developers who want to use its functionality from their own software. The API consists of two methods, exposed on the session bus at com.worldwidemann.plotinus:

  • GetCommands(window_path) -> (bus_name, command_paths)
    Takes the object path of a GTK+ window (which can e.g. be obtained from a Mutter window via meta_window_get_gtk_window_object_path) and returns an array of object paths referencing commands extracted from that window, as well as the name of the bus on which they are registered.
    The mechanism behind this method is somewhat similar to must be enabled before using this method.

  • ShowCommandPalette(commands) -> (bus_name, command_palette_path)
    Takes an array of commands (structs of the form (path, label, accelerators)) and opens a command palette window displaying those commands. The returned object path references a control object registered on the returned bus name which provides signals on user interaction with the window.

Calls to these methods are processed by the Plotinus D-Bus service, which can be started with

plotinus

Examples

The following examples demonstrate how to use the D-Bus API from Python. They require pydbus to be installed and the Plotinus D-Bus service to be running.

Application remote control

#!/usr/bin/env python

import sys
from pydbus import SessionBus

bus = SessionBus()
plotinus = bus.get("com.worldwidemann.plotinus")

bus_name, command_paths = plotinus.GetCommands(sys.argv[1])
commands = [bus.get(bus_name, command_path) for command_path in command_paths]

for i, command in enumerate(commands):
  print("[%d] %s -> %s" % (i, " -> ".join(command.Path), command.Label))

index = raw_input("Number of command to execute: ")

if index:
  commands[int(index)].Execute()

Before running this example, enable window registration with

gsettings set com.worldwidemann.plotinus:/com/worldwidemann/plotinus/default/ dbus-enabled true

Then, run an application (e.g. gedit) with Plotinus enabled. Now run the script with the window object path as an argument, i.e.

./application_remote_control.py /org/gnome/gedit/window/1

Application launcher

Based on this Argos plugin, uses Plotinus' command palette to display a list of applications available on the system.

#!/usr/bin/env python

import os, re
from pydbus import SessionBus
from gi.repository import GLib, Gio

applications = {}

for app_info in Gio.AppInfo.get_all():
  categories = app_info.get_categories()
  if categories is None:
    continue
  # Remove "%U" and "%F" placeholders
  command_line = re.sub("%\\w", "", app_info.get_commandline()).strip()
  app = (app_info.get_name(), command_line)
  for category in categories.split(";"):
    if category not in ["GNOME", "GTK", ""]:
      if category not in applications:
        applications[category] = []
      applications[category].append(app)
      break

commands = []
command_lines = []

for category, apps in sorted(applications.items()):
  for app in sorted(apps):
    commands.append(([category], app[0], []))
    command_lines.append(app[1])

bus = SessionBus()
plotinus = bus.get("com.worldwidemann.plotinus")

bus_name, command_palette_path = plotinus.ShowCommandPalette(commands)
command_palette = bus.get(bus_name, command_palette_path)

loop = GLib.MainLoop()

def command_executed(index):
  os.system(command_lines[index])

command_palette.CommandExecuted.connect(command_executed)

def closed():
  # Wait for CommandExecuted signal
  GLib.timeout_add(500, loop.quit)

command_palette.Closed.connect(closed)

loop.run()

Acknowledgments

Documentation on GTK+ modules is essentially nonexisting. Without gtkparasite and gnome-globalmenu to learn from, it would have been a lot harder to get this project off the ground.

The CMake modules are copied verbatim from Elementary's pantheon-installer repository.

Vala is still the greatest thing ever to happen to Linux Desktop development.

Contributing

Contributors are always welcome. However, please file an issue describing what you intend to add before opening a pull request, especially for new features! I have a clear vision of what I want (and do not want) Plotinus to be, so discussing potential additions might help you avoid duplication and wasted work.

By contributing, you agree to release your changes under the same license as the rest of the project (see below).

License

Copyright © 2016-2017 Philipp Emanuel Weidmann ([email protected])

Released under the terms of the GNU General Public License, version 3

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].