This commit is contained in:
Syed Daanish
2025-02-09 15:45:42 +03:00
parent 2fb189efc7
commit 1d81a67e00
6 changed files with 66 additions and 21 deletions

19
.github/workflows/go.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
- name: Build
run: go build -v ./...

21
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Build and Release Go Binary
on:
release:
types: [created]
permissions:
contents: write
packages: write
jobs:
release-linux-amd64:
name: release linux/amd64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: linux
goarch: amd64

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 Syed
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# Tuipart
Gparted but TUI.

4
go.mod
View File

@@ -1,10 +1,10 @@
module tuipart module tuipart
go 1.23.3 go 1.23
require ( require (
github.com/gdamore/encoding v1.0.0 // indirect github.com/gdamore/encoding v1.0.0 // indirect
github.com/gdamore/tcell/v2 v2.7.4 // indirect github.com/gdamore/tcell/v2 v2.7.4 // direct
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/rivo/uniseg v0.4.3 // indirect github.com/rivo/uniseg v0.4.3 // indirect

19
main.go
View File

@@ -24,25 +24,6 @@ var symbols []rune
func main() { func main() {
symbols = []rune("󰞔󰪸󰸞") symbols = []rune("󰞔󰪸󰸞")
/*
// ╭───╮
// │  │
// ╰───╯
disk := "nvme0n1"
parts := getPartitions()
mounted_parts(disk, parts)
part_labels(disk, parts)
fmt.Println(parts)
for _, val := range parts {
x, y := get_used_p(disk+"p"+val[0], val[4])
if y != nil {
fmt.Println(disk+"p"+val[0], val[4], "--")
} else {
fmt.Println(disk+"p"+val[0], val[4], fmt.Sprintf("%.2f%%", x))
}
}
return
//*/
screen_tmp, err := tcell.NewScreen() screen_tmp, err := tcell.NewScreen()
if err != nil { if err != nil {
log.Fatalf("Error creating screen: %v", err) log.Fatalf("Error creating screen: %v", err)