Skip to content

Commit 98de957

Browse files
committed
feat: v1.1.3
1 parent 42bac42 commit 98de957

File tree

14 files changed

+67
-66
lines changed

14 files changed

+67
-66
lines changed

README.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,7 @@
44
</div>
55

66
<br><br>
7-
## ANNOUNCEMENT:
8-
**I've decided to shutdown Windows compatibility, reason is, this tool is terminal friendly and Windows users usually don't, other user friendly tools are used, like the Windows 10 builtin "Win + Shift + S" command. The linux support will continue and I want to embrace Unix like OSs, hope you all understand me.**
9-
10-
&nbsp;
117
## ❗️ Install:
12-
Arch based:
13-
```bash
14-
git clone https://aur.archlinux.org/ghost-git.git
15-
cd ghost-git
16-
makepkg -si
17-
```
18-
19-
OR with a AUR Helper:
20-
```bash
21-
yay -S ghost-git
22-
```
23-
24-
<br><br>
25-
Others:
268
```bash
279
git clone https://github.com/z3oxs/ghost.git
2810
cd ghost

chans/keyEventsMulti.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import (
55

66
"fyne.io/fyne/v2"
77
"fyne.io/fyne/v2/canvas"
8-
"github.com/z3oxs/ghost/utils"
8+
"github.com/imf4ll/ghost/types"
99
)
1010

1111
func KeyEventsMulti (
1212
event chan *fyne.KeyEvent, selectedDisplay int,
13-
window fyne.Window, screenshots []*canvas.Raster, displays []utils.Display,
13+
window fyne.Window, screenshots []*canvas.Raster, displays []types.Display,
1414
) {
1515
for {
1616
select {
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package utils
1+
package get
22

33
/*
44
#cgo LDFLAGS: -lXrandr -lX11
@@ -7,23 +7,20 @@ package utils
77
*/
88
import "C"
99

10-
import "unsafe"
10+
import (
11+
"unsafe"
1112

12-
type Display struct {
13-
X,
14-
Y,
15-
Width,
16-
Height int
17-
}
13+
"github.com/imf4ll/ghost/types"
14+
)
1815

19-
func GetDisplays() []Display {
20-
var validDisplays []Display
16+
func GetDisplays() []types.Display {
17+
var validDisplays []types.Display
2118

2219
displays := (*[1 << 10]C.struct_DisplayInfo)(unsafe.Pointer(C.getDisplays()))[0:10]
2320

2421
for _, i := range displays {
2522
if (i.w != 0 && i.h != 0) {
26-
validDisplays = append(validDisplays, Display {
23+
validDisplays = append(validDisplays, types.Display {
2724
X: int(i.x),
2825
Y: int(i.y),
2926
Width: int(i.w),

utils/getMouse.go renamed to get/getMouse.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package utils
1+
package get
22

33
/*
44
#cgo LDFLAGS: -lX11

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/z3oxs/ghost
1+
module github.com/imf4ll/ghost
22

33
go 1.17
44

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"fmt"
77
"log"
88

9-
"github.com/z3oxs/ghost/modes"
9+
"github.com/imf4ll/ghost/modes"
1010
)
1111

1212
var (
@@ -60,7 +60,7 @@ Flags:
6060

6161
func main() {
6262
if version {
63-
fmt.Println("\nCurrent version:\n v1.1.2")
63+
fmt.Println("\nCurrent version:\n v1.1.3")
6464

6565
os.Exit(3)
6666
}

modes/display.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ package modes
33
import (
44
"log"
55

6-
"github.com/z3oxs/ghost/utils"
6+
"github.com/imf4ll/ghost/get"
7+
"github.com/imf4ll/ghost/save"
8+
"github.com/imf4ll/ghost/utils"
79
)
810

9-
func Display(save string, clipboard, output, upload, file bool, display int) {
10-
displays := utils.GetDisplays()
11+
func Display(filename string, clipboard, output, upload, file bool, display int) {
12+
displays := get.GetDisplays()
1113

1214
if display > len(displays) {
1315
log.Fatal("Invalid screen selected.")
@@ -21,8 +23,8 @@ func Display(save string, clipboard, output, upload, file bool, display int) {
2123
displaySelected.Y,
2224
displaySelected.Width,
2325
displaySelected.Height,
24-
save,
26+
filename,
2527
)
2628

27-
utils.SaveHandler(clipboard, output, upload, file, screenshot)
29+
save.SaveHandler(clipboard, output, upload, file, screenshot)
2830
}

modes/fullscreen.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
package modes
22

3-
import "github.com/z3oxs/ghost/utils"
3+
import (
4+
"github.com/imf4ll/ghost/save"
5+
"github.com/imf4ll/ghost/utils"
6+
)
47

5-
func Fullscreen(save string, clipboard, output, upload, file bool) {
6-
screenshot := utils.CaptureScreen(save)
8+
func Fullscreen(filename string, clipboard, output, upload, file bool) {
9+
screenshot := utils.CaptureScreen(filename)
710

8-
utils.SaveHandler(clipboard, output, upload, file, screenshot)
11+
save.SaveHandler(clipboard, output, upload, file, screenshot)
912
}
1013

modes/selection.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,23 @@ package modes
33
import (
44
"image"
55

6-
"github.com/z3oxs/ghost/utils"
6+
"github.com/imf4ll/ghost/get"
7+
"github.com/imf4ll/ghost/save"
8+
"github.com/imf4ll/ghost/utils"
79
)
810

9-
func Selection(save string, clipboard, output, upload, file bool) {
11+
func Selection(filename string, clipboard, output, upload, file bool) {
1012
var screenshot image.Image
1113

12-
m := utils.GetMouseAndKeyboard()
14+
m := get.GetMouseAndKeyboard()
1315

1416
if m.X1 < m.X2 {
1517
screenshot = utils.CaptureRect (
1618
m.X1,
1719
m.Y1,
1820
m.X2 - m.X1,
1921
m.Y2 - m.Y1,
20-
save,
22+
filename,
2123
)
2224

2325
} else {
@@ -26,10 +28,10 @@ func Selection(save string, clipboard, output, upload, file bool) {
2628
m.Y2,
2729
m.X1 - m.X2,
2830
m.Y1 - m.Y2,
29-
save,
31+
filename,
3032
)
3133

3234
}
3335

34-
utils.SaveHandler(clipboard, output, upload, file, screenshot)
36+
save.SaveHandler(clipboard, output, upload, file, screenshot)
3537
}

modes/selectionGUI.go

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ import (
77
"fyne.io/fyne/v2"
88
"fyne.io/fyne/v2/app"
99
"fyne.io/fyne/v2/canvas"
10-
"github.com/z3oxs/ghost/chans"
11-
"github.com/z3oxs/ghost/utils"
10+
11+
"github.com/imf4ll/ghost/chans"
12+
"github.com/imf4ll/ghost/get"
13+
"github.com/imf4ll/ghost/save"
14+
"github.com/imf4ll/ghost/utils"
1215
)
1316

14-
func SelectionGUI(save string, clipboard, output, upload, file bool) {
17+
func SelectionGUI(filename string, clipboard, output, upload, file bool) {
1518
var selectedDisplay int
1619
var multipleDisplay bool
1720
var screenshot image.Image
@@ -26,7 +29,7 @@ func SelectionGUI(save string, clipboard, output, upload, file bool) {
2629
window.SetPadded(false)
2730
window.SetFullScreen(true)
2831

29-
displays := utils.GetDisplays()
32+
displays := get.GetDisplays()
3033

3134
if len(displays) > 0 {
3235
multipleDisplay = true
@@ -37,7 +40,7 @@ func SelectionGUI(save string, clipboard, output, upload, file bool) {
3740
display.Y,
3841
display.Width,
3942
display.Height,
40-
save,
43+
filename,
4144
)
4245

4346
image := canvas.NewRasterFromImage(displayScreenshot)
@@ -57,7 +60,7 @@ func SelectionGUI(save string, clipboard, output, upload, file bool) {
5760
window.SetContent(screenshots[selectedDisplay])
5861

5962
} else {
60-
image := canvas.NewRasterFromImage(utils.CaptureScreen(save))
63+
image := canvas.NewRasterFromImage(utils.CaptureScreen(filename))
6164

6265
go chans.KeyEvents(event)
6366

@@ -75,15 +78,15 @@ func SelectionGUI(save string, clipboard, output, upload, file bool) {
7578
defer wg.Done()
7679

7780
for {
78-
m := utils.GetMouse()
81+
m := get.GetMouse()
7982

8083
if m.X1 < m.X2 {
8184
screenshot = utils.CaptureRect (
8285
m.X1,
8386
m.Y1,
8487
m.X2 - m.X1,
8588
m.Y2 - m.Y1,
86-
save,
89+
filename,
8790
)
8891

8992
} else {
@@ -92,15 +95,15 @@ func SelectionGUI(save string, clipboard, output, upload, file bool) {
9295
m.Y2,
9396
m.X1 - m.X2,
9497
m.Y1 - m.Y2,
95-
save,
98+
filename,
9699
)
97100

98101
}
99102

100103
break
101104
}
102105

103-
utils.SaveHandler(clipboard, output, upload, file, screenshot)
106+
save.SaveHandler(clipboard, output, upload, file, screenshot)
104107

105108
window.Close()
106109
}()

0 commit comments

Comments
 (0)