Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Atuin] Module #264

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

[Atuin] Module #264

wants to merge 16 commits into from

Conversation

Tearran
Copy link
Member

@Tearran Tearran commented Nov 20, 2024

Interesting title. Playing with making a module for basic setup of atuin.
bash "./tools/modules/software/module_atuin" help

note missing .sh
assemble looks for *.sh before writing to the lib
can leverage this for testing so its not included

Commands: help install remove status
Available commands:
  install       - Install Atuin 

https://docs.atuin.sh/guide/installation/

running installs to $HOME

Not sure how to make this global. maybe module update_skel may be a hint?

Tearran and others added 2 commits November 19, 2024 14:40
 install remove logout and status for @atuinsh repo atuin
@Tearran Tearran added Discussion Being discussed - Voice your opinions :) Feature Request Feature suggestion Help needed We need your involvement Needs review Seeking for review labels Nov 20, 2024
@github-actions github-actions bot added the size/medium PR with more then 50 and less then 250 lines label Nov 20, 2024
@EvilOlaf
Copy link
Member

EvilOlaf commented Nov 20, 2024

Some thoughts about that from the chat:

  • beohoff mentions the latency for bash users is better when using bash-preexec instead of ble.sh. I did not research which one is installed by default by atuin.
  • I've setup our own server for sync: https://services.armbian.de/atuin . This is subject of change, like using a different unused domain for this or whatever.
    • using environmental variable for sync server only works for register command but once the default config is written (which happens AFTER issuing register) it seems superiour. Also environment variable isn't written back into this config so its either about us or the user to adjust sync address... if they prefer to do so.

@Tearran
Copy link
Member Author

Tearran commented Nov 20, 2024

beohoff mentions the latency for bash users is better when using bash-preexec instead of ble.sh. I did not research which one is installed by default by atuin.

Seem like it is using preexec, The installer does use ~/.bash-preexec.sh and no referance to ble.sh

@Tearran
Copy link
Member Author

Tearran commented Nov 20, 2024

Therefore when implementing this via configng the config file with adjustments needs to be written the installation (line 32: sync_address = "https://services.armbian.de/atuin")

after install the config looks all commented. so we can overwrite the default and use a custom one.

to restore the default
atuin default-config > ~/.config/atuin/config.toml

@EvilOlaf
Copy link
Member

after install the config looks all commented. so we can overwrite the default and use a custom one.

Yes, most seems commented by default. For me the following ones were uncommented by default:
enter_accept = true and records = true

@Tearran
Copy link
Member Author

Tearran commented Nov 20, 2024

Yes, most seems commented by default. For me the following ones were uncommented by default:
enter_accept = true and records = true

This seems to cover the default variables for the sync server

sync_address = "https://services.armbian.de/atuin" 
enter_accept = true

[sync]
records = true

Included, IMO to be relative in continued development
paths and daemon settings

This still only able to work in "$HOME" "~/" environment.

@github-actions github-actions bot added size/large PR with 250 lines or more and removed size/medium PR with more then 50 and less then 250 lines labels Nov 21, 2024
@github-actions github-actions bot added size/medium PR with more then 50 and less then 250 lines and removed size/large PR with 250 lines or more labels Nov 22, 2024
@Tearran
Copy link
Member Author

Tearran commented Nov 22, 2024

latest update.
works with bash
added .sh to include

./tools/config-assemble.sh" -p
./bin/armbian-config --api module_atuin help

Usage: module_atuin <command>
Commands: help install remove reset

Available commands:
  install       - setup atuin in /home/tearran
  reset         -  reset config to atuin default
  remove        -  Uninstall atuin
 ./configng/bin/armbian-config --api see_menu module_atuin
image install

restart shell

atuin help
atuin 18.4.0-beta.3
Ellie Huxtable <[email protected]>
Magical shell history

Usage:
  atuin <COMMAND>

Commands:
  history          Manipulate shell history
  import           Import shell history from file
  stats            Calculate statistics for your history
  search           Interactive history search
  sync             Sync with the configured server
  login            Login to the configured server
  logout           Log out
  register         Register with the configured server
  key              Print the encryption key for transfer to another machine
  status           Display the sync status
  account          Manage your sync account
  kv               Get or set small key-value pairs
  store            Manage the atuin data store
  dotfiles         Manage your dotfiles with Atuin
  init             Print Atuin's shell init script
  info             Information about dotfiles locations and ENV vars
  doctor           Run the doctor to check for common issues
  daemon           *Experimental* Start the background daemon
  default-config   Print the default atuin configuration (config.toml)
  server           Start an atuin server
  uuid             Generate a UUID
  contributors
  gen-completions  Generate shell completions
  help             Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

AROW UP
image

https://docs.atuin.sh

@Tearran
Copy link
Member Author

Tearran commented Nov 26, 2024

Issues:

  • Not an improvement to the installer @atuinsh provides.
  • sudo make checking and installing overcomplicate.
  • only supports bash, config for other need to be added

@igorpecovnik
Copy link
Member

igorpecovnik commented Nov 26, 2024

only supports bash, config for other need to be added

ZSH, as we provide it, would be nice to work OOB.

Not an improvement to the installer
sudo make checking and installing overcomplicate.

What if we add this functionality system-wide, like our ZSH implementation. Superuser within the script is even changing default shell for all. If Admin of OS do this, user can move back to BASH at any moment. We can do one step less here, to do everything for the users of the system, except enabling it. And give instructions how to enable this feature with a simple (user) step.

https://github.com/armbian/configng/blob/main/tools/modules/system/update_skel.sh

@Tearran
Copy link
Member Author

Tearran commented Nov 26, 2024

Not sure how to make this global. maybe module update_skel may be a hint?

So skel is the way to go for so called global, or as you say system-wide that could simplify things.

since the server url is subject to change maybe should add a default url

["module_atuin,server_url"]="https://services.armbian.de/atuin"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Being discussed - Voice your opinions :) Feature Request Feature suggestion Help needed We need your involvement Needs review Seeking for review size/medium PR with more then 50 and less then 250 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants