Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
neofetch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
neofetch
Commits
6f07012b
Commit
6f07012b
authored
Nov 06, 2016
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Misc: Fix lint errors
parent
4e3325bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
39 deletions
+38
-39
neofetch
neofetch
+38
-39
No files found.
neofetch
View file @
6f07012b
...
@@ -691,7 +691,7 @@ getwmtheme() {
...
@@ -691,7 +691,7 @@ getwmtheme() {
"Blackbox"
|
"bbLean"
*)
"Blackbox"
|
"bbLean"
*)
path=
"
$(
wmic process get ExecutablePath |
grep
-F
"blackbox"
)
"
path=
"
$(
wmic process get ExecutablePath |
grep
-F
"blackbox"
)
"
path=
"
${
path
//
'\'
/
'/'
}
"
path=
"
${
path
//
\\/\/
}
"
wmtheme=
"
$(
grep
"^session
\.
styleFile:"
"
${
path
/\.exe/.rc
}
"
)
"
wmtheme=
"
$(
grep
"^session
\.
styleFile:"
"
${
path
/\.exe/.rc
}
"
)
"
wmtheme=
"
${
wmtheme
/
'session.styleFile: '
}
"
wmtheme=
"
${
wmtheme
/
'session.styleFile: '
}
"
...
@@ -915,7 +915,7 @@ getcpu_usage() {
...
@@ -915,7 +915,7 @@ getcpu_usage() {
case
"
$os
"
in
case
"
$os
"
in
"Linux"
)
cores
=
"
$(
awk
-F
': '
'/siblings/ {printf $2; exit}'
/proc/cpuinfo
)
"
;;
"Linux"
)
cores
=
"
$(
awk
-F
': '
'/siblings/ {printf $2; exit}'
/proc/cpuinfo
)
"
;;
"Mac OS X"
|
"BSD"
)
cores
=
"
$(
sysctl
-n
hw.ncpu
)
"
;;
"Mac OS X"
|
"BSD"
)
cores
=
"
$(
sysctl
-n
hw.ncpu
)
"
;;
"Solaris"
)
cores
=
"
$(
kstat
-m
cpu_info |
grep
-
F
"chip_id"
|
wc
-l
|
tr
-d
' '
)
"
;;
"Solaris"
)
cores
=
"
$(
kstat
-m
cpu_info |
grep
-
c
-F
"chip_id"
)
"
;;
"iPhone OS"
)
cores
=
"
${
cpu
/*\(
}
"
;
cores
=
"
${
cores
/\)*
}
"
;;
"iPhone OS"
)
cores
=
"
${
cpu
/*\(
}
"
;
cores
=
"
${
cores
/\)*
}
"
;;
esac
esac
fi
fi
...
@@ -1661,27 +1661,26 @@ getbattery() {
...
@@ -1661,27 +1661,26 @@ getbattery() {
"
Linux
")
"
Linux
")
# We use 'prin' here and exit the function early so that we can
# We use 'prin' here and exit the function early so that we can
# do multi battery support with a single battery per line.
# do multi battery support with a single battery per line.
if [[ -f /sys/class/power_supply/**/capacity ]]; then
for bat in "
/sys/class/power_supply/BAT
"*; do
for bat in "
/sys/class/power_supply/BAT
"*; do
capacity="
$(
<
"
${
bat
}
/capacity"
)
"
capacity="
$(
<
"
${
bat
}
/capacity"
)
"
status="
$(
<
"
${
bat
}
/status"
)
"
status="
$(
<
"
${
bat
}
/status"
)
"
# Fix for bash on Windows 10 which includes /proc files
# Fix for bash on Windows 10 which includes /proc files
# for battery usage despite there not being a battery
# for battery usage despite there not being a battery
# installed.
# installed.
[[ -z "
$capacity
" ]] && return
[[ -z "
$capacity
" ]] && return
battery="
${
capacity
}
% [
${
status
}
]
"
battery="
${
capacity
}
% [
${
status
}
]
"
case "
$battery_display
" in
case "
$battery_display
" in
"
bar
") battery="
$(
bar
"
$capacity
"
100
)
" ;;
"
bar
") battery="
$(
bar
"
$capacity
"
100
)
" ;;
"
infobar
") battery+="
$(
bar
"
$capacity
"
100
)
" ;;
"
infobar
") battery+="
$(
bar
"
$capacity
"
100
)
" ;;
"
barinfo
") battery="
$(
bar
"
$capacity
"
100
)
${
battery
}
" ;;
"
barinfo
") battery="
$(
bar
"
$capacity
"
100
)
${
battery
}
" ;;
esac
esac
prin "
${
subtitle
}${
bat
:
-1
}
" "
$battery
"
done
prin "
${
subtitle
}${
bat
:
-1
}
" "
$battery
"
done
fi
unset battery
unset battery
return
return
;;
;;
...
@@ -1725,7 +1724,7 @@ getbattery() {
...
@@ -1725,7 +1724,7 @@ getbattery() {
"
Haiku
")
"
Haiku
")
battery0full="
$(
awk
-F
'[^0-9]*'
'NR==2 {print $4}'
/dev/power/acpi_battery/0
)
"
battery0full="
$(
awk
-F
'[^0-9]*'
'NR==2 {print $4}'
/dev/power/acpi_battery/0
)
"
battery0now="
$(
awk
-F
'[^0-9]*'
'NR==5 {print $4}'
/dev/power/acpi_battery/0
)
"
battery0now="
$(
awk
-F
'[^0-9]*'
'NR==5 {print $4}'
/dev/power/acpi_battery/0
)
"
battery="
$((
battery0full
/
battery0now
*
100
))
%
"
battery="
$((
battery0full
*
100
/
battery0now
))
%
"
;;
;;
esac
esac
...
@@ -2017,7 +2016,7 @@ getascii() {
...
@@ -2017,7 +2016,7 @@ getascii() {
# Get lines/columns of the ascii file.
# Get lines/columns of the ascii file.
lines=1
lines=1
while IFS='
\n
' read -r line 2>/dev/null; do
while IFS=
$
'
\n
' read -r line 2>/dev/null; do
[[ "
${#
line
}
" -gt "
${
ascii_length
:-
0
}
" ]] && ascii_length="
${#
line
}
"
[[ "
${#
line
}
" -gt "
${
ascii_length
:-
0
}
" ]] && ascii_length="
${#
line
}
"
lines="
$((
lines+
=
1
))
"
lines="
$((
lines+
=
1
))
"
done <<< "
$ascii_strip
"
done <<< "
$ascii_strip
"
...
@@ -2026,7 +2025,7 @@ getascii() {
...
@@ -2026,7 +2025,7 @@ getascii() {
[[ "
$ascii_length_force
" ]] && ascii_length="
$ascii_length_force
"
[[ "
$ascii_length_force
" ]] && ascii_length="
$ascii_length_force
"
padding="
\0
33[
$((
ascii_length
+
gap
))
C
"
padding="
\0
33[
$((
ascii_length
+
gap
))
C
"
printf "
%b
%s
" "
$print
"
printf "
%b
" "
$print
"
export LC_ALL=C
export LC_ALL=C
}
}
...
@@ -2052,14 +2051,14 @@ getimage() {
...
@@ -2052,14 +2051,14 @@ getimage() {
esac
esac
if [[ -n "
$TMUX
" ]]; then
if [[ -n "
$TMUX
" ]]; then
printf "
%b
%s
" "
\0
33Ptmux
;
\0
33
\0
33[14t
\0
33
\0
33[c
\0
33
\\
"
printf "
%b
" "
\0
33Ptmux
;
\0
33
\0
33[14t
\0
33
\0
33[c
\0
33
\\
"
read_flags="
-d
c
"
read_flags="
-d
c
"
elif [[ "
$image_backend
" == "
tycat
" ]]; then
elif [[ "
$image_backend
" == "
tycat
" ]]; then
printf "
%b
%s
" "
\0
33
}
qs
\0
00
"
printf "
%b
" "
\0
33
}
qs
\0
00
"
else
else
printf "
%b
%s
" "
\0
33[14t
\0
33[c
"
printf "
%b
" "
\0
33[14t
\0
33[c
"
read_flags="
-d
c
"
read_flags="
-d
c
"
fi
fi
...
@@ -2097,7 +2096,7 @@ getimage() {
...
@@ -2097,7 +2096,7 @@ getimage() {
[[ "
$image_backend
" != "
iterm2
" ]]; then
[[ "
$image_backend
" != "
iterm2
" ]]; then
if type -p xdpyinfo >/dev/null 2>&1; then
if type -p xdpyinfo >/dev/null 2>&1; then
current_window="
$(
xdpyinfo |
grep
-F
"focus"
|
grep
-E
-o
0x[0-9a-f]+
)
"
current_window="
$(
xdpyinfo |
grep
-F
"focus"
|
grep
-E
-o
"0x[0-9a-f]+"
)
"
elif type -p xprop >/dev/null 2>&1; then
elif type -p xprop >/dev/null 2>&1; then
current_window="
$(
xprop
-root
|
awk
'/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}'
)
"
current_window="
$(
xprop
-root
|
awk
'/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}'
)
"
fi
fi
...
@@ -2272,12 +2271,12 @@ displayimage() {
...
@@ -2272,12 +2271,12 @@ displayimage() {
# Add a tiny delay to fix issues with images not
# Add a tiny delay to fix issues with images not
# appearing in specific terminal emulators.
# appearing in specific terminal emulators.
sleep 0.05
sleep 0.05
printf "%b
%s
\n" "0;1;$xoffset;$yoffset;$width;$height;;;;;$img\n4;\n3;" |\
printf "%b\n" "0;1;$xoffset;$yoffset;$width;$height;;;;;$img\n4;\n3;" |\
"$w3m_img_path" -bg "$background_color" >/dev/null & 2>&1 || padding="\033[0C"
"$w3m_img_path" -bg "$background_color" >/dev/null & 2>&1 || padding="\033[0C"
;;
;;
"iterm2")
"iterm2")
printf "%b
%s
\a\n" "\033]1337;File=width=${width}px;height=${height}px;inline=1:$(base64 < "$img")"
printf "%b\a\n" "\033]1337;File=width=${width}px;height=${height}px;inline=1:$(base64 < "$img")"
;;
;;
"tycat")
"tycat")
...
@@ -2388,7 +2387,7 @@ info() {
...
@@ -2388,7 +2387,7 @@ info() {
[[
-z
"
$2
"
]]
&&
string
=
"
${
string
/*
:
}
"
[[
-z
"
$2
"
]]
&&
string
=
"
${
string
/*
:
}
"
# Print the string
# Print the string
printf
"%b
%s
\n
"
"
${
padding
}${
zws
}${
string
}${
reset
}
"
printf
"%b
\n
"
"
${
padding
}${
zws
}${
string
}${
reset
}
"
# Calculate info height
# Calculate info height
info_height
=
"
$((
info_height+
=
1
))
"
info_height
=
"
$((
info_height+
=
1
))
"
...
@@ -2420,7 +2419,7 @@ prin() {
...
@@ -2420,7 +2419,7 @@ prin() {
string
=
"
$(
trim
"
$string
"
)
"
string
=
"
$(
trim
"
$string
"
)
"
# Print the info
# Print the info
printf
"%b
%s
\n
"
"
${
padding
}${
zws
}${
string
}${
reset
}
"
printf
"%b
\n
"
"
${
padding
}${
zws
}${
string
}${
reset
}
"
# Calculate info height
# Calculate info height
info_height
=
"
$((
info_height+
=
1
))
"
info_height
=
"
$((
info_height+
=
1
))
"
...
@@ -2676,9 +2675,9 @@ setcolors() {
...
@@ -2676,9 +2675,9 @@ setcolors() {
color
()
{
color
()
{
case
"
$1
"
in
case
"
$1
"
in
[
0-6]
)
printf
"%b
%s
"
"
${
reset
}
\0
33[3
${
1
}
m"
;;
[
0-6]
)
printf
"%b"
"
${
reset
}
\0
33[3
${
1
}
m"
;;
7
|
"fg"
)
printf
"%b
%s
"
"
$reset
"
;;
7
|
"fg"
)
printf
"%b"
"
$reset
"
;;
*
)
printf
"%b
%s
"
"
\0
33[38;5;
${
1
}
m"
;;
*
)
printf
"%b"
"
\0
33[38;5;
${
1
}
m"
;;
esac
esac
}
}
...
@@ -2865,7 +2864,7 @@ bar() {
...
@@ -2865,7 +2864,7 @@ bar() {
bar
=
"
$(
color
fg
)
[
$bar
"
bar
=
"
$(
color
fg
)
[
$bar
"
fi
fi
printf
"%b
%s
\n
"
"
${
bar
}${
info_color
}
"
printf
"%b
\n
"
"
${
bar
}${
info_color
}
"
}
}
# }}}
# }}}
...
@@ -3327,12 +3326,12 @@ main() {
...
@@ -3327,12 +3326,12 @@ main() {
fi
fi
# Re-enable line wrap
# Re-enable line wrap
printf
"%b
%s
"
"
\0
33[?7h"
printf
"%b"
"
\0
33[?7h"
[[
"
$scrot
"
==
"on"
]]
&&
takescrot
[[
"
$scrot
"
==
"on"
]]
&&
takescrot
# Show error messages
# Show error messages
[[
"
$verbose
"
==
"on"
]]
&&
printf
"%b
%s
"
"
$err
"
[[
"
$verbose
"
==
"on"
]]
&&
printf
"%b"
"
$err
"
# Reset exit status of the tests above
# Reset exit status of the tests above
printf
"%s"
printf
"%s"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment