Merge branch 'end-4:main' into keybinds-settings

This commit is contained in:
Madjid Taha
2025-11-01 04:19:18 +01:00
committed by GitHub
13 changed files with 270 additions and 212 deletions
View File
+2 -2
View File
@@ -18,11 +18,11 @@ input_path = '~/.config/matugen/templates/fuzzel/fuzzel_theme.ini'
output_path = '~/.config/fuzzel/fuzzel_theme.ini'
[templates.gtk3]
input_path = '~/.config/matugen/templates/gtk/gtk-colors.css'
input_path = '~/.config/matugen/templates/gtk-3.0/gtk.css'
output_path = '~/.config/gtk-3.0/gtk.css'
[templates.gtk4]
input_path = '~/.config/matugen/templates/gtk/gtk-colors.css'
input_path = '~/.config/matugen/templates/gtk-4.0/gtk.css'
output_path = '~/.config/gtk-4.0/gtk.css'
[templates.kde_colors]
@@ -0,0 +1,44 @@
/*
* GTK Colors
* Generated with Matugen
*/
@media (prefers-color-scheme: light) {
@define-color accent_color {{colors.primary.light.hex}};
@define-color accent_fg_color {{colors.on_primary.light.hex}};
@define-color accent_bg_color {{colors.primary.light.hex}};
@define-color window_bg_color {{colors.background.light.hex}};
@define-color window_fg_color {{colors.on_background.light.hex}};
@define-color headerbar_bg_color {{colors.surface_dim.light.hex}};
@define-color headerbar_fg_color {{colors.on_surface.light.hex}};
@define-color popover_bg_color {{colors.surface_dim.light.hex}};
@define-color popover_fg_color {{colors.on_surface.light.hex}};
@define-color view_bg_color {{colors.surface.light.hex}};
@define-color view_fg_color {{colors.on_surface.light.hex}};
@define-color card_bg_color {{colors.surface.light.hex}};
@define-color card_fg_color {{colors.on_surface.light.hex}};
@define-color sidebar_bg_color @window_bg_color;
@define-color sidebar_fg_color @window_fg_color;
@define-color sidebar_border_color @window_bg_color;
@define-color sidebar_backdrop_color @window_bg_color;
}
@media (prefers-color-scheme: dark) {
@define-color accent_color {{colors.primary.dark.hex}};
@define-color accent_fg_color {{colors.on_primary.dark.hex}};
@define-color accent_bg_color {{colors.primary.dark.hex}};
@define-color window_bg_color {{colors.background.dark.hex}};
@define-color window_fg_color {{colors.on_background.dark.hex}};
@define-color headerbar_bg_color {{colors.surface_dim.dark.hex}};
@define-color headerbar_fg_color {{colors.on_surface.dark.hex}};
@define-color popover_bg_color {{colors.surface_dim.dark.hex}};
@define-color popover_fg_color {{colors.on_surface.dark.hex}};
@define-color view_bg_color {{colors.surface.dark.hex}};
@define-color view_fg_color {{colors.on_surface.dark.hex}};
@define-color card_bg_color {{colors.surface.dark.hex}};
@define-color card_fg_color {{colors.on_surface.dark.hex}};
@define-color sidebar_bg_color @window_bg_color;
@define-color sidebar_fg_color @window_fg_color;
@define-color sidebar_border_color @window_bg_color;
@define-color sidebar_backdrop_color @window_bg_color;
}
+2
View File
@@ -53,6 +53,8 @@
##### Not work, to be solved #####
# swaylock pamtester
# TODO: migrate all packages from dist-arch. Note that for each package, must know why it's needed and how it's used specifically, cuz things may be need tweak to properly use the package installed by Nix, especially those have hardcoded path /usr/* .
### illogical-impulse-audio
libcava #cava
lxqt.pavucontrol-qt #pavucontrol-qt
+3 -18
View File
@@ -292,24 +292,9 @@ function check_disk_space() {
return 0
}
function auto_get_git_submodule(){
local git_submodules_list=()
while IFS= read -r path; do
[ -z "$path" ] && continue
git_submodules_list+=("$path")
done < <(git submodule status --recursive 2>/dev/null | awk '{print $2}')
local missing=0
for p in "${git_submodules_list[@]}"; do
if [ ! -d "$p" ] || [ -z "$(ls -A "$p" 2>/dev/null)" ]; then
missing=1
break
fi
done
if [ "$missing" -eq 1 ]; then
function auto_update_git_submodule(){
if git submodule status --recursive | grep -E '^[+-U]';then
# Note: `git pull --recurse-submodules` cannot substitute `git submodule update --init --recursive` cuz it does not init a submodule when needed.
x git submodule update --init --recursive
fi
}
+5 -9
View File
@@ -9,15 +9,11 @@
pkglistfile=$(mktemp)
pkglistfile_orig=${LIST_FILE_PATH}
pkglistfile_orig_s=${REPO_ROOT}/cache/dependencies_stripped.conf
#if ! "$(command -v curl)";then
# echo "Please install curl first.";exit 1
#fi
#if ! "$(command -v gzip)";then
# echo "Please install gzip first.";exit 1
#fi
#if ! "$(command -v pacman)";then
# echo "pacman not found, aborting...";exit 1
#fi
for cmd in curl gzip pacman;do
if ! command -v $cmd;then
echo "Please install $cmd first.";exit 1
fi
done
remove_bashcomments_emptylines $pkglistfile_orig $pkglistfile_orig_s
cat $pkglistfile_orig_s | sed "s_\ _\n_g" > $pkglistfile
+12 -7
View File
@@ -4,7 +4,7 @@ printf "${STY_CYAN}[$0]: 1. Install dependencies\n${STY_RST}"
function outdate_detect(){
# Shallow clone prevent latest_commit_timestamp() from working.
x git_auto_unshallow
x git_auto_unshallow 2>&1>/dev/null
local source_path="$1"
local target_path="$2"
@@ -119,12 +119,17 @@ elif [[ -f "./sdata/dist-${OS_DISTRO_ID}/install-deps.sh" ]]; then
if [[ "${tmp_update_status}" =~ ^(OUTDATED|EMPTY_TARGET|EMPTY_SOURCE|FORCE_OUTDATED|WIP)$ ]]; then
printf "${STY_RED}${STY_BOLD}===URGENT===${STY_RST}\n"
printf "${STY_RED}"
printf "The community provided ./sdata/dist-${TARGET_ID}/ is not updated (update status: ${tmp_update_status}),\n"
printf "which means it does not fully reflect the latest changes of ./sdata/dist-arch/ .\n"
printf "You are highly recommended to abort this script, until someone (maybe you?) has updated the ./sdata/dist-${TARGET_ID}/ to fully reflect the latest changes in ./sdata/dist-arch/ .\n"
printf "PR is welcomed. Please see discussion#2140 for details.\n"
printf "The community provided ./sdata/dist-${TARGET_ID}/ is outdated (status: ${tmp_update_status}),\n"
printf "which means it probably does not reflect all latest changes of ./sdata/dist-arch/ .\n"
printf "\n"
printf "According to the actual changes, it may still works, but it can also work unexpectedly.\n"
printf "It's highly recommended to check the following links before continue:${STY_RST}\n"
printf "${STY_UNDERLINE}https://github.com/end-4/dots-hyprland/discussions/2140${STY_RST}\n"
printf "${STY_RED}${STY_INVERT}If you are proceeding anyway, illogical-impulse will very likely not work as expected.${STY_RST}\n"
printf "${STY_UNDERLINE}https://github.com/end-4/dots-hyprland/commits/main/sdata/dist-arch${STY_RST}\n"
printf "${STY_UNDERLINE}https://github.com/end-4/dots-hyprland/commits/main/sdata/dist-${TARGET_ID}${STY_RST}\n"
printf "\n"
printf "${STY_PURPLE}${STY_INVERT}PR on ./sdata/dist-${TARGET_ID}/ to properly reflect the latest changes of ./sdata/dist-arch is welcomed.${STY_RST}\n"
printf "\n"
if [ "$ask" = "false" ]; then
echo "Urgent problem encountered, aborting...";exit 1
fi
@@ -163,7 +168,7 @@ else
printf "./sdata/dist-${OS_DISTRO_ID}/install-deps.sh not found.\n"
printf "./sdata/dist-${TARGET_ID}/install-deps.sh will be used.\n"
printf "1. It may disrupt your system and will likely fail without your manual intervention.\n"
printf "2. It's WIP and only contains small number of dependencies far from enough.\n"
printf "2. It is WIP and only contains small number of dependencies far from enough.\n"
printf "Proceed only at your own risk.\n"
printf "${STY_RST}"
pause
+21 -7
View File
@@ -1,10 +1,26 @@
# This script is meant to be sourced.
# It's not for directly running.
# TODO: https://github.com/end-4/dots-hyprland/issues/2137
# See https://github.com/end-4/dots-hyprland/issues/2137
#
# Stage 1 todos:
# TODO: Properly handle hyprland config, ~/.config/hypr/hyprland.conf should be overwritten only when firstrun
# TODO: add --exp-files-path <path> Use <path> instead of the default yaml config
# TODO: add --exp-files-regen Force copy the default config to ${EXP_FILE_PATH} (auto do this when not existed)
# TODO: Implement versioning, i.e. when user-defined yaml config file has version number mismatch with the default one, produce error. If only minor version number is not the same, the error can be ommitted via --exp-file-no-strict .
# TODO: add --exp-files-no-strict Ignore error when minor version number is not the same
#
# Stage 2 todos:
# TODO: Implement bool key symlink (both read-write and read-only), when the value of `symlink` is true, then instead using `rsync` or `cp`, use `ln`.
# TODO: add --exp-file-reset-symlink Try to remove all symlink in .config and .local, which point to the local repo
# TODO: Update help and doc about `--exp-files` and the yaml config, including the possible values of mode.
#
# Stage 3 todos:
# TODO: Implement user-define yaml with merging (override) ability for user who only wants little customization and is satisfied with most of the defaults. User can use `./install-files.yaml` as custom config. When `./install-files.yaml` exists and have correct major version number, merge it together with `sdata/step/3.install-files.yaml` to generate a `cache/install-files.final.yaml` to determine how to copy files. About how to merge two yaml files, I know some software such as rime input method and docker supports a override yaml config, which we may reference from. See also https://github.com/mikefarah/yq/discussions/1437
# TODO: Implement variants like keybindings, terminals, etc under user_preferences.
# Configuration file
CONFIG_FILE="sdata/subcmd-install/3.files.yaml"
CONFIG_FILE="sdata/subcmd-install/3.files-exp.yaml"
# =============================================================================
wizard_update_preferences() {
@@ -66,7 +82,7 @@ wizard_update_preferences() {
echo
echo "Preferences updated!"
}
}
# Get user preference
get_pref() {
@@ -89,7 +105,7 @@ should_process_pattern() {
[[ "$(get_pref "$type")" == "$value" ]]
}
}
# Compare hashes of files/directories, return true if they are the same, false otherwise
files_are_same() {
@@ -117,7 +133,7 @@ files_are_same() {
# One is a file, one is a directory - different types
return 1
fi
}
}
# Find next backup number
get_next_backup_number() {
@@ -259,5 +275,3 @@ for pattern in "${patterns[@]}"; do
;;
esac
done
#####################################################################################
@@ -1,3 +1,11 @@
# The possible values of `mode`: (by default `sync`)
# - `sync`: Make the destination completely the same as the source.
# - `soft`: Skip existing files when copying
# - `hard`: Overwrite existing files when copying
# - `soft-backup`: If target file exists, copy source file to `*.new`. Do not create `*.new` but skip coyping when source and target HASH values are exactly the same.
# - `hard-backup`: If target file exists, create backup by renaming it to `*.old.<n>` where `<n>` is a number increment from 1 to prevent backup gets overwritten when running twice. (Keep in mind that this script must be idempotent.) Also must compare the actual file content by using MD5 HASH value to prevent generating lots of `*.old.<n>`s when runnng multiple times. Do not create backup but skip coyping when source and target HASH values are exactly the same.
# - `skip`: Skip this step
# - `skip-if-exists`: Skip this step if target exists
version: "1.0"
user_preferences:
shell: "fish" # fish | zsh
+4 -4
View File
@@ -22,7 +22,7 @@ function auto_backup_configs(){
false) if [[ ! -d "$BACKUP_DIR" ]]; then local backup=true;fi;;
*)
printf "${STY_RED}"
printf "Would you like to backup clashing dirs/files to \"$BACKUP_DIR\"?"
printf "Would you like to backup clashing dirs/files to \"$BACKUP_DIR\"?\n"
printf "${STY_RST}"
while true;do
echo " y = Yes, backup"
@@ -33,7 +33,7 @@ function auto_backup_configs(){
local backup=true;break ;;
[nNsS]) echo -e "${STY_BLUE}Alright, skipping...${STY_RST}"
local backup=false;break ;;
*) echo -e "${STY_RED}Please enter [y/n].${STY_RST}";;
*) echo -e "${STY_RED}Please enter [y/n/s].${STY_RST}";;
esac
done
;;
@@ -46,8 +46,8 @@ function auto_backup_configs(){
}
#####################################################################################
showfun auto_get_git_submodule
v auto_get_git_submodule
showfun auto_update_git_submodule
v auto_update_git_submodule
# Backup
if [[ ! "${SKIP_BACKUP}" == true ]]; then auto_backup_configs; fi
+2 -1
View File
@@ -28,7 +28,8 @@ Options for install:
${STY_CYAN}
New features (experimental):
--exp-files Use yaml-based config for the third step copying files.
This feature is ${STY_YELLOW}still on early stage${STY_CYAN}, feedback and contribution welcomed,
This feature is ${STY_YELLOW}still on early stage${STY_CYAN},
feedback and contribution welcomed,
see https://github.com/end-4/dots-hyprland/issues/2137 for details.
--via-nix Use Nix and Home-manager to install dependencies.
This feature is ${STY_RED}working in progress${STY_CYAN}. Contribution is welcomed,
+3
View File
@@ -23,6 +23,7 @@ Syntax:
Subcommands:
install (Re)Install/Update illogical-impulse.
Note: To update to the latest, manually run \"git pull\" first.
install-deps Run the install step \"1. Install dependencies\"
install-setups Run the install step \"2. Setup for permissions/services etc\"
install-files Run the install step \"3. Copying config files\"
@@ -36,6 +37,8 @@ Subcommands:
For each <subcommand>, use -h for details:
$0 <subcommand> -h
${STY_BOLD}${STY_CYAN}Access ${STY_UNDERLINE}https://ii.clsty.link${STY_RST} ${STY_BOLD}${STY_CYAN}for documentation about illogical-impulse.${STY_RST}
"
}
case $1 in