Skip to content

Commit bfde42d

Browse files
committed
Initial commit
0 parents  commit bfde42d

File tree

20 files changed

+993
-0
lines changed

20 files changed

+993
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# IntelliJ
2+
*.iml
3+
.idea/
4+
5+
# Eclipse
6+
.settings/
7+
.project
8+
.classpath
9+
10+
# Common
11+
*target/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Alex
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Jeofetch
2+
3+
<p align="center">
4+
A Java-based ripoff of <a href="https://github.com/dylanaraps/neofetch" target="_blank">neofetch</a>.
5+
<br />
6+
<small>
7+
(pronounced jay-oh-fetch, <i>/dʒeɪ-oʊ-fetʃ/</i>)
8+
</small>
9+
</p>
10+
11+
12+
<p align="center">
13+
<a href="./LICENSE.md"><img src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
14+
</p>
15+
16+
<br />
17+
18+
<img src="https://i.imgur.com/fzJtLqr.png" alt="Jeofetch running under WSL" align="right" height="240px">
19+
20+
Jeofetch is a command-line tool to showoff your system and what you have!
21+
22+
Obviously this is to screenshot and show to other people, it isn't really a good diagnostic tool.
23+
24+
<br />
25+
<br />
26+
27+
# Usage
28+
29+
0) Have Java installed, any version &gt;7 do.
30+
1) Grab the latest release zip from [here](https://github.com/e3ndr/jeofetch/releases/latest).
31+
2) Extract the zip to a folder.
32+
4) Put said folder on your path. (Linux users will also need to make the `.sh` file executable)
33+
5) Run `jeofetch` from your favorite console. (Add `-H` to hide your user and hostname)
34+
6) Screenshot.
35+
7) Profit!
36+
37+
Running `jeofetch -h` will list all the available commands.
38+
39+
# More
40+
41+
Need/want more art? Open an issue and I'll *try* to get you sorted.

dist/jeofetch.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
java -jar jeofetch.jar %*

dist/jeofetch.command

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
java -jar Jeofetch.jar $@

dist/jeofetch.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
java -jar Jeofetch.jar $@

pom.xml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>xyz.e3ndr</groupId>
6+
<artifactId>Jeofetch</artifactId>
7+
<version>1.0.0</version>
8+
9+
<properties>
10+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
11+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
12+
</properties>
13+
14+
<build>
15+
<resources>
16+
<resource>
17+
<directory>src/main/resources</directory>
18+
<filtering>true</filtering>
19+
</resource>
20+
</resources>
21+
22+
<plugins>
23+
<plugin>
24+
<groupId>org.apache.maven.plugins</groupId>
25+
<artifactId>maven-compiler-plugin</artifactId>
26+
<version>3.8.1</version>
27+
<configuration>
28+
<source>1.8</source>
29+
<target>1.8</target>
30+
</configuration>
31+
</plugin>
32+
<plugin>
33+
<groupId>org.apache.maven.plugins</groupId>
34+
<artifactId>maven-assembly-plugin</artifactId>
35+
<executions>
36+
<execution>
37+
<phase>package</phase>
38+
<goals>
39+
<goal>single</goal>
40+
</goals>
41+
<configuration>
42+
<finalName>jeofetch</finalName>
43+
<archive>
44+
<manifest>
45+
<mainClass>
46+
xyz.e3ndr.jeofetch.Bootstrap
47+
</mainClass>
48+
</manifest>
49+
</archive>
50+
<descriptorRefs>
51+
<descriptorRef>jar-with-dependencies</descriptorRef>
52+
</descriptorRefs>
53+
<appendAssemblyId>false</appendAssemblyId>
54+
</configuration>
55+
</execution>
56+
</executions>
57+
</plugin>
58+
</plugins>
59+
</build>
60+
61+
<repositories>
62+
<repository>
63+
<id>jitpack.io</id>
64+
<url>https://jitpack.io</url>
65+
</repository>
66+
</repositories>
67+
68+
<dependencies>
69+
<dependency>
70+
<groupId>org.projectlombok</groupId>
71+
<artifactId>lombok</artifactId>
72+
<version>1.18.12</version>
73+
<scope>provided</scope>
74+
</dependency>
75+
<dependency> <!-- For Eclipse users -->
76+
<groupId>org.jetbrains</groupId>
77+
<artifactId>annotations</artifactId>
78+
<version>19.0.0</version>
79+
<scope>provided</scope>
80+
</dependency>
81+
82+
<!-- Utilities -->
83+
<dependency>
84+
<groupId>com.github.e3ndr</groupId>
85+
<artifactId>ConsoleUtil</artifactId>
86+
<version>1.3.1</version>
87+
<scope>compile</scope>
88+
</dependency>
89+
<dependency>
90+
<groupId>com.github.casterlabs.rakurai</groupId>
91+
<artifactId>Util</artifactId>
92+
<version>1.9.1</version>
93+
<scope>compile</scope>
94+
</dependency>
95+
<dependency>
96+
<groupId>info.picocli</groupId>
97+
<artifactId>picocli</artifactId>
98+
<version>4.3.0</version>
99+
<scope>compile</scope>
100+
</dependency>
101+
</dependencies>
102+
</project>
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
package xyz.e3ndr.jeofetch;
2+
3+
import java.io.IOException;
4+
5+
import lombok.Getter;
6+
import picocli.CommandLine;
7+
import picocli.CommandLine.Command;
8+
import picocli.CommandLine.Option;
9+
import xyz.e3ndr.consoleutil.ConsoleUtil;
10+
import xyz.e3ndr.consoleutil.input.InputKey;
11+
import xyz.e3ndr.consoleutil.input.KeyHook;
12+
import xyz.e3ndr.consoleutil.input.KeyListener;
13+
14+
@Getter
15+
@Command(name = "print", mixinStandardHelpOptions = true, version = ":^)", description = "Prints a neofetch-esque report")
16+
public class Bootstrap implements Runnable {
17+
18+
@Option(names = {
19+
"-H",
20+
"--hide"
21+
}, description = "Hides sensitive information")
22+
private boolean hideSensitive = false;
23+
24+
@Option(names = {
25+
"-na",
26+
"--no-art"
27+
}, description = "Disables art")
28+
private boolean noArt = false;
29+
30+
@Option(names = {
31+
"-nc",
32+
"--no-color"
33+
}, description = "Disables color and formatting")
34+
private boolean noColor = false;
35+
36+
@Option(names = {
37+
"-s",
38+
"--stay"
39+
}, description = "Stays on screen until you press a key")
40+
private boolean stay = false;
41+
42+
@Option(names = {
43+
"-f",
44+
"--force"
45+
}, description = "Forces a piece of art to be on screen")
46+
private String forced = null;
47+
48+
public static void main(String[] args) {
49+
// try {
50+
// ConsoleUtil.summonConsoleWindow();
51+
// } catch (IOException | InterruptedException e) {}
52+
53+
new CommandLine(new Bootstrap()).execute(args);
54+
}
55+
56+
@Override
57+
public void run() {
58+
if (System.getProperty("StartedWithConsole", "").equals("true")) {
59+
try {
60+
this.stay = true;
61+
ConsoleUtil.setTitle("Jeofetch");
62+
} catch (IOException | InterruptedException e) {}
63+
}
64+
65+
try {
66+
Jeofetch.print(this);
67+
} catch (Throwable t) {
68+
t.printStackTrace();
69+
}
70+
71+
if (this.stay) {
72+
KeyHook.addListener(new KeyListener() {
73+
@Override
74+
public void onKey(char key, boolean alt, boolean control) {
75+
System.exit(0);
76+
}
77+
78+
@Override
79+
public void onKey(InputKey key) {
80+
System.exit(0);
81+
}
82+
});
83+
84+
try {
85+
Thread.sleep(Long.MAX_VALUE);
86+
} catch (InterruptedException e) {}
87+
}
88+
}
89+
90+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package xyz.e3ndr.jeofetch;
2+
3+
import java.io.IOException;
4+
import java.io.InputStream;
5+
import java.nio.charset.StandardCharsets;
6+
7+
import co.casterlabs.rakurai.io.IOUtil;
8+
9+
public class FileUtil {
10+
11+
public static String loadResource(String path) throws IOException {
12+
InputStream in = FileUtil.class.getClassLoader().getResourceAsStream(path);
13+
14+
if (in == null) {
15+
return null;
16+
} else {
17+
return IOUtil.readInputStreamString(in, StandardCharsets.UTF_8);
18+
}
19+
}
20+
21+
}

0 commit comments

Comments
 (0)