summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Desbrieres <aurelien@hackers.camp>2014-12-19 18:42:40 +0100
committerAurelien Desbrieres <aurelien@hackers.camp>2014-12-19 18:42:40 +0100
commit5a9d7f349389ea70e03d430b46186ddda98f68a8 (patch)
tree6a20dd732c9ddf92a589918915fcda43562f590c
parentba43f4fcd2d95db238c728eae98b318de564bf67 (diff)
parente72d299db015781d748003eaf5ac8e5a8126dae9 (diff)
downloadabslibre-5a9d7f349389ea70e03d430b46186ddda98f68a8.tar.gz
abslibre-5a9d7f349389ea70e03d430b46186ddda98f68a8.tar.bz2
abslibre-5a9d7f349389ea70e03d430b46186ddda98f68a8.zip
Ncurses BitTorrent client based on libTorrent with color patch.
-rw-r--r--libre/icecat/PKGBUILD10
-rw-r--r--libre/icecat/devtools-appmanager.patch17
-rw-r--r--libre/iceweasel/PKGBUILD12
-rw-r--r--libre/iceweasel/devtools-appmanager-webide.patch53
-rw-r--r--libre/iceweasel/vendor.js8
-rw-r--r--pcr/rtorrent-color/PKGBUILD43
-rw-r--r--pcr/rtorrent-color/rtorrent-0.9.4_color.patch446
-rw-r--r--pcr/rtorrent-color/rtorrent-color.install27
8 files changed, 602 insertions, 14 deletions
diff --git a/libre/icecat/PKGBUILD b/libre/icecat/PKGBUILD
index 1104ce030..239b3d477 100644
--- a/libre/icecat/PKGBUILD
+++ b/libre/icecat/PKGBUILD
@@ -40,7 +40,8 @@ source=("http://ftp.gnu.org/gnu/gnuzilla/$pkgver/$pkgname-$pkgver.tar.xz"
$pkgname-install-dir.patch
vendor.js
rhbz-966424.patch
- $pkgname-fixed-loading-icon.png)
+ $pkgname-fixed-loading-icon.png
+ devtools-appmanager.patch)
md5sums=('52f310b515cf185636e889d55f9d615d'
'6674e0f2468787444c0a0a3e5da22934'
'df08eaa1ac3bc6c2356be4fbf8ec8932'
@@ -50,7 +51,8 @@ md5sums=('52f310b515cf185636e889d55f9d615d'
'7b2213f23f7dec017f67257b9fd2780f'
'afafa89b727642c33ade82f2ffbe64a7'
'16a112aaeee34ff3cae1fc1a521448a0'
- '6e335a517c68488941340ee1c23f97b0')
+ '6e335a517c68488941340ee1c23f97b0'
+ 'e2048a522e989e3c7da1674d4a6ffca0')
prepare() {
export GNU_BUILD="gnuzilla-release"
@@ -58,7 +60,9 @@ prepare() {
mv $pkgname-$pkgver "$srcdir/$GNU_BUILD"
cd "$srcdir/$GNU_BUILD"
-
+ # Disable appmanager
+ # Note: to enable appmanager is necessary to use a 100% free "Firefox OS" distribution and ADBHelper Parabola package.
+ patch -Np1 -i "$srcdir/devtools-appmanager.patch"
# Put gnu_headshadow.png on the source code
install -m644 "$srcdir/gnu_headshadow.png" \
diff --git a/libre/icecat/devtools-appmanager.patch b/libre/icecat/devtools-appmanager.patch
new file mode 100644
index 000000000..0770abc31
--- /dev/null
+++ b/libre/icecat/devtools-appmanager.patch
@@ -0,0 +1,17 @@
+diff -Nur a/browser/app/profile/icecat.js b/browser/app/profile/icecat.js
+--- a/browser/app/profile/icecat.js 2014-10-21 09:53:09.000000000 -0200
++++ b/browser/app/profile/icecat.js 2014-12-19 14:33:04.453900819 -0200
+@@ -1235,9 +1235,10 @@
+ pref("devtools.commands.dir", "");
+
+ // Enable the app manager
+-pref("devtools.appmanager.enabled", true);
+-pref("devtools.appmanager.lastTab", "help");
+-pref("devtools.appmanager.manifestEditor.enabled", true);
++// Note: to enable appmanager is necessary to use a 100% free "Firefox OS" distribution.
++pref("devtools.appmanager.enabled", false);
++pref("devtools.appmanager.lastTab", "");
++pref("devtools.appmanager.manifestEditor.enabled", false);
+
+ // Toolbox preferences
+ pref("devtools.toolbox.footer.height", 250);
diff --git a/libre/iceweasel/PKGBUILD b/libre/iceweasel/PKGBUILD
index 3e448309e..cea378297 100644
--- a/libre/iceweasel/PKGBUILD
+++ b/libre/iceweasel/PKGBUILD
@@ -52,7 +52,8 @@ source=("$_debrepo/`debfile $_debname`_$_debver.orig.tar.bz2"
$pkgname-install-dir.patch
vendor.js
rhbz-966424.patch
- $pkgname-fixed-loading-icon.png)
+ $pkgname-fixed-loading-icon.png
+ devtools-appmanager-webide.patch)
md5sums=('67c5ab2f4551c2743e70a3bcb041bf66'
'5d72813950fdcf47a38b2f0eb7ebe33d'
'5eca2c1dbdd9c043b24de39cd05d6e8f'
@@ -60,9 +61,10 @@ md5sums=('67c5ab2f4551c2743e70a3bcb041bf66'
'b03a979a78484503ba8dddad4f2c96d1'
'fd8f61f2ae44e5b0e0b2c7b433695980'
'1c42509891cf6843660a5f3c69896e80'
- '01d3f73ccc5153182ac07b2d14b54fa6'
+ '2e99ba1f020a4bae19260f4c321cf97d'
'16a112aaeee34ff3cae1fc1a521448a0'
- '6e335a517c68488941340ee1c23f97b0')
+ '6e335a517c68488941340ee1c23f97b0'
+ '5e00db4323ee0191a8c0d68b4c6795f6')
prepare() {
export DEBIAN_BUILD="mozilla-release"
@@ -78,6 +80,10 @@ prepare() {
rm -v debian/patches/l10n/Place-google-and-gmail-before-yandex.patch || true
quilt push -av
+
+ # Disable appmanager/webide
+ # Note: to enable appmanager/webide is necessary to use a 100% free "Firefox OS" distribution and ADBHelper Parabola package.
+ patch -Np1 -i "$srcdir/devtools-appmanager-webide.patch"
# Put gnu_headshadow.png on the source code
install -m644 "$srcdir/gnu_headshadow.png" \
diff --git a/libre/iceweasel/devtools-appmanager-webide.patch b/libre/iceweasel/devtools-appmanager-webide.patch
new file mode 100644
index 000000000..373c34ceb
--- /dev/null
+++ b/libre/iceweasel/devtools-appmanager-webide.patch
@@ -0,0 +1,53 @@
+diff -Nur mozilla-release.orig/browser/app/profile/firefox.js mozilla-release/browser/app/profile/firefox.js
+--- mozilla-release.orig/browser/app/profile/firefox.js 2014-11-26 00:17:06.000000000 -0200
++++ mozilla-release/browser/app/profile/firefox.js 2014-12-19 13:30:18.447609374 -0200
+@@ -1303,12 +1303,14 @@
+ pref("devtools.commands.dir", "");
+
+ // Enable the app manager
+-pref("devtools.appmanager.enabled", true);
+-pref("devtools.appmanager.lastTab", "help");
+-pref("devtools.appmanager.manifestEditor.enabled", true);
++// Note: to enable appmanager is necessary to use a 100% free "Firefox OS" distribution.
++pref("devtools.appmanager.enabled", false);
++pref("devtools.appmanager.lastTab", "");
++pref("devtools.appmanager.manifestEditor.enabled", false);
+
+ // Enable DevTools WebIDE by default
+-pref("devtools.webide.enabled", true);
++// Note: to enable webide is necessary to use a 100% free "Firefox OS" distribution and ADBHelper Parabola package.
++pref("devtools.webide.enabled", false);
+
+ // Toolbox preferences
+ pref("devtools.toolbox.footer.height", 250);
+diff -Nur mozilla-release.orig/browser/devtools/webide/webide-prefs.js mozilla-release/browser/devtools/webide/webide-prefs.js
+--- mozilla-release.orig/browser/devtools/webide/webide-prefs.js 2014-11-26 00:17:07.000000000 -0200
++++ mozilla-release/browser/devtools/webide/webide-prefs.js 2014-12-19 13:30:28.444671229 -0200
+@@ -2,16 +2,17 @@
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
++# Note: to enable webide is necessary to use a 100% free "Firefox OS" distribution and ADBHelper Parabola package.
+
+-pref("devtools.webide.showProjectEditor", true);
+-pref("devtools.webide.templatesURL", "https://code.cdn.mozilla.net/templates/list.json");
+-pref("devtools.webide.autoinstallADBHelper", true);
++pref("devtools.webide.showProjectEditor", false);
++pref("devtools.webide.templatesURL", "");
++pref("devtools.webide.autoinstallADBHelper", false);
+ pref("devtools.webide.lastprojectlocation", "");
+-pref("devtools.webide.restoreLastProject", true);
++pref("devtools.webide.restoreLastProject", false);
+ pref("devtools.webide.enableLocalRuntime", false);
+-pref("devtools.webide.addonsURL", "https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/index.json");
+-pref("devtools.webide.simulatorAddonsURL", "https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/#VERSION#/#OS#/fxos_#SLASHED_VERSION#_simulator-#OS#-latest.xpi");
+-pref("devtools.webide.simulatorAddonID", "fxos_#SLASHED_VERSION#_simulator@mozilla.org");
+-pref("devtools.webide.adbAddonURL", "https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/adb-helper/#OS#/adbhelper-#OS#-latest.xpi");
+-pref("devtools.webide.adbAddonID", "adbhelper@mozilla.org");
+-pref("devtools.webide.monitorWebSocketURL", "ws://localhost:9000");
++pref("devtools.webide.addonsURL", "");
++pref("devtools.webide.simulatorAddonsURL", "");
++pref("devtools.webide.simulatorAddonID", "");
++pref("devtools.webide.adbAddonURL", "");
++pref("devtools.webide.adbAddonID", "");
++pref("devtools.webide.monitorWebSocketURL", "");
diff --git a/libre/iceweasel/vendor.js b/libre/iceweasel/vendor.js
index f84f623d2..fd7a153b5 100644
--- a/libre/iceweasel/vendor.js
+++ b/libre/iceweasel/vendor.js
@@ -44,11 +44,3 @@ pref("media.gmp-manager.url.override", "data:text/plain,");
// Disable openh264.
pref("media.gmp-gmpopenh264.provider.enabled", false);
-
-// Make sure that WebIDE avoid installing nonfree Firefox OS in development tools
-pref("devtools.webide.adbAddonID"; "");
-pref("devtools.webide.adbAddonURL"; "");
-pref("devtools.webide.addonsURL"; "");
-pref("devtools.webide.autoinstallADBHelper"; "false");
-pref("devtools.webide.simulatorAddonID"; "");
-pref("devtools.webide.simulatorAddonsURL"; "");
diff --git a/pcr/rtorrent-color/PKGBUILD b/pcr/rtorrent-color/PKGBUILD
new file mode 100644
index 000000000..2016108f1
--- /dev/null
+++ b/pcr/rtorrent-color/PKGBUILD
@@ -0,0 +1,43 @@
+# Maintainer : Aurelien Desbrieres <aurelien@hackers.camp>
+# Contributor: KopfKrieg <archlinux [at] absolem [dot] cc>
+# Contributor: Ashren <edgar [at] archlinux [dot] us>
+# Contributor: Lucky <archlinux@builds.lucky.li> and Hleem
+# Based on rtorrent-color from AUR
+
+pkgname=rtorrent-color
+_pkgname="rtorrent"
+#_pkgname="${pkgname%-*}" not supported by AUR ;)
+pkgver=0.9.4
+pkgrel=2
+pkgdesc="Ncurses BitTorrent client based on libTorrent with color patch."
+url="http://libtorrent.rakshasa.no"
+arch=("i686" "x86_64")
+license=("GPL")
+depends=("curl" "libtorrent=0.13.4" "xmlrpc-c" "libsigc++")
+conflicts=("${_pkgname}")
+provides=("${_pkgname}")
+install="${pkgname}.install"
+source=("${url}/downloads/${_pkgname}-${pkgver}.tar.gz"
+ "${_pkgname}-${pkgver}_color.patch")
+
+build() {
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+
+ patch -uNp1 -i "${srcdir}/${_pkgname}-${pkgver}_color.patch"
+
+ export CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
+ ./configure \
+ --prefix=/usr \
+ --enable-debug \
+ --with-xmlrpc-c \
+
+ make
+}
+
+package() {
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+
+ make DESTDIR="${pkgdir}" install
+
+ install -Dm644 doc/rtorrent.rc "${pkgdir}/usr/share/doc/rtorrent/rtorrent.rc"
+}
diff --git a/pcr/rtorrent-color/rtorrent-0.9.4_color.patch b/pcr/rtorrent-color/rtorrent-0.9.4_color.patch
new file mode 100644
index 000000000..9595b83fa
--- /dev/null
+++ b/pcr/rtorrent-color/rtorrent-0.9.4_color.patch
@@ -0,0 +1,446 @@
+diff --git a/src/command_network.cc b/src/command_network.cc
+index c445c38..24ad5c0 100644
+--- a/src/command_network.cc
++++ b/src/command_network.cc
+@@ -241,6 +241,26 @@ initialize_command_network() {
+ CMD2_ANY ("strings.connection_type", tr1::bind(&torrent::option_list_strings, torrent::OPTION_CONNECTION_TYPE));
+ CMD2_ANY ("strings.encryption", tr1::bind(&torrent::option_list_strings, torrent::OPTION_ENCRYPTION));
+
++ CMD2_ANY ("colors.color_inactive_fg", tr1::bind(&ui::Root::get_color_inactive_fg, control->ui()));
++ CMD2_ANY_VALUE_V ("colors.color_inactive_fg.set", tr1::bind(&ui::Root::set_color_inactive_fg, control->ui(), tr1::placeholders::_2));
++ CMD2_ANY ("colors.color_inactive_bg", tr1::bind(&ui::Root::get_color_inactive_bg, control->ui()));
++ CMD2_ANY_VALUE_V ("colors.color_inactive_bg.set", tr1::bind(&ui::Root::set_color_inactive_bg, control->ui(), tr1::placeholders::_2));
++
++ CMD2_ANY ("colors.color_dead_fg", tr1::bind(&ui::Root::get_color_dead_fg, control->ui()));
++ CMD2_ANY_VALUE_V ("colors.color_dead_fg.set", tr1::bind(&ui::Root::set_color_dead_fg, control->ui(), tr1::placeholders::_2));
++ CMD2_ANY ("colors.color_dead_bg", tr1::bind(&ui::Root::get_color_dead_bg, control->ui()));
++ CMD2_ANY_VALUE_V ("colors.color_dead_bg.set", tr1::bind(&ui::Root::set_color_dead_bg, control->ui(), tr1::placeholders::_2));
++
++ CMD2_ANY ("colors.color_active_fg", tr1::bind(&ui::Root::get_color_active_fg, control->ui()));
++ CMD2_ANY_VALUE_V ("colors.color_active_fg.set", tr1::bind(&ui::Root::set_color_active_fg, control->ui(), tr1::placeholders::_2));
++ CMD2_ANY ("colors.color_active_bg", tr1::bind(&ui::Root::get_color_active_bg, control->ui()));
++ CMD2_ANY_VALUE_V ("colors.color_active_bg.set", tr1::bind(&ui::Root::set_color_active_bg, control->ui(), tr1::placeholders::_2));
++
++ CMD2_ANY ("colors.color_finished_fg", tr1::bind(&ui::Root::get_color_finished_fg, control->ui()));
++ CMD2_ANY_VALUE_V ("colors.color_finished_fg.set", tr1::bind(&ui::Root::set_color_finished_fg, control->ui(), tr1::placeholders::_2));
++ CMD2_ANY ("colors.color_finished_bg", tr1::bind(&ui::Root::get_color_finished_bg, control->ui()));
++ CMD2_ANY_VALUE_V ("colors.color_finished_bg.set", tr1::bind(&ui::Root::set_color_finished_bg, control->ui(), tr1::placeholders::_2));
++
+ // CMD2_ANY_STRING ("encoding_list", tr1::bind(&apply_encoding_list, tr1::placeholders::_2));
+ CMD2_ANY_STRING ("encoding.add", tr1::bind(&apply_encoding_list, tr1::placeholders::_2));
+
+diff --git a/src/display/canvas.cc b/src/display/canvas.cc
+index 31db4ad..255e7c3 100644
+--- a/src/display/canvas.cc
++++ b/src/display/canvas.cc
+@@ -99,6 +99,12 @@ Canvas::initialize() {
+ m_isInitialized = true;
+
+ initscr();
++ start_color();
++ use_default_colors();
++ init_pair(4, -1, -1);
++ init_pair(3, -1, -1);
++ init_pair(2, -1, -1);
++ init_pair(1, -1, -1);
+ raw();
+ noecho();
+ nodelay(stdscr, TRUE);
+diff --git a/src/display/window_download_list.cc b/src/display/window_download_list.cc
+index ead4ddd..ffd79c9 100644
+--- a/src/display/window_download_list.cc
++++ b/src/display/window_download_list.cc
+@@ -37,6 +37,7 @@
+ #include "config.h"
+
+ #include <rak/algorithm.h>
++#include <torrent/rate.h>
+
+ #include "core/download.h"
+ #include "core/view.h"
+@@ -104,9 +105,41 @@ WindowDownloadList::redraw() {
+ char buffer[m_canvas->width() + 1];
+ char* last = buffer + m_canvas->width() - 2 + 1;
+
++ /*
++ There are four states where colors are applied:
++ 1 inactive # If inactive, e.g. user stopped down/upload
++ 2 dead # If active but no down/upload
++ 3 active # If active and download
++ 4 finished # If finished
++ */
++
+ print_download_title(buffer, last, *range.first);
+- m_canvas->print(0, pos++, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer);
+-
++ m_canvas->print(0, pos, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer);
++ if( (*range.first)->is_done() ) {
++ if( (*range.first)->download()->info()->up_rate()->rate() != 0 ) {
++ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_BOLD, 4); // Finished and uploading
++ } else {
++ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_NORMAL, 4); // Finished
++ }
++ } else if( (*range.first)->is_active() ) {
++ if( (*range.first)->download()->info()->down_rate()->rate() != 0 ) {
++ if( (*range.first)->download()->info()->up_rate()->rate() != 0 ) {
++ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_BOLD, 3); // Active and uploading
++ } else {
++ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_NORMAL, 3); // Active
++ }
++ } else {
++ if( (*range.first)->download()->info()->up_rate()->rate() != 0 ) {
++ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_BOLD, 2); // Dead but still uploading
++ } else {
++ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_NORMAL, 2); // Dead
++ }
++ }
++ } else {
++ m_canvas->set_attr(0, pos, m_canvas->width()-1, A_NORMAL, 1); // Inactive
++ }
++ pos++;
++
+ print_download_info(buffer, last, *range.first);
+ m_canvas->print(0, pos++, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer);
+
+@@ -114,7 +147,83 @@ WindowDownloadList::redraw() {
+ m_canvas->print(0, pos++, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer);
+
+ ++range.first;
+- }
++ }
++}
++
++// Inactive
++void
++WindowDownloadList::set_color_inactive_fg(int64_t color) {
++ short fg, bg;
++ pair_content(1, &fg, &bg);
++ if( color < 0 ) color = -1;
++ color = color % 8;
++ init_pair(1, (short)color, bg);
++}
++
++void
++WindowDownloadList::set_color_inactive_bg(int64_t color) {
++ short fg, bg;
++ pair_content(1, &fg, &bg);
++ if( color < 0 ) color = -1;
++ color = color % 8;
++ init_pair(1, fg, (short)color);
++}
++
++// Dead
++void
++WindowDownloadList::set_color_dead_fg(int64_t color) {
++ short fg, bg;
++ pair_content(2, &fg, &bg);
++ if( color < 0 ) color = -1;
++ color = color % 8;
++ init_pair(2, (short)color, bg);
++}
++
++void
++WindowDownloadList::set_color_dead_bg(int64_t color) {
++ short fg, bg;
++ pair_content(2, &fg, &bg);
++ if( color < 0 ) color = -1;
++ color = color % 8;
++ init_pair(2, fg, (short)color);
++}
++
++// Active
++void
++WindowDownloadList::set_color_active_fg(int64_t color) {
++ short fg, bg;
++ pair_content(3, &fg, &bg);
++ if( color < 0 ) color = -1;
++ color = color % 8;
++ init_pair(3, (short)color, bg);
++}
++
++void
++WindowDownloadList::set_color_active_bg(int64_t color) {
++ short fg, bg;
++ pair_content(3, &fg, &bg);
++ if( color < 0 ) color = -1;
++ color = color % 8;
++ init_pair(3, fg, (short)color);
++}
++
++// Finished
++void
++WindowDownloadList::set_color_finished_fg(int64_t color) {
++ short fg, bg;
++ pair_content(4, &fg, &bg);
++ if( color < 0 ) color = -1;
++ color = color % 8;
++ init_pair(4, (short)color, bg);
++}
++
++void
++WindowDownloadList::set_color_finished_bg(int64_t color) {
++ short fg, bg;
++ pair_content(4, &fg, &bg);
++ if( color < 0 ) color = -1;
++ color = color % 8;
++ init_pair(4, fg, (short)color);
+ }
+
+ }
+diff --git a/src/display/window_download_list.h b/src/display/window_download_list.h
+index 8e15cac..4551a47 100644
+--- a/src/display/window_download_list.h
++++ b/src/display/window_download_list.h
+@@ -55,6 +55,15 @@ public:
+
+ void set_view(core::View* l);
+
++ void set_color_inactive_fg(int64_t color);
++ void set_color_inactive_bg(int64_t color);
++ void set_color_dead_fg(int64_t color);
++ void set_color_dead_bg(int64_t color);
++ void set_color_active_fg(int64_t color);
++ void set_color_active_bg(int64_t color);
++ void set_color_finished_fg(int64_t color);
++ void set_color_finished_bg(int64_t color);
++
+ private:
+ core::View* m_view;
+
+diff --git a/src/main.cc b/src/main.cc
+index 5e826bb..44faa21 100644
+--- a/src/main.cc
++++ b/src/main.cc
+@@ -388,6 +388,15 @@ main(int argc, char** argv) {
+ CMD2_REDIRECT ("ip", "network.local_address.set");
+ CMD2_REDIRECT ("port_range", "network.port_range.set");
+
++ CMD2_REDIRECT ("color_inactive_fg", "colors.color_inactive_fg.set");
++ CMD2_REDIRECT ("color_inactive_bg", "colors.color_inactive_bg.set");
++ CMD2_REDIRECT ("color_dead_fg", "colors.color_dead_fg.set");
++ CMD2_REDIRECT ("color_dead_bg", "colors.color_dead_bg.set");
++ CMD2_REDIRECT ("color_active_fg", "colors.color_active_fg.set");
++ CMD2_REDIRECT ("color_active_bg", "colors.color_active_bg.set");
++ CMD2_REDIRECT ("color_finished_fg", "colors.color_finished_fg.set");
++ CMD2_REDIRECT ("color_finished_bg", "colors.color_finished_bg.set");
++
+ CMD2_REDIRECT_GENERIC("dht", "dht.mode.set");
+ CMD2_REDIRECT_GENERIC("dht_port", "dht.port.set");
+
+diff --git a/src/ui/download_list.cc b/src/ui/download_list.cc
+index e3abc9a..7dc7469 100644
+--- a/src/ui/download_list.cc
++++ b/src/ui/download_list.cc
+@@ -136,6 +136,11 @@ DownloadList::unfocus_download(core::Download* d) {
+ current_view()->next_focus();
+ }
+
++display::WindowDownloadList*
++DownloadList::current_window_list() {
++ return dynamic_cast<ElementDownloadList*>(m_uiArray[DISPLAY_DOWNLOAD_LIST])->window();
++}
++
+ void
+ DownloadList::activate_display(Display displayType) {
+ if (!is_active())
+diff --git a/src/ui/download_list.h b/src/ui/download_list.h
+index 3712e36..7810f65 100644
+--- a/src/ui/download_list.h
++++ b/src/ui/download_list.h
+@@ -98,6 +98,7 @@ public:
+ void activate_display(Display d);
+
+ core::View* current_view();
++ display::WindowDownloadList* current_window_list();
+ void set_current_view(const std::string& name);
+
+ void slot_open_uri(slot_string s) { m_slot_open_uri = s; }
+diff --git a/src/ui/element_download_list.h b/src/ui/element_download_list.h
+index 20185b5..00ef880 100644
+--- a/src/ui/element_download_list.h
++++ b/src/ui/element_download_list.h
+@@ -60,6 +60,7 @@ public:
+ void disable();
+
+ core::View* view() { return m_view; }
++ WDownloadList* window() { return m_window; }
+ void set_view(core::View* l);
+
+ void receive_command(const char* cmd);
+diff --git a/src/ui/root.cc b/src/ui/root.cc
+index 981fcc2..2df0f5a 100644
+--- a/src/ui/root.cc
++++ b/src/ui/root.cc
+@@ -44,6 +44,7 @@
+
+ #include "core/manager.h"
+ #include "display/frame.h"
++#include "display/window_download_list.h"
+ #include "display/window_http_queue.h"
+ #include "display/window_title.h"
+ #include "display/window_input.h"
+@@ -65,7 +66,15 @@ Root::Root() :
+ m_windowTitle(NULL),
+ m_windowHttpQueue(NULL),
+ m_windowInput(NULL),
+- m_windowStatusbar(NULL) {
++ m_windowStatusbar(NULL),
++ color_inactive_fg(-1),
++ color_inactive_bg(-1),
++ color_dead_fg(-1),
++ color_dead_bg(-1),
++ color_active_fg(-1),
++ color_active_bg(-1),
++ color_finished_fg(-1),
++ color_finished_bg(-1) {
+ }
+
+ void
+@@ -97,6 +106,14 @@ Root::init(Control* c) {
+ setup_keys();
+
+ m_downloadList->activate(rootFrame->frame(1));
++ m_downloadList->current_window_list()->set_color_inactive_fg(color_inactive_fg);
++ m_downloadList->current_window_list()->set_color_inactive_bg(color_inactive_bg);
++ m_downloadList->current_window_list()->set_color_dead_fg(color_dead_fg);
++ m_downloadList->current_window_list()->set_color_dead_bg(color_dead_bg);
++ m_downloadList->current_window_list()->set_color_active_fg(color_active_fg);
++ m_downloadList->current_window_list()->set_color_active_bg(color_active_bg);
++ m_downloadList->current_window_list()->set_color_finished_fg(color_finished_fg);
++ m_downloadList->current_window_list()->set_color_finished_bg(color_finished_bg);
+ }
+
+ void
+@@ -272,4 +289,88 @@ Root::current_input() {
+ return m_windowInput->input();
+ }
+
++// Inactive
++int
++Root::get_color_inactive_fg() {
++ return color_inactive_fg;
++}
++
++void
++Root::set_color_inactive_fg(int64_t color) {
++ color_inactive_fg = color;
++}
++
++int
++Root::get_color_inactive_bg() {
++ return color_inactive_bg;
++}
++
++void
++Root::set_color_inactive_bg(int64_t color) {
++ color_inactive_bg = color;
++}
++
++// Dead
++int
++Root::get_color_dead_fg() {
++ return color_dead_fg;
++}
++
++void
++Root::set_color_dead_fg(int64_t color) {
++ color_dead_fg = color;
++}
++
++int
++Root::get_color_dead_bg() {
++ return color_dead_bg;
++}
++
++void
++Root::set_color_dead_bg(int64_t color) {
++ color_dead_bg = color;
++}
++
++// Active
++int
++Root::get_color_active_fg() {
++ return color_active_fg;
++}
++
++void
++Root::set_color_active_fg(int64_t color) {
++ color_active_fg = color;
++}
++
++int
++Root::get_color_active_bg() {
++ return color_active_bg;
++}
++
++void
++Root::set_color_active_bg(int64_t color) {
++ color_active_bg = color;
++}
++
++// Finished
++int
++Root::get_color_finished_fg() {
++ return color_finished_fg;
++}
++
++void
++Root::set_color_finished_fg(int64_t color) {
++ color_finished_fg = color;
++}
++
++int
++Root::get_color_finished_bg() {
++ return color_finished_bg;
++}
++
++void
++Root::set_color_finished_bg(int64_t color) {
++ color_finished_bg = color;
++}
++
+ }
+diff --git a/src/ui/root.h b/src/ui/root.h
+index cbc5ff4..a550aeb 100644
+--- a/src/ui/root.h
++++ b/src/ui/root.h
+@@ -83,6 +83,23 @@ public:
+ void set_down_throttle_i64(int64_t throttle) { set_down_throttle(throttle >> 10); }
+ void set_up_throttle_i64(int64_t throttle) { set_up_throttle(throttle >> 10); }
+
++ int get_color_inactive_fg();
++ void set_color_inactive_fg(int64_t color);
++ int get_color_inactive_bg();
++ void set_color_inactive_bg(int64_t color);
++ int get_color_dead_fg();
++ void set_color_dead_fg(int64_t color);
++ int get_color_dead_bg();
++ void set_color_dead_bg(int64_t color);
++ int get_color_active_fg();
++ void set_color_active_fg(int64_t color);
++ int get_color_active_bg();
++ void set_color_active_bg(int64_t color);
++ int get_color_finished_fg();
++ void set_color_finished_fg(int64_t color);
++ int get_color_finished_bg();
++ void set_color_finished_bg(int64_t color);
++
+ void adjust_down_throttle(int throttle);
+ void adjust_up_throttle(int throttle);
+
+@@ -105,6 +122,15 @@ private:
+ WStatusbar* m_windowStatusbar;
+
+ input::Bindings m_bindings;
++
++ int64_t color_inactive_fg;
++ int64_t color_inactive_bg;
++ int64_t color_dead_fg;
++ int64_t color_dead_bg;
++ int64_t color_active_fg;
++ int64_t color_active_bg;
++ int64_t color_finished_fg;
++ int64_t color_finished_bg;
+ };
+
+ }
diff --git a/pcr/rtorrent-color/rtorrent-color.install b/pcr/rtorrent-color/rtorrent-color.install
new file mode 100644
index 000000000..fbf2a6f6c
--- /dev/null
+++ b/pcr/rtorrent-color/rtorrent-color.install
@@ -0,0 +1,27 @@
+post_install() {
+ cat << "EOF"
+==>
+==> Set colors using the options below in .rtorrent.rc:
+==> Options: color_inactive_fg, color_inactive_bg, color_dead_fg, color_dead_bg,
+==> color_active_fg, color_active_bg, color_finished_fg, color_finished_bg,
+==>
+==> Colors: 0 = black 1 = red 2 = green 3 = yellow 4 = blue 5 = magenta 6 = cyan 7 = white
+==>
+==> Nice example-config: color_inactive_fg = 4
+==> color_dead_fg = 1
+==> color_active_fg = 3
+==> color_finished_fg = 2
+==>
+==> Explanation:
+==> Inactive: Deactivated torrent
+==> Dead: Active but can't find seeders
+==> Active: Active and downloading
+==> Finished: Download done
+==> If the torrent is highlighted (using bold text) you're uploading data
+==>
+EOF
+}
+
+post_upgrade() {
+ post_install
+}