-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
complete rework of docs, fix far execute switch.go
- Loading branch information
Showing
4 changed files
with
169 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
archive/ | ||
export/ | ||
note |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,133 @@ | ||
# Short about this app: | ||
* App made fully in go and distributed as executable for any platform. (batch is code is only for ME to build and compress the app for releasing) | ||
* It's a very easy to use, flexible naming customisation and protability app. | ||
* It provides the user to make multiple "User Folders" which will store the spotify user data so you don't have to login again when wanting to switch accounts! | ||
|
||
# About this app: | ||
* Get the power to switch spotify accounts without having to log in everytime | ||
* Fully made in Go | ||
* Very fast & simple | ||
* Customisable user folder name | ||
* Portable to store & move the user folder anywhere | ||
|
||
# Platforms supported: | ||
- Windows | ||
- Linux | ||
- MacOS (called darwin) | ||
|
||
# Architectures supported: | ||
- AMD64 : for a cpu of 64 bit | ||
- 386 : for a cpu of 32/86 bit | ||
- ARM : for cpu of type arm | ||
- ARM64 : for cpu of type arm64 | ||
|
||
# How to download released archive: | ||
1. Go to releases | ||
2. Choose your version | ||
3. Download the archive with the platform-architecture name from the chapters above | ||
4. De-archive/Extract the contents in a folder where you want your "Spotify Account Switcher" app to be | ||
|
||
# How to use the app: | ||
There are two parts of the program: | ||
1. Main | ||
2. Switch | ||
- The main one, run it and it will: | ||
- create a folder called "New User" | ||
- copy the contents of the folder called Source into the new user folder | ||
- copy the "prefs" file from the spotify directory (this is the file that actually stores your profile data) | ||
- The switch one, run it and it will: | ||
- copy or overide the "prefs" file from the spotify directory with the one inside your user folder | ||
|
||
# Customisation: | ||
- This app is flexible for naming but robust for the actual structure | ||
- Naming : | ||
- You can change the name of the folder newly create by the main executable to anything you want! | ||
- Portability : | ||
- After you create a user folder you can move it anywhere you want! | ||
|
||
# How it all works: | ||
1. The main executable | ||
- creates a folder if it doesn't exist already called "New User" | ||
- copy the switch executable from the source folder into the new user folder | ||
- copy the prefs file from the spotify directory into your new user folder | ||
2. How the app finds the prefs file: | ||
- based on the OS (operating system) it expands/goes to a directory through enviroment variables of the system or simply the path | ||
3. The switch executable: | ||
- copies the prefs file within the directory of the switch executable and copies or overides the one from the spotify directory. | ||
|
||
|
||
# Building from source: | ||
### 1. Building with the command (RECOMMENDED) (put the following commands): | ||
- go build main.go | ||
- (and inside your user folder): | ||
- go build switch.go | ||
|
||
### 2. Running without building with the command (NOT RECOMMENDED - slower) (put the following commands): | ||
- go run main.go | ||
- (and inside your user folder): | ||
- go run switch.go | ||
|
||
### 3. The build batch file (NOT RECOMMENDED): | ||
- that script will create a folder called export which will contain a build folder for each platform | ||
|
||
### 4. The compress batch file (NOT RECOMMENDED): | ||
- that script will compress each folder insidethe export folder into a folder called archive containing the archived build folders for each platform | ||
- AMD64 : 64 bit cpu | ||
- 386 : 32 bit cpu | ||
- ARM : arm cpu | ||
- ARM64 : arm 64 bit cpu | ||
|
||
# How to install: | ||
1. Go to [Releases](https://github.com/AlexDeFoc/Spotify_Account_Switcher/releases) page | ||
2. Download the version for your platform & architecture | ||
3. Extract files and put them where you want the app to be | ||
|
||
# How to use | ||
|
||
## Creating a new user: | ||
1. Execute the main file | ||
|
||
This creates a folder called "New User", and makes a copy of your Spotify profile called "prefs". | ||
|
||
Now you can move and customise however you want your user profile folder. | ||
|
||
## Switching user accounts: | ||
1. Go inside your user profile folder that you want to switch to. | ||
2. Execute the switch file | ||
|
||
This puts the "prefs" file from the user profile into the Spotify directory. | ||
|
||
# Automate switching accounts: | ||
#### Notes: | ||
This chapter is optional, as you can simply go to you _"Spotify Switcher App"_ folder and go to your user folder that you wish and execute the switch executable. | ||
|
||
I provide a powershell script. In the future i may provide a bash version. | ||
|
||
How i will make it even easier for me to switch accounts is to put this script into my Windows Terminal profile ps1 file, which is loaded whenever i open my terminal, and then i can assign aliases. | ||
|
||
If you want to do the same google "Windows Terminal profile ps1 config". | ||
|
||
``` | ||
function spotifySwitchGO { | ||
param ( | ||
[Parameter(Mandatory = $true)] | ||
[string]$accountAlias | ||
) | ||
$spotifyAccountsFolderNames = @{ | ||
sp1 = 'Main' | ||
sp2 = 'Mini-Alex' | ||
sp3 = 'Mini-Alex2' | ||
} | ||
foreach ($key in $spotifyAccountsFolderNames.Keys) { | ||
if ($key -eq $accountAlias) { | ||
$user = $spotifyAccountsFolderNames[$key] | ||
break | ||
} | ||
} | ||
$switcherPath = Join-Path 'C:/App/Spotify Switcher/' "$user" '/switch.exe' | ||
& "$switcherPath" | ||
} | ||
set-alias -Name sp -Value spotifySwitchGO | ||
``` | ||
### Explanation of the code above: | ||
1. We tell our console to get the name that we type after the _sp_ alias | ||
2. We create a map with keys as our aliases for our accounts and keys for the name of the accounts folder | ||
3. We loop through the map and check if what we provided in the console matches any key from our map and if yes then assign the value of that key to a variable | ||
4. Join the path of our Spotify Switcher App, with the name of the user folder we wanted from the _$user_ variable, and with the name of our switch executable | ||
5. Then using the _&_ symbol we ensure that we run the executable from that path | ||
6. We assign a alias for our function so we can easily just type in our console, to switch to the _"Main"_ account: | ||
``` | ||
sp sp1 | ||
``` | ||
7. That's it! It can be complicated but if you break it down it's easy, and if you don't want this much complexity you can make your own function with simple if and else if statements. | ||
|
||
# Building & running from source | ||
#### Notes: | ||
I don't recommend this aproach because the releases are up to date with the source code. The only times they will be delayed is when i would want to update the documentation. | ||
|
||
When running from source without building it is SLOWER than building or running the distributed executables from the [Release](https://github.com/AlexDeFoc/Spotify_Account_Switcher/releases) page. | ||
|
||
You are required to have this tools: | ||
- git (for cloning) | ||
- go (for building & running) | ||
|
||
## Building from source: | ||
1. Clone the repository into a folder | ||
2. Open a console/terminal and go inside that folder | ||
3. Run the following command: | ||
``` | ||
go build main.go | ||
``` | ||
4. Then go inside the Source folder | ||
5. Run the following command: | ||
``` | ||
go build switch.go | ||
``` | ||
|
||
## Running from source: | ||
1. Clone the repository into a folder | ||
2. Open a console/terminal and go inside that folder | ||
3. Run the following command - to make a new user folder: | ||
``` | ||
go run main.go | ||
``` | ||
4. Then go inside your user folder | ||
5. Run the following command - to switch to that user account | ||
``` | ||
go run switch.go | ||
``` | ||
|
||
# How to contribute: | ||
#### Note: | ||
You can contribute with scripts, examples, simpler or more optimised ones, maybe in bash or other scripting languages for making it a easier time for the linux community. | ||
|
||
You can also contribute with optimisations to the main source code or the switcher one. | ||
|
||
Any contribution is warm welcomed. Although i would ask from anyone wanting to contribute to the app to follow these goals of the project: | ||
- Fast and simple | ||
- Efficient | ||
- Cross-compatible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
- Complete rework of documentation | ||
✅1. About app | ||
✅2. Support | ||
✅3. How to install | ||
✅4. How to use | ||
Create a new user | ||
Switch to new user | ||
✅5. Automate for easier switch | ||
✅6. Build & Run from source | ||
Note | ||
Build | ||
Run | ||
✅7. Contribute | ||
Note | ||
Goals | ||
|
||
- Fixed issue with switch.go not finding prefs file inside the place where was it being executate. Made it very hard to make scripts & automate. Now you can call it from anywhere else. |