Sync config from arch
- hypr/apps.lua - hypr/autostart.lua - hypr/envs.lua - hypr/hyprland.lua - hypr/hyprsunset.conf - hypr/input.lua - hypr/looknfeel.lua - hypr/omasettings.lua - hypr/xdph.conf - omarchy/branding/about.txt - omarchy/branding/screensaver.txt - omarchy/extensions/omarchy-menu.jsonc - omarchy/hooks/battery-low.d/play-warning-sound.sample - omarchy/hooks/font-set.d/show-font-notification.sample - omarchy/hooks/post-boot.d/weather.sample - omarchy/hooks/post-update.d/install-voxtype.hook - omarchy/hooks/post-update.d/setup-agent.hook - omarchy/hooks/post-update.d/setup-fingerprint.hook - omarchy/hooks/post-update.d/show-update-notification.sample - omarchy/hooks/pre-refresh-pacman.d/add-custom-repo.sample - omarchy/hooks/theme-set.d/show-theme-notification.sample - omarchy/shell.json - omarchy/shell.toml - omarchy/theme.name - omarchy/themes/azure-glow/README.md - omarchy/themes/azure-glow/alacritty.toml - omarchy/themes/azure-glow/btop.theme - omarchy/themes/azure-glow/hyprland.conf - omarchy/themes/azure-glow/hyprlock.conf - omarchy/themes/azure-glow/icons.theme - … 269 more
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
id=${1:?plugin id required}
|
||||
action=${2:-disable}
|
||||
[[ $id =~ ^[A-Za-z0-9][A-Za-z0-9._-]*$ && $id != *..* ]] || exit 2
|
||||
[[ $action == disable || $action == enable ]] || exit 2
|
||||
config=$(omarchy-shell shell listShellConfig)
|
||||
|
||||
if [[ $action == disable ]]; then
|
||||
changes=$(jq -er --arg id "$id" '
|
||||
if type != "object" then error("invalid config") else . end
|
||||
| (.bar.layout // {})
|
||||
| if type != "object" then error("invalid layout") else . end
|
||||
| [to_entries[] | .value
|
||||
| if type != "array" then error("invalid section") else .[] end
|
||||
| select(type == "object")
|
||||
| select((.widgets | type) == "array" and (.widgets | index($id)) != null)
|
||||
| [.id, (.widgets | map(select(. != $id)) | tojson)] | @tsv]
|
||||
| join("\n")
|
||||
' <<< "$config")
|
||||
while IFS=$'\t' read -r host widgets; do
|
||||
[[ -n $host ]] || continue
|
||||
omarchy bar set "$host" widgets "$widgets" --json
|
||||
done <<< "$changes"
|
||||
exec omarchy plugin disable "$id"
|
||||
fi
|
||||
|
||||
exec omarchy plugin "$action" "$id"
|
||||
Reference in New Issue
Block a user