diff --git a/bin/actions/status.sh b/bin/actions/status.sh index b2f1a1f..828b3f8 100755 --- a/bin/actions/status.sh +++ b/bin/actions/status.sh @@ -4,6 +4,8 @@ source ~/dotfiles/bin/helpers/functions.sh source ~/dotfiles/bin/helpers/apt_packages.sh source ~/dotfiles/bin/helpers/vscode-extensions.sh source ~/dotfiles/bin/helpers/cargo_packages.sh +source ~/dotfiles/bin/helpers/flatpak_packages.sh +source ~/dotfiles/bin/helpers/keyboard_shortcuts.sh # Check if parameter --verbose was passed if [ "$2" = "--verbose" ]; then @@ -12,6 +14,10 @@ else verbose=false fi +echo -e "\n" + +print_keyboard_shortcuts_status print_apt_status print_cargo_status +print_flatpak_status print_vsc_status diff --git a/bin/helpers/keyboard_shortcuts.sh b/bin/helpers/keyboard_shortcuts.sh index 7cbed58..3f6c5e5 100644 --- a/bin/helpers/keyboard_shortcuts.sh +++ b/bin/helpers/keyboard_shortcuts.sh @@ -45,3 +45,26 @@ ensure_keyboard_shortcuts() { gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "${new_bindings_string}" } + +print_keyboard_shortcuts_status() { + printfe "%s" "cyan" "Checking keyboard shortcuts..." + echo -en "\r" + + # Retrieve current custom keybindings + existing_bindings=$(gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings | tr -d "[]'") + existing_count=$(echo $existing_bindings | tr -cd , | wc -c) + + # Iterate over parsed JSON shortcuts + for key_combination in $(echo "$shortcuts" | jq -r 'keys[]'); do + command=$(echo "$shortcuts" | jq -r ".[\"$key_combination\"]") + + if [[ ! $existing_bindings =~ "custom${index}" ]]; then + printfe "%s\n" "red" " - Custom shortcut ${key_combination} is missing" + fi + + ((index++)) + done + + json_count=$(echo $shortcuts | jq 'keys | length') + printfe "%s\n" "cyan" "Keyboard shortcuts $index/$json_count configured" +} \ No newline at end of file