Skip to content

Commit

Permalink
project: rename cufetch -> customfetch + deprecate it
Browse files Browse the repository at this point in the history
  • Loading branch information
Toni500github committed Nov 6, 2024
1 parent a3c7cd6 commit 19313a4
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 40 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: |
cd /tmp/customfetch-0.10.1.orig
sudo dpkg -i customfetch_0.10.1-1_amd64.deb
cufetch --wrap-lines=0
customfetch --wrap-lines=0
build_ubuntu-latest:

Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
printf "getting 0x5353 hexcode\n" && grep -nri "5353" /sys/class/ || true
- name: Test customfetch
run: ./build/debug/cufetch --wrap-lines=0
run: ./build/debug/customfetch --wrap-lines=0

build_Arch-AUR:

Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
run: neofetch

- name: Test customfetch
run: cufetch --wrap-lines=0
run: customfetch --wrap-lines=0

build_Arch:

Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
printf "/etc/os-release\n" && cat /etc/os-release
- name: Test customfetch
run: ./build/debug/cufetch --wrap-lines=0
run: ./build/debug/customfetch --wrap-lines=0

test-all-ascii-art:
runs-on: ubuntu-latest
Expand All @@ -170,4 +170,4 @@ jobs:
# yes, i know too long
# the --color arguments are just for adding a missing color to the non done ascii
- name: Test all the ascii art logos
run: for f in assets/ascii/*; do printf "\e[31m%s\e[0m\n" "$f" && cufetch --wrap-lines=0 -s "$f" -D assets --color "c1=!#fff111" --color "c2=!#00ff1a" --color "c3=!#faa311" --color "c4=!#343412" --color "c5=!#fff311" --color "c6=!#faa3aa" && sleep 1; done
run: for f in assets/ascii/*; do printf "\e[31m%s\e[0m\n" "$f" && customfetch --wrap-lines=0 -s "$f" -D assets --color "c1=!#fff111" --color "c2=!#00ff1a" --color "c3=!#faa311" --color "c4=!#343412" --color "c5=!#fff311" --color "c6=!#faa3aa" && sleep 1; done
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ build/
assets/distro_ascii_arts.json
assets/distro_ascii_arts.txt
cufetch
test.txt
test*.txt
pci.ids
output/
customfetch
customfetch_r
cufetch_r
thinkpad-arch_logo.txt
tanjiro_logo.txt
Expand Down
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ifeq ($(USE_DCONF), 1)
endif

NAME = customfetch
TARGET = cufetch
TARGET = $(NAME)
OLDVERSION = 0.10.0
VERSION = 0.10.1
BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
Expand All @@ -75,9 +75,10 @@ endif
$(TARGET): fmt toml $(OBJ)
mkdir -p $(BUILDDIR)
$(CXX) $(OBJ) $(BUILDDIR)/toml++/toml.o -o $(BUILDDIR)/$(TARGET) $(LDFLAGS)
cd $(BUILDDIR)/ && ln -sf $(TARGET) cufetch

dist:
bsdtar -zcf $(NAME)-v$(VERSION).tar.gz LICENSE cufetch.1 assets/ascii/ -C $(BUILDDIR) $(TARGET)
bsdtar -zcf $(NAME)-v$(VERSION).tar.gz LICENSE $(TARGET).1 assets/ascii/ -C $(BUILDDIR) $(TARGET)

clean:
rm -rf $(BUILDDIR)/$(TARGET) $(OBJ)
Expand All @@ -90,19 +91,20 @@ distclean:

install: $(TARGET)
install $(BUILDDIR)/$(TARGET) -Dm 755 -v $(DESTDIR)$(PREFIX)/bin/$(TARGET)
cd $(DESTDIR)$(PREFIX)/bin/ && ln -sf $(TARGET) cufetch
mkdir -p $(DESTDIR)$(MANPREFIX)/man1/
sed -e "s/@VERSION@/$(VERSION)/g" -e "s/@BRANCH@/$(BRANCH)/g" < cufetch.1 > $(DESTDIR)$(MANPREFIX)/man1/cufetch.1
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/cufetch.1
sed -e "s/@VERSION@/$(VERSION)/g" -e "s/@BRANCH@/$(BRANCH)/g" < $(TARGET).1 > $(DESTDIR)$(MANPREFIX)/man1/$(TARGET).1
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/$(TARGET).1
cd assets/ && find ascii/ -type f -exec install -Dm 644 "{}" "$(DESTDIR)$(PREFIX)/share/customfetch/{}" \;
ifeq ($(GUI_MODE), 1)
mkdir -p $(DESTDIR)$(APPPREFIX)
cp -f cufetch.desktop $(DESTDIR)$(APPPREFIX)
cp -f $(TARGET).desktop $(DESTDIR)$(APPPREFIX)
endif

uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/$(TARGET)
rm -f $(DESTDIR)$(MANPREFIX)/man1/cufetch.1
rm -f $(DESTDIR)$(APPPREFIX)/cufetch.desktop
rm -f $(DESTDIR)$(PREFIX)/bin/$(TARGET) $(DESTDIR)$(PREFIX)/bin/cufetch
rm -f $(DESTDIR)$(MANPREFIX)/man1/$(TARGET).1
rm -f $(DESTDIR)$(APPPREFIX)/$(TARGET).desktop
rm -rf $(DESTDIR)$(PREFIX)/share/customfetch/

remove: uninstall
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The name can vary depending on the package manager or distro

>[!NOTE]
>installing with GUI mode may slow down customfetch a bit because it needs to load the GUI libraries at runtime.\
>To check if it's enabled or not, run "cufetch --version"
>To check if it's enabled or not, run "customfetch --version"
### Debian/Ubuntu and based
Download the latest `.deb` package in [releases](https://github.com/Toni500github/customfetch/releases/latest)
Expand All @@ -73,9 +73,9 @@ taur -S customfetch-gui-bin

### General Distros (Manual installation)
Download the latest `.tar.gz` tarball file in [releases](https://github.com/Toni500github/customfetch/releases/latest) \
It contains the binary `cufetch` and the manual `cufetch.1` with the `LICENSE`.\
It contains the binary `customfetch` and the manual `customfetch.1` with the `LICENSE`.\
Togheter with the directory `assets/ascii` with the distro ascii art logos.\
If installing the GUI mode version, there's `cufetch.desktop`
If installing the GUI mode version, there's `customfetch.desktop`

### Arch and based (AUR) (source)
```bash
Expand Down Expand Up @@ -106,12 +106,12 @@ cd customfetch
make install DEBUG=0 GUI_MODE=0

# automatically generates a config and prints the infos
cufetch
customfetch
```

## Config (with explanation)

Read the manual `cufetch.1` or the comments in the default generated config for knowing more about the configuration in customfetch.\
Read the manual `customfetch.1` or the comments in the default generated config for knowing more about the configuration in customfetch.\
This is only an explaination about tags and preview, that can be always found in the documentation.

Here's an example using my config
Expand Down
4 changes: 2 additions & 2 deletions cufetch.1 → customfetch.1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.SH NAME
customfetch \- A command\-line and GUI system information tool (or neofetch like program)
.SH SYNOPSIS
.B cufetch
.B customfetch
[\fI\,OPTION\/\fR]...
.SH CONFIGURATION
customfetch focus point is to be customizable and fast at the same time.
Expand Down Expand Up @@ -146,7 +146,7 @@ It's recommended to use GUI mode for the moment if something doesn't work
\fB\-m\fR, \fB\-\-layout\-line\fR
Will replace the config layout, with a layout you specify in the arguments
.br
Example: "cufetch -m "${auto}OS: $<os.name>" -m "${auto}CPU: $<cpu.cpu>" "
Example: "customfetch -m "${auto}OS: $<os.name>" -m "${auto}CPU: $<cpu.cpu>" "
.br
Will only print the logo (if not disabled), along side the parsed OS and CPU
.TP
Expand Down
2 changes: 1 addition & 1 deletion cufetch.desktop → customfetch.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Name=Customfetch
Comment=Highly customizable and fast fetch program
Type=Application
Exec=cufetch --gui
Exec=customfetch --gui
Terminal=false
Categories=Viewer;GTK;
Icon=lookswitcher
Expand Down
4 changes: 2 additions & 2 deletions examples/config_cool.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
# Save the file and use `-s "/path/to/text/file"`.
# Use `--offset` (`-o`) for aligning and put it under the bonsai.
#
# Read the manual cufetch.1 for more infos with $() tag
# Read the manual customfetch.1 for more infos with $() tag
#
# Q: Can I run recursive tags?
# A: If "$<disk($<disk($[1,1,$(echo -n $<disk(/).mountdir>),23]).mountdir>).disk>" works,
Expand Down Expand Up @@ -224,7 +224,7 @@ flatpak-dirs = ["/var/lib/flatpak/app/", "~/.local/share/flatpak/app/"]
apk-files = ["/var/lib/apk/db/installed"]

# GUI options
# note: customfetch needs to be compiled with GUI_MODE=1 (check with "cufetch --version")
# note: customfetch needs to be compiled with GUI_MODE=1 (check with "customfetch --version")
[gui]
enable = false

Expand Down
2 changes: 1 addition & 1 deletion examples/config_simple.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
# Save the file and use `-s "/path/to/text/file"`.
# Use `--offset` (`-o`) for aligning and put it under the bonsai.
#
# Read the manual cufetch.1 for more infos with $() tag
# Read the manual customfetch.1 for more infos with $() tag
#
# Q: Can I run recursive tags?
# A: If "$<disk($<disk($[1,1,$(echo -n $<disk(/).mountdir>),23]).mountdir>).disk>" works,
Expand Down
4 changes: 2 additions & 2 deletions examples/nitch_like_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
# Save the file and use `-s "/path/to/text/file"`.
# Use `--offset` (`-o`) for aligning and put it under the bonsai.
#
# Read the manual cufetch.1 for more infos with $() tag
# Read the manual customfetch.1 for more infos with $() tag
#
# Q: Can I run recursive tags?
# A: If "$<disk($<disk($[1,1,$(echo -n $<disk(/).mountdir>),23]).mountdir>).disk>" works,
Expand Down Expand Up @@ -206,7 +206,7 @@ flatpak-dirs = ["/var/lib/flatpak/app/", "~/.local/share/flatpak/app/"]
apk-files = ["/var/lib/apk/db/installed"]

# GUI options
# note: customfetch needs to be compiled with GUI_MODE=1 (check with "cufetch --version")
# note: customfetch needs to be compiled with GUI_MODE=1 (check with "customfetch --version")
[gui]
enable = false

Expand Down
4 changes: 2 additions & 2 deletions include/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ inline constexpr std::string_view AUTOCONFIG = R"#([config]
# Save the file and use `-s "/path/to/text/file"`.
# Use `--offset` (`-o`) for aligning and put it under the bonsai.
#
# Read the manual cufetch.1 for more infos with $() tag
# Read the manual customfetch.1 for more infos with $() tag
#
# Q: Can I run recursive tags?
# A: If "$<disk($<disk($[1,1,$(echo -n $<disk(/).mountdir>),23]).mountdir>).disk>" works,
Expand Down Expand Up @@ -340,7 +340,7 @@ flatpak-dirs = ["/var/lib/flatpak/app/", "~/.local/share/flatpak/app/"]
apk-files = ["/var/lib/apk/db/installed"]
# GUI options
# note: customfetch needs to be compiled with GUI_MODE=1 (check with "cufetch --version" if GUI mode was enabled)
# note: customfetch needs to be compiled with GUI_MODE=1 (check with "customfetch --version" if GUI mode was enabled)
[gui]
enable = false
Expand Down
2 changes: 1 addition & 1 deletion include/parse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct parse_args_t
};

/* Parse input, in-place, with data from systemInfo.
* Documentation on formatting is in the default config.toml file or the cufetch.1 manual.
* Documentation on formatting is in the default config.toml file or the customfetch.1 manual.
* @param input The string to parse
* @param systemInfo The system infos
* @param pureOutput The output of the string but without tags
Expand Down
14 changes: 7 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static void version()

static void help(bool invalid_opt = false)
{
fmt::println("Usage: cufetch [OPTIONS]...");
fmt::println("Usage: customfetch [OPTIONS]...");
fmt::println(R"(
A command-line system information tool (or neofetch like program), which its focus point is customizability and perfomance
Expand All @@ -96,7 +96,7 @@ A command-line system information tool (or neofetch like program), which its foc
It's recommended to use GUI mode for the moment if something doesn't work
-m, --layout-line Will replace the config layout, with a layout you specify in the arguments
Example: `cufetch -m "${{auto}}OS: $<os.name>" -m "${{auto}}CPU: $<cpu.cpu>"`
Example: `customfetch -m "${{auto}}OS: $<os.name>" -m "${{auto}}CPU: $<cpu.cpu>"`
Will only print the logo (if not disabled), along side the parsed OS and CPU
-g, --gui Use GUI mode instead of priting in the terminal (use --version to check if it was enabled)
Expand All @@ -122,7 +122,7 @@ A command-line system information tool (or neofetch like program), which its foc
Syntax MUST be "name=value" with no space beetween "=", example: --color "foo=#444333".
Thus replaces any instance of foo with #444333. Can be done with multiple colors separetly.
Read the manual "cufetch.1" or the autogenerated config file for more infos about customfetch and how it works
Read the manual "customfetch.1" or the autogenerated config file for more infos about customfetch and how it works
)"sv);
std::exit(invalid_opt);
}
Expand All @@ -136,8 +136,8 @@ module
member : description [example of what it prints, maybe another]
Should be used in the config as like as $<module.member>
NOTE: there are modules such as "user.de_version" that may slow down cufetch because of querying things like the DE version
cufetch is still fast tho :)
NOTE: there are modules such as "user.de_version" that may slow down customfetch because of querying things like the DE version
customfetch is still fast tho :)
os
name : OS name (pretty name) [Ubuntu 22.04.4 LTS, Arch Linux]
Expand Down Expand Up @@ -513,11 +513,11 @@ int main(int argc, char *argv[])
path = logo_type_path;
}

debug("{} path = {}", __PRETTY_FUNCTION__, path);

if (!std::filesystem::exists(path) && !config.m_disable_source)
die("'{}' doesn't exist. Can't load image/text file", path);

debug("{} path = {}", __PRETTY_FUNCTION__, path);

#ifdef GUI_MODE
if (config.gui)
{
Expand Down
4 changes: 2 additions & 2 deletions src/query/unix/theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static bool get_cursor_gsettings(const std::string_view de_name, Theme::Theme_t&

if (config.slow_query_warnings)
{
warn("cufetch could not detect a gtk configuration file. cufetch will use the much-slower gsettings.");
warn("customfetch could not detect a gtk configuration file. customfetch will use the much-slower gsettings.");
warn("If there's a file in a standard location that we aren't detecting, please file an issue on our GitHub.");
info("You can disable this warning by disabling slow-query-warnings in your config.toml file.");
}
Expand Down Expand Up @@ -375,7 +375,7 @@ static void get_gtk_theme_gsettings(const std::string_view de_name, Theme::Theme

if (config.slow_query_warnings)
{
warn("cufetch could not detect a gtk configuration file. cufetch will use the much-slower gsettings.");
warn("customfetch could not detect a gtk configuration file. customfetch will use the much-slower gsettings.");
warn("If there's a file in a standard location that we aren't detecting, please file an issue on our GitHub.");
info("You can disable this warning by disabling slow-query-warnings in your config.toml file.");
}
Expand Down
2 changes: 1 addition & 1 deletion src/query/unix/user.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static std::string get_shell_name(const std::string_view shell_path)

static std::string get_term_name(std::string& term_ver, const std::string_view osname)
{
// cufetch -> shell -> terminal
// customfetch -> shell -> terminal
const pid_t ppid = getppid();
std::ifstream ppid_f(fmt::format("/proc/{}/status", ppid), std::ios::in);
std::string line, term_pid;
Expand Down

0 comments on commit 19313a4

Please sign in to comment.