AM icon indicating copy to clipboard operation
AM copied to clipboard

apptui

Open zen0bit opened this issue 1 year ago • 26 comments

Should be usable

Need testing and finalizing..

  • [x] standalone TUI
  • [ ] recreate as module
  • [ ] more testing
  • [ ] finalizing

Anyone willing to test it? apptui

zen0bit avatar Feb 24 '24 00:02 zen0bit

My advice is to use bash-native gum alternative instead of gum itself, as not all distros have gum installed. Universal Blue has something called ugum here:

https://github.com/ublue-os/config/blob/main/build/ublue-os-just/ugum

It uses gum if installed, with fallback to fzf & finally with fallback to native bash solution for option presentation.

You can see some examples of Universal Blue just scripts which utilize ugum

https://github.com/ublue-os/config/tree/main/build/ublue-os-just

fiftydinar avatar Feb 24 '24 12:02 fiftydinar

My advice is to use bash-native gum alternative instead of gum itself, as not all distros have gum installed. Universal Blue has something called ugum here:

looks nice

but with ugum no way to make nice header like with gum, etc..

PS: easybashgui looks even better then ugum

zen0bit avatar Feb 24 '24 12:02 zen0bit

Hey gum already releases their binary in their github, isn't it better to add an am script to install gum this way than to try a bunch fo different package managers? (I can make the script if needed).

EDIT: Added gum anyway lol

Samueru-sama avatar Apr 21 '24 17:04 Samueru-sama

I am not trying

Wanna use official distro repositories (Is almost anywhere) or build from source

Was intended copy official instructions

But nice to add that...

We can post that on their repo.

You know publicity :wink:

zen0bit avatar Apr 22 '24 01:04 zen0bit

So can I now include gum TUI in am? Since we now have offical way of installing it anywhere... :wink: :wink:

You can't imagine what can be done with it... PS: You can, you can try yourself

Maybe finally you can try it yourself @ivan-hc now you know how to install needed gum. PS: You tried my apptui? @Samueru-sama

PPS: Almost everything is already done so fuse it to am will be quick :wink: And that's power which comes with nice TUI...

zen0bit avatar Apr 22 '24 01:04 zen0bit

Which reminds me...

Can I have some place in wiki for my apptui? (Chapter: 8. External TUI) Even if not yet (because of that?) finished So maybe I can get some feedback :honey_pot:

zen0bit avatar Apr 22 '24 02:04 zen0bit

PS: You tried my apptui? @Samueru-sama

image

(I don't know why I get those errors above, granted I ripped out the function that tries to install gum with my distro package manager so I don't know if that broke it lol).

So maybe I can get some feedback 🍯

I don't like that when you are on a menu entry you have to navigate to back to MAIN MENU instead of using left/right navigation keys to go back and forth, like on the lf file manager you know?

I am not trying

image

Well, instead of whatever that is, just use am to get gum.

Samueru-sama avatar Apr 22 '24 02:04 Samueru-sama

Well, instead of whatever that is, just use am to get gum.

Will do that, since you add it :heart:

Not updated for longer time, not sure if everything still works as expected (on both gum and am sides)

That two messages should disappear if you have appman in same dir I started with appman. Then moved to AM after I really got it that are one project and main development is here... Was bit confused at begining (Never saw project like that) PS: Not solved silencing that message... yet

PPS: Solution for now: run apptui in dir where appman is.. Or ignore (harmless) message

zen0bit avatar Apr 22 '24 03:04 zen0bit

I will try to add apptui to am...

I don't like that when you are on a menu entry you have to navigate to back to MAIN MENU instead of using left/right navigation keys to go back and forth, like on the lf file manager you know?

:+1: Really like that

Tried implement something like that, but leaved for later as to hard for quick solve Should not be that hard implement But never tried bind actions to keys (I have to learn that)

will look at lf..

PS: But i dont see anything installed in your screenshot

The whole switching between am/appman should be improved I think

apptui

zen0bit avatar Apr 22 '24 04:04 zen0bit

My advice is to use bash-native gum alternative instead of gum itself, as not all distros have gum installed. Universal Blue has something called ugum here:

https://github.com/ublue-os/config/blob/main/build/ublue-os-just/ugum

It uses gum if installed, with fallback to fzf & finally with fallback to native bash solution for option presentation.

You can see some examples of Universal Blue just scripts which utilize ugum

https://github.com/ublue-os/config/tree/main/build/ublue-os-just

Now gum is in AM database...

zen0bit avatar Apr 22 '24 04:04 zen0bit

I'm happy that we can finally have a TUI version, and this is also an example I've done in my comment on the other issue you just opened https://github.com/ivan-hc/AM/issues/460

ivan-hc avatar Apr 22 '24 06:04 ivan-hc

So start fix all bugs, test it with am and appman, and I'll finally merge it.

Also, I can add it as an app in the database that can be optionally installed at first start (with "gum").

ivan-hc avatar Apr 22 '24 06:04 ivan-hc

I'm happy that we can finally have a TUI version, and this is also an example I've done in my comment on the other issue you just opened #460

It's been there whole time. I just not made any more promotion

zen0bit avatar Apr 22 '24 06:04 zen0bit

I'm happy that we can finally have a TUI version, and this is also an example I've done in my comment on the other issue you just opened #460

It's been there whole time. I just not made any more promotion

I've seen that, and I know that it still needs to be improved, at least we had not to be forced having "gum" installed from repositories.

ivan-hc avatar Apr 22 '24 06:04 ivan-hc

Already looking at improving that. Just I have to rework script. Currently check if using appman/am after the installation of gum not before PS: Sended you invitation to oSoWoSo

zen0bit avatar Apr 22 '24 06:04 zen0bit

@Samueru-sama I already thought about that using files for menus than I can do that in gum quite easily (Already tried this approach for yad UIs) But file not as powerfull as filter options. And I am actually "in" gum in that menu (not bash)

zen0bit avatar Apr 22 '24 07:04 zen0bit

@Samueru-sama I already thought about that using files for menus than I can do that in gum quite easily (Already tried this approach for yad UIs) But file not as powerfull as filter options. And I am actually "in" gum in that menu (not bash)

No I didn't mean using files for menus, but having the back and forth navigation with the left/right arrow keys, like lf and ranger do.

@ivan-hc Did zen0 give you 50 euro that you accepted the invitation 😆

Samueru-sama avatar Apr 22 '24 12:04 Samueru-sama

@zen0bit Btw I just noticed something:

configdir=$HOME/.config/$progname

It has to check for $XDG_CONFIG_HOME first and if it is not defined, then it defaults to that path you have there.

This is how appman does it:

image

(You don't need to check for XDG_DATA_HOME unless you also plan on using that location for something else).

Also I think it is better if the TUI uses the $XDG_CONFIG_HOME/appman or $HOME/.config/appman dir instead of making its own apptui directory, or apptui is inside that location at the very least.

Samueru-sama avatar Apr 22 '24 13:04 Samueru-sama

@Samueru-sama I already thought about that using files for menus than I can do that in gum quite easily (Already tried this approach for yad UIs) But file not as powerfull as filter options. And I am actually "in" gum in that menu (not bash)

No I didn't mean using files for menus, but having the back and forth navigation with the left/right arrow keys, like lf and ranger do.

@ivan-hc Did zen0 give you 50 euro that you accepted the invitation 😆

I mean that if I do menus in gum file

I can browse browse directories with arrow keys (because will be files in directories)

gum choose or gum filter don't offer this option.

you have to quit gum menu first before you can go back to previous gum menu

but with files is doable

ps: Maybe I can ask in gum. To add such feature, but i though that someone already ask thing like that...

PPS: will look at that XDG thing...

zen0bit avatar Apr 22 '24 15:04 zen0bit

PPS: will look at that XDG thing...

Replace this:

configdir=$HOME/.config/$progname

with

# Check XDG variable
if [ -n "$XDG_CONFIG_HOME" ]; then
	configdir="$XDG_CONFIG_HOME/appman/$progname"
else
	configdir="$HOME/.config/appman/$progname"
fi

I already put it insdie appman because I don't think this needs to be on a separate directory.

Samueru-sama avatar Apr 22 '24 17:04 Samueru-sama

PPS: will look at that XDG thing...

Replace this:

configdir=$HOME/.config/$progname

with

# Check XDG variable
if [ -n "$XDG_CONFIG_HOME" ]; then
	configdir="$XDG_CONFIG_HOME/appman/$progname"
else
	configdir="$HOME/.config/appman/$progname"
fi

I already put it insdie appman because I don't think this needs to be on a separate directory.

But i use it for am

zen0bit avatar Apr 22 '24 19:04 zen0bit

PPS: will look at that XDG thing...

Replace this:

configdir=$HOME/.config/$progname

with

# Check XDG variable
if [ -n "$XDG_CONFIG_HOME" ]; then
	configdir="$XDG_CONFIG_HOME/appman/$progname"
else
	configdir="$HOME/.config/appman/$progname"
fi

I already put it insdie appman because I don't think this needs to be on a separate directory.

But i use it for am

I don't see a problem with that.

Samueru-sama avatar Apr 22 '24 19:04 Samueru-sama

image

There is a missing check for "$ZDOTDIR/.bash_complation"👀 as appman patches that location when enabling zsh completion.

Samueru-sama avatar Apr 23 '24 03:04 Samueru-sama

There is a missing check for "$ZDOTDIR/.bash_complation"👀 as appman patches that location when enabling zsh completion.

@Samueru-sama Maybe PR in my repo will be quicker (if you already solved)

Let's not polute with apptui stuff here? (Or you don't mind Ivan-hc?) Let's move itto my repowhere belongs.. PS: Thanks for feedback BTW ❤️ PPS: Never tried zsh (🐟 user)

zen0bit avatar Apr 23 '24 04:04 zen0bit

There is a missing check for "$ZDOTDIR/.bash_complation"👀 as appman patches that location when enabling zsh completion.

@Samueru-sama Maybe PR in my repo will be quicker (if you already solved)

Let's not polute with apptui stuff here? (Or you don't mind Ivan-hc?) Let's move itto my repowhere belongs.. PS: Thanks for feedback BTW ❤️ PPS: Never tried zsh (🐟 user)

Ok I couldn't find that repo to make a PR to, so here are the changes, do a diff on the file to compare it: https://pastebin.com/ud6BgF0a

EDIT: Forgot to put the " " on $ZDOTDIR, you can add them later.

Samueru-sama avatar Apr 23 '24 05:04 Samueru-sama

There is a missing check for "$ZDOTDIR/.bash_complation"👀 as appman patches that location when enabling zsh completion.

@Samueru-sama Maybe PR in my repo will be quicker (if you already solved) Let's not polute with apptui stuff here? (Or you don't mind Ivan-hc?) Let's move itto my repowhere belongs.. PS: Thanks for feedback BTW ❤️ PPS: Never tried zsh (🐟 user)

Ok I couldn't find that repo to make a PR to, so here are the changes, do a diff on the file to compare it: https://pastebin.com/ud6BgF0a

EDIT: Forgot to put the " " on $ZDOTDIR, you can add them later.

I don't have own repo for project I am doing it AM fork branch apptui (from where this PR is...) https://github.com/oSoWoSo/AM/tree/apptui You can see it on top of PR 😀

push to osowoso/am branch:apptui Perhaps you don't see it in list but it will work... just write it in fields instead of ivan-hc/am

zen0bit avatar Apr 23 '24 05:04 zen0bit