Commit Graph

84 Commits

Author SHA1 Message Date
Jeevitha Kannan K S
c6d3671d57
Apply suggestions from code review
Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
2024-11-22 06:18:54 +05:30
Jeevitha Kannan K S
c8dd5c779c
Fix scroll down not reaching bottom entry 2024-11-21 10:19:44 +05:30
Jeevitha Kannan K S
ab7a67087d
refact: rust fixes and optimizations (#933)
* fix: getting locked out when running script

* Use success and fail colors and reorder imports

Use theme color instead of using ratatui::Color for running_command success and fail + search preview text color + min tui warning color, add colors for confirmation prompt, fix inverted success and fail colors

* Remove redundant code in themes

Removed redundant match statement with a function

* Fix scroll beyond list, color bleeding and refact in confirmation.rs

Remove unnecessary usage of pub in ConfirmPropmt struct fields, simplify numbering, prevent scrolling beyond list, fix color bleeding

* Implement case insensitive, fix word disappearing bug

Use regex for case insesitive finding, implement String instead of char<Vec>, fix word disappearing by recalculating the render x for preview text

* Revert "Remove redundant code in themes"

This reverts commit 3b7e859af8.

* Reference instead of passing the vector

* Revert regex and String implementation

Use Vec<char> for search_input to prevent panics when using multi-byte characters, use lowercase conversion instead of regex, Added comments for clarity

* Replace ansi and text wrapping code with ratatui

Replaced ansi related code for tree sitter highlight with direct ratatui::text. Cache the processed text in appstate to remove processing of text for every frame render.Create paragraph instead of list so that scroll and wrapping can be done without external crates. Add caps keys for handle_key_event.

* Fix conflicts

* Reference instead of borrowing commands, refact mut variables

Reference instead of borrowing commands from state, Refactor draw function variables to immutable, calculate innersize from block instead of manual definition

* Update tui/src/filter.rs

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>

* Rendering optimizations and function refactors

Handle `find_command` inside state itself -> `get_command_by_name`. Move tips to a seperate file for modularity. Pass the whole args to state instead of seperate args. Use const for float and confirmation prompt float sizes. Add the `longest_tab_length` to appstate struct so that it will not be calculated for each frame render use static str instead String for tips. Use function for spawning confirmprompt. Merge command list and task items list rendering a single widget instead of two. Remove redundant keys in handle_key. Optimize scrolling logic. Rename `toggle_task_list_guide` -> `enable_task_list_guide`

* Cleanup

Use prelude for ratatui imports. Use const for theme functions, add
missing hints

* Update deps, remove unused temp-dir

* Add accidentally deleted preview.tape

Add labels + Wait 2sec after program ends

* Add fields to config files

Skip Confirmation, Bypass Size

* Remove accidentally commited config file

---------

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
2024-11-17 12:24:54 -06:00
Jeevitha Kannan K S
fa69885b6c
Use vt100-ctt instead of patching the dep (#952)
Thanks @a-kenji
2024-11-16 15:07:22 -06:00
Adam Perkowski
2dabb934f7
fix: crate cache & versions (#949) 2024-11-14 17:30:48 -06:00
nyx
7147ed93e9
implement a root check menu (#927)
* implement a root check menu

* code needs to be readable

* rephrase it a lil bit

* disregard escalation tool variable if found as root

* refactor: Call root check from within AppState constructor (#7)

* remove duplicate check

* add comment back

---------

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
2024-11-11 10:27:30 -06:00
zdiff
16dd91ca29
Reduce the size of the linutil binary by removing unused features from tui/Cargo.toml (#922)
Co-authored-by: zdiff <zdiff@localhost>
2024-11-11 10:23:54 -06:00
Jeevitha Kannan K S
432d6b3b0c
feat: Mouse scroll (#913)
* feat: add mouse scrolling

* revert: bluetooth-manager.sh

* feat: mouse hori scrolls

* Update tui/src/main.rs

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>

* Update tui/src/confirmation.rs

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>

* feat: implemetation of mouse position

Suggested by Liam (<33645555+lj3954@users.noreply.github.com>)

---------

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
2024-11-11 10:22:21 -06:00
Jeevitha Kannan K S
8639da3855
feat: Command execution log (#898)
* feat: option to save logs

* refact: use time crate

* fix: panics

* hints

* update roadmap
2024-11-08 09:10:31 -06:00
Jeevitha Kannan K S
9f0863729f
feat: Add automation based on config file (#836)
* feat: Add automation based on config file

* docs: add configuration to the manpage & README

* update roadmap

---------

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: Chris Titus <contact@christitus.com>
2024-11-07 13:21:37 -06:00
Jeevitha Kannan K S
d033b0f36d
feat: Add --skip-confirmation flag (#834)
* feat: Add --skip-confirmation flag

* add `--skip-confirmation` to the manpage

---------

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-11-07 13:09:18 -06:00
Jeevitha Kannan K S
472c85eb79
Increase scroll length (#830) 2024-11-07 13:08:20 -06:00
Liam
980365f7c9
refactor: Re-export ego-tree dependency from linutil core (#811)
* refactor: Export ego-tree from linutil core, rather than workspace

* refactor: Improve code formatting

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2024-11-07 13:00:34 -06:00
nyx
421044f43e
fix reversion (#923) 2024-11-07 12:58:18 -06:00
Jeevitha Kannan K S
176b19d692
Use ratatui bundled crossterm (#805) 2024-11-06 16:29:52 -06:00
Adam Perkowski
9d1dc35f43
📃 feat: Linux Neptune (Valve's kernel for SteamDeck) installation (#683)
* Linux Neptune installation script

* fixed some stuff that's not supposed to be here

Co-authored-by: nnyyxxxx <nnyyxxxx@users.noreply.github.com>

* fix repo check

* added audio patches

https://github.com/ChrisTitusTech/linutil/issues/269#issuecomment-2380379049

* add linux neptune to docs (userguide)

* steamdeck precondition

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>

* precondition fix

* another precondition fix

---------

Co-authored-by: nnyyxxxx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
Co-authored-by: Chris Titus <contact@christitus.com>
2024-11-06 16:20:16 -06:00
Liam
6728e7ee9b
refact: Handle temporary directories entirely within core (#754)
* refactor: Handle temporary directories entirely within core

* fix (xtask): Handle modified tablist struct

* refactor (xtask): Apply Clippy suggested changes

* Fix size_bypass

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2024-11-06 15:28:17 -06:00
nyx
c36879e22f
Implement Rounded corners (#918)
* add rounded corners

* more

* apply rounded corners to script boxes as well
2024-11-06 14:01:19 -06:00
Adam Perkowski
f0734f361c
🦀 feat(ux): add a minimum size bypass cli flag (#920)
* 🦀 feat(ux): add a minimum size bypass cli flag

* oopsie
2024-11-06 09:49:26 -06:00
nyx
565f507190
implement word wrapping functionality (#755)
* implement dynamic auto updating word wrapping functionality

* run fmt

* remove dupe space

* run fmt

* add remove comments back

* fix compilation errors

* run fmt

* run docgen

* run docgen

* fix conflicts

* run cargo xtask docgen

* use boolean rather than enum

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
2024-11-06 09:40:55 -06:00
Jeevitha Kannan K S
67b749942c
refact: multi-selection to per cmd (#719)
* Add per cmd multi-selection

* Add colors for nm cmds

* fix: conflicts
2024-11-05 13:59:57 -06:00
nyx
5878f4dbf0
implement fish like tab completion (#767)
* implement fish like tab completion

* grey the pv out and convert to lowercase

* run fmt

* do not tabcomplete if the user hits enter

* fix

* fix lints

* run docgen

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-11-01 16:01:01 -05:00
dependabot[bot]
4c3cc75997
Bump clap from 4.5.19 to 4.5.20 (#825)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.19 to 4.5.20.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.19...clap_complete-v4.5.20)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-31 15:20:21 -05:00
dependabot[bot]
1730d9da21
Bump tree-sitter-highlight from 0.24.2 to 0.24.3 (#826)
Bumps [tree-sitter-highlight](https://github.com/tree-sitter/tree-sitter) from 0.24.2 to 0.24.3.
- [Release notes](https://github.com/tree-sitter/tree-sitter/releases)
- [Changelog](https://github.com/tree-sitter/tree-sitter/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tree-sitter/tree-sitter/compare/v0.24.2...v0.24.3)

---
updated-dependencies:
- dependency-name: tree-sitter-highlight
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-31 15:20:01 -05:00
JEEVITHA KANNAN K S
afa2afc0e8
chore: bump ratatui -> 0.29.0 (#865)
* chore: bump ratatui -> 0.29.0

* chore: bump ansi-to-tui -> 7.0.0

* chore: bump tui-term -> 0.2.0
2024-10-31 15:19:24 -05:00
JEEVITHA KANNAN K S
11336cf9f1
chore: Add spacing before and after for tui titles (#706)
* Add spacing

* Use string instead of box::leak

* Update tui/src/state.rs

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>

---------

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
Co-authored-by: Chris Titus <contact@christitus.com>
2024-10-31 14:14:17 -05:00
nyx
fc2d731754
do not exit linutil in confirmation prompt when q is pressed (#758)
* do not exit linutil in confirmation prompt when q is pressed

* remove cap support

* add ``ctrl + c`` exiting

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-10-31 13:49:08 -05:00
nyx
72dfb29969
dont allow the user to bring up the command desc if there is none (#753)
* dont allow the user to bring up the command desc if there is none

* obey our god lints

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
2024-10-31 13:42:06 -05:00
nyx
52565e5ea1
clear the search bar if the user changes categories (#752)
Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
2024-10-31 13:41:03 -05:00
nyx
38138334b7
dont allow scrolling when last line is visible (#729)
* dont allow scrolling when last line is visible

* apply changes proposed by adam

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-10-31 13:37:01 -05:00
nyx
1dcc3f3c99
allow scrolling past last entry / first entry (#727)
* allow scrolling past last entry

* Update tui/src/state.rs

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>

* Update tui/src/state.rs

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>

* apply changes proposed by adam

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* apply changes proposed by adam round 2

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* undo changes proposed by adam in scroll up and down funcs

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-10-31 13:35:53 -05:00
nyx
2d14a0a7b6
return user to their previous position if they exit a subdir (#725)
* return user to their previous position if they enter a subdir

* fix lint

* implement changes proposed by adam

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* add newline back

* coalesce `visit_stack` and `position_stack` (#6)

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: cartercanedy <99052281+cartercanedy@users.noreply.github.com>
2024-10-31 13:30:22 -05:00
nyx
0c8977192f
fix color bleeding (#723)
Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
2024-10-31 13:27:13 -05:00
nyx
a5fd25f6af
organize shortcut list into a grid-like-pattern (#721)
* organize shortcut list into a grid-like-pattern

* increase minimum size

* add newline back to satisfy lint

* decrease to 25

* optimization

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

* satisfy lint

* implement some changes proposed by adam

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>

---------

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
2024-10-31 13:25:16 -05:00
Bernhard M. Wiedemann
b2fb33229b
Replace BUILD_DATE with CARGO_PKG_VERSION (#878)
to make builds reproducible.
See https://reproducible-builds.org/ for why this is good.
2024-10-31 13:22:17 -05:00
Adam Perkowski
4f7de594a6
🔍️ exiting search with Ctrl-C + better shortcut tips (#768) 2024-10-24 14:43:16 -05:00
Adam Perkowski
55b5838cb5
📔 docs: add a manpage (#783)
* 📔 docs: add a manpage

* 📦️ include `linutil.1` in `linutil_tui`

* oopsie...

* `©` -> `(c)`
2024-10-08 16:14:16 -05:00
dependabot[bot]
cab73530fe
Bump clap from 4.5.18 to 4.5.19 (#781)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.18 to 4.5.19.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.18...clap_complete-v4.5.19)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-08 16:00:01 -05:00
dependabot[bot]
1e92f48c61
Bump tree-sitter-highlight from 0.23.0 to 0.24.2 (#780)
Bumps [tree-sitter-highlight](https://github.com/tree-sitter/tree-sitter) from 0.23.0 to 0.24.2.
- [Release notes](https://github.com/tree-sitter/tree-sitter/releases)
- [Changelog](https://github.com/tree-sitter/tree-sitter/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tree-sitter/tree-sitter/compare/v0.23.0...v0.24.2)

---
updated-dependencies:
- dependency-name: tree-sitter-highlight
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-08 15:59:21 -05:00
Chris Titus
abebe9bee1
Merge pull request #633 from afonsofrancof:generic-popup-title
Made popup title customizable. The Script's preview title is now its command name
2024-10-08 15:21:29 -05:00
Adam Perkowski
f1ee0569c3
✏️ fix: ALL typos (#775) 2024-10-07 20:42:03 -05:00
afonsofrancof
34ffbc5e8d
Merge branch 'main' of ssh://github.com/ChrisTitusTech/linutil into generic-popup-title 2024-10-03 21:08:15 +01:00
JEEVITHA KANNAN K S
26d0adc829
Refact temp-dir (#749) 2024-10-03 14:20:50 -05:00
Adam Perkowski
3c4a5dcecd
vt100 patches (#743)
Co-authored-by: JEEVITHA KANNAN K S <ksjeevithakannan123@gmail.com>
2024-10-02 16:47:27 -05:00
Adam Perkowski
2d4c9aa8e3
bump crates to 24.9.28 (#693) 2024-09-30 17:05:05 -05:00
cartercanedy
7cc38df7e1
Feat: confirmation prompts (#687)
* confirmation prompt

* actually implement scrolling

* finalize styling

* get rid of generics on AppState and Focus

* add bottom title as help text

* number formatting
2024-09-30 16:48:22 -05:00
dependabot[bot]
6a8987b35a
Bump unicode-width from 0.1.13 to 0.2.0 (#661)
Bumps [unicode-width](https://github.com/unicode-rs/unicode-width) from 0.1.13 to 0.2.0.
- [Commits](https://github.com/unicode-rs/unicode-width/commits)

---
updated-dependencies:
- dependency-name: unicode-width
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-30 16:14:26 -05:00
dependabot[bot]
8096a45e58
Bump clap from 4.5.17 to 4.5.18 (#660)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.17 to 4.5.18.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.17...clap_complete-v4.5.18)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-30 16:14:07 -05:00
JEEVITHA KANNAN K S
66b92c84b0
feat: Add scroll (#643)
* Add scroll

* Update running_command.rs

* Add hints, Up and Down to terminal
2024-09-30 15:46:05 -05:00
JEEVITHA KANNAN K S
b549510895
Fix selected-cmd bug (#638) 2024-09-30 15:23:16 -05:00