From 44d90b0619e4c5bed89e3cdc4ffda111d11a678b Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Fri, 8 May 2020 12:45:02 -0300 Subject: [PATCH] tinywm: init at 2014-04-22 A tiny window manger for X11 --- .../services/x11/window-managers/default.nix | 1 + .../services/x11/window-managers/tinywm.nix | 25 +++++++++ .../window-managers/tinywm/default.nix | 51 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 4 files changed, 79 insertions(+) create mode 100644 nixos/modules/services/x11/window-managers/tinywm.nix create mode 100644 pkgs/applications/window-managers/tinywm/default.nix diff --git a/nixos/modules/services/x11/window-managers/default.nix b/nixos/modules/services/x11/window-managers/default.nix index 04a9fc46628c..b815c5f16a1e 100644 --- a/nixos/modules/services/x11/window-managers/default.nix +++ b/nixos/modules/services/x11/window-managers/default.nix @@ -30,6 +30,7 @@ in ./sawfish.nix ./stumpwm.nix ./spectrwm.nix + ./tinywm.nix ./twm.nix ./windowmaker.nix ./wmii.nix diff --git a/nixos/modules/services/x11/window-managers/tinywm.nix b/nixos/modules/services/x11/window-managers/tinywm.nix new file mode 100644 index 000000000000..8e5d9b9170ca --- /dev/null +++ b/nixos/modules/services/x11/window-managers/tinywm.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.xserver.windowManager.tinywm; +in +{ + ###### interface + options = { + services.xserver.windowManager.tinywm.enable = mkEnableOption "tinywm"; + }; + + ###### implementation + config = mkIf cfg.enable { + services.xserver.windowManager.session = singleton { + name = "tinywm"; + start = '' + ${pkgs.tinywm}/bin/tinywm & + waitPID=$! + ''; + }; + environment.systemPackages = [ pkgs.tinywm ]; + }; +} diff --git a/pkgs/applications/window-managers/tinywm/default.nix b/pkgs/applications/window-managers/tinywm/default.nix new file mode 100644 index 000000000000..0e30857267bd --- /dev/null +++ b/pkgs/applications/window-managers/tinywm/default.nix @@ -0,0 +1,51 @@ +{ stdenv, fetchFromGitHub +, libX11 }: + +stdenv.mkDerivation rec { + pname = "tinywm"; + version = "2014-04-22"; + + src = fetchFromGitHub { + owner = "mackstann"; + repo = pname; + rev = "9d05612f41fdb8bc359f1fd9cc930bf16315abb1"; + sha256 = "1s7r4f2d3lk1i8h089v2vyrr02hh0y9i3ihl9kqgk9s87hqw8q5b"; + }; + + buildInputs = [ libX11 ]; + + dontConfigure = true; + + buildPhase = '' + ${stdenv.cc}/bin/cc -Wall -pedantic -I${libX11}/include tinywm.c -L${libX11}/lib -lX11 -o tinywm + ''; + + installPhase = '' + install -dm755 $out/bin $out/share/doc/${pname}-${version} + install -m755 tinywm -t $out/bin/ + # The annotated source code is a piece of documentation + install -m644 annotated.c README -t $out/share/doc/${pname}-${version} + ''; + + meta = with stdenv.lib;{ + description = "A tiny window manger for X11"; + longDescription = '' + + TinyWM is a tiny window manager that I created as an exercise in + minimalism. It is also maybe helpful in learning some of the very basics + of creating a window manager. It is only around 50 lines of C. There is + also a Python version using python-xlib. + + It lets you do four basic things: + + - Move windows interactively with Alt+Button1 drag (left mouse button) + - Resize windows interactively with Alt+Button3 drag (right mouse button) + - Raise windows with Alt+F1 (not high on usability I know, but I needed a + keybinding in there somewhere) + - Focus windows with the mouse pointer (X does this on its own) + ''; + homepage = "http://incise.org/tinywm.html"; + maintainers = with maintainers; [ AndersonTorres ]; + platforms = libX11.meta.platforms; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4d4823890791..0aea30459105 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22223,6 +22223,8 @@ in trayer = callPackage ../applications/window-managers/trayer { }; + tinywm = callPackage ../applications/window-managers/tinywm { }; + tree-from-tags = callPackage ../applications/audio/tree-from-tags { }; tdrop = callPackage ../applications/misc/tdrop { };