Compare commits

..

No commits in common. "7ac0e277396ff41f0f9a1dd935595fbb5652bd77" and "c29b6c6fd4125b916f19d9cae90a82f6954875bd" have entirely different histories.

9 changed files with 57 additions and 61 deletions

View File

@ -1,23 +1,17 @@
<div align="center"> <div align="center">
<img src="./assets/hilbish-flower.png" width=128><br> <h1>Hilbish</h1>
<img src="./assets/hilbish-text.png" width=256>
<h1></h1>
<blockquote> <blockquote>
🌺 The flower shell. A comfy and nice little shell for Lua users and fans! 🎀 a nice lil shell for lua people made with go and lua
</blockquote> </blockquote><p align="center">
<p align="center"> <a href="https://github.com/Hilbis/Hilbish/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22"><img src="https://img.shields.io/github/issues/Hilbis/Hilbish/help%20wanted?color=green" alt="help wanted"></a>
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/Rosettea/Hilbish?style=flat-square"> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
<img alt="GitHub commits since latest release (by date)" src="https://img.shields.io/github/commits-since/Rosettea/Hilbish/latest?style=flat-square">
<img alt="GitHub contributors" src="https://img.shields.io/github/contributors/Rosettea/Hilbish?style=flat-square"><br>
<a href="https://github.com/Rosettea/Hilbish/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22"><img src="https://img.shields.io/github/issues/Hilbis/Hilbish/help%20wanted?style=flat-square&color=green" alt="help wanted"></a>
<a href="https://github.com/Rosettea/Hilbish/blob/master/LICENSE"><img alt="GitHub license" src="https://img.shields.io/github/license/Rosettea/Hilbish?style=flat-square"></a>
<a href="https://discord.gg/3PDdcQz"><img alt="Discord" src="https://img.shields.io/discord/732357621503229962?color=blue&style=flat-square"></a>
</p> </p>
</div> </div>
Hilbish is a new, Unix-like shell which uses Lua as its configuration language. Hilbish is an interactive Unix-like shell written in Go, with the config
It's decently fast for interactive use and includes a bunch of utility functions and features and other code written in Lua.
to make your life in a terminal easier. It is sort of in a stable state currently, usable as a daily shell,
but there may still be breaking changes in Lua modules.
# Screenshots # Screenshots
<div align="center"> <div align="center">
@ -48,22 +42,21 @@ like what is highlighted in the screenshot.
<br><img src="https://modeus.is-inside.me/KJ0Puceb.png"><br> <br><img src="https://modeus.is-inside.me/KJ0Puceb.png"><br>
### AUR ### AUR
![AUR maintainer](https://img.shields.io/aur/maintainer/hilbish?logo=arch-linux&style=flat-square) Arch Linux users can install Hilbish from the AUR.
Arch Linux users can install Hilbish from the AUR with the following command:
```sh ```sh
yay -S hilbish yay -S hilbish
``` ```
Or from the latest `master` commit with: If you want the latest and greatest, you can install and compile from the latest git commit
```sh ```sh
yay -S hilbish-git yay -S hilbish-git
``` ```
### Manual Build ### Manual Build
#### Prerequisites #### Prerequisites
- [Go 1.16+](https://go.dev) - [Go 1.16](https://go.dev)
- GNU Readline - GNU Readline
On Fedora or other RPM based distros, readline can be installed with: On Fedora, readline can be installed with:
``` ```
sudo dnf install readline-devel sudo dnf install readline-devel
``` ```
@ -73,6 +66,11 @@ On Debian/Ubuntu and distros based on them, it can be installed with:
sudo apt install libreadline-dev sudo apt install libreadline-dev
``` ```
On OpenSUSE, it can be installed with:
```
sudo zypper install readline-devel
```
On Arch Linux, it can be installed with: On Arch Linux, it can be installed with:
``` ```
sudo pacman -S readline sudo pacman -S readline
@ -81,38 +79,48 @@ sudo pacman -S readline
#### Build #### Build
First, clone Hilbish: First, clone Hilbish:
```sh ```sh
git clone --recursive https://github.com/Rosettea/Hilbish git clone --recursive https://github.com/Hilbis/Hilbish
cd Hilbish cd Hilbish
go get -d ./... # If you want the latest stable release, run this following command
```
To build, run:
```
make dev
```
Or, if you want a stable branch, run these commands:
```
git checkout $(git describe --tags `git rev-list --tags --max-count=1`) git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
make build ```
```
After you did all that, run `sudo make install` to install Hilbish globally. And get dependencies and build:
```sh
go get -d all
make dev
```
If you `git checkout`'d the latest stable release, run
`make build` instead of `make dev`.
or want to experiment Hilbiline, instead run
`make hilbiline`
#### Install
`sudo make install`
### Uninstall
```sh
sudo make uninstall
```
# Contributing # Contributing
Any kind of contributions to Hilbish are welcome! Any kind of contributions to Hilbish are welcome!
Read [CONTRIBUTING.md](CONTRIBUTING.md) before getting started. Make sure to read [CONTRIBUTING.md](CONTRIBUTING.md) before getting started.
### Special Thanks To
Everyone here who has contributed:
##### Thanks to everyone below who's contributed!
<a href="https://github.com/Hilbis/Hilbish/graphs/contributors"> <a href="https://github.com/Hilbis/Hilbish/graphs/contributors">
<img src="https://contrib.rocks/image?repo=Hilbis/Hilbish" /> <img src="https://contrib.rocks/image?repo=Hilbis/Hilbish" />
</a> </a>
*Made with [contributors-img](https://contrib.rocks).* *Made with [contributors-img](https://contrib.rocks).*
### Credits
- [This blog post](https://www.vidarholen.net/contents/blog/?p=878) which
is how Hilbish now inserts a newline even if output doesn't have one.
# License # License
Hilbish is licensed under the MIT license! Hilbish is licensed under the MIT license.
Read the [license here](LICENSE) for more info. [Read here](LICENSE) for more info.
Images in the [assets](assets/) folder are under CC-BY-SA 4.0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 88 KiB

15
main.go
View File

@ -32,7 +32,6 @@ var (
hooks bait.Bait hooks bait.Bait
defaultConfPath string defaultConfPath string
defaultHistPath string
) )
func main() { func main() {
@ -44,7 +43,7 @@ func main() {
if defaultConfDir == "" { if defaultConfDir == "" {
// we'll add *our* default if its empty (wont be if its changed comptime) // we'll add *our* default if its empty (wont be if its changed comptime)
if _, err := os.Stat(filepath.Join(confDir, "hilbish")); os.IsNotExist(err) { if _, err := os.Stat(filepath.Join(confDir, "hilbish", "hilbishrc.lua")); os.IsNotExist(err) {
defaultConfPath = filepath.Join(homedir, "/.hilbishrc.lua") defaultConfPath = filepath.Join(homedir, "/.hilbishrc.lua")
} else { } else {
defaultConfPath = filepath.Join(confDir, "hilbish", "hilbishrc.lua") defaultConfPath = filepath.Join(confDir, "hilbish", "hilbishrc.lua")
@ -53,17 +52,7 @@ func main() {
// else do ~ substitution // else do ~ substitution
defaultConfPath = filepath.Join(strings.Replace(defaultConfDir, "~", homedir, 1), ".hilbishrc.lua") defaultConfPath = filepath.Join(strings.Replace(defaultConfDir, "~", homedir, 1), ".hilbishrc.lua")
} }
if defaultHistDir == "" {
// we'll add *our* default if its empty (wont be if its changed comptime)
if _, err := os.Stat(filepath.Join(confDir, "hilbish")); os.IsNotExist(err) {
defaultHistPath = filepath.Join(homedir, "/.hilbish-history")
} else {
defaultHistPath = filepath.Join(confDir, "hilbish", ".hilbish-history")
}
} else {
// else do ~ substitution
defaultHistPath = filepath.Join(strings.Replace(defaultHistDir, "~", homedir, 1), ".hilbishrc.lua")
}
helpflag := getopt.BoolLong("help", 'h', "Prints Hilbish flags") helpflag := getopt.BoolLong("help", 'h', "Prints Hilbish flags")
verflag := getopt.BoolLong("version", 'v', "Prints Hilbish version") verflag := getopt.BoolLong("version", 'v', "Prints Hilbish version")
setshflag := getopt.BoolLong("setshellenv", 'S', "Sets $SHELL to Hilbish's executed path") setshflag := getopt.BoolLong("setshellenv", 'S', "Sets $SHELL to Hilbish's executed path")

4
rl.go
View File

@ -14,7 +14,7 @@ type LineReader struct {
// other gophers might hate this naming but this is local, shut up // other gophers might hate this naming but this is local, shut up
func NewLineReader(prompt string) *LineReader { func NewLineReader(prompt string) *LineReader {
readline.Completer = readline.FilenameCompleter readline.Completer = readline.FilenameCompleter
readline.LoadHistory(defaultHistPath) readline.LoadHistory(homedir + "/.hilbish-history")
return &LineReader{ return &LineReader{
Prompt: prompt, Prompt: prompt,
@ -31,7 +31,7 @@ func (lr *LineReader) SetPrompt(prompt string) {
func (lr *LineReader) AddHistory(cmd string) { func (lr *LineReader) AddHistory(cmd string) {
readline.AddHistory(cmd) readline.AddHistory(cmd)
readline.SaveHistory(defaultHistPath) readline.SaveHistory(homedir + "/.hilbish-history")
} }
func (lr *LineReader) ClearInput() { func (lr *LineReader) ClearInput() {

View File

@ -4,7 +4,6 @@ package main
var ( var (
version = "v0.5.1" version = "v0.5.1"
defaultConfDir = "" // ~ will be substituted for home, path for user's default config defaultConfDir = "" // ~ will be substituted for home, path for user's default config
defaultHistDir = ""
prompt string // Prompt will always get changed anyway prompt string // Prompt will always get changed anyway
multilinePrompt = "> " multilinePrompt = "> "

View File

@ -10,9 +10,9 @@ var (
.. hilbish.xdg.data .. '/hilbish/libs/?/init.lua;' .. hilbish.xdg.data .. '/hilbish/libs/?/init.lua;'
.. hilbish.xdg.data .. '/hilbish/libs/?/?.lua;' .. hilbish.xdg.data .. '/hilbish/libs/?/?.lua;'
.. hilbish.xdg.data .. '/hilbish/libs/?.lua' .. hilbish.xdg.data .. '/hilbish/libs/?.lua'
.. hilbish.xdg.config .. '/hilbish/?/init.lua' .. hilbish.xdg.config .. '/?/init.lua'
.. hilbish.xdg.config .. '/hilbish/?/?.lua' .. hilbish.xdg.config .. '/?/?.lua'
.. hilbish.xdg.config .. '/hilbish/?.lua'` .. hilbish.xdg.config .. '/?.lua'`
preloadPath = "/usr/share/hilbish/preload.lua" preloadPath = "/usr/share/hilbish/preload.lua"
sampleConfPath = "/usr/share/hilbish/.hilbishrc.lua" // Path to default/sample config sampleConfPath = "/usr/share/hilbish/.hilbishrc.lua" // Path to default/sample config
) )