mirror of
https://github.com/anotherhadi/usbguard-tui.git
synced 2026-10-05 10:18:25 +02:00
@@ -1,17 +1,19 @@
|
|||||||
```
|
```
|
||||||
▖▖▄▖▄ ▄▖ ▌ ▄▖▖▖▄▖
|
_ _ ____ ____ ____ _ _____ _ _ ___
|
||||||
▌▌▚ ▙▘▌ ▌▌▀▌▛▘▛▌ ▐ ▌▌▐
|
| | | / ___|| __ ) / ___|_ _ __ _ _ __ __| | |_ _| | | |_ _|
|
||||||
▙▌▄▌▙▘▙▌▙▌█▌▌ ▙▌ ▐ ▙▌▟▖
|
| | | \___ \| _ \| | _| | | |/ _` | '__/ _` | | | | | | || |
|
||||||
|
| |_| |___) | |_) | |_| | |_| | (_| | | | (_| | | | | |_| || |
|
||||||
|
\___/|____/|____/ \____|\__,_|\__,_|_| \__,_| |_| \___/|___|
|
||||||
```
|
```
|
||||||
|
|
||||||
[](go.mod)
|

|
||||||
[](https://github.com/anotherhadi/usbguard-tui/releases)
|

|
||||||
[](LICENSE)
|

|
||||||
[](https://goreportcard.com/report/github.com/anotherhadi/usbguard-tui)
|
[](https://ko-fi.com/anotherhadi)
|
||||||
|
|
||||||
# USBGuard TUI
|
# USBGuard TUI
|
||||||
|
|
||||||
A terminal UI for managing USB devices via [usbguard](https://usbguard.github.io/).
|
> A terminal UI for managing USB devices via [usbguard](https://usbguard.github.io/).
|
||||||
|
|
||||||
USBGuard is a software framework for implementing a USB device authorization policy (allowlisting/blocklisting). It protects your system against rogue USB devices by scanning them and checking their parameters against a set of rules.
|
USBGuard is a software framework for implementing a USB device authorization policy (allowlisting/blocklisting). It protects your system against rogue USB devices by scanning them and checking their parameters against a set of rules.
|
||||||
|
|
||||||
@@ -21,6 +23,8 @@ Built with [bubbletea](https://github.com/charmbracelet/bubbletea) & Golang!
|
|||||||
|
|
||||||
Colors and styles can be customized using [ilovetui](https://github.com/anotherhadi/ilovetui), which applies theme changes across all compatible TUI applications at once.
|
Colors and styles can be customized using [ilovetui](https://github.com/anotherhadi/ilovetui), which applies theme changes across all compatible TUI applications at once.
|
||||||
|
|
||||||
|
> This project is NOT affiliated with, endorsed by, or connected to "Red Hat, Inc" in any way. It is an unofficial, community-driven tool.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- List all connected USB devices with their current status
|
- List all connected USB devices with their current status
|
||||||
@@ -28,7 +32,7 @@ Colors and styles can be customized using [ilovetui](https://github.com/anotherh
|
|||||||
- Action popup for quick device management
|
- Action popup for quick device management
|
||||||
- Filter devices by name with `/`
|
- Filter devices by name with `/`
|
||||||
- Auto-refresh
|
- Auto-refresh
|
||||||
- Keyboard shortcuts for all actions (`a`/`A`, `b`/`B`, `e`/`E`, ...)
|
- Keyboard shortcuts for all actions (`a`/`A`, `b`/`B`, `e`/`E`, ...) & Mouse support
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
@@ -52,7 +56,7 @@ go install github.com/anotherhadi/usbguard-tui@latest
|
|||||||
```sh
|
```sh
|
||||||
git clone https://github.com/anotherhadi/usbguard-tui
|
git clone https://github.com/anotherhadi/usbguard-tui
|
||||||
cd usbguard-tui
|
cd usbguard-tui
|
||||||
go build -o usbguard-tui .
|
go build -o usbguard-tui ./cmd/usbguard-tui
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
@@ -95,4 +99,4 @@ The device list refreshes automatically every 2 seconds.
|
|||||||
<a href="https://github.com/anotherhadi/usbguard-tui">github</a> |
|
<a href="https://github.com/anotherhadi/usbguard-tui">github</a> |
|
||||||
<a href="https://gitlab.com/anotherhadi_mirror/usbguard-tui">gitlab (mirror)</a> |
|
<a href="https://gitlab.com/anotherhadi_mirror/usbguard-tui">gitlab (mirror)</a> |
|
||||||
<a href="https://git.hadi.icu/anotherhadi/usbguard-tui">gitea (mirror)</a>
|
<a href="https://git.hadi.icu/anotherhadi/usbguard-tui">gitea (mirror)</a>
|
||||||
</div
|
</div>
|
||||||
|
|||||||
+1
-1
@@ -93,7 +93,7 @@ func (a actionModal) View() tea.View {
|
|||||||
hintStyle := lipgloss.NewStyle().Foreground(style.S.Muted)
|
hintStyle := lipgloss.NewStyle().Foreground(style.S.Muted)
|
||||||
parts := []string{a.list.View(), ""}
|
parts := []string{a.list.View(), ""}
|
||||||
if a.rulesManaged {
|
if a.rulesManaged {
|
||||||
parts = append(parts, hintStyle.Render(fmt.Sprintf("[NixOS: perm rules queued — press %s to copy]", listKeys.CopyRules.Help().Key)))
|
parts = append(parts, hintStyle.Render(fmt.Sprintf("[NixOS: perm rules queued, press %s to copy]", listKeys.CopyRules.Help().Key)))
|
||||||
}
|
}
|
||||||
parts = append(parts, hintStyle.Render("↑↓ navigate enter confirm esc cancel"))
|
parts = append(parts, hintStyle.Render("↑↓ navigate enter confirm esc cancel"))
|
||||||
return tea.NewView(strings.Join(parts, "\n"))
|
return tea.NewView(strings.Join(parts, "\n"))
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ import (
|
|||||||
"github.com/anotherhadi/usbguard-tui/internal/guard"
|
"github.com/anotherhadi/usbguard-tui/internal/guard"
|
||||||
)
|
)
|
||||||
|
|
||||||
// deviceZoneID returns the bubblezone marker ID used to detect mouse clicks
|
|
||||||
// on a given device's row in the list.
|
|
||||||
func deviceZoneID(dev guard.Device) string {
|
func deviceZoneID(dev guard.Device) string {
|
||||||
return "device-" + strconv.Itoa(dev.ID)
|
return "device-" + strconv.Itoa(dev.ID)
|
||||||
}
|
}
|
||||||
@@ -97,8 +95,6 @@ func (d actionDelegate) Height() int { return 1 }
|
|||||||
func (d actionDelegate) Spacing() int { return 0 }
|
func (d actionDelegate) Spacing() int { return 0 }
|
||||||
func (d actionDelegate) Update(_ tea.Msg, _ *list.Model) tea.Cmd { return nil }
|
func (d actionDelegate) Update(_ tea.Msg, _ *list.Model) tea.Cmd { return nil }
|
||||||
|
|
||||||
// actionZoneID returns the bubblezone marker ID used to detect mouse clicks
|
|
||||||
// on a given row of the action modal's list.
|
|
||||||
func actionZoneID(index int) string {
|
func actionZoneID(index int) string {
|
||||||
return "action-" + strconv.Itoa(index)
|
return "action-" + strconv.Itoa(index)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user