Skip to content

Commit 4fee2f7

Browse files
committed
🔧 | Fixed sound compatibility on Windows
1 parent 256c7b0 commit 4fee2f7

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ uninstall-linux:
88
rm -rf /opt/ghost/
99

1010
install-win:
11-
mkdir ${HOME}\\AppData\\Roaming\\ghost
12-
cp ./sounds/* ${HOME}\\AppData\\Roaming\\ghost\\
11+
mkdir ${USERPROFILE}\\AppData\\Roaming\\ghost
12+
cp ./sounds/* ${USERPROFILE}\\AppData\\Roaming\\ghost\\
1313
go build
1414
echo "Move the builded binary for any location you want!"
1515

1616
uninstall-win:
17-
rmdir ${HOME}\\AppData\\Roaming\\ghost
17+
rmdir ${USERPROFILE}\\AppData\\Roaming\\ghost

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,10 @@ ghost -f -o
5151
### Install (Will need 'make'):<br>
5252
#### Windows:<br>
5353
`sudo make install-win`<br><br>
54+
55+
**If you face any problem:**
56+
- Create the directory manually: `mkdir C:\Users\<USER>\AppData\Roaming\ghost`
57+
- Copy the sounds to the created directory: `cp .\sounds\* C:\Users\<USER>\AppData\Roaming\ghost\`
58+
5459
#### Linux:<br>
5560
`sudo make install-linux`<br><br>

utils/checkSave.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func CheckSave(save string) bool {
1515
}
1616

1717
case "windows":
18-
if save == fmt.Sprintf("%s\\AppData\\Local\\Temp\\screenshot.png", os.Getenv("HOME")) {
18+
if save == fmt.Sprintf("%s\\AppData\\Local\\Temp\\screenshot.png", os.Getenv("USERPROFILE")) {
1919
return true
2020

2121
}

utils/playSound.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func PlaySound(sound string) {
1818
done := make(chan bool)
1919

2020
if runtime.GOOS == "windows" {
21-
file, _ = os.Open(fmt.Sprintf("%s\\AppData\\Roaming\\ghost\\%s", os.Getenv("HOME"), sound))
21+
file, _ = os.Open(fmt.Sprintf("%s\\AppData\\Roaming\\ghost\\%s", os.Getenv("USERPROFILE"), sound))
2222

2323
} else if runtime.GOOS == "linux" {
2424
file, _ = os.Open(fmt.Sprintf("/opt/ghost/%s", sound))

0 commit comments

Comments
 (0)