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
55420c3c
Commit
55420c3c
authored
May 02, 2017
by
Herdiansyah
Committed by
GitHub
May 02, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #711 from konimex/fallback
Misc: Use fallback values for some functions
parents
fe3da7e0
def8123c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
46 deletions
+46
-46
neofetch
neofetch
+46
-46
No files found.
neofetch
View file @
55420c3c
...
@@ -1173,7 +1173,16 @@ get_gpu() {
...
@@ -1173,7 +1173,16 @@ get_gpu() {
esac
esac
;;
;;
"BSD"
|
"Solaris"
|
"MINIX"
|
"AIX"
)
"Windows"
)
gpu
=
"
$(
wmic path Win32_VideoController get caption
)
"
gpu
=
"
${
gpu
//Caption
}
"
;;
"Haiku"
)
gpu
=
"
$(
listdev |
grep
-A2
-F
'device Display controller'
|
awk
-F
':'
'/device beef/ {print $2}'
)
"
;;
*
)
case
"
$kernel_name
"
in
case
"
$kernel_name
"
in
"FreeBSD"
*
|
"DragonFly"
*
)
"FreeBSD"
*
|
"DragonFly"
*
)
gpu
=
"
$(
pciconf
-lv
|
grep
-B
4
-F
"VGA"
|
grep
-F
"device"
)
"
gpu
=
"
$(
pciconf
-lv
|
grep
-B
4
-F
"VGA"
|
grep
-F
"device"
)
"
...
@@ -1187,15 +1196,6 @@ get_gpu() {
...
@@ -1187,15 +1196,6 @@ get_gpu() {
;;
;;
esac
esac
;;
;;
"Windows"
)
gpu
=
"
$(
wmic path Win32_VideoController get caption
)
"
gpu
=
"
${
gpu
//Caption
}
"
;;
"Haiku"
)
gpu
=
"
$(
listdev |
grep
-A2
-F
'device Display controller'
|
awk
-F
':'
'/device beef/ {print $2}'
)
"
;;
esac
esac
if
[[
"
$gpu_brand
"
==
"off"
]]
;
then
if
[[
"
$gpu_brand
"
==
"off"
]]
;
then
...
@@ -1394,19 +1394,6 @@ get_song() {
...
@@ -1394,19 +1394,6 @@ get_song() {
get_resolution
()
{
get_resolution
()
{
case
"
$os
"
in
case
"
$os
"
in
"Linux"
|
"BSD"
|
"Solaris"
|
"MINIX"
|
"AIX"
)
if
type
-p
xrandr
>
/dev/null
;
then
case
"
$refresh_rate
"
in
"on"
)
resolution
=
"
$(
xrandr
--nograb
--current
|
awk
'match($0,/[0-9]*\.[0-9]*\*/) {printf $1 " @ " substr($0,RSTART,RLENGTH) "Hz, "}'
)
"
;;
"off"
)
resolution
=
"
$(
xrandr
--nograb
--current
|
awk
'/\*/ {printf $1 ", "}'
)
"
;;
esac
resolution
=
"
${
resolution
//\*
}
"
elif
type
-p
xdpyinfo
>
/dev/null
;
then
resolution
=
"
$(
xdpyinfo |
awk
'/dimensions:/ {printf $2}'
)
"
fi
;;
"Mac OS X"
)
"Mac OS X"
)
if
type
-p
screenresolution
>
/dev/null
;
then
if
type
-p
screenresolution
>
/dev/null
;
then
resolution
=
"
$(
screenresolution get 2>&1 |
awk
'/Display/ {printf $6 "Hz, "}'
)
"
resolution
=
"
$(
screenresolution get 2>&1 |
awk
'/Display/ {printf $6 "Hz, "}'
)
"
...
@@ -1451,6 +1438,19 @@ get_resolution() {
...
@@ -1451,6 +1438,19 @@ get_resolution() {
[[
"
$refresh_rate
"
==
"off"
]]
&&
resolution
=
"
${
resolution
/ @*
}
"
[[
"
$refresh_rate
"
==
"off"
]]
&&
resolution
=
"
${
resolution
/ @*
}
"
;;
;;
*
)
if
type
-p
xrandr
>
/dev/null
;
then
case
"
$refresh_rate
"
in
"on"
)
resolution
=
"
$(
xrandr
--nograb
--current
|
awk
'match($0,/[0-9]*\.[0-9]*\*/) {printf $1 " @ " substr($0,RSTART,RLENGTH) "Hz, "}'
)
"
;;
"off"
)
resolution
=
"
$(
xrandr
--nograb
--current
|
awk
'/\*/ {printf $1 ", "}'
)
"
;;
esac
resolution
=
"
${
resolution
//\*
}
"
elif
type
-p
xdpyinfo
>
/dev/null
;
then
resolution
=
"
$(
xdpyinfo |
awk
'/dimensions:/ {printf $2}'
)
"
fi
;;
esac
esac
resolution
=
"
${
resolution
%,*
}
"
resolution
=
"
${
resolution
%,*
}
"
...
@@ -2192,7 +2192,29 @@ get_image_source() {
...
@@ -2192,7 +2192,29 @@ get_image_source() {
get_wallpaper() {
get_wallpaper() {
case "
$os
" in
case "
$os
" in
"
Linux
" | "
BSD
" | "
Solaris
" | "
MINIX
" | "
AIX
")
"
Mac OS X
")
image="
$(
osascript
-e
'tell application "System Events" to picture of current desktop'
)
"
;;
"
Windows
")
case "
$distro
" in
"
Windows XP
")
case "
$kernel_name
" in
"
CYGWIN
"*) image="
/cygdrive/c/Documents and Settings/
${
USER
}
" ;;
"
MSYS2
"* | "
MINGW
*
") image="
/c/Documents and Settings/
${
USER
}
" ;;
esac
image+="
/Local Settings/Application Data/Microsoft
"
image+="
/Wallpaper1.bmp
"
;;
"
Windows
"*)
image="
$APPDATA
/Microsoft/Windows/Themes
"
image+="
/TranscodedWallpaper.jpg
"
;;
esac
;;
*)
# Get DE if user has disabled the function.
# Get DE if user has disabled the function.
((de_run != 1)) && get_de
((de_run != 1)) && get_de
...
@@ -2223,28 +2245,6 @@ get_wallpaper() {
...
@@ -2223,28 +2245,6 @@ get_wallpaper() {
image="
${
image
/
'file://'
}
"
image="
${
image
/
'file://'
}
"
image="
$(
trim_quotes
"
$image
"
)
"
image="
$(
trim_quotes
"
$image
"
)
"
;;
;;
"
Mac OS X
")
image="
$(
osascript
-e
'tell application "System Events" to picture of current desktop'
)
"
;;
"
Windows
")
case "
$distro
" in
"
Windows XP
")
case "
$kernel_name
" in
"
CYGWIN
"*) image="
/cygdrive/c/Documents and Settings/
${
USER
}
" ;;
"
MSYS2
"* | "
MINGW
*
") image="
/c/Documents and Settings/
${
USER
}
" ;;
esac
image+="
/Local Settings/Application Data/Microsoft
"
image+="
/Wallpaper1.bmp
"
;;
"
Windows
"*)
image="
$APPDATA
/Microsoft/Windows/Themes
"
image+="
/TranscodedWallpaper.jpg
"
;;
esac
;;
esac
esac
# If image is an xml file, don't use it.
# If image is an xml file, don't use it.
...
...
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