citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

default.nix (785B)


      1 { pkgs        ? import <nixpkgs> {},
      2   stdenv      ? pkgs.stdenv,
      3   fetchurl    ? pkgs.fetchurl, 
      4   bash        ? pkgs.bash,
      5   xdotool     ? pkgs.xdotool,
      6   zenity      ? pkgs.gnome.zenity,
      7   writeScript ? pkgs.writeScript 
      8 }:
      9 let
     10   x11-rename-zen = writeScript "x11-rename-zen" ''
     11     #!${bash}/bin/bash
     12     name="$(${zenity}/bin/zenity --entry --text=name:)"
     13     ${xdotool}/bin/xdotool selectwindow set_window --name $name
     14   '';
     15 in
     16 stdenv.mkDerivation rec {
     17   pname = "x11-rename";
     18   version = "0.1";
     19 
     20   src = writeScript pname ''
     21     #!${bash}/bin/bash
     22     ${xdotool}/bin/xdotool selectwindow set_window --name "$1"
     23   '';
     24 
     25   phases = ["installPhase"];
     26 
     27   installPhase = ''
     28     mkdir -p $out/bin
     29     cp $src $out/bin/${pname}
     30     cp ${x11-rename-zen} $out/bin/x11-rename-zen
     31   '';
     32 }