diff options
author | Sam Parkinson <sam@sam.today> | 2018-02-15 07:34:50 +1100 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2018-02-14 22:25:12 +0100 |
commit | 16fa6f59f77fd635665ba719e278bc673ceb1d9e (patch) | |
tree | 9e615fc3fc7435a525308a0f672b64afc4ba7f3f /nixos | |
parent | 8f316ff3981269c6ee51eb36422b095eac079e4d (diff) | |
download | nixpkgs-16fa6f59f77fd635665ba719e278bc673ceb1d9e.tar nixpkgs-16fa6f59f77fd635665ba719e278bc673ceb1d9e.tar.gz nixpkgs-16fa6f59f77fd635665ba719e278bc673ceb1d9e.tar.bz2 nixpkgs-16fa6f59f77fd635665ba719e278bc673ceb1d9e.tar.lz nixpkgs-16fa6f59f77fd635665ba719e278bc673ceb1d9e.tar.xz nixpkgs-16fa6f59f77fd635665ba719e278bc673ceb1d9e.tar.zst nixpkgs-16fa6f59f77fd635665ba719e278bc673ceb1d9e.zip |
nixos/plotinus: add module to enable plotinus
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/programs/plotinus.nix | 36 | ||||
-rw-r--r-- | nixos/modules/programs/plotinus.xml | 25 | ||||
-rw-r--r-- | nixos/release.nix | 1 | ||||
-rw-r--r-- | nixos/tests/plotinus.nix | 27 |
5 files changed, 90 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index d8d6749f796..4c8da8e12bf 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -92,6 +92,7 @@ ./programs/nano.nix ./programs/npm.nix ./programs/oblogout.nix + ./programs/plotinus.nix ./programs/qt5ct.nix ./programs/rootston.nix ./programs/screen.nix diff --git a/nixos/modules/programs/plotinus.nix b/nixos/modules/programs/plotinus.nix new file mode 100644 index 00000000000..065e72d6c37 --- /dev/null +++ b/nixos/modules/programs/plotinus.nix @@ -0,0 +1,36 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.programs.plotinus; +in +{ + meta = { + maintainers = pkgs.plotinus.meta.maintainers; + doc = ./plotinus.xml; + }; + + ###### interface + + options = { + programs.plotinus = { + enable = mkOption { + default = false; + description = '' + Whether to enable the Plotinus GTK+3 plugin. Plotinus provides a + popup (triggered by Ctrl-Shift-P) to search the menus of a + compatible application. + ''; + type = types.bool; + }; + }; + }; + + ###### implementation + + config = mkIf cfg.enable { + environment.variables.XDG_DATA_DIRS = [ "${pkgs.plotinus}/share/gsettings-schemas/${pkgs.plotinus.name}" ]; + environment.variables.GTK3_MODULES = [ "${pkgs.plotinus}/lib/libplotinus.so" ]; + }; +} diff --git a/nixos/modules/programs/plotinus.xml b/nixos/modules/programs/plotinus.xml new file mode 100644 index 00000000000..85b0e023e6c --- /dev/null +++ b/nixos/modules/programs/plotinus.xml @@ -0,0 +1,25 @@ +<chapter xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:xi="http://www.w3.org/2001/XInclude" + version="5.0" + xml:id="module-program-plotinus"> + +<title>Plotinus</title> + +<para><emphasis>Source:</emphasis> <filename>modules/programs/plotinus.nix</filename></para> + +<para><emphasis>Upstream documentation:</emphasis> <link xlink:href="https://github.com/p-e-w/plotinus"/></para> + +<para>Plotinus is a searchable command palette in every modern GTK+ application.</para> + +<para>When in a GTK+3 application and Plotinus is enabled, you can press <literal>Ctrl+Shift+P</literal> to open the command palette. The command palette provides a searchable list of of all menu items in the application.</para> + +<para>To enable Plotinus, add the following to your <filename>configuration.nix</filename>: + +<programlisting> +programs.plotinus.enable = true; +</programlisting> + +</para> + +</chapter> diff --git a/nixos/release.nix b/nixos/release.nix index e473a080424..4cae07dd99a 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -277,6 +277,7 @@ in rec { tests.ipv6 = callTest tests/ipv6.nix {}; tests.jenkins = callTest tests/jenkins.nix {}; tests.plasma5 = callTest tests/plasma5.nix {}; + tests.plotinus = callTest tests/plotinus.nix {}; tests.keymap = callSubTests tests/keymap.nix {}; tests.initrdNetwork = callTest tests/initrd-network.nix {}; tests.kafka_0_9 = callTest tests/kafka_0_9.nix {}; diff --git a/nixos/tests/plotinus.nix b/nixos/tests/plotinus.nix new file mode 100644 index 00000000000..557d65f7960 --- /dev/null +++ b/nixos/tests/plotinus.nix @@ -0,0 +1,27 @@ +import ./make-test.nix ({ pkgs, ... }: { + name = "plotinus"; + meta = { + maintainers = pkgs.plotinus.meta.maintainers; + }; + + machine = + { config, pkgs, ... }: + + { imports = [ ./common/x11.nix ]; + programs.plotinus.enable = true; + environment.systemPackages = [ pkgs.gnome3.gnome-calculator pkgs.xdotool ]; + }; + + testScript = + '' + $machine->waitForX; + $machine->execute("xterm -e 'gnome-calculator' &"); + $machine->waitForWindow(qr/Calculator/); + $machine->execute("xdotool key ctrl+shift+p"); + $machine->sleep(1); # wait for the popup + $machine->execute("xdotool key p r e f e r e n c e s Return"); + $machine->waitForWindow(qr/Preferences/); + $machine->screenshot("screen"); + ''; + +}) |