From 6ad32a4ef15f3d5bcddebefe7702e88d17aac5b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D1=8F=D1=87=D0=B5=D1=81=D0=BB=D0=B0=D0=B2=20=D0=93?= =?UTF-8?q?=D0=B0=D0=B5=D0=B2=D1=81=D0=BA=D0=B8=D1=85?= Date: Thu, 6 Aug 2020 12:57:36 +0400 Subject: [PATCH 1/2] Add LC_ALL=C to package query command --- src/pkgtop.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkgtop.go b/src/pkgtop.go index 120f832..d0ccab9 100644 --- a/src/pkgtop.go +++ b/src/pkgtop.go @@ -339,7 +339,7 @@ OSCheckLoop: cmdList.Rows = []string{cmdPrefix + pkgsCmd[osID], cmdPrefix + osIDCmd} /* Retrieve packages with the OS command. */ - pkgs := str.Split(execCmd("sh", "-c", pkgsCmd[osID]), "\n") + pkgs := str.Split(execCmd("env", "LC_ALL=C", "sh", "-c", pkgsCmd[osID]), "\n") /* Check if the operating system command exists. */ if _, hasKey := pkgsCmd[osID]; !hasKey { ui.Close() From c496ddf0911b7c0eea78642c3d805d30003fd7f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D1=8F=D1=87=D0=B5=D1=81=D0=BB=D0=B0=D0=B2=20=D0=93?= =?UTF-8?q?=D0=B0=D0=B5=D0=B2=D1=81=D0=BA=D0=B8=D1=85?= Date: Thu, 6 Aug 2020 13:23:33 +0400 Subject: [PATCH 2/2] Suppres error output of df command --- src/pkgtop.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkgtop.go b/src/pkgtop.go index d0ccab9..39b8dff 100644 --- a/src/pkgtop.go +++ b/src/pkgtop.go @@ -44,7 +44,7 @@ var ( " Hardware: $(uname --m)\\n" + " Hardware Platform: $(uname -i)\\n" + " OS: $(uname -o)\\n\"" - dfCmd = "df -h | awk '{$1=$1};1 {if(NR>1)print}'" /* Print the disk usage with 'df' */ + dfCmd = "df -h 2> /dev/null | awk '{$1=$1};1 {if(NR>1)print}'" /* Print the disk usage with 'df' */ pkgsCmd = map[string]string{ /* Commands for listing the installed packages */ "arch,manjaro": "pacman -Qi | awk '/^Name/{name=$3} " + "/^Version/{ver=$3} " +