Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for non english locales #27

Merged
merged 2 commits into from
Aug 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/pkgtop.go
Original file line number Diff line number Diff line change
Expand Up @@ -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} " +
Expand Down Expand Up @@ -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()
Expand Down