mirror of https://github.com/Hilbis/Hilbish
Compare commits
No commits in common. "72d6b0a4a0266eb1b3ab1b6c17ea90a3020cc152" and "97188e73a515fa43d36b0bde6c96f7d27438751b" have entirely different histories.
72d6b0a4a0
...
97188e73a5
|
@ -1,11 +1,5 @@
|
||||||
# 🎀 Changelog
|
# 🎀 Changelog
|
||||||
|
|
||||||
## [2.0.1] - 2022-12-28
|
|
||||||
### Fixed
|
|
||||||
- Corrected documentation for hooks, removing outdated `command.no-perm`
|
|
||||||
- Fixed an issue where `cd` with no args would not update the old pwd
|
|
||||||
- Tiny documentation enhancements for the `hilbish.timer` interface
|
|
||||||
|
|
||||||
## [2.0.0] - 2022-12-20
|
## [2.0.0] - 2022-12-20
|
||||||
**NOTES FOR USERS/PACKAGERS UPDATING:**
|
**NOTES FOR USERS/PACKAGERS UPDATING:**
|
||||||
- Hilbish now uses [Task] insead of Make for builds.
|
- Hilbish now uses [Task] insead of Make for builds.
|
||||||
|
@ -617,7 +611,6 @@ This input for example will prompt for more input to complete:
|
||||||
|
|
||||||
First "stable" release of Hilbish.
|
First "stable" release of Hilbish.
|
||||||
|
|
||||||
[2.0.1]: https://github.com/Rosettea/Hilbish/compare/v2.0.0...v2.0.1
|
|
||||||
[2.0.0]: https://github.com/Rosettea/Hilbish/compare/v1.2.0...v2.0.0
|
[2.0.0]: https://github.com/Rosettea/Hilbish/compare/v1.2.0...v2.0.0
|
||||||
[2.0.0-rc1]: https://github.com/Rosettea/Hilbish/compare/v1.2.0...v2.0.0-rc1
|
[2.0.0-rc1]: https://github.com/Rosettea/Hilbish/compare/v1.2.0...v2.0.0-rc1
|
||||||
[1.2.0]: https://github.com/Rosettea/Hilbish/compare/v1.1.4...v1.2.0
|
[1.2.0]: https://github.com/Rosettea/Hilbish/compare/v1.1.4...v1.2.0
|
||||||
|
|
38
README.md
38
README.md
|
@ -26,30 +26,52 @@ and aims to be infinitely configurable. If something isn't, open an issue!
|
||||||
|
|
||||||
# Table of Contents
|
# Table of Contents
|
||||||
- [Screenshots](#Screenshots)
|
- [Screenshots](#Screenshots)
|
||||||
- [Getting Hilbish](#Getting-Hilbish)
|
- [Installation](#Installation)
|
||||||
|
- [Prebuilt Bins](#Prebuilt-binaries)
|
||||||
|
- [AUR](#AUR)
|
||||||
|
- [Nixpkgs](#Nixpkgs)
|
||||||
|
- [Manual Build](#Manual-Build)
|
||||||
- [Contributing](#Contributing)
|
- [Contributing](#Contributing)
|
||||||
|
|
||||||
# Screenshots
|
# Screenshots
|
||||||
<div align="center">
|
<div align="center">
|
||||||
|
<img src="gallery/default.png"><br><br>
|
||||||
<img src="gallery/terminal.png"><br><br>
|
<img src="gallery/terminal.png"><br><br>
|
||||||
<img src="gallery/tab.png"><br><br>
|
|
||||||
<img src="gallery/pillprompt.png">
|
<img src="gallery/pillprompt.png">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
# Getting Hilbish
|
# Installation
|
||||||
**NOTE:** Hilbish is not guaranteed to work properly on Windows, starting
|
**NOTE:** Hilbish is not guaranteed to work properly on Windows, starting
|
||||||
from the 2.0 version. It will still be able to compile, but functionality
|
from the 2.0 version. It will still be able to compile, but functionality
|
||||||
may be lacking.
|
may be lacking.
|
||||||
|
|
||||||
You can check the [install page](https://rosettea.github.io/Hilbish/install/)
|
## Prebuilt binaries
|
||||||
on the website for distributed binaries from GitHub or other package repositories.
|
Go [here](https://nightly.link/Rosettea/Hilbish/workflows/build/master) for
|
||||||
Otherwise, continue reading for steps on compiling.
|
builds on the master branch.
|
||||||
|
|
||||||
## Prerequisites
|
## AUR
|
||||||
|
[![AUR maintainer](https://img.shields.io/aur/maintainer/hilbish?logo=arch-linux&style=flat-square)](https://aur.archlinux.org/packages/hilbish)
|
||||||
|
Arch Linux users can install Hilbish from the AUR with the following command:
|
||||||
|
```sh
|
||||||
|
yay -S hilbish
|
||||||
|
```
|
||||||
|
|
||||||
|
[![AUR maintainer](https://img.shields.io/aur/maintainer/hilbish?logo=arch-linux&style=flat-square)](https://aur.archlinux.org/packages/hilbish-git)
|
||||||
|
Or from the latest `master` commit with:
|
||||||
|
```sh
|
||||||
|
yay -S hilbish-git
|
||||||
|
```
|
||||||
|
|
||||||
|
## Nixpkgs
|
||||||
|
Nix/NixOS users can install Hilbish from the central repository, nixpkgs, through the usual ways.
|
||||||
|
If you're new to nix you should probably read up on how to do that [here](https://nixos.wiki/wiki/Cheatsheet).
|
||||||
|
|
||||||
|
## Manual Build
|
||||||
|
### Prerequisites
|
||||||
- [Go 1.17+](https://go.dev)
|
- [Go 1.17+](https://go.dev)
|
||||||
- [Task](https://taskfile.dev/installation/) (**Go on the hyperlink here to see Task's install method for your OS.**)
|
- [Task](https://taskfile.dev/installation/) (**Go on the hyperlink here to see Task's install method for your OS.**)
|
||||||
|
|
||||||
## Build
|
### Build
|
||||||
First, clone Hilbish. The recursive is required, as some Lua libraries
|
First, clone Hilbish. The recursive is required, as some Lua libraries
|
||||||
are submodules.
|
are submodules.
|
||||||
```sh
|
```sh
|
||||||
|
|
|
@ -8,28 +8,9 @@ menu:
|
||||||
---
|
---
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
The timers interface si one to easily set timeouts and intervals
|
||||||
If you ever want to run a piece of code on a timed interval, or want to wait
|
to run functions after a certain time or repeatedly without using
|
||||||
a few seconds, you don't have to rely on timing tricks, as Hilbish has a
|
odd tricks.
|
||||||
timer API to set intervals and timeouts.
|
|
||||||
|
|
||||||
These are the simple functions `hilbish.interval` and `hilbish.timeout` (doc
|
|
||||||
accessible with `doc hilbish`). But if you want slightly more control over
|
|
||||||
them, there is the `hilbish.timers` interface. It allows you to get
|
|
||||||
a timer via ID and control them.
|
|
||||||
|
|
||||||
All functions documented with the `Timer` type refer to a Timer object.
|
|
||||||
|
|
||||||
An example of usage:
|
|
||||||
```
|
|
||||||
local t = hilbish.timers.create(1, 5000, function()
|
|
||||||
print 'hello!'
|
|
||||||
end)
|
|
||||||
|
|
||||||
t:stop()
|
|
||||||
print(t.running, t.duration, t.type)
|
|
||||||
t:start()
|
|
||||||
```
|
|
||||||
|
|
||||||
## Interface fields
|
## Interface fields
|
||||||
- `INTERVAL`: Constant for an interval timer type
|
- `INTERVAL`: Constant for an interval timer type
|
||||||
|
|
|
@ -3,5 +3,5 @@
|
||||||
|
|
||||||
+ `command.not-found` -> cmdStr > Thrown when a command is not found.
|
+ `command.not-found` -> cmdStr > Thrown when a command is not found.
|
||||||
|
|
||||||
+ `command.not-executable` -> cmdStr > Thrown when Hilbish attempts to run a file
|
+ `command.no-perm` -> cmdStr > Thrown when Hilbish attempts to execute a file but
|
||||||
that is not executable.
|
has no permission.
|
||||||
|
|
|
@ -1 +1,38 @@
|
||||||
This has been moved to the `hilbish.timers` API doc (accessible by `doc api hilbish.timers`)
|
If you ever want to run a piece of code on a timed interval, or want to wait
|
||||||
|
a few seconds, you don't have to rely on timing tricks, as Hilbish has a
|
||||||
|
timer API to set intervals and timeouts.
|
||||||
|
|
||||||
|
These are the simple functions `hilbish.interval` and `hilbish.timeout` (doc
|
||||||
|
accessible with `doc hilbish`). But if you want slightly more control over
|
||||||
|
them, there is the `hilbish.timers` interface. It allows you to get
|
||||||
|
a timer via ID.
|
||||||
|
|
||||||
|
# Timer Interface
|
||||||
|
## Functions
|
||||||
|
- `get(id)` -> timer: get a timer via its id
|
||||||
|
- `create(type, ms, callback)` -> timer: creates a timer, adding it to the timer pool.
|
||||||
|
`type` is the type of timer it will be. 0 is an interval, 1 is a timeout.
|
||||||
|
`ms` is the time it will run for in seconds. callback is the function called
|
||||||
|
when the timer is triggered.
|
||||||
|
|
||||||
|
# Timer Object
|
||||||
|
All those previously mentioned functions return a `timer` object, to which
|
||||||
|
you can stop and start a timer again.
|
||||||
|
|
||||||
|
An example of usage:
|
||||||
|
local t = hilbish.timers.create(1, 5000, function()
|
||||||
|
print 'hello!'
|
||||||
|
end)
|
||||||
|
|
||||||
|
t:stop()
|
||||||
|
print(t.running, t.duration, t.type)
|
||||||
|
t:start()
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
- `duration`: amount of time the timer runs for in milliseconds
|
||||||
|
- `running`: whether the timer is running or not
|
||||||
|
- `type`: the type of timer (0 is interval, 1 is timeout)
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
- `stop()`: stops the timer. returns an error if it's already stopped
|
||||||
|
- `start()`: starts the timer. returns an error if it's already started
|
||||||
|
|
BIN
gallery/tab.png
BIN
gallery/tab.png
Binary file not shown.
Before Width: | Height: | Size: 18 KiB |
|
@ -8,14 +8,14 @@ commander.register('cd', function (args)
|
||||||
if #args > 1 then
|
if #args > 1 then
|
||||||
print("cd: too many arguments")
|
print("cd: too many arguments")
|
||||||
return 1
|
return 1
|
||||||
end
|
elseif #args > 0 then
|
||||||
|
local path = args[1]:gsub('$%$','\0'):gsub('${([%w_]+)}', os.getenv)
|
||||||
|
:gsub('$([%w_]+)', os.getenv):gsub('%z','$'):gsub('^%s*(.-)%s*$', '%1')
|
||||||
|
|
||||||
local path = args[1] and args[1] or hilbish.home
|
|
||||||
if path == '-' then
|
if path == '-' then
|
||||||
path = dirs.old
|
path = dirs.old
|
||||||
print(path)
|
print(path)
|
||||||
end
|
end
|
||||||
|
|
||||||
dirs.setOld(hilbish.cwd())
|
dirs.setOld(hilbish.cwd())
|
||||||
dirs.push(path)
|
dirs.push(path)
|
||||||
|
|
||||||
|
@ -25,4 +25,11 @@ commander.register('cd', function (args)
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
bait.throw('cd', path)
|
bait.throw('cd', path)
|
||||||
|
|
||||||
|
return
|
||||||
|
end
|
||||||
|
fs.cd(hilbish.home)
|
||||||
|
bait.throw('cd', hilbish.home)
|
||||||
|
|
||||||
|
dirs.push(hilbish.home)
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -119,30 +119,9 @@ func (th *timersModule) luaGet(thr *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
// #property running If the timer is running
|
// #property running If the timer is running
|
||||||
// #property duration The duration in milliseconds that the timer will run
|
// #property duration The duration in milliseconds that the timer will run
|
||||||
// timeout and interval API
|
// timeout and interval API
|
||||||
/*
|
// The timers interface si one to easily set timeouts and intervals
|
||||||
If you ever want to run a piece of code on a timed interval, or want to wait
|
// to run functions after a certain time or repeatedly without using
|
||||||
a few seconds, you don't have to rely on timing tricks, as Hilbish has a
|
// odd tricks.
|
||||||
timer API to set intervals and timeouts.
|
|
||||||
|
|
||||||
These are the simple functions `hilbish.interval` and `hilbish.timeout` (doc
|
|
||||||
accessible with `doc hilbish`). But if you want slightly more control over
|
|
||||||
them, there is the `hilbish.timers` interface. It allows you to get
|
|
||||||
a timer via ID and control them.
|
|
||||||
|
|
||||||
## Timer Object
|
|
||||||
All functions documented with the `Timer` type refer to a Timer object.
|
|
||||||
|
|
||||||
An example of usage:
|
|
||||||
```
|
|
||||||
local t = hilbish.timers.create(1, 5000, function()
|
|
||||||
print 'hello!'
|
|
||||||
end)
|
|
||||||
|
|
||||||
t:stop()
|
|
||||||
print(t.running, t.duration, t.type)
|
|
||||||
t:start()
|
|
||||||
```
|
|
||||||
*/
|
|
||||||
func (th *timersModule) loader(rtm *rt.Runtime) *rt.Table {
|
func (th *timersModule) loader(rtm *rt.Runtime) *rt.Table {
|
||||||
timerMethods := rt.NewTable()
|
timerMethods := rt.NewTable()
|
||||||
timerFuncs := map[string]util.LuaExport{
|
timerFuncs := map[string]util.LuaExport{
|
||||||
|
|
Loading…
Reference in New Issue