Skip to content

Commit

Permalink
Merge branch 'newlanguage-modelica' of github.com:dietmarw/onefetch i…
Browse files Browse the repository at this point in the history
…nto newlanguage-modelica
  • Loading branch information
o2sh committed Dec 29, 2024
2 parents d49d4ab + 18c8d39 commit 1c0d157
Show file tree
Hide file tree
Showing 100 changed files with 4,010 additions and 5,769 deletions.
5 changes: 0 additions & 5 deletions .cargo/audit.toml

This file was deleted.

11 changes: 0 additions & 11 deletions .codecov.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ARG VARIANT="buster"
ARG VARIANT="bookworm"
FROM mcr.microsoft.com/devcontainers/rust:1-${VARIANT}
RUN sudo apt update && sudo apt install -y cmake
11 changes: 7 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"name": "Rust",
"name": "onefetch",
"build": {
"dockerfile": "Dockerfile",
"args": { "VARIANT": "buster" }
"args": { "VARIANT": "bookworm" }
},
"customizations": {
"vscode": {
"extensions": ["EditorConfig.EditorConfig"]
}
},
"postCreateCommand": "git config --global --add safe.directory $PWD && cargo install cargo-insta",
"extensions": ["EditorConfig.EditorConfig"],
"remoteUser": "vscode"
}
22 changes: 7 additions & 15 deletions .devcontainer/website/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
{
"name": "Node.js & TypeScript",
"image": "mcr.microsoft.com/devcontainers/typescript-node:16-bullseye",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/onefetch,type=bind,consistency=cached",
"workspaceFolder": "/workspaces/onefetch/docs/vercel",
"extensions": ["esbenp.prettier-vscode", "svelte.svelte-vscode"],
"postCreateCommand": "npm ci",
"postAttachCommand": "npm run dev -- --port 3000",
"settings": {
"editor.formatOnSave": true
},
"portsAttributes": {
"3000": {
"label": "onfetch.dev",
"onAutoForward": "notify"
"name": "onefetch.dev",
"image": "mcr.microsoft.com/devcontainers/typescript-node:22-bullseye",
"customizations": {
"vscode": {
"extensions": ["esbenp.prettier-vscode", "svelte.svelte-vscode"]
}
}
},
"postCreateCommand": "npm install"
}
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ indent_style = tab
[*.json]
indent_style = space
indent_size = 2

[*.rb]
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ updates:
- "gix-*"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
13 changes: 12 additions & 1 deletion .github/wiki/Command-line-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ INFO:
-e, --exclude <EXCLUDE>...
Ignore all files & directories matching EXCLUDE
--no-bots [<REGEX>]
--no-bots[=<REGEX>]
Exclude [bot] commits. Use <REGEX> to override the default pattern
--no-merges
Expand All @@ -51,6 +51,12 @@ INFO:
-E, --email
Show the email address of each author
--http-url
Display repository URL as HTTP
--hide-token
Hide token in repository URL
--include-hidden
Count hidden files and directories
Expand Down Expand Up @@ -128,6 +134,11 @@ VISUALS:
--no-art
Hides the ascii art or image if provided
--nerd-fonts
Use Nerd Font icons
Replaces language chips with Nerd Font icons
DEVELOPER:
-o, --output <FORMAT>
Outputs Onefetch in a specific format
Expand Down
78 changes: 67 additions & 11 deletions .github/wiki/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ Onefetch is installed, then what?
```sh
> onefetch /path/of/your/repo
```

Or

```sh
> cd /path/of/your/repo
> onefetch
Expand All @@ -15,38 +16,50 @@ Onefetch is installed, then what?
### Misc

By [**@spenserblack**](https://github.com/spenserblack)

```sh
# Runs `onefetch -a Assembly`, `onefetch -a C`, etc.
onefetch -l | tr "[:upper:] " "[:lower:]-" | while read line; do echo "$line"; onefetch -a $line; done;
```

### Automatic repo detection and running

If you want to automate the detection and running of `onefetch` every time you `cd` into a repository you can leverage one of the methods below:

#### 1. Bash / Zsh

By [**@quazar-omega**](https://github.com/quazar-omega)

A script to put in your `.bashrc` - or `.zshrc` - to run onefetch whenever you open a shell into a repository or `cd` into a repository, making sure that it's different from the last one you were in:

```sh
# git repository greeter
last_repository=
check_directory_for_new_repository() {
current_repository=$(git rev-parse --show-toplevel 2> /dev/null)
if [ "$current_repository" ] && \
[ "$current_repository" != "$last_repository" ]; then
onefetch
fi
last_repository=$current_repository
current_repository=$(git rev-parse --show-toplevel 2> /dev/null)
if [ "$current_repository" ] && \
[ "$current_repository" != "$last_repository" ]; then
onefetch
fi
last_repository=$current_repository
}
cd() {
builtin cd "$@"
check_directory_for_new_repository
builtin cd "$@"
check_directory_for_new_repository
}

# optional, greet also when opening shell directly in repository directory
# adds time to startup
check_directory_for_new_repository
```

#### 2. Fish

By [**@TheSast**](https://github.com/TheSast)

A fish adaptation of the previous script, run it once in your shell to save it:

```fish
function cd -w='cd'
builtin cd $argv || return
Expand All @@ -66,11 +79,14 @@ funcsave cd
funcsave check_directory_for_new_repository
```

#### 3. CMD

By [**@mataha**](https://github.com/mataha)

An adaptation of the above snippet suited for Windows's `cmd.exe`,
specifically for inclusion in AutoRun scripts or DOSKEY macrofiles:
```batchfile

```bat
@set LAST_REPOSITORY=
@doskey cd = ( ^
Expand Down Expand Up @@ -102,7 +118,47 @@ specifically for inclusion in AutoRun scripts or DOSKEY macrofiles:
)
```

#### 4. Powershell

By [**@kiapanahi**](https://github.com/kiapanahi)

An adaptation of the above snippet suited for `Powershell`. Put this script in the `$PROFILE`.

```pwsh
# git repository greeter
$global:lastRepository = $null
function Check-DirectoryForNewRepository {
$currentRepository = git rev-parse --show-toplevel 2>$null
if ($currentRepository -and ($currentRepository -ne $global:lastRepository)) {
onefetch
}
$global:lastRepository = $currentRepository
}
function Set-Location {
param (
[string]$path
)
# Use the default Set-Location to change the directory
Microsoft.PowerShell.Management\Set-Location -Path $path
# Check if we are in a new Git repository
Check-DirectoryForNewRepository
}
# Optional: Check the repository also when opening a shell directly in a repository directory
# Uncomment the following line if desired
#Check-DirectoryForNewRepository
```

### Git alias

By [**@mbrehin**](https://github.com/mbrehin)

You can also add git alias to run onefetch during your git workflows

```sh
# Add Git alias for onefetch.
git config --global alias.project-summary '!which onefetch && onefetch'
Expand Down
8 changes: 4 additions & 4 deletions .github/wiki/Images-in-the-terminal.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Onefetch supports displaying images using [`kitty`](https://sw.kovidgoyal.net/kitty/graphics-protocol.html), [`Sixel`](https://en.wikipedia.org/wiki/Sixel) and [`iTerm`](https://www.iterm2.com/documentation-images.html).
Onefetch supports displaying images using [`kitty`](https://sw.kovidgoyal.net/kitty/graphics-protocol.html), [`Sixel`](https://en.wikipedia.org/wiki/Sixel) and [`iTerm`](https://www.iterm2.com/documentation-images.html) protocols.

<p align="center">
<img src="https://raw.githubusercontent.com/o2sh/onefetch/main/assets/screenshot-1.png" height="250px">
</p>

When running `onefetch --image ./My-picture.jpg`, the program looks for the first `Image Backend` supported by the terminal and use it to display the requested image instead of the Ascii logo.
When running `onefetch --image ./My-picture.jpg`, the program looks for the first `Image Protocol` supported by the terminal and use it to display the requested image instead of the Ascii logo.

If you decide to go manual, and want to force the use of a specific image backend --> `onefetch --image ./My-picture.jpg --image-backend sixel|kitty|iterm`
If you decide to go manual, and want to force the use of a specific image protocol: `onefetch --image ./My-picture.jpg --image-protocol sixel|kitty|iterm`

### Sixel

Expand All @@ -20,4 +20,4 @@ The kitty terminal graphics protocol used on the terminal of the same name allow

### ITerm

The iTerm inline image protocol supported by iTerm2 (also WezTerm) allows to display images within the terminal.
The iTerm inline image protocol supported by iTerm2 (also WezTerm) allows to display images within the terminal.
38 changes: 26 additions & 12 deletions .github/wiki/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ This wiki page will guide you through getting onefetch working on your system.
# Table of Contents

- [Universal Install](#universal-install)
- [Build from source](#build-from-source)
- [Cargo](#cargo)
- [Snap](#snap)
- [Build from source](#build-from-source)
- [OS/Distro Packages](#osdistro-packages)
- [Alpine Linux](#alpine-linux)
- [Arch](#arch)
Expand All @@ -31,9 +31,33 @@ This wiki page will guide you through getting onefetch working on your system.

If your architecture is supported by the pre-built binaries, you can download them from the [releases page](https://github.com/o2sh/onefetch/releases/latest).

## Build from source

First, install rust toolchain with [rustup](https://rustup.rs/):

```shell
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

> [!IMPORTANT]
> Ensure [CMake](https://cmake.org/download/) is installed.
```
git clone https://github.com/o2sh/onefetch
cd onefetch
make install
```

## Cargo

First, install `rustup` to get the `rust` compiler installed on your system (using the recommended `curl https://sh.rustup.rs -sSf | sh -s` installation method) and then
First, install rust toolchain with [rustup](https://rustup.rs/):

```shell
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

> [!IMPORTANT]
> Ensure [CMake](https://cmake.org/download/) is installed.
```
cargo install onefetch
Expand All @@ -57,16 +81,6 @@ snap install onefetch

The stable version will be installed for you automatically.

## Build from source

First, install `rustup` to get the `rust` compiler installed on your system (using the recommended `curl https://sh.rustup.rs -sSf | sh -s` installation method) and then

```
git clone https://github.com/o2sh/onefetch
cd onefetch
make install
```

# OS/Distro Packages

## Alpine Linux
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/audit.yml

This file was deleted.

Loading

0 comments on commit 1c0d157

Please sign in to comment.