diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a07bcfe..9f1555a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,31 @@ Changelog +## [2025.1.0](https://github.com/davidsneighbour/dotfiles/compare/v2024.6.0...v2025.1.0) (2025-01-05) + + +### Features + +* initiate binaries submodule ([3729e76](https://github.com/davidsneighbour/dotfiles/commit/3729e762a6b7e6cf4efac173e61099b4614aff32)) + + +### Bug Fixes + +* add venv package to apt setup ([a3fb28d](https://github.com/davidsneighbour/dotfiles/commit/a3fb28d9938da8c180419c62b2ac7f698888f70f)) +* lib loader fix ([2f95a8c](https://github.com/davidsneighbour/dotfiles/commit/2f95a8cf3176874083f2644654bc3766bfdcb71e)) +* remove unused parts and fix issues in bash scripts ([0bb2b19](https://github.com/davidsneighbour/dotfiles/commit/0bb2b19406d9097061b7585196720f45da803057)) +* update dotbot configuration ([cc69770](https://github.com/davidsneighbour/dotfiles/commit/cc697700976d9818b35139147280b6c48bc747ec)) +* update pishutdown service script ([3b30101](https://github.com/davidsneighbour/dotfiles/commit/3b301018db46b79589949939829b2ea804369837)) + + +### Configuration + +* **vscode:** update configuration ([c419f54](https://github.com/davidsneighbour/dotfiles/commit/c419f546093a72c8a1d2f70f42b3150794451459)) + + +### Build System + +* **deps:** add markdownlint configuration ([6d337b6](https://github.com/davidsneighbour/dotfiles/commit/6d337b6478ab44af904cbf39433187d7506ac60e)) +* **deps:** update dependencies ([a6f5009](https://github.com/davidsneighbour/dotfiles/commit/a6f5009dfa289f00be5175c0b226869786615ad8)) + ## [2024.6.0](https://github.com/davidsneighbour/dotfiles/compare/v2024.5.0...v2024.6.0) (2024-11-29) diff --git a/CITATION.cff b/CITATION.cff index 7ecdad44..947237fd 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -5,6 +5,6 @@ authors: given-names: "Patrick" orcid: "https://orcid.org/0000-0001-6250-2135" title: "Dotfiles by @davidsneighbour" -version: 2024.5.1 -date-released: 2024-11-29 +version: 2025.1.0 +date-released: 2025-01-05 url: "https://github.com/davidsneighbour/dotfiles" diff --git a/bash/_functions/keycombinations.sh b/bash/_functions/keycombinations.sh index a902102f..47bac6ff 100755 --- a/bash/_functions/keycombinations.sh +++ b/bash/_functions/keycombinations.sh @@ -1,7 +1,30 @@ #!/bin/bash +# Exit on errors, unset variables, and pipe failures +set -euo pipefail + export_keybindings() { + if [[ "$1" == "--help" ]]; then + echo "Usage: ${FUNCNAME[0]} " + echo "Export GNOME keybindings to the specified file." + echo + echo "Arguments:" + echo " The file where keybindings will be saved." + echo + echo "Notice:" + echo " It is recommended to use the keybindingsmanager script instead:" + echo " ./$(basename "$0") --export " + echo + echo "Part of DNB's dotfiles: https://github.com/davidsneighbour/dotfiles/" + return 0 + fi + local filename="$1" + if [[ -z "$filename" ]]; then + echo "Error: No filename specified. Use --help for usage information." >&2 + return 1 + fi + echo "Exporting keybindings to $filename" local gsettings_folders=( @@ -13,33 +36,19 @@ export_keybindings() { custom_bindings=$(dconf list /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/ | tr -d '/') { - # Export main keybindings for folder in "${gsettings_folders[@]}"; do gsettings list-recursively "$folder" | while read -r line; do if [[ "$line" =~ ^([^[:space:]]+)[[:space:]]+([^[:space:]]+)[[:space:]]+(.+)$ ]]; then - local path="${BASH_REMATCH[1]}" - local name="${BASH_REMATCH[2]}" - local value="${BASH_REMATCH[3]}" - if [[ "$value" =~ ^\[ ]]; then - echo -e "$path\t$name\t$value" - fi + echo -e "${BASH_REMATCH[1]}\t${BASH_REMATCH[2]}\t${BASH_REMATCH[3]}" else - echo "Could not parse line: $line" >&2 - exit 1 + echo "Warning: Could not parse line: $line" >&2 fi done done - # Export custom keybindings for custom in $custom_bindings; do local folder="/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/${custom}/" - local name - name=$(dconf read "${folder}name") - local command - command=$(dconf read "${folder}command") - local binding - binding=$(dconf read "${folder}binding") - echo -e "custom\t$name\t$command\t$binding" + echo -e "custom\t$(dconf read "${folder}name")\t$(dconf read "${folder}command")\t$(dconf read "${folder}binding")" done } > "$filename" @@ -47,15 +56,39 @@ export_keybindings() { } import_keybindings() { + if [[ "$1" == "--help" ]]; then + echo "Usage: ${FUNCNAME[0]} " + echo "Import GNOME keybindings from the specified file." + echo + echo "Arguments:" + echo " The file containing keybindings to import." + echo + echo "Notice:" + echo " It is recommended to use the keybindingsmanager script instead:" + echo " ./$(basename "$0") --import " + echo + echo "Part of DNB's dotfiles: https://github.com/davidsneighbour/dotfiles/" + return 0 + fi + local filename="$1" + if [[ -z "$filename" ]]; then + echo "Error: No filename specified. Use --help for usage information." >&2 + return 1 + fi + echo "Importing keybindings from $filename" + if [[ ! -f "$filename" ]]; then + echo "Error: File $filename does not exist." >&2 + return 1 + fi + local custom_count=0 local custom_list="" while IFS=$'\t' read -r type name_or_path command_or_name binding_or_value; do if [[ "$type" == "custom" ]]; then - echo "Installing custom keybinding: $name_or_path" local folder="/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${custom_count}/" dconf write "${folder}name" "$name_or_path" dconf write "${folder}command" "$command_or_name" @@ -63,28 +96,30 @@ import_keybindings() { custom_list+="'${folder}'," custom_count=$((custom_count + 1)) else - echo "Importing $name_or_path $command_or_name" gsettings set "$type" "$name_or_path" "$command_or_name" fi done < "$filename" if [[ $custom_count -gt 0 ]]; then - custom_list="[${custom_list%,}]" - echo "Importing list of custom keybindings." - dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings "$custom_list" + dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings "[${custom_list%,}]" fi echo "Keybindings imported successfully." } keybindingsmanager() { - - show_help() { - echo "Import and export keybindings" - echo " -e, --export Export keybindings to a file" - echo " -i, --import Import keybindings from a file" - echo " -h, --help Show this help message" - } + if [[ "$1" == "--help" || -z "$1" ]]; then + echo "Usage: ${FUNCNAME[0]} [OPTIONS]" + echo "Options:" + echo " -e, --export Export keybindings to the specified file" + echo " -i, --import Import keybindings from the specified file" + echo " -h, --help Show this help message" + echo + echo "This script provides a convenient way to manage GNOME keybindings." + echo + echo "Part of DNB's dotfiles: https://github.com/davidsneighbour/dotfiles/" + return 0 + fi local action="" local filename="" @@ -102,25 +137,19 @@ keybindingsmanager() { shift 2 ;; -h|--help) - show_help - exit 0 + ${FUNCNAME[0]} --help + return 0 ;; *) - echo "Unknown argument: $1" >&2 - show_help - exit 1 + echo "Error: Unknown argument $1. Use --help for usage information." >&2 + return 1 ;; esac done - if [[ -z "$action" ]]; then - echo "No action specified. Use -h for help." >&2 - exit 1 - fi - if [[ -z "$filename" ]]; then - echo "No filename specified. Use -h for help." >&2 - exit 1 + echo "Error: No filename specified. Use --help for usage information." >&2 + return 1 fi if [[ "$action" == "export" ]]; then @@ -128,7 +157,7 @@ keybindingsmanager() { elif [[ "$action" == "import" ]]; then import_keybindings "$filename" else - echo "Unknown action: $action" >&2 - exit 1 + echo "Error: Unknown action $action. Use --help for usage information." >&2 + return 1 fi } diff --git a/etc/config.yaml b/etc/config.yaml index ffaeb09c..646c8d4e 100644 --- a/etc/config.yaml +++ b/etc/config.yaml @@ -80,3 +80,6 @@ command: /home/patrick/github.com/davidsneighbour/dotfiles/bin/cronjobs/update-npm.sh >> /home/patrick/cron.log 2>&1 - cron: 30 */4 * * * command: /home/patrick/github.com/davidsneighbour/dotfiles/bin/cronjobs/filespace-discord.sh >> /home/patrick/cron.log 2>&1 + - cron: 0 18 * * * + command: /bin/bash -c "cd ~/github.com/davidsneighbour/dotfiles && keybindingsmanager -e etc/keycombinations.csv" >> ~/keybindings_export.log 2>&1 + diff --git a/etc/keycombinations.csv b/etc/keycombinations.csv index dd424657..18f9cb42 100644 --- a/etc/keycombinations.csv +++ b/etc/keycombinations.csv @@ -1,4 +1,5 @@ org.gnome.desktop.wm.keybindings activate-window-menu ['space'] +org.gnome.desktop.wm.keybindings always-on-top @as [] org.gnome.desktop.wm.keybindings begin-move ['F7'] org.gnome.desktop.wm.keybindings begin-resize ['F8'] org.gnome.desktop.wm.keybindings close ['F4'] @@ -8,7 +9,12 @@ org.gnome.desktop.wm.keybindings cycle-panels ['Escape'] org.gnome.desktop.wm.keybindings cycle-panels-backward ['Escape'] org.gnome.desktop.wm.keybindings cycle-windows ['Escape'] org.gnome.desktop.wm.keybindings cycle-windows-backward ['Escape'] +org.gnome.desktop.wm.keybindings lower @as [] +org.gnome.desktop.wm.keybindings maximize @as [] +org.gnome.desktop.wm.keybindings maximize-horizontally @as [] +org.gnome.desktop.wm.keybindings maximize-vertically @as [] org.gnome.desktop.wm.keybindings minimize ['KP_0'] +org.gnome.desktop.wm.keybindings move-to-center @as [] org.gnome.desktop.wm.keybindings move-to-corner-ne ['KP_Prior'] org.gnome.desktop.wm.keybindings move-to-corner-nw ['KP_Home'] org.gnome.desktop.wm.keybindings move-to-corner-se ['KP_Next'] @@ -22,6 +28,17 @@ org.gnome.desktop.wm.keybindings move-to-side-n ['KP_Up'] org.gnome.desktop.wm.keybindings move-to-side-s ['KP_Down'] org.gnome.desktop.wm.keybindings move-to-side-w ['KP_Left'] org.gnome.desktop.wm.keybindings move-to-workspace-1 ['Home'] +org.gnome.desktop.wm.keybindings move-to-workspace-10 @as [] +org.gnome.desktop.wm.keybindings move-to-workspace-11 @as [] +org.gnome.desktop.wm.keybindings move-to-workspace-12 @as [] +org.gnome.desktop.wm.keybindings move-to-workspace-2 @as [] +org.gnome.desktop.wm.keybindings move-to-workspace-3 @as [] +org.gnome.desktop.wm.keybindings move-to-workspace-4 @as [] +org.gnome.desktop.wm.keybindings move-to-workspace-5 @as [] +org.gnome.desktop.wm.keybindings move-to-workspace-6 @as [] +org.gnome.desktop.wm.keybindings move-to-workspace-7 @as [] +org.gnome.desktop.wm.keybindings move-to-workspace-8 @as [] +org.gnome.desktop.wm.keybindings move-to-workspace-9 @as [] org.gnome.desktop.wm.keybindings move-to-workspace-down ['Down'] org.gnome.desktop.wm.keybindings move-to-workspace-last ['End'] org.gnome.desktop.wm.keybindings move-to-workspace-left ['Page_Up', 'Left', 'Left'] @@ -29,6 +46,10 @@ org.gnome.desktop.wm.keybindings move-to-workspace-right ['Page_Do org.gnome.desktop.wm.keybindings move-to-workspace-up ['Up'] org.gnome.desktop.wm.keybindings panel-main-menu ['F1'] org.gnome.desktop.wm.keybindings panel-run-dialog ['F2'] +org.gnome.desktop.wm.keybindings raise @as [] +org.gnome.desktop.wm.keybindings raise-or-lower @as [] +org.gnome.desktop.wm.keybindings set-spew-mark @as [] +org.gnome.desktop.wm.keybindings show-desktop @as [] org.gnome.desktop.wm.keybindings switch-applications ['Tab', 'Tab'] org.gnome.desktop.wm.keybindings switch-applications-backward ['Tab', 'Tab'] org.gnome.desktop.wm.keybindings switch-group ['Above_Tab', 'Above_Tab'] @@ -38,19 +59,48 @@ org.gnome.desktop.wm.keybindings switch-input-source-backward ['sp org.gnome.desktop.wm.keybindings switch-panels ['Tab'] org.gnome.desktop.wm.keybindings switch-panels-backward ['Tab'] org.gnome.desktop.wm.keybindings switch-to-workspace-1 ['Home'] +org.gnome.desktop.wm.keybindings switch-to-workspace-10 @as [] +org.gnome.desktop.wm.keybindings switch-to-workspace-11 @as [] +org.gnome.desktop.wm.keybindings switch-to-workspace-12 @as [] +org.gnome.desktop.wm.keybindings switch-to-workspace-2 @as [] +org.gnome.desktop.wm.keybindings switch-to-workspace-3 @as [] +org.gnome.desktop.wm.keybindings switch-to-workspace-4 @as [] +org.gnome.desktop.wm.keybindings switch-to-workspace-5 @as [] +org.gnome.desktop.wm.keybindings switch-to-workspace-6 @as [] +org.gnome.desktop.wm.keybindings switch-to-workspace-7 @as [] +org.gnome.desktop.wm.keybindings switch-to-workspace-8 @as [] +org.gnome.desktop.wm.keybindings switch-to-workspace-9 @as [] org.gnome.desktop.wm.keybindings switch-to-workspace-down ['Down'] org.gnome.desktop.wm.keybindings switch-to-workspace-last ['End'] org.gnome.desktop.wm.keybindings switch-to-workspace-left ['Page_Up', 'Left', 'Left'] org.gnome.desktop.wm.keybindings switch-to-workspace-right ['Page_Down', 'Right', 'Right'] org.gnome.desktop.wm.keybindings switch-to-workspace-up ['Up'] +org.gnome.desktop.wm.keybindings switch-windows @as [] +org.gnome.desktop.wm.keybindings switch-windows-backward @as [] +org.gnome.desktop.wm.keybindings toggle-above @as [] +org.gnome.desktop.wm.keybindings toggle-fullscreen @as [] org.gnome.desktop.wm.keybindings toggle-maximized ['KP_5'] +org.gnome.desktop.wm.keybindings toggle-on-all-workspaces @as [] +org.gnome.desktop.wm.keybindings unmaximize @as [] +org.gnome.settings-daemon.plugins.power ambient-enabled true +org.gnome.settings-daemon.plugins.power idle-brightness 30 +org.gnome.settings-daemon.plugins.power idle-dim true +org.gnome.settings-daemon.plugins.power lid-close-ac-action 'suspend' +org.gnome.settings-daemon.plugins.power lid-close-battery-action 'suspend' +org.gnome.settings-daemon.plugins.power lid-close-suspend-with-external-monitor false +org.gnome.settings-daemon.plugins.power power-button-action 'interactive' +org.gnome.settings-daemon.plugins.power power-saver-profile-on-low-battery true +org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 3600 +org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing' +org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 900 +org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'suspend' org.gnome.settings-daemon.plugins.media-keys battery-status [''] org.gnome.settings-daemon.plugins.media-keys battery-status-static ['XF86Battery'] org.gnome.settings-daemon.plugins.media-keys calculator [''] org.gnome.settings-daemon.plugins.media-keys calculator-static ['XF86Calculator'] org.gnome.settings-daemon.plugins.media-keys control-center [''] org.gnome.settings-daemon.plugins.media-keys control-center-static ['XF86Tools'] -org.gnome.settings-daemon.plugins.media-keys custom-keybindings ['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/'] +org.gnome.settings-daemon.plugins.media-keys custom-keybindings ['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/'] org.gnome.settings-daemon.plugins.media-keys decrease-text-size [''] org.gnome.settings-daemon.plugins.media-keys eject [''] org.gnome.settings-daemon.plugins.media-keys eject-static ['XF86Eject'] @@ -134,6 +184,7 @@ org.gnome.settings-daemon.plugins.media-keys volume-mute [''] org.gnome.settings-daemon.plugins.media-keys volume-mute-quiet [''] org.gnome.settings-daemon.plugins.media-keys volume-mute-quiet-static ['XF86AudioMute'] org.gnome.settings-daemon.plugins.media-keys volume-mute-static ['XF86AudioMute'] +org.gnome.settings-daemon.plugins.media-keys volume-step 6 org.gnome.settings-daemon.plugins.media-keys volume-up [''] org.gnome.settings-daemon.plugins.media-keys volume-up-precise [''] org.gnome.settings-daemon.plugins.media-keys volume-up-precise-static ['XF86AudioRaiseVolume', 'XF86AudioRaiseVolume'] @@ -143,3 +194,4 @@ org.gnome.settings-daemon.plugins.media-keys volume-up-static ['XF86AudioRaiseVo org.gnome.settings-daemon.plugins.media-keys www [''] org.gnome.settings-daemon.plugins.media-keys www-static ['XF86WWW'] custom 'Launcher' 'rofi -show run' 'r' +custom 'Launcher for VSCode' '/home/patrick/github.com/davidsneighbour/dotfiles/filesystem/.config/rofi/workspaces.sh --createworkspace --projectsdirs github.com/davidsneighbour,github.com/theNewDynamic,gitlab.com/wonderland-gmbh' 'w' diff --git a/package.json b/package.json index 65179cc7..b4147534 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@davidsneighbour/dotfiles", "description": "David's Neighbour's .dotfiles", - "version": "2024.6.0", + "version": "2025.1.0", "license": "GPL-3.0-or-later", "repository": "https://github.com/davidsneighbour/dotfiles", "author": "Patrick Kollitsch ",