dynamic-colors: 2013-12-28 -> 0.2.1
This commit is contained in:
parent
e6e7de082d
commit
c6a717d212
@ -257,6 +257,7 @@
|
||||
palo = "Ingolf Wanger <palipalo9@googlemail.com>";
|
||||
pashev = "Igor Pashev <pashev.igor@gmail.com>";
|
||||
pesterhazy = "Paulus Esterhazy <pesterhazy@gmail.com>";
|
||||
peterhoeg = "Peter Hoeg <peter@hoeg.com>";
|
||||
philandstuff = "Philip Potter <philip.g.potter@gmail.com>";
|
||||
phile314 = "Philipp Hausmann <nix@314.ch>";
|
||||
Phlogistique = "Noé Rubinstein <noe.rubinstein@gmail.com>";
|
||||
|
@ -1,37 +1,40 @@
|
||||
{ stdenv, fetchFromGitHub, makeWrapper, tmux, vim }:
|
||||
{ stdenv, fetchFromGitHub }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "dynamic-colors-git-${version}";
|
||||
version = "2013-12-28";
|
||||
name = "dynamic-colors-${version}";
|
||||
version = "0.2.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "sos4nt";
|
||||
owner = "peterhoeg";
|
||||
repo = "dynamic-colors";
|
||||
rev = "35325f43620c5ee11a56db776b8f828bc5ae1ddd";
|
||||
sha256 = "1xsjanqyvjlcj1fb8x4qafskxp7aa9b43ba9gyjgzr7yz8hkl4iz";
|
||||
rev = "v${version}";
|
||||
sha256 = "061lh4qjk4671hwzmj55n3gy5hsi4p3hb30hj5bg3s6glcsbjpr5";
|
||||
};
|
||||
|
||||
buildInputs = [ makeWrapper ];
|
||||
|
||||
patches = [ ./separate-config-and-dynamic-root-path.patch ];
|
||||
dontBuild = true;
|
||||
dontStrip = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin $out/etc/bash_completion.d $out/share/dynamic-colors
|
||||
cp bin/dynamic-colors $out/bin/
|
||||
cp completions/dynamic-colors.bash $out/etc/bash_completion.d/
|
||||
cp -r colorschemes $out/share/dynamic-colors/
|
||||
mkdir -p \
|
||||
$out/bin \
|
||||
$out/share/colorschemes \
|
||||
$out/share/bash-completion/completions \
|
||||
$out/share/zsh/site-packages
|
||||
|
||||
sed -e 's|\<tmux\>|${tmux}/bin/tmux|g' \
|
||||
-e 's|/usr/bin/vim|${vim}/bin/vim|g' \
|
||||
-i "$out/bin/dynamic-colors"
|
||||
install -m755 bin/dynamic-colors $out/bin/
|
||||
install -m644 completions/dynamic-colors.bash $out/share/bash-completion/completions/dynamic-colors
|
||||
install -m644 completions/dynamic-colors.zsh $out/share/zsh/site-packages/_dynamic-colors
|
||||
install -m644 colorschemes/* -t $out/share/colorschemes
|
||||
|
||||
wrapProgram $out/bin/dynamic-colors --set DYNAMIC_COLORS_ROOT "$out/share/dynamic-colors"
|
||||
sed -e "s|/usr/share/dynamic-colors|$out/share|g" \
|
||||
-i $out/bin/dynamic-colors
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = https://github.com/sos4nt/dynamic-colors;
|
||||
homepage = https://github.com/peterhoeg/dynamic-colors;
|
||||
license = stdenv.lib.licenses.mit;
|
||||
description = "Change terminal colors on the fly";
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
maintainers = [ stdenv.lib.maintainers.peterhoeg ];
|
||||
};
|
||||
}
|
||||
|
@ -1,58 +0,0 @@
|
||||
From ee44b859003972275d8e469ab41b9900420295e0 Mon Sep 17 00:00:00 2001
|
||||
From: Malte Rohde <malte.rohde@flavoursys.com>
|
||||
Date: Fri, 9 Jan 2015 13:10:41 +0100
|
||||
Subject: [PATCH] Store user configuration in appropriate config location.
|
||||
|
||||
So that the dynamic-colors source can live somewhere else
|
||||
(e.g., /usr/local/dynamic-colors) and multiple users
|
||||
can use the same script.
|
||||
---
|
||||
bin/dynamic-colors | 21 ++++++++++++++++-----
|
||||
1 file changed, 16 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/bin/dynamic-colors b/bin/dynamic-colors
|
||||
index a669221..5d6bce7 100755
|
||||
--- a/bin/dynamic-colors
|
||||
+++ b/bin/dynamic-colors
|
||||
@@ -84,16 +84,27 @@ else
|
||||
fi
|
||||
COLORSCHEMES="${DYNAMIC_COLORS_ROOT}/colorschemes"
|
||||
|
||||
+if [ -z "${DYNAMIC_COLORS_HOME}" ]; then
|
||||
+ if [ -d "${HOME}/.dynamic-colors" ] || [ -z "${XDG_CONFIG_HOME}" ]; then
|
||||
+ DYNAMIC_COLORS_HOME="${HOME}/.dynamic-colors"
|
||||
+ else
|
||||
+ DYNAMIC_COLORS_HOME="${XDG_CONFIG_HOME}/dynamic-colors"
|
||||
+ fi
|
||||
+else
|
||||
+ DYNAMIC_COLORS_HOME="${DYNAMIC_COLORS_HOME%/}"
|
||||
+fi
|
||||
+
|
||||
write_colorscheme_name () {
|
||||
- echo "$1" > "${DYNAMIC_COLORS_ROOT}/colorscheme"
|
||||
+ [ ! -d "${DYNAMIC_COLORS_HOME}" ] && mkdir -p "${DYNAMIC_COLORS_HOME}"
|
||||
+ echo "$1" > "${DYNAMIC_COLORS_HOME}/colorscheme"
|
||||
}
|
||||
|
||||
load_colorscheme_name () {
|
||||
- head -1 "${DYNAMIC_COLORS_ROOT}/colorscheme"
|
||||
+ head -1 "${DYNAMIC_COLORS_HOME}/colorscheme"
|
||||
}
|
||||
|
||||
init () {
|
||||
- [ ! -f "${DYNAMIC_COLORS_ROOT}/colorscheme" ] && return
|
||||
+ [ ! -f "${DYNAMIC_COLORS_HOME}/colorscheme" ] && return
|
||||
colorscheme_name=$(load_colorscheme_name)
|
||||
load_colorscheme "$colorscheme_name"
|
||||
set_colors
|
||||
@@ -142,8 +153,8 @@ audit () {
|
||||
}
|
||||
|
||||
cycle() {
|
||||
- if [ -f "${DYNAMIC_COLORS_ROOT}/colorscheme" ]; then
|
||||
- current=`head -1 "${DYNAMIC_COLORS_ROOT}/colorscheme"`
|
||||
+ if [ -f "${DYNAMIC_COLORS_HOME}/colorscheme" ]; then
|
||||
+ current=$(load_colorscheme_name)
|
||||
found=false
|
||||
cd "$COLORSCHEMES"
|
||||
for file in *.sh; do
|
Loading…
Reference in New Issue
Block a user