Skip to content

Commit

Permalink
chore(release): v2025.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsneighbour committed Jan 5, 2025
1 parent 6d337b6 commit f6a03e2
Show file tree
Hide file tree
Showing 6 changed files with 158 additions and 47 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -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"
115 changes: 72 additions & 43 deletions bash/_functions/keycombinations.sh
Original file line number Diff line number Diff line change
@@ -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]} <filename>"
echo "Export GNOME keybindings to the specified file."
echo
echo "Arguments:"
echo " <filename> The file where keybindings will be saved."
echo
echo "Notice:"
echo " It is recommended to use the keybindingsmanager script instead:"
echo " ./$(basename "$0") --export <filename>"
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=(
Expand All @@ -13,78 +36,90 @@ 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"

echo "Keybindings exported successfully."
}

import_keybindings() {
if [[ "$1" == "--help" ]]; then
echo "Usage: ${FUNCNAME[0]} <filename>"
echo "Import GNOME keybindings from the specified file."
echo
echo "Arguments:"
echo " <filename> The file containing keybindings to import."
echo
echo "Notice:"
echo " It is recommended to use the keybindingsmanager script instead:"
echo " ./$(basename "$0") --import <filename>"
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"
dconf write "${folder}binding" "$binding_or_value"
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 <filename> Export keybindings to a file"
echo " -i, --import <filename> 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 <filename> Export keybindings to the specified file"
echo " -i, --import <filename> 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=""
Expand All @@ -102,33 +137,27 @@ 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
export_keybindings "$filename"
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
}
3 changes: 3 additions & 0 deletions etc/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

54 changes: 53 additions & 1 deletion etc/keycombinations.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
org.gnome.desktop.wm.keybindings activate-window-menu ['<Alt>space']
org.gnome.desktop.wm.keybindings always-on-top @as []
org.gnome.desktop.wm.keybindings begin-move ['<Alt>F7']
org.gnome.desktop.wm.keybindings begin-resize ['<Alt>F8']
org.gnome.desktop.wm.keybindings close ['<Alt>F4']
Expand All @@ -8,7 +9,12 @@ org.gnome.desktop.wm.keybindings cycle-panels ['<Control><Alt>Escape']
org.gnome.desktop.wm.keybindings cycle-panels-backward ['<Shift><Control><Alt>Escape']
org.gnome.desktop.wm.keybindings cycle-windows ['<Alt>Escape']
org.gnome.desktop.wm.keybindings cycle-windows-backward ['<Shift><Alt>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 ['<Primary><Alt>KP_0']
org.gnome.desktop.wm.keybindings move-to-center @as []
org.gnome.desktop.wm.keybindings move-to-corner-ne ['<Primary><Alt>KP_Prior']
org.gnome.desktop.wm.keybindings move-to-corner-nw ['<Primary><Alt>KP_Home']
org.gnome.desktop.wm.keybindings move-to-corner-se ['<Primary><Alt>KP_Next']
Expand All @@ -22,13 +28,28 @@ org.gnome.desktop.wm.keybindings move-to-side-n ['<Primary><Alt>KP_Up']
org.gnome.desktop.wm.keybindings move-to-side-s ['<Primary><Alt>KP_Down']
org.gnome.desktop.wm.keybindings move-to-side-w ['<Primary><Alt>KP_Left']
org.gnome.desktop.wm.keybindings move-to-workspace-1 ['<Super><Shift>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 ['<Control><Shift><Alt>Down']
org.gnome.desktop.wm.keybindings move-to-workspace-last ['<Super><Shift>End']
org.gnome.desktop.wm.keybindings move-to-workspace-left ['<Super><Shift>Page_Up', '<Super><Shift><Alt>Left', '<Control><Shift><Alt>Left']
org.gnome.desktop.wm.keybindings move-to-workspace-right ['<Super><Shift>Page_Down', '<Super><Shift><Alt>Right', '<Control><Shift><Alt>Right']
org.gnome.desktop.wm.keybindings move-to-workspace-up ['<Control><Shift><Alt>Up']
org.gnome.desktop.wm.keybindings panel-main-menu ['<Alt>F1']
org.gnome.desktop.wm.keybindings panel-run-dialog ['<Alt>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 ['<Super>Tab', '<Alt>Tab']
org.gnome.desktop.wm.keybindings switch-applications-backward ['<Shift><Super>Tab', '<Shift><Alt>Tab']
org.gnome.desktop.wm.keybindings switch-group ['<Super>Above_Tab', '<Alt>Above_Tab']
Expand All @@ -38,19 +59,48 @@ org.gnome.desktop.wm.keybindings switch-input-source-backward ['<Shift><Super>sp
org.gnome.desktop.wm.keybindings switch-panels ['<Control><Alt>Tab']
org.gnome.desktop.wm.keybindings switch-panels-backward ['<Shift><Control><Alt>Tab']
org.gnome.desktop.wm.keybindings switch-to-workspace-1 ['<Super>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 ['<Control><Alt>Down']
org.gnome.desktop.wm.keybindings switch-to-workspace-last ['<Super>End']
org.gnome.desktop.wm.keybindings switch-to-workspace-left ['<Super>Page_Up', '<Super><Alt>Left', '<Control><Alt>Left']
org.gnome.desktop.wm.keybindings switch-to-workspace-right ['<Super>Page_Down', '<Super><Alt>Right', '<Control><Alt>Right']
org.gnome.desktop.wm.keybindings switch-to-workspace-up ['<Control><Alt>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 ['<Primary><Alt>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']
Expand Down Expand Up @@ -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 ['<Alt>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 ['<Shift>XF86AudioRaiseVolume', '<Ctrl><Shift>XF86AudioRaiseVolume']
Expand All @@ -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' '<Super>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' '<Super>w'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <patrick@davids-neighbour.com>",
Expand Down

0 comments on commit f6a03e2

Please sign in to comment.