mirror of https://github.com/Hilbis/Hilbish
Compare commits
No commits in common. "7ac0e277396ff41f0f9a1dd935595fbb5652bd77" and "c29b6c6fd4125b916f19d9cae90a82f6954875bd" have entirely different histories.
7ac0e27739
...
c29b6c6fd4
92
README.md
92
README.md
|
@ -1,23 +1,17 @@
|
|||
<div align="center">
|
||||
<img src="./assets/hilbish-flower.png" width=128><br>
|
||||
<img src="./assets/hilbish-text.png" width=256>
|
||||
<h1></h1>
|
||||
<h1>Hilbish</h1>
|
||||
<blockquote>
|
||||
🌺 The flower shell. A comfy and nice little shell for Lua users and fans!
|
||||
</blockquote>
|
||||
<p align="center">
|
||||
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/Rosettea/Hilbish?style=flat-square">
|
||||
<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>
|
||||
🎀 a nice lil shell for lua people made with go and lua
|
||||
</blockquote><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>
|
||||
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Hilbish is a new, Unix-like shell which uses Lua as its configuration language.
|
||||
It's decently fast for interactive use and includes a bunch of utility functions and features
|
||||
to make your life in a terminal easier.
|
||||
Hilbish is an interactive Unix-like shell written in Go, with the config
|
||||
and other code written in Lua.
|
||||
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
|
||||
<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>
|
||||
|
||||
### 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 with the following command:
|
||||
Arch Linux users can install Hilbish from the AUR.
|
||||
```sh
|
||||
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
|
||||
yay -S hilbish-git
|
||||
```
|
||||
|
||||
### Manual Build
|
||||
#### Prerequisites
|
||||
- [Go 1.16+](https://go.dev)
|
||||
- [Go 1.16](https://go.dev)
|
||||
- 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
|
||||
```
|
||||
|
@ -73,6 +66,11 @@ On Debian/Ubuntu and distros based on them, it can be installed with:
|
|||
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:
|
||||
```
|
||||
sudo pacman -S readline
|
||||
|
@ -81,38 +79,48 @@ sudo pacman -S readline
|
|||
#### Build
|
||||
First, clone Hilbish:
|
||||
```sh
|
||||
git clone --recursive https://github.com/Rosettea/Hilbish
|
||||
git clone --recursive https://github.com/Hilbis/Hilbish
|
||||
cd Hilbish
|
||||
go get -d ./...
|
||||
```
|
||||
|
||||
To build, run:
|
||||
```
|
||||
make dev
|
||||
```
|
||||
|
||||
Or, if you want a stable branch, run these commands:
|
||||
```
|
||||
# If you want the latest stable release, run this following command
|
||||
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
|
||||
Any kind of contributions to Hilbish are welcome!
|
||||
Read [CONTRIBUTING.md](CONTRIBUTING.md) before getting started.
|
||||
Any kind of contributions to Hilbish are welcome!
|
||||
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">
|
||||
<img src="https://contrib.rocks/image?repo=Hilbis/Hilbish" />
|
||||
</a>
|
||||
|
||||
*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
|
||||
Hilbish is licensed under the MIT license!
|
||||
Read the [license here](LICENSE) for more info.
|
||||
|
||||
Images in the [assets](assets/) folder are under CC-BY-SA 4.0
|
||||
|
||||
Hilbish is licensed under the MIT license.
|
||||
[Read here](LICENSE) for more info.
|
||||
|
|
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
15
main.go
|
@ -32,7 +32,6 @@ var (
|
|||
|
||||
hooks bait.Bait
|
||||
defaultConfPath string
|
||||
defaultHistPath string
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -44,7 +43,7 @@ func main() {
|
|||
|
||||
if defaultConfDir == "" {
|
||||
// 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")
|
||||
} else {
|
||||
defaultConfPath = filepath.Join(confDir, "hilbish", "hilbishrc.lua")
|
||||
|
@ -53,17 +52,7 @@ func main() {
|
|||
// else do ~ substitution
|
||||
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")
|
||||
verflag := getopt.BoolLong("version", 'v', "Prints Hilbish version")
|
||||
setshflag := getopt.BoolLong("setshellenv", 'S', "Sets $SHELL to Hilbish's executed path")
|
||||
|
|
4
rl.go
4
rl.go
|
@ -14,7 +14,7 @@ type LineReader struct {
|
|||
// other gophers might hate this naming but this is local, shut up
|
||||
func NewLineReader(prompt string) *LineReader {
|
||||
readline.Completer = readline.FilenameCompleter
|
||||
readline.LoadHistory(defaultHistPath)
|
||||
readline.LoadHistory(homedir + "/.hilbish-history")
|
||||
|
||||
return &LineReader{
|
||||
Prompt: prompt,
|
||||
|
@ -31,7 +31,7 @@ func (lr *LineReader) SetPrompt(prompt string) {
|
|||
|
||||
func (lr *LineReader) AddHistory(cmd string) {
|
||||
readline.AddHistory(cmd)
|
||||
readline.SaveHistory(defaultHistPath)
|
||||
readline.SaveHistory(homedir + "/.hilbish-history")
|
||||
}
|
||||
|
||||
func (lr *LineReader) ClearInput() {
|
||||
|
|
1
vars.go
1
vars.go
|
@ -4,7 +4,6 @@ package main
|
|||
var (
|
||||
version = "v0.5.1"
|
||||
defaultConfDir = "" // ~ will be substituted for home, path for user's default config
|
||||
defaultHistDir = ""
|
||||
|
||||
prompt string // Prompt will always get changed anyway
|
||||
multilinePrompt = "> "
|
||||
|
|
|
@ -10,9 +10,9 @@ var (
|
|||
.. hilbish.xdg.data .. '/hilbish/libs/?/init.lua;'
|
||||
.. hilbish.xdg.data .. '/hilbish/libs/?/?.lua;'
|
||||
.. hilbish.xdg.data .. '/hilbish/libs/?.lua'
|
||||
.. hilbish.xdg.config .. '/hilbish/?/init.lua'
|
||||
.. hilbish.xdg.config .. '/hilbish/?/?.lua'
|
||||
.. hilbish.xdg.config .. '/hilbish/?.lua'`
|
||||
.. hilbish.xdg.config .. '/?/init.lua'
|
||||
.. hilbish.xdg.config .. '/?/?.lua'
|
||||
.. hilbish.xdg.config .. '/?.lua'`
|
||||
preloadPath = "/usr/share/hilbish/preload.lua"
|
||||
sampleConfPath = "/usr/share/hilbish/.hilbishrc.lua" // Path to default/sample config
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue