32 Commits

Author SHA1 Message Date
s1d3sw1ped
12a9c101f2 Merge pull request 'Merge pull request 'update-develop' (#26) from update-develop into develop' (#27) from develop into master
Some checks failed
CI / Test (push) Successful in 1m21s
CI / Lint (push) Successful in 1m55s
CI / Build (push) Successful in 2m33s
Release versioned tag / Test (push) Successful in 1m35s
Release versioned tag / Lint (push) Successful in 2m5s
Release versioned tag / Build versioned release (push) Failing after 2m11s
Reviewed-on: #27
2024-05-20 07:22:04 +00:00
s1d3sw1ped
ff6381575e Merge pull request 'update-develop' (#26) from update-develop into develop
All checks were successful
CI / Lint (push) Successful in 1m35s
CI / Test (push) Successful in 1m27s
CI / Lint (pull_request) Successful in 1m47s
CI / Test (pull_request) Successful in 1m23s
CI / Build (push) Successful in 2m43s
CI / Build (pull_request) Successful in 2m23s
Reviewed-on: #26
2024-05-20 07:21:42 +00:00
s1d3sw1ped
acb4401e37 Merge pull request 'fix-ci' (#25) from fix-ci into master
All checks were successful
CI / Test (push) Successful in 1m39s
CI / Lint (push) Successful in 1m48s
CI / Build (push) Successful in 2m57s
CI / Test (pull_request) Successful in 1m43s
CI / Lint (pull_request) Successful in 1m53s
CI / Build (pull_request) Successful in 2m50s
Reviewed-on: #25
2024-05-20 07:01:22 +00:00
76d8c1744a fix ci stuff for other things
All checks were successful
CI / Test (pull_request) Successful in 1m36s
CI / Lint (pull_request) Successful in 1m39s
CI / Build (pull_request) Successful in 2m39s
2024-05-20 01:58:17 -05:00
s1d3sw1ped
b2bef77f09 Merge pull request 'small typo fix and removed unneeded global variable' (#23) from cleanup_typos into develop
Some checks failed
CI / Lint (push) Failing after 36s
CI / Test (push) Successful in 1m37s
CI / Test (pull_request) Successful in 1m17s
CI / Lint (pull_request) Successful in 1m55s
CI / Build (push) Successful in 2m56s
CI / Build (pull_request) Successful in 2m20s
Reviewed-on: #23
2024-05-20 06:51:53 +00:00
4cbb0666cb add run number to artifacts
All checks were successful
CI / Test (pull_request) Successful in 1m27s
CI / Lint (pull_request) Successful in 2m2s
CI / Build (pull_request) Successful in 2m41s
2024-05-20 01:47:36 -05:00
83cb34001f fyne metadata sucks so jst custom stuff
All checks were successful
CI / Test (pull_request) Successful in 1m17s
CI / Lint (pull_request) Successful in 1m58s
CI / Build (pull_request) Successful in 2m36s
2024-05-20 01:37:58 -05:00
1f09482950 remove version and build from fyneapp.toml
All checks were successful
CI / Test (pull_request) Successful in 1m32s
CI / Lint (pull_request) Successful in 1m57s
CI / Build (pull_request) Successful in 2m41s
2024-05-20 01:00:32 -05:00
1af4d225b5 add os dependencies to lint
All checks were successful
CI / Test (pull_request) Successful in 1m28s
CI / Lint (pull_request) Successful in 1m52s
CI / Build (pull_request) Successful in 2m47s
2024-05-20 00:47:05 -05:00
7863c53280 test
Some checks failed
CI / Lint (pull_request) Failing after 54s
CI / Test (pull_request) Successful in 2m3s
CI / Build (pull_request) Successful in 2m49s
2024-05-20 00:35:08 -05:00
s1d3sw1ped
35d888ec62 Merge pull request 'merge master into develop' (#22) from master into develop
All checks were successful
CI / Lint (push) Successful in 1m10s
CI / Test (push) Successful in 3m38s
CI / Build (push) Successful in 4m9s
Reviewed-on: #22
2024-03-12 05:16:43 +00:00
s1d3sw1ped
15e317b6fe Merge pull request 'fix' (#21) from fix3 into master
All checks were successful
CI / Lint (push) Successful in 50s
CI / Test (push) Successful in 3m32s
CI / Build (push) Successful in 4m4s
CI / Lint (pull_request) Successful in 1m2s
CI / Test (pull_request) Successful in 3m46s
CI / Build (pull_request) Successful in 4m18s
Reviewed-on: #21
2024-03-12 05:03:56 +00:00
07f11c7d22 fix
Some checks failed
CI / Build (pull_request) Has been cancelled
CI / Test (pull_request) Has been cancelled
CI / Lint (pull_request) Has been cancelled
2024-03-12 00:03:21 -05:00
s1d3sw1ped
7c28081b65 Merge pull request 'fix' (#20) from fix2 into master
All checks were successful
CI / Lint (push) Successful in 40s
CI / Build (push) Successful in 3m22s
CI / Test (push) Successful in 3m42s
Reviewed-on: #20
2024-03-12 04:56:40 +00:00
d9a75a5e21 fix
Some checks failed
CI / Test (pull_request) Has been cancelled
CI / Lint (pull_request) Has been cancelled
CI / Build (pull_request) Has been cancelled
2024-03-11 23:56:22 -05:00
s1d3sw1ped
5da6636dd7 Merge pull request 'blah' (#19) from fix into master
All checks were successful
CI / Lint (push) Successful in 55s
CI / Test (push) Successful in 3m45s
CI / Build (push) Successful in 4m16s
Reviewed-on: #19
2024-03-12 04:40:10 +00:00
b04e653350 blah
Some checks failed
CI / Test (pull_request) Has been cancelled
CI / Build (pull_request) Has been cancelled
CI / Lint (pull_request) Has been cancelled
2024-03-11 23:39:24 -05:00
s1d3sw1ped
8469610328 Merge pull request 'ci and general changes' (#18) from ci_and_edits into master
All checks were successful
CI / Lint (push) Successful in 46s
CI / Build (push) Successful in 3m36s
CI / Test (push) Successful in 4m7s
Reviewed-on: #18
2024-03-12 04:06:14 +00:00
9703682b4a try fixing ci again
All checks were successful
CI / Lint (pull_request) Successful in 54s
CI / Build (pull_request) Successful in 3m35s
CI / Test (pull_request) Successful in 4m0s
2024-03-11 21:59:14 -05:00
e281fbafdb ci and general changes
All checks were successful
CI / Lint (pull_request) Successful in 50s
CI / Build (pull_request) Successful in 3m46s
CI / Test (pull_request) Successful in 4m6s
2024-03-11 21:42:16 -05:00
be35430727 please
Some checks failed
CI / Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Build (push) Successful in 3m2s
2024-03-11 14:09:01 -05:00
3667bfae52 please
Some checks failed
CI / Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Build (push) Successful in 3m12s
2024-03-11 14:01:07 -05:00
8ec9119bc1 please
All checks were successful
CI / Lint (push) Successful in 56s
CI / Test (push) Successful in 3m43s
CI / Build (push) Successful in 4m20s
2024-03-11 12:46:27 -05:00
4924466a93 please
Some checks failed
CI / Lint (push) Successful in 53s
CI / Test (push) Successful in 3m5s
CI / Build (push) Failing after 1m56s
2024-03-11 11:45:17 -05:00
e37e629630 please
Some checks failed
CI / Lint (push) Successful in 49s
CI / Build (push) Failing after 3m2s
CI / Test (push) Successful in 3m32s
2024-03-10 22:08:51 -05:00
e1db654a48 please
Some checks failed
CI / Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Build (push) Successful in 2m56s
2024-03-10 22:00:02 -05:00
ee19aadac9 please
Some checks failed
CI / Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Build (push) Failing after 1m58s
2024-03-10 21:56:40 -05:00
17b0d9f72e please
Some checks failed
CI / Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Build (push) Successful in 3m2s
2024-03-10 21:46:47 -05:00
99a59b47c2 please
Some checks failed
CI / Lint (push) Successful in 48s
CI / Build (push) Failing after 2m48s
CI / Test (push) Successful in 3m18s
2024-03-10 21:41:26 -05:00
77f83b89f6 Merge branch 'master' of ssh://git.s1d3sw1ped.com:2222/s1d3sw1ped/SwipedModSwitcher
All checks were successful
CI / Lint (push) Successful in 56s
CI / Build (push) Successful in 3m12s
CI / Test (push) Successful in 3m37s
2024-03-10 21:23:53 -05:00
s1d3sw1ped
86d4095444 Merge pull request 'cleanup' (#17) from develop into master
All checks were successful
CI / Lint (push) Successful in 48s
CI / Build (push) Successful in 3m0s
CI / Test (push) Successful in 3m20s
Reviewed-on: #17
2024-03-11 02:04:57 +00:00
58bb19b43f add actions 2024-03-10 00:41:03 -06:00
5 changed files with 68 additions and 25 deletions

View File

@@ -19,6 +19,11 @@ jobs:
check-latest: true
cache: true
- name: Setup OS dependencies
run: |
apt-get update
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
- name: Install go dependencies
run: go mod tidy
@@ -90,8 +95,9 @@ jobs:
- name: Build for linux
run: |
fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}${EXE} main.go
fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}
env:
VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}}
GOOS: linux
GOARCH: amd64
@@ -101,17 +107,18 @@ jobs:
- name: Build for windows
run: |
fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}${EXE} main.go
fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}.exe
env:
VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}}
GOOS: windows
GOARCH: amd64
EXE: .exe
EXE: ".exe"
CGO_ENABLED: 1
CC: x86_64-w64-mingw32-gcc
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: swiped-mod-switcher-${{github.ref_name}}
name: swiped-mod-switcher-${{github.ref_name}}-${{github.run_number}}
path: bin/

View File

@@ -20,6 +20,11 @@ jobs:
check-latest: true
cache: true
- name: Setup OS dependencies
run: |
apt-get update
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
- name: Install go dependencies
run: go mod tidy
@@ -91,30 +96,30 @@ jobs:
- name: Build for linux
run: |
fyne package --os ${{GOOS}} --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-linux-amd64 main.go
fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}
ls bin
env:
VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}}
GOOS: linux
GOARCH: amd64
EXE: ""
CGO_ENABLED: 1
CC: gcc
- name: Build for windows
run: |
fyne package --os ${{GOOS}} --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-windows-amd64.exe main.go
fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}.exe
ls bin
env:
VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}}
GOOS: windows
GOARCH: amd64
EXE: .exe
CGO_ENABLED: 1
CC: x86_64-w64-mingw32-gcc
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: swiped-mod-switcher-${{github.ref_name}}
name: swiped-mod-switcher-${{github.ref_name}}-${{github.run_number}}
path: bin/

View File

@@ -21,6 +21,11 @@ jobs:
check-latest: true
cache: true
- name: Setup OS dependencies
run: |
apt-get update
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
- name: Install go dependencies
run: go mod tidy
@@ -87,7 +92,7 @@ jobs:
- name: Build for linux
run: |
fyne package --os ${{GOOS}} --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-linux-amd64 main.go
fyne build --release --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-${GOOS}-${GOARCH}
env:
VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}}
@@ -97,10 +102,9 @@ jobs:
CGO_ENABLED: 1
CC: gcc
- name: Build for windows
run: |
fyne package --os ${{GOOS}} --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-windows-amd64.exe main.go
fyne build --release --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-${GOOS}-${GOARCH}.exe
env:
VERSION: ${{github.ref_name}}
BUILD: ${{github.run_number}}
@@ -110,7 +114,6 @@ jobs:
CGO_ENABLED: 1
CC: x86_64-w64-mingw32-gcc
- name: Release binaries
uses: https://gitea.com/actions/release-action@main
with:

View File

@@ -1,6 +1,4 @@
[Details]
Icon = "icon.png"
Name = "Swiped Mod Switcher"
ID = "com.s1d3sw1ped.swipedmodswitcher"
Version = "0.0.0"
Build = 1
Icon = "icon.png"
Name = "Swiped Mod Switcher"
ID = "com.s1d3sw1ped.swipedmodswitcher"

36
main.go
View File

@@ -4,9 +4,9 @@ import (
"fmt"
"os"
"path/filepath"
"runtime/debug"
"s1d3sw1ped/swipedmodswitcher/admin"
"slices"
"strconv"
"strings"
"fyne.io/fyne/v2"
@@ -61,16 +61,42 @@ var cfg *Config
func main() {
if !admin.Admin() {
fmt.Println("not running as administrator relaunching")
if err := admin.RunSelfElevated(); err != nil {
panic(err)
}
os.Exit(0)
return // just incase
}
cfg = loadConfig()
ap := app.New()
wp := ap.NewWindow(ap.Metadata().Name + " v" + ap.Metadata().Version + "." + strconv.Itoa(ap.Metadata().Build))
commithash := func() string {
if info, ok := debug.ReadBuildInfo(); ok {
for _, setting := range info.Settings {
if setting.Key == "vcs.revision" {
return setting.Value
}
}
}
return ""
}()
buildversion := ap.Metadata().Custom["BuildVersion"]
if buildversion == "" {
buildversion = ""
}
buildnumber := ap.Metadata().Custom["BuildNumber"]
if buildnumber == "" {
buildnumber = "commit " + commithash
} else {
buildnumber = "build " + buildnumber
}
wp := ap.NewWindow(ap.Metadata().Name + " " + buildversion + " " + buildnumber)
wp.Resize(fyne.NewSize(600, 1))
wp.CenterOnScreen()
@@ -136,10 +162,14 @@ func fillGrid(grid *fyne.Container, parent fyne.Window) {
grid.Hide()
defer grid.Show()
grid.RemoveAll()
if admin.Admin() {
for _, profile := range profiles {
profilename := filepath.Base(profile)
grid.Add(widget.NewButton(profilename, makeIFunc(profile, archive, parent)))
}
} else {
grid.Add(widget.NewLabel("not running as administrator"))
}
}
func scanProfiles(profilesroot string) []string {
@@ -181,6 +211,6 @@ func makeIFunc(profile, archive string, parent fyne.Window) func() {
return
}
dialog.NewInformation("Success", fmt.Sprintf("filinked files from %s to %s", filepath.Base(profile), archive), parent).Show()
dialog.NewInformation("Success", fmt.Sprintf("linked files from %s to %s", filepath.Base(profile), archive), parent).Show()
}
}