-
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.
- Loading branch information
1 parent
028b049
commit b867e92
Showing
7 changed files
with
142 additions
and
66 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{"esversion": 6} |
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 |
---|---|---|
|
@@ -33,9 +33,14 @@ A GNOME Shell extension that allows you to toggle the **AmneziaWG** (via awg-qui | |
|
||
![Screenshot](images/screenshot-prefs.png) | ||
|
||
## Gnome Versions Support | ||
## Versions | ||
|
||
- 40|41|42|43|44 - `master` branch, `v3` tag | ||
> [!NOTE] | ||
> `Main` branch always has latest `Version Name`. | ||
| Version Name | Version | Gnome Shell Support | Tag | | ||
|--------------|---------|---------------------|--------| | ||
| 1.4.0 | 4 | 40-44 | v1.4.0 | | ||
|
||
## Manual Installation | ||
|
||
|
@@ -46,16 +51,17 @@ git clone https://github.com/amnezia-vpn/amneziawg-gnome-extension.git ~/.local/ | |
``` | ||
|
||
> [!TIP] | ||
> add `--branch <version tag>` if you need exact version | ||
> add `--branch <version tag>` if you need exact version. Version from `main` may not work with your gnome shell version. | ||
### Get extension from ZIP: | ||
```bash | ||
wget https://github.com/amnezia-vpn/amneziawg-gnome-extension/releases/download/v3/[email protected] | ||
version_tag=1.4.0 # Latest version | ||
wget https://github.com/amnezia-vpn/amneziawg-gnome-extension/releases/download/v${version_tag}/[email protected] | ||
gnome-extensions install [email protected] --force | ||
``` | ||
|
||
> [!TIP] | ||
> Replace `v3` in url with `<version tag>` if you need another version | ||
> Replace `version_tag` variable value if you need another version | ||
### Apply extension | ||
|
||
|
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,57 @@ | ||
const ExtensionUtils = imports.misc.extensionUtils; | ||
const Me = ExtensionUtils.getCurrentExtension(); | ||
|
||
var GsettingsManager = class { | ||
constructor(schemaId = null) { | ||
if (!schemaId) { | ||
const meta = ExtensionUtils.getCurrentExtension().metadata; | ||
schemaId = meta['settings-schema']; | ||
} | ||
|
||
this.settings = ExtensionUtils.getSettings(schemaId); | ||
|
||
if (!this.settings) { | ||
throw new Error(`Failed to load schema: ${schemaId}`); | ||
} | ||
} | ||
|
||
|
||
resetKey(key) { | ||
if (!this.settings.list_keys().includes(key)) { | ||
throw new Error(`Key '${key}' does not exist in the schema.`); | ||
} | ||
this.settings.reset(key); | ||
log(`Key '${key}' has been reset to its default value.`); | ||
} | ||
|
||
listKeys() { | ||
return this.settings.list_keys(); | ||
} | ||
|
||
getValue(key) { | ||
if (!this.settings.list_keys().includes(key)) { | ||
throw new Error(`Key '${key}' does not exist in the schema.`); | ||
} | ||
return this.settings.get_value(key).unpack(); | ||
} | ||
|
||
setValue(key, value) { | ||
if (!this.settings.list_keys().includes(key)) { | ||
throw new Error(`Key '${key}' does not exist in the schema.`); | ||
} | ||
|
||
const currentType = this.settings.get_value(key).get_type_string(); | ||
const variant = new imports.gi.GLib.Variant(currentType, value); | ||
|
||
this.settings.set_value(key, variant); | ||
log(`Key '${key}' has been set to: ${value}`); | ||
} | ||
|
||
resetAllKeys() { | ||
const keys = this.listKeys(); | ||
for (const key of keys) { | ||
this.resetKey(key); | ||
} | ||
log("All keys have been reset to their default values."); | ||
} | ||
}; |
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