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

apptui #175

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

apptui #175

wants to merge 10 commits into from

Conversation

zen0bit
Copy link
Contributor

@zen0bit zen0bit commented Feb 24, 2024

Should be usable

Need testing and finalizing..

  • standalone TUI
  • recreate as module
  • more testing
  • finalizing

Anyone willing to test it?
apptui

@zen0bit zen0bit mentioned this pull request Feb 24, 2024
@zen0bit zen0bit force-pushed the apptui branch 2 times, most recently from 8898a11 to 44d58f5 Compare February 24, 2024 02:14
@fiftydinar
Copy link
Contributor

fiftydinar commented Feb 24, 2024

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

@zen0bit
Copy link
Contributor Author

zen0bit commented Feb 24, 2024

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

@Samueru-sama
Copy link
Contributor

Samueru-sama commented Apr 21, 2024

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 Samueru-sama mentioned this pull request Apr 21, 2024
@zen0bit
Copy link
Contributor Author

zen0bit commented Apr 22, 2024

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 😉

@zen0bit
Copy link
Contributor Author

zen0bit commented Apr 22, 2024

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

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 😉
And that's power which comes with nice TUI...

@zen0bit
Copy link
Contributor Author

zen0bit commented Apr 22, 2024

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 🍯

@Samueru-sama
Copy link
Contributor

Samueru-sama commented Apr 22, 2024

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.

@zen0bit
Copy link
Contributor Author

zen0bit commented Apr 22, 2024

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

Will do that, since you add it ❤️

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
Copy link
Contributor Author

zen0bit commented Apr 22, 2024

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?

👍 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
Copy link
Contributor Author

zen0bit commented Apr 22, 2024

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...

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 22, 2024

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

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 22, 2024

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").

@zen0bit
Copy link
Contributor Author

zen0bit commented Apr 22, 2024

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

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 22, 2024

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.

@zen0bit
Copy link
Contributor Author

zen0bit commented Apr 22, 2024

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
Copy link
Contributor Author

zen0bit commented Apr 22, 2024

@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)

@Samueru-sama
Copy link
Contributor

@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
Copy link
Contributor

Samueru-sama commented Apr 22, 2024

@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.

@zen0bit
Copy link
Contributor Author

zen0bit commented Apr 22, 2024

@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...

@Samueru-sama
Copy link
Contributor

Samueru-sama commented Apr 22, 2024

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.

@zen0bit
Copy link
Contributor Author

zen0bit commented Apr 22, 2024

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

@Samueru-sama
Copy link
Contributor

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
Copy link
Contributor

image

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

@zen0bit
Copy link
Contributor Author

zen0bit commented Apr 23, 2024

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)

@Samueru-sama
Copy link
Contributor

Samueru-sama commented Apr 23, 2024

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.

@zen0bit
Copy link
Contributor Author

zen0bit commented Apr 23, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants