lol

Makes a .desktop startup item from a .desktop menu entry.

svn path=/nixpkgs/trunk/; revision=31958

+34
+34
pkgs/build-support/make-startupitem/default.nix
··· 1 + # given a pakcage with a $name.desktop file, makes a copy 2 + # as autostart item. 3 + 4 + {stdenv, lib}: 5 + { name # name of the desktop file (without .desktop) 6 + , package # package where the desktop file resides in 7 + , after ? null 8 + , condition ? null 9 + , phase ? "2" 10 + }: 11 + 12 + # the builder requires that 13 + # $package/share/applications/$name.desktop 14 + # exists as file. 15 + 16 + stdenv.mkDerivation { 17 + name = "autostart-${name}"; 18 + priority = 5; 19 + 20 + buildCommand = '' 21 + ensureDir $out/share/autostart 22 + target=${name}.desktop 23 + cp ${package}/share/applications/${name}.desktop $target 24 + chmod +rw $target 25 + echo "X-KDE-autostart-phase=${phase}" >> $target 26 + ${lib.optionalString (after != null) ''echo "${after}" >> $target''} 27 + ${lib.optionalString (condition != null) ''echo "${condition}" >> $target''} 28 + cp $target $out/share/autostart 29 + ''; 30 + 31 + # this will automatically put 'package' in the environment when you 32 + # put its startup item in there. 33 + propagatedBuildInputs = [ package ]; 34 + }