This file contains hidden or 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
| #!/bin/bash | |
| # multihead.sh - Toggles external monitors on/off. | |
| # | |
| # Copyright (C) 2021 Daniel Rudolf (<https://www.daniel-rudolf.de>) | |
| # License: The MIT License <http://opensource.org/licenses/MIT> | |
| # | |
| # SPDX-License-Identifier: MIT | |
| APP_NAME="$(basename "${BASH_SOURCE[0]}")" |
This file contains hidden or 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
| #!/bin/bash | |
| # mimetypes.sh | |
| # Load default applications for MIME types from a JSON file. | |
| # | |
| # This script reads MIME type <> default application mappings from JSON files | |
| # (pass filesystem paths as script arguments) and configures defaults via | |
| # `xdg-mime default <application> <MIME type>`. | |
| # | |
| # Missing or uninstalled applications are ignored. If the first listed | |
| # application is not installed, the next one is used as fallback. |
This file contains hidden or 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
| #!/bin/bash | |
| # gnome-extensions.sh | |
| # Installs GNOME Shell extensions directly from extensions.gnome.org. | |
| # | |
| # This script takes GNOME Shell extension UUIDs as arguments and fetches, | |
| # downloads, and installs the latest version on `extensions.gnome.org` that is | |
| # compatible with the locally installed GNOME Shell version. | |
| # | |
| # Note that GNOME Shell will not automatically discover and activate newly | |
| # installed extensions within the current session. In practice, this requires |
This file contains hidden or 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
| #!/bin/bash | |
| # gsettings.sh | |
| # Loads GSettings and dconf configuration values from a JSON file. | |
| # | |
| # This script reads GSettings and dconf configuration values from a JSON file | |
| # (pass a filesystem path as the only argument) and applies them to the local | |
| # system. It optionally supports Flatpak applications, does not fail when a | |
| # GSettings schema does not exist, and supports relocatable schemas. | |
| # | |
| # The JSON file must contain an object with the keys `"gsettings"` and |
This file contains hidden or 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
| #!/bin/bash | |
| # systemd-mutex.sh | |
| # Acquires and holds a mutex lock until terminated | |
| # | |
| # This script acquires and holds an exclusive (pass one of `--exclusive`, `-e`, | |
| # or `-x`; default) or shared (pass `--shared` or `-s`) `flock` lock on the | |
| # given file (pass required `MUTEX_FILE`) until terminated. If the lock cannot | |
| # be acquired immediately, it either waits indefinitely until it can, or until | |
| # the given timeout is exceeded (pass optional float `TIMEOUT` in seconds). | |
| # Optionally, pass `-v` or `--verbose` to explain what's being done. |
This file contains hidden or 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
| #!/bin/bash | |
| ## | |
| # Run org.chromium.Chromium with file forwarding and temp profiles | |
| # | |
| # This wrapper script runs the 'org.chromium.Chromium' Flatpak and | |
| # transparently adds the following options to Chromium's CLI: | |
| # - Flatpak's `-u`, `--user`, `--system`, `--installation=NAME`, `--arch`, | |
| # `--branch`, `--file-forwarding`, and `--verbose` options are passed to | |
| # Flatpak; refer to flatpak-run(1) for details about these options | |
| # - `--user-data-dir=NAME` additionally accepts existing user data directories |
This file contains hidden or 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
| #!/bin/bash | |
| ## | |
| # Bind mounts a directory with mapped IDs | |
| # | |
| # This script allows users running Linux 5.12 and later to easily create bind | |
| # mounts with mapped IDs. For example, `bindfs.sh --idmap foo:bar src dst` bind | |
| # mounts './src/' to './dst/', but all files owned by 'foo' appear as if they | |
| # were owned by 'bar' instead. Files and directories owned by different users | |
| # are kept as-is. This is the key difference to `mount --bind --map-users`. | |
| # Usually one must be 'root' to run this script. |
This file contains hidden or 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
| ## | |
| # Safely source sh-based config files with `bwrap` | |
| # | |
| # This function allows script developers to safely include sh-based config | |
| # files, especially if the config file isn't owned by the running user. Most | |
| # notably this function allows one to source config files owned by unprivileged | |
| # users as root, without practically giving said unprivileged user root access. | |
| # The file is sourced within an unprivileged bwrap container with read-only | |
| # access to /usr and nothing else. The sh-based config file can thus do | |
| # anything a sourced Bash file normally could (e.g. do complex calculations |
This file contains hidden or 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
| #!/bin/bash | |
| # nm-systemd-dispatcher.sh | |
| # Starts/stops a Systemd unit when a connection's status changes to up/down. | |
| # | |
| # Install this script to `/etc/NetworkManager/dispatcher.d/60-systemd.sh` and | |
| # add the following section to your NetworkManager connection config in | |
| # `/etc/NetworkManager/system-connections/*.nmconnection`: | |
| # [user] | |
| # systemd.unit=myservice.service | |
| # |
This file contains hidden or 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
| #!/bin/bash | |
| # mkarchiso-gnome | |
| # Creates a live ISO of Arch Linux with GNOME | |
| # | |
| # This script was created to ease creating live ISOs of Arch Linux with GNOME | |
| # installed. It's highly customized to my personal preferences, thus it's | |
| # likely not very useful as-is for most people, but it could be a good | |
| # starting point for others to create their own custom live ISO. | |
| # | |
| # More about `mkarchiso`: https://wiki.archlinux.org/title/Archiso |
NewerOlder