Package Details: htop-vim-solarized-git 3.3.0.r31.g4feac8e7-1

Git Clone URL: https://aur.archlinux.org/htop-vim-solarized-git.git (read-only, click to copy)
Package Base: htop-vim-solarized-git
Description: Interactive process viewer with solarized and vim keybindings patch
Upstream URL: https://github.com/htop-dev/htop
Licenses: GPL
Conflicts: htop
Provides: htop
Submitter: icasdri
Maintainer: None
Last Packager: icasdri
Votes: 10
Popularity: 0.000000
First Submitted: 2015-10-10 19:32 (UTC)
Last Updated: 2024-03-02 18:09 (UTC)

Dependencies (6)

Required by (4)

Sources (3)

Latest Comments

1 2 3 Next › Last »

Hekuran commented on 2020-11-27 12:51 (UTC) (edited on 2020-11-29 10:41 (UTC) by Hekuran)

Here is the update: https://pastebin.com/raw/3T64ceUF

(use `patch -l' to avoid white space diff)

diff --git a/PKGBUILD b/PKGBUILD
index 919fcf1..542cd56 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -28,7 +28,7 @@ source=(
 sha384sums=(
     'SKIP'
     '33b6f8247d6784b73f63870b44340cf0f765d22dd3ce5306718a2698dccdb171a3bb905fe87b966a598e3b4c0730d241'
-    '38b6e858f23f74d18fa0ae042f9ca197de24aa3b3ab9f5d51048ac42d2d0208a7c9e62b32e1423c29de7035f6ddecf08'
+    '87e8859e00a8c312691822cc1ae525af90dee599aa5a79becaf568a7db3342d72df8a477bb223941e4f7198ddb6e368f'
 )


@@ -69,4 +69,3 @@ package() {
     cd "${srcdir}/${_pkgname}"
     make DESTDIR="${pkgdir}" install
 }
-
diff --git a/vim-keybindings.patch b/vim-keybindings.patch
index c14dcf9..bf700d5 100644
--- a/vim-keybindings.patch
+++ b/vim-keybindings.patch
@@ -1,15 +1,17 @@
+diff --git a/Action.c b/Action.c
+index 47fa6f1..fd65fad 100644
 --- a/Action.c
 +++ b/Action.c
-@@ -404,7 +404,7 @@ static Htop_Reaction actionTogglePauseProcessUpdate(State *st) {
- }
- 
- static const struct { const char* key; const char* info; } helpLeft[] = {
+@@ -449,7 +449,7 @@ static const struct {
+    const char* key;
+    const char* info;
+ } helpLeft[] = {
 -   { .key = " Arrows: ", .info = "scroll process list" },
-+   { .key = " hjkl: ", .info = "scroll process list" },
++   { .key = " hjkl: ", .info = "scroll process list" },
     { .key = " Digits: ", .info = "incremental PID search" },
     { .key = "   F3 /: ", .info = "incremental name search" },
     { .key = "   F4 \\: ",.info = "incremental name filtering" },
-@@ -426,7 +426,7 @@ static const struct { const char* key; const char* info; } helpRight[] = {
+@@ -475,7 +475,7 @@ static const struct {
     { .key = "  Space: ", .info = "tag process" },
     { .key = "      c: ", .info = "tag process and its children" },
     { .key = "      U: ", .info = "untag all processes" },
@@ -18,11 +20,12 @@
     { .key = "   F7 ]: ", .info = "higher priority (root only)" },
     { .key = "   F8 [: ", .info = "lower priority (+ nice)" },
  #if (defined(HAVE_LIBHWLOC) || defined(HAVE_LINUX_AFFINITY))
-@@ -434,11 +434,11 @@ static const struct { const char* key; const char* info; } helpRight[] = {
+@@ -483,12 +483,11 @@ static const struct {
  #endif
     { .key = "      e: ", .info = "show process environment" },
     { .key = "      i: ", .info = "set IO priority" },
 -   { .key = "      l: ", .info = "list open files with lsof" },
+-   { .key = "      x: ", .info = "list file locks of process" },
 +   { .key = "      L: ", .info = "list open files with lsof" },
     { .key = "      s: ", .info = "trace syscalls with strace" },
     { .key = "      w: ", .info = "wrap process command in multiple lines" },
@@ -32,7 +35,7 @@
     { .key = "  F10 q: ", .info = "quit" },
     { .key = NULL, .info = NULL }
  };
-@@ -601,6 +601,7 @@ void Action_setBindings(Htop_Action* keys) {
+@@ -663,6 +662,7 @@ void Action_setBindings(Htop_Action* keys) {
     keys['I'] = actionInvertSortOrder;
     keys[KEY_F(6)] = actionExpandCollapseOrSortColumn;
     keys[KEY_F(18)] = actionExpandCollapseOrSortColumn;
@@ -40,7 +43,7 @@
     keys['<'] = actionSetSortColumn;
     keys[','] = actionSetSortColumn;
     keys['>'] = actionSetSortColumn;
-@@ -609,7 +610,8 @@ void Action_setBindings(Htop_Action* keys) {
+@@ -671,7 +671,8 @@ void Action_setBindings(Htop_Action* keys) {
     keys['q'] = actionQuit;
     keys['a'] = actionSetAffinity;
     keys[KEY_F(9)] = actionKill;
@@ -50,10 +53,11 @@
     keys[KEY_RECLICK] = actionExpandOrCollapse;
     keys['+'] = actionExpandOrCollapse;
     keys['='] = actionExpandOrCollapse;
-@@ -620,12 +622,11 @@ void Action_setBindings(Htop_Action* keys) {
+@@ -682,13 +683,11 @@ void Action_setBindings(Htop_Action* keys) {
     keys['S'] = actionSetup;
     keys['C'] = actionSetup;
     keys[KEY_F(2)] = actionSetup;
+-   keys['x'] = actionShowLocks;
 -   keys['l'] = actionLsof;
 +   keys['L'] = actionLsof;
     keys['s'] = actionStrace;
@@ -64,6 +68,8 @@
     keys['?'] = actionHelp;
     keys['U'] = actionUntagAll;
     keys['c'] = actionTagAllChildren;
+diff --git a/CategoriesPanel.c b/CategoriesPanel.c
+index 2dc1c3b..426b988 100644
 --- a/CategoriesPanel.c
 +++ b/CategoriesPanel.c
 @@ -77,6 +77,8 @@ static HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) {
@@ -75,9 +81,11 @@
        case KEY_HOME:
        case KEY_END: {
           int previous = selected;
+diff --git a/Panel.c b/Panel.c
+index 68a245e..f722d7b 100644
 --- a/Panel.c
 +++ b/Panel.c
-@@ -319,10 +319,12 @@ bool Panel_onKey(Panel* this, int key) {
+@@ -329,10 +329,12 @@ bool Panel_onKey(Panel* this, int key) {
     int size = Vector_size(this->items);
     switch (key) {
     case KEY_DOWN:
@@ -90,7 +98,7 @@
     case KEY_CTRL('P'):
        this->selected--;
        break;
-@@ -337,23 +339,33 @@ bool Panel_onKey(Panel* this, int key) {
+@@ -347,23 +349,33 @@ bool Panel_onKey(Panel* this, int key) {
        break;
     #endif
     case KEY_LEFT:
@@ -126,7 +134,7 @@
        this->selected += (this->h - 1);
        this->scrollV = MAXIMUM(0, MINIMUM(Vector_size(this->items) - this->h,
                                   this->scrollV + this->h - 1));
-@@ -375,9 +387,11 @@ bool Panel_onKey(Panel* this, int key) {
+@@ -385,9 +397,11 @@ bool Panel_onKey(Panel* this, int key) {
        break;
     }
     case KEY_HOME:
@@ -138,9 +146,11 @@
        this->selected = size - 1;
        break;
     case KEY_CTRL('A'):
+diff --git a/ScreenManager.c b/ScreenManager.c
+index 87746c7..bbfa1a3 100644
 --- a/ScreenManager.c
 +++ b/ScreenManager.c
-@@ -257,7 +257,7 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
+@@ -255,7 +255,7 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
           continue;
        }
        case KEY_LEFT:
@@ -149,8 +159,8 @@
           if (this->panelCount < 2) {
              goto defaultHandler;
           }
-@@ -271,7 +271,7 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
-             goto tryLeft;
+@@ -276,7 +276,7 @@ tryLeft:
+ 
           break;
        case KEY_RIGHT:
 -      case KEY_CTRL('F'):

bennebartsch commented on 2020-11-17 01:00 (UTC) (edited on 2020-11-17 01:01 (UTC) by bennebartsch)

Failing again :(

patching file Action.c
Hunk #1 FAILED at 404.
Hunk #2 succeeded at 465 (offset 39 lines).
Hunk #3 FAILED at 434.
Hunk #4 succeeded at 652 (offset 51 lines).
Hunk #5 succeeded at 661 (offset 51 lines).
Hunk #6 FAILED at 622.
3 out of 6 hunks FAILED -- saving rejects to file Action.c.rej

icasdri commented on 2020-11-03 01:31 (UTC) (edited on 2020-11-03 01:36 (UTC) by icasdri)

Thanks for the patch! I've pushed the fixes (with some changes -- notably, enabling both x and d for kill instead of having to choose).

Hekuran commented on 2020-11-02 16:44 (UTC) (edited on 2020-11-02 16:47 (UTC) by Hekuran)

After more than two years, its time to update. I did everything for you, here: https://filebin.net/ysc7vl71hkv7o7gf/htop-vim-solarized-git.patch?t=k5z2z9r9

(i hope my nvim settings didnt mess white space up) code:

diff --git a/PKGBUILD b/PKGBUILD
index 0b23646..0443c6b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,95 +4,73 @@
 # Contributor: Eric Belanger <eric at archlinux.org>
 # Contributor: Daniel J Griffiths <ghost1227 at archlinux.us>
 # Contributor: Wesley Merkel <ooesili at gmail.com>
+# Contributor: Hekuran Gashi <hekurangashi at protonmail dot com>

 ##### OPTIONS ###############################################################

-# Set the following variable accordingly:
-#    * x if you would like to use x as the kill-process shortcut in htop
-#    * d if you would like to use d as the kill-process shortcut in htop
-# (we need one of these as htop's default shortcut k conflicts with vim
-#  movement keys!)
-
-kill_process_shortcut=x
-#kill_process_shortcut=d
+#Uncomment the following line if you wish to kill with `d`
+#cp d_for_kill.diff d_for_kill.patch

 #############################################################################

 _pkgname=htop
-pkgname=htop-vim-solarized-git
-pkgver=2.2.0.r15.g67e3689
+pkgname=${_pkgname}-vim-solarized-git
+pkgver=1536.15652e7
 pkgrel=1
-pkgdesc="Interactive process viewer with solarized and vim keybindings patch"
-arch=('i686' 'x86_64')
-url="https://github.com/hishamhm/${_pkgname}"
+pkgdesc="Interactive text-mode process viewer. Patched for vim keybindings"
+arch=('any')
+url="https://github.com/htop-dev/${_pkgname}"
 license=('GPL')
-depends=('ncurses')
-makedepends=('git' 'python2')
+depends=('ncurses' 'libncursesw.so' 'libnl')
+makedepends=('git')
 optdepends=('lsof: show files opened by a process'
             'strace: attach to a running process')
 provides=('htop')
-conflicts=('htop')
+conflicts=('htop' 'htop-git')
 options=('!emptydirs')
-source=(
-    "git+${url}.git"
-    'solarized-colors.patch'
-    'vim-keybindings-common.patch'
-    'vim-keybindings-d-for-kill.patch'
-    'vim-keybindings-x-for-kill.patch'
-)
-sha384sums=(
-    'SKIP'
-    '33b6f8247d6784b73f63870b44340cf0f765d22dd3ce5306718a2698dccdb171a3bb905fe87b966a598e3b4c0730d241'
-    '4e4d5d81372c3a4b007856664110319d0f8c89c2e8434628f89d833a8f1cc54650797c2e852eb9d50ad3e695f2bba93f'
-    'bf255f46456fe13992667f25216045dfd382469c9ae69e57071761c1e8dc9158c05d5c569b8b2e1f365d7b4eb6f3f307'
-    'c137cae3ec83fe2a0d379b83010d6092423dedc69676448a7b6d7fd815ffe3048848a5b7669920e5020bd96063c14466'
-)
-
-
+source=("git+${url}.git"
+        'solarized-colors.patch'
+        'vim-keybindings.patch'
+        'd_for_kill.diff')
+sha256sums=('SKIP'
+            'ef49988c39a7c7e3dd9ffacf8ffbf53d626c0acaae15d93b2d7017ffba732790'
+            'ef0bbe1981e66581cbc2f53976938323f1f42bd89aac3651c51368b5524f3ee1'
+            'adfc123deae256b73527b90708c47d79d3534d8c17fe00e53058c34cd3c459a3')

 pkgver() {
     cd "${srcdir}/${_pkgname}"
-    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+    local ver="$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
+    printf "%s" "${ver//-/.}"
 }

 prepare() {
-    cd "${srcdir}/${_pkgname}"
-
-    patch_list=(
-        'solarized-colors.patch'
-        'vim-keybindings-common.patch'
-        "vim-keybindings-${kill_process_shortcut}-for-kill.patch"
-    )
+   cd "${srcdir}/../";patch < d_for_kill.patch && echo 'PATCHED FOR D KILL'
+   cd "${srcdir}/${_pkgname}"

-    msg2 "Using '$kill_process_shortcut' as the kill-process shortcut in htop"
+   for _p in ${srcdir}/*.patch
+   do
+       msg2 "Applying $_p"
+       patch -p1 -i $_p
+   done

-    for _p in "${patch_list[@]}"
-    do
-        msg2 "Applying $_p"
-        patch -p1 -i "../$_p"
-    done
-
-    ./autogen.sh
-
-    sed -i 's|ncursesw/curses.h|curses.h|' RichString.[ch] configure
-    sed -i 's|python|python2|' scripts/MakeHeader.py
-
-    ./configure \
-        --prefix=/usr \
-        --enable-unicode \
-        --enable-openvz \
-        --enable-vserver \
-        --enable-cgroup \
-        --enable-oom
+   autoreconf -fi
 }

 build() {
-    cd "${srcdir}/${_pkgname}"
-    make
+  cd "${srcdir}/${_pkgname}"
+
+  ./configure \
+      --prefix=/usr \
+      --sysconfdir=/etc \
+      --enable-cgroup \
+      --enable-delayacct \
+      --enable-openvz \
+      --enable-unicode \
+      --enable-vserver
+
+  make
 }

 package() {
-    cd "${srcdir}/${_pkgname}"
-    make DESTDIR="${pkgdir}" install
+    make -C "${srcdir}/${_pkgname}" DESTDIR="$pkgdir" install
 }
-
diff --git a/d_for_kill.diff b/d_for_kill.diff
new file mode 100644
index 0000000..25d845b
--- /dev/null
+++ b/d_for_kill.diff
@@ -0,0 +1,22 @@
+diff --git a/vim-keybindings.patch b/vim-keybindings.patch
+index b60f105..7c8fa5e 100644
+--- a/vim-keybindings.patch
++++ b/vim-keybindings.patch
+@@ -16,7 +16,7 @@ index 233f132..c885197 100644
+     { .key = "      c: ", .info = "tag process and its children" },
+     { .key = "      U: ", .info = "untag all processes" },
+ -   { .key = "   F9 k: ", .info = "kill process/tagged processes" },
+-+   { .key = "   F9 x: ", .info = "kill process/tagged processes" },
+++   { .key = "   F9 d: ", .info = "kill process/tagged processes" },
+     { .key = "   F7 ]: ", .info = "higher priority (root only)" },
+     { .key = "   F8 [: ", .info = "lower priority (+ nice)" },
+  #if (defined(HAVE_LIBHWLOC) || defined(HAVE_LINUX_AFFINITY))
+@@ -47,7 +47,7 @@ index 233f132..c885197 100644
+     keys['a'] = actionSetAffinity;
+     keys[KEY_F(9)] = actionKill;
+ -   keys['k'] = actionKill;
+-+   keys['x'] = actionKill;
+++   keys['d'] = actionKill;
+     keys[KEY_RECLICK] = actionExpandOrCollapse;
+     keys['+'] = actionExpandOrCollapse;
+     keys['='] = actionExpandOrCollapse;
diff --git a/vim-keybindings-d-for-kill.patch b/vim-keybindings-d-for-kill.patch
deleted file mode 100644
index 393a2ce..0000000
--- a/vim-keybindings-d-for-kill.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/Action.c
-+++ b/Action.c
-@@ -427,7 +427,7 @@ static const struct { const char* key; const char* info; } helpRight[] = {
-    { .key = "  Space: ", .info = "tag process" },
-    { .key = "      c: ", .info = "tag process and its children" },
-    { .key = "      U: ", .info = "untag all processes" },
--   { .key = "   F9 k: ", .info = "kill process/tagged processes" },
-+   { .key = "   F9 d: ", .info = "kill process/tagged processes" },
-    { .key = "   F7 ]: ", .info = "higher priority (root only)" },
-    { .key = "   F8 [: ", .info = "lower priority (+ nice)" },
- #if (HAVE_LIBHWLOC || HAVE_LINUX_AFFINITY)
-@@ -575,7 +576,7 @@ void Action_setBindings(Htop_Action* keys) {
-    keys['q'] = actionQuit;
-    keys['a'] = actionSetAffinity;
-    keys[KEY_F(9)] = actionKill;
--   keys['k'] = actionKill;
-+   keys['d'] = actionKill;
-    keys[KEY_RECLICK] = actionExpandOrCollapse;
-    keys['+'] = actionExpandOrCollapse;
-    keys['='] = actionExpandOrCollapse;
diff --git a/vim-keybindings-x-for-kill.patch b/vim-keybindings-x-for-kill.patch
deleted file mode 100644
index 44abe85..0000000
--- a/vim-keybindings-x-for-kill.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/Action.c
-+++ b/Action.c
-@@ -427,7 +427,7 @@ static const struct { const char* key; const char* info; } helpRight[] = {
-    { .key = "  Space: ", .info = "tag process" },
-    { .key = "      c: ", .info = "tag process and its children" },
-    { .key = "      U: ", .info = "untag all processes" },
--   { .key = "   F9 k: ", .info = "kill process/tagged processes" },
-+   { .key = "   F9 x: ", .info = "kill process/tagged processes" },
-    { .key = "   F7 ]: ", .info = "higher priority (root only)" },
-    { .key = "   F8 [: ", .info = "lower priority (+ nice)" },
- #if (HAVE_LIBHWLOC || HAVE_LINUX_AFFINITY)
-@@ -575,7 +576,7 @@ void Action_setBindings(Htop_Action* keys) {
-    keys['q'] = actionQuit;
-    keys['a'] = actionSetAffinity;
-    keys[KEY_F(9)] = actionKill;
--   keys['k'] = actionKill;
-+   keys['x'] = actionKill;
-    keys[KEY_RECLICK] = actionExpandOrCollapse;
-    keys['+'] = actionExpandOrCollapse;
-    keys['='] = actionExpandOrCollapse;
diff --git a/vim-keybindings-common.patch b/vim-keybindings.patch
similarity index 61%
rename from vim-keybindings-common.patch
rename to vim-keybindings.patch
index 055c5ff..b60f105 100644
--- a/vim-keybindings-common.patch
+++ b/vim-keybindings.patch
@@ -1,29 +1,40 @@
+diff --git a/Action.c b/Action.c
+index 233f132..c885197 100644
 --- a/Action.c
 +++ b/Action.c
-@@ -406,7 +406,7 @@ static Htop_Reaction actionRedraw() {
+@@ -393,7 +393,7 @@ static Htop_Reaction actionRedraw(ATTR_UNUSED State *st) {
  }
- 
+
  static const struct { const char* key; const char* info; } helpLeft[] = {
 -   { .key = " Arrows: ", .info = "scroll process list" },
-+   { .key = " hjkl: ", .info = "scroll process list" },
++   { .key = "   hjkl: ", .info = "scroll process list" },
     { .key = " Digits: ", .info = "incremental PID search" },
     { .key = "   F3 /: ", .info = "incremental name search" },
     { .key = "   F4 \\: ",.info = "incremental name filtering" },
-@@ -435,11 +435,11 @@ static const struct { const char* key; const char* info; } helpRight[] = {
+@@ -414,7 +414,7 @@ static const struct { const char* key; const char* info; } helpRight[] = {
+    { .key = "  Space: ", .info = "tag process" },
+    { .key = "      c: ", .info = "tag process and its children" },
+    { .key = "      U: ", .info = "untag all processes" },
+-   { .key = "   F9 k: ", .info = "kill process/tagged processes" },
++   { .key = "   F9 x: ", .info = "kill process/tagged processes" },
+    { .key = "   F7 ]: ", .info = "higher priority (root only)" },
+    { .key = "   F8 [: ", .info = "lower priority (+ nice)" },
+ #if (defined(HAVE_LIBHWLOC) || defined(HAVE_LINUX_AFFINITY))
+@@ -422,11 +422,11 @@ static const struct { const char* key; const char* info; } helpRight[] = {
  #endif
     { .key = "      e: ", .info = "show process environment" },
     { .key = "      i: ", .info = "set IO priority" },
 -   { .key = "      l: ", .info = "list open files with lsof" },
 +   { .key = "      L: ", .info = "list open files with lsof" },
     { .key = "      s: ", .info = "trace syscalls with strace" },
-    { .key = "         ", .info = "" },
+    { .key = "      w: ", .info = "wrap process command in multiple lines" },
     { .key = " F2 C S: ", .info = "setup" },
 -   { .key = "   F1 h: ", .info = "show this help screen" },
 +   { .key = "   F1 ?: ", .info = "show this help screen" },
     { .key = "  F10 q: ", .info = "quit" },
     { .key = NULL, .info = NULL }
  };
-@@ -567,6 +567,7 @@ void Action_setBindings(Htop_Action* keys) {
+@@ -566,6 +566,7 @@ void Action_setBindings(Htop_Action* keys) {
     keys['I'] = actionInvertSortOrder;
     keys[KEY_F(6)] = actionExpandCollapseOrSortColumn;
     keys[KEY_F(18)] = actionExpandCollapseOrSortColumn;
@@ -31,7 +42,16 @@
     keys['<'] = actionSetSortColumn;
     keys[','] = actionSetSortColumn;
     keys['>'] = actionSetSortColumn;
-@@ -586,12 +587,11 @@ void Action_setBindings(Htop_Action* keys) {
+@@ -574,7 +575,7 @@ void Action_setBindings(Htop_Action* keys) {
+    keys['q'] = actionQuit;
+    keys['a'] = actionSetAffinity;
+    keys[KEY_F(9)] = actionKill;
+-   keys['k'] = actionKill;
++   keys['x'] = actionKill;
+    keys[KEY_RECLICK] = actionExpandOrCollapse;
+    keys['+'] = actionExpandOrCollapse;
+    keys['='] = actionExpandOrCollapse;
+@@ -585,12 +586,11 @@ void Action_setBindings(Htop_Action* keys) {
     keys['S'] = actionSetup;
     keys['C'] = actionSetup;
     keys[KEY_F(2)] = actionSetup;
@@ -45,25 +65,11 @@
     keys['?'] = actionHelp;
     keys['U'] = actionUntagAll;
     keys['c'] = actionTagAllChildren;
---- a/CategoriesPanel.c
-+++ b/CategoriesPanel.c
-@@ -87,6 +87,8 @@ static HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) {
-       case KEY_CTRL('N'):
-       case KEY_NPAGE:
-       case KEY_PPAGE:
-+      case 'g':
-+      case 'G':
-       case KEY_HOME:
-       case KEY_END: {
-          int previous = selected;
+diff --git a/Panel.c b/Panel.c
+index 315f388..5842cc7 100644
 --- a/Panel.c
 +++ b/Panel.c
-@@ -372,14 +372,16 @@ void Panel_draw(Panel* this, bool focus) {
- 
- bool Panel_onKey(Panel* this, int key) {
-    assert (this != NULL);
--   
-+
+@@ -318,10 +318,12 @@ bool Panel_onKey(Panel* this, int key) {
     int size = Vector_size(this->items);
     switch (key) {
     case KEY_DOWN:
@@ -76,14 +82,14 @@
     case KEY_CTRL('P'):
        this->selected--;
        break;
-@@ -394,23 +396,33 @@ bool Panel_onKey(Panel* this, int key) {
+@@ -336,23 +338,33 @@ bool Panel_onKey(Panel* this, int key) {
        break;
     #endif
     case KEY_LEFT:
 -   case KEY_CTRL('B'):
 +   case 'h':
        if (this->scrollH > 0) {
-          this->scrollH -= MAX(CRT_scrollHAmount, 0);
+          this->scrollH -= MAXIMUM(CRT_scrollHAmount, 0);
           this->needsRedraw = true;
        }
        break;
@@ -104,15 +110,15 @@
     case KEY_PPAGE:
 +   case KEY_CTRL('B'):
        this->selected -= (this->h - 1);
-       this->scrollV = MAX(0, this->scrollV - this->h + 1);
+       this->scrollV = MAXIMUM(0, this->scrollV - this->h + 1);
        this->needsRedraw = true;
        break;
     case KEY_NPAGE:
 +   case KEY_CTRL('F'):
        this->selected += (this->h - 1);
-       this->scrollV = MAX(0, MIN(Vector_size(this->items) - this->h,
+       this->scrollV = MAXIMUM(0, MINIMUM(Vector_size(this->items) - this->h,
                                   this->scrollV + this->h - 1));
-@@ -432,9 +444,11 @@ bool Panel_onKey(Panel* this, int key) {
+@@ -374,9 +386,11 @@ bool Panel_onKey(Panel* this, int key) {
        break;
     }
     case KEY_HOME:
@@ -124,12 +130,14 @@
        this->selected = size - 1;
        break;
     case KEY_CTRL('A'):
+diff --git a/README b/README
+index 67f80ef..84f90d7 100644
 --- a/README
 +++ b/README
-@@ -17,6 +17,44 @@
- This software has evolved considerably over the years,
- and is reasonably complete, but there is always room for improvement.
- 
+@@ -17,6 +17,47 @@ The information displayed is configurable through a graphical setup and can be s
+
+ Tasks related to processes (e.g. killing and renicing) can be done without entering their PIDs.
+
 +Vim keybindings
 +----------------
 +
@@ -162,18 +170,23 @@
 +In order to accomodate these keybindings, the following changes
 +were made to the original keybindings:
 +
-+* Ctrl+F and Ctrt+B can now longer be used to navigate horizontally
++* Ctrl+F and Ctrt+B can no longer be used to navigate horizontally
 +* 'h' can no longer be used to access the help, leaving Ctrl+F1 & '?'
 +* 'k' can no longer be used to kill processes, being replaced with 'x'
 +* 'l' can no longer be used to list open files, being replaced with 'L'
 +
 +
- Comparison between `htop` and classic `top`
- -------------------------------------------
- 
++Comparison between `htop` and classic `top`
++-------------------------------------------
++
+ Running `htop` requires `ncurses` libraries (typically named libncursesw*).
+
+ For more information and details on how to contribute to `htop` visit [htop.dev](https://htop.dev).
+diff --git a/ScreenManager.c b/ScreenManager.c
+index 2a2cb1d..705ae17 100644
 --- a/ScreenManager.c
 +++ b/ScreenManager.c
-@@ -279,7 +279,7 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
+@@ -250,7 +250,7 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
           continue;
        }
        case KEY_LEFT:
@@ -182,7 +195,7 @@
           if (this->panelCount < 2) {
              goto defaultHandler;
           }
-@@ -293,7 +293,7 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
+@@ -264,7 +264,7 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
              goto tryLeft;
           break;
        case KEY_RIGHT:

bennebartsch commented on 2020-09-14 07:06 (UTC) (edited on 2020-09-14 07:09 (UTC) by bennebartsch)

README patch fails:

    ==> Beginne prepare()...
      -> Using 'x' as the kill-process shortcut in htop
      -> Applying solarized-colors.patch
    patching file CRT.c
      -> Applying vim-keybindings-common.patch
    patching file Action.c
    patching file CategoriesPanel.c
    patching file Panel.c
    patching file README
    Hunk #1 FAILED at 17.
    1 out of 1 hunk FAILED -- saving rejects to file README.rej
    patching file ScreenManager.c
    Hunk #1 succeeded at 277 (offset -2 lines).
    Hunk #2 succeeded at 291 (offset -2 lines).
    ==> FEHLER: Ein Fehler geschah in prepare().

icasdri commented on 2018-09-09 19:17 (UTC)

Fixed. We now use upstream's "Broken Gray" colorscheme (instead of inventing our own). Also G/g keybindings are working again :)

izenin commented on 2018-05-30 16:07 (UTC) (edited on 2018-05-30 16:08 (UTC) by izenin)

It is broken again:

  -> Applying solarized-colors.patch
patching file CRT.c
Hunk #1 FAILED at 36.
Hunk #2 succeeded at 352 (offset 1 line).
Hunk #3 succeeded at 366 (offset 1 line).
Hunk #4 succeeded at 390 (offset 1 line).
Hunk #5 succeeded at 407 (offset 1 line).
1 out of 5 hunks FAILED -- saving rejects to file CRT.c.rej
==> ERROR: A failure occurred in prepare().

icasdri commented on 2017-09-05 00:21 (UTC)

I've pushed the fix. I have also changed the versioning scheme to more closely match that of stable releases. pacman will probably think it's a downgrade, but that's just this once.

icasdri commented on 2017-09-04 23:32 (UTC)

Thank you everyone for the feedback and help. I apologize for not looking into this earlier. It seems that htop upstream has done some major changes to CRT.c in support of different color schemes. I'll hopefully have an updated version out later today.

cprussin commented on 2017-08-15 18:36 (UTC) (edited on 2017-08-16 18:36 (UTC) by cprussin)

I've fixed the patch issue here and created a new aur package: https://aur.archlinux.org/packages/htop-vim-solarized/ Note that my new package tracks the latest htop stable release, rather than the htop git master. You can feel free to pull my version of vim-keybindings-common.patch and drop it in here if you'd like to keep tracking the git master, that should fix the issues with this package for now.