GSettings Array Manipulator
Welcome to the GSettings Array Manipulator, a powerful command-line tool designed to simplify and streamline your interactions with GSettings arrays. With this tool, you can perform a variety of tasks, from inserting items into an array to sorting and deduplicating items, all with a few simple commands.
Features
- Insert: Add one or more items to your array at a specified index.
- List: Display all items in your array, each on a new line.
- Sort: Sort all items in your array.
- Deduplicate: Remove duplicate items from your array.
- Pop: Print and remove the item at a specified index.
- Remove: Delete one or more items from your array.
- Clear: Remove all items from your array.
Installation
You can download and make the script executable using the following commands:
wget https://gist.github.com/rindeal/c5786254410028f760ee2351d884a744/raw/gsettings-array.py
chmod +x gsettings-array.py
Usage
The general usage of the GSettings Array Manipulator is as follows:
./gsettings-array.py COMMAND
Replace COMMAND with one of the available commands listed in the Features section.
For detailed usage instructions for each command, use the -h or --help option after the command, like so:
./gsettings-array.py COMMAND -h
Examples
Here are some examples of how to use the various commands:
-
Insert Command:
gsettings-array insert --dedup "org.gnome.desktop.input-sources" "sources" 0 "('xkb', 'us+cz_sk_de')"
This command inserts the tuple
('xkb', 'us+cz_sk_de')at index 0 in thesourcesarray of theorg.gnome.desktop.input-sourcesschema. The--dedupoption ensures that no duplicates will be present in the array. -
List Command:
gsettings-array ls "org.gnome.desktop.input-sources" "sources"
This command lists all items in the
sourcesarray of theorg.gnome.desktop.input-sourcesschema. -
Sort Command:
gsettings-array sort "org.gnome.desktop.input-sources" "sources"
This command sorts all items in the
sourcesarray of theorg.gnome.desktop.input-sourcesschema. -
Deduplicate Command:
gsettings-array dedup "org.gnome.desktop.input-sources" "sources"
This command removes duplicate items from the
sourcesarray of theorg.gnome.desktop.input-sourcesschema. -
Pop Command:
gsettings-array pop "org.gnome.desktop.input-sources" "sources" 0
This command prints and removes the item at index 0 from the
sourcesarray of theorg.gnome.desktop.input-sourcesschema. -
Remove Command:
gsettings-array rm "org.gnome.desktop.input-sources" "sources" "('xkb', 'us+cz_sk_de')"
This command removes the tuple
('xkb', 'us+cz_sk_de')from thesourcesarray of theorg.gnome.desktop.input-sourcesschema. -
Clear Command:
gsettings-array clear "org.gnome.desktop.input-sources" "sources"
This command removes all items from the
sourcesarray of theorg.gnome.desktop.input-sourcesschema.
Metadata
Release files for gsettings-array 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gsettings_array-1.0.1.tar.gz | 24.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gsettings_array-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 52.7 kB
Release files / gsettings_array-1.0.1.tar.gz
| Download URL | gsettings_array-1.0.1.tar.gz |
|---|---|
| Size | 24.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e334b67e3bb99a5b5dd6e053b49f3370393dc8d78c78723977429ebce1783c81
|
|
BLAKE2b-256 checksum How to use checksums |
c2a46941a86ef41b5cc48cfb3076532f518d3e2083cb977a30d2eb471bbcde80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|
Release files / gsettings_array-1.0.1-py3-none-any.whl
| Download URL | gsettings_array-1.0.1-py3-none-any.whl |
|---|---|
| Size | 27.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec78fa4daafecf7bdbc6cfaf9b6fb76bfc82572c588be777de8f6d300398635e
|
|
BLAKE2b-256 checksum How to use checksums |
5e78944e46aac1b0f785d908e1cc44c4bcf98e7f1b822b120a5fd86169071d13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|