diff --git a/pkgs/q/default.nix b/pkgs/q/default.nix index 41aa8c6..3dfbcab 100644 --- a/pkgs/q/default.nix +++ b/pkgs/q/default.nix @@ -6,7 +6,7 @@ let - hrule = ''${pkgs.terminal-tools}/bin/hrule''; + hrule = "${pkgs.terminal-tools}/bin/hrule"; q-cal = let @@ -78,34 +78,27 @@ let ' ''; - q-timeZoneDate = zone: + q-timeZoneDate = size: zone: let dateString = comment: "'+%Y-%m-%dT[;38;5;${ toString timeColor }m%H:%M:%S[;38;5;${toString timeZoneColor}m%:z ${comment}' "; timeZoneVariable = lib.optionalString (zone != null) "TZ=${zone}"; - comment = lib.optionalString (zone != null) " : ${zone}"; + comment = lib.optionalString (zone != null) + " : ${lib.fixedWidthString size " " zone}"; # sh in '' - ${timeZoneVariable} ${pkgs.coreutils}/bin/date ${dateString comment} + ${timeZoneVariable} ${pkgs.coreutils}/bin/date ${ + dateString comment + } | ${pkgs.terminal-tools}/bin/center ''; q-timeZoneDates = if timeZones == [ ] then - q-timeZoneDate null + q-timeZoneDate 0 null else - lib.concatMapStringsSep "\n" q-timeZoneDate timeZones; - - q-gitdir = '' - if test -d .git; then - #git status --porcelain - branch=$( - ${pkgs.git}/bin/git branch \ - | ${pkgs.gnused}/bin/sed -rn 's/^\* (.*)/\1/p' - ) - echo "± $LOGNAME@''${HOSTNAME-$(${pkgs.nettools}/bin/hostname)}:$PWD .git $branch" - fi - ''; + let size = lib.foldr lib.max 0 (map builtins.stringLength timeZones); + in lib.concatMapStringsSep "\n" (q-timeZoneDate size) timeZones; q-intel_backlight = '' cd /sys/class/backlight/intel_backlight diff --git a/pkgs/terminal-tools/default.nix b/pkgs/terminal-tools/default.nix index 2d5aa3c..07af407 100644 --- a/pkgs/terminal-tools/default.nix +++ b/pkgs/terminal-tools/default.nix @@ -7,8 +7,9 @@ rustPlatform.buildRustPackage rec { #src = ./.; src = fetchgit { url = "https://git.ingolf-wagner.de/palo/terminal-tools"; - rev = "e77560d04aa6b86da2a8dc235c7168ca9cdd7d45"; - sha256 = "087cp0m42x3rjkkhh3zi48ahz4qkavr7lgc9fy299m9gjy6alb7p"; + rev = "816cfd8eae8f8136437e4076116e0267c6a6eb0d"; + sha256 = "07zf716wy0rqpzwj580haw935lj5ih0wzhfn26dq83kf9nm09iyg"; + }; cargoSha256 = "0dgbw6idlzzpgljv0lxavimh1h8qlib0qrcn92f5imy6a12phrmm";