mirror of
https://github.com/EnumeratedDev/stormfetch.git
synced 2026-09-16 07:56:12 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e2631d5b0 | ||
|
|
153758b68e | ||
|
|
ed45b739a5 | ||
|
|
8c380dbec4 |
@@ -8,12 +8,12 @@ ifeq ($(SYSCONFDIR),)
|
|||||||
SYSCONFDIR := $(PREFIX)/etc
|
SYSCONFDIR := $(PREFIX)/etc
|
||||||
endif
|
endif
|
||||||
ifeq ($(GO),)
|
ifeq ($(GO),)
|
||||||
GO := /usr/bin/go
|
GO := $(shell type -a -P go | head -n 1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
build:
|
build:
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
$(GO) build -ldflags "-w" -o build/stormfetch stormfetch
|
$(GO) build -ldflags "-w -X 'main.systemConfigDir=$(SYSCONFDIR)'" -o build/stormfetch stormfetch
|
||||||
|
|
||||||
install: build/stormfetch config/
|
install: build/stormfetch config/
|
||||||
mkdir -p $(DESTDIR)$(BINDIR)
|
mkdir -p $(DESTDIR)$(BINDIR)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Stormfetch is still in beta, so distro compatibility is limited. If you would li
|
|||||||
- Download `make` from your package manager
|
- Download `make` from your package manager
|
||||||
- Run the following command to compile the project
|
- Run the following command to compile the project
|
||||||
```
|
```
|
||||||
make
|
make SYSCONFDIR=/etc
|
||||||
```
|
```
|
||||||
- Run the following command to install stormfetch into your system. You may also append a DESTDIR variable at the end of this line if you wish to install in a different location
|
- Run the following command to install stormfetch into your system. You may also append a DESTDIR variable at the end of this line if you wish to install in a different location
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#/45;27;45;7
|
||||||
|
${C1} 'o'
|
||||||
|
'ooo'
|
||||||
|
'ooxoo'
|
||||||
|
'ooxxxoo'
|
||||||
|
'oookkxxoo'
|
||||||
|
'oiioxkkxxoo'
|
||||||
|
':;:iiiioxxxoo'
|
||||||
|
`'.;::ioxxoo'
|
||||||
|
'-. `':;jiooo'
|
||||||
|
'oooio-.. `'i:io'
|
||||||
|
'ooooxxxxoio:,. `'-;'
|
||||||
|
'ooooxxxxxkkxoooIi:-. `'
|
||||||
|
'ooooxxxxxkkkkxoiiiiiji'
|
||||||
|
'ooooxxxxxkxxoiiii:'` .i'
|
||||||
|
'ooooxxxxxoi:::'` .;ioxo'
|
||||||
|
'ooooxooi::'` .:iiixkxxo'
|
||||||
|
'ooooi:'` `'';ioxxo'
|
||||||
|
'i:'` '':io'
|
||||||
|
'` `'
|
||||||
@@ -24,7 +24,7 @@ get_packages() {
|
|||||||
ARRAY+=("$(xbps-query -l | wc -l) (xbps)")
|
ARRAY+=("$(xbps-query -l | wc -l) (xbps)")
|
||||||
fi
|
fi
|
||||||
if command_exists bpm; then
|
if command_exists bpm; then
|
||||||
ARRAY+=("$(bpm list -n) (bpm)")
|
ARRAY+=("$(bpm list -c) (bpm)")
|
||||||
fi
|
fi
|
||||||
if command_exists emerge; then
|
if command_exists emerge; then
|
||||||
ARRAY+=("$(ls -l /var/db/pkg/* | wc -l) (emerge)")
|
ARRAY+=("$(ls -l /var/db/pkg/* | wc -l) (emerge)")
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var systemConfigDir = "/etc/"
|
||||||
|
|
||||||
var configPath = ""
|
var configPath = ""
|
||||||
var fetchScriptPath = ""
|
var fetchScriptPath = ""
|
||||||
|
|
||||||
@@ -46,12 +48,12 @@ func main() {
|
|||||||
|
|
||||||
func readConfig() {
|
func readConfig() {
|
||||||
// Get home directory
|
// Get home directory
|
||||||
configDir, _ := os.UserConfigDir()
|
userConfigDir, _ := os.UserConfigDir()
|
||||||
// Find valid config directory
|
// Find valid config directory
|
||||||
if _, err := os.Stat(path.Join(configDir, "stormfetch/config.yaml")); err == nil {
|
if _, err := os.Stat(path.Join(userConfigDir, "stormfetch/config.yaml")); err == nil {
|
||||||
configPath = path.Join(configDir, "stormfetch/config.yaml")
|
configPath = path.Join(userConfigDir, "stormfetch/config.yaml")
|
||||||
} else if _, err := os.Stat("/etc/stormfetch/config.yaml"); err == nil {
|
} else if _, err := os.Stat(path.Join(systemConfigDir, "stormfetch/config.yaml")); err == nil {
|
||||||
configPath = "/etc/stormfetch/config.yaml"
|
configPath = path.Join(systemConfigDir, "stormfetch/config.yaml")
|
||||||
} else {
|
} else {
|
||||||
log.Fatalf("Config file not found: %s", err.Error())
|
log.Fatalf("Config file not found: %s", err.Error())
|
||||||
}
|
}
|
||||||
@@ -74,10 +76,10 @@ func readConfig() {
|
|||||||
log.Fatalf("Fetch script path points to a directory")
|
log.Fatalf("Fetch script path points to a directory")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if _, err := os.Stat(path.Join(configDir, "stormfetch/fetch_script.sh")); err == nil {
|
if _, err := os.Stat(path.Join(userConfigDir, "stormfetch/fetch_script.sh")); err == nil {
|
||||||
fetchScriptPath = path.Join(configDir, "stormfetch/fetch_script.sh")
|
fetchScriptPath = path.Join(userConfigDir, "stormfetch/fetch_script.sh")
|
||||||
} else if _, err := os.Stat("/etc/stormfetch/fetch_script.sh"); err == nil {
|
} else if _, err := os.Stat(path.Join(systemConfigDir, "stormfetch/fetch_script.sh")); err == nil {
|
||||||
fetchScriptPath = "/etc/stormfetch/fetch_script.sh"
|
fetchScriptPath = path.Join(systemConfigDir, "stormfetch/fetch_script.sh")
|
||||||
} else {
|
} else {
|
||||||
log.Fatalf("Fetch script file not found: %s", err.Error())
|
log.Fatalf("Fetch script file not found: %s", err.Error())
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 121 KiB |
Reference in New Issue
Block a user