Skip to content

Commit

Permalink
Merge pull request #77 from akshayr-mecha/chore-alacritty-permissions
Browse files Browse the repository at this point in the history
fix(alacritty): fix alacritty theme directory permissions
  • Loading branch information
akshayr-mecha authored Jan 4, 2025
2 parents c7e504e + fcd0b49 commit d7ee5a1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 23 deletions.
2 changes: 2 additions & 0 deletions debian/distro/build-debian.nu
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ def main [machine: string, build_dir: string] {

set_config_dir_ownership

set_alacritty_config_dir_ownership

unmount_sys_proc_volumes

pack_root_fs
Expand Down
23 changes: 0 additions & 23 deletions debian/distro/modules/alacritty-config.nu
Original file line number Diff line number Diff line change
Expand Up @@ -99,29 +99,6 @@ Exec=alacritty
SUDO chmod 644 $desktop_file_path
log_debug "Desktop entry created successfully."

let themes_dir = $"/home/mecha/.alacritty-theme"
try {
SUDO chown -R mecha:mecha $themes_dir
log_info "Ownership set successfully."
} catch {
|error| log_error $"Failed to set ownership : ($error)"
}

# set permissions to 700
try {
SUDO chmod 700 $themes_dir
log_info "Permissions set successfully."
} catch {
|error| log_error $"Failed to set permissions : ($error)"
}

# migrate alacritty
try {
alacritty migrate
log_info "Alacritty migrated."
} catch {
|error| log_error $"Failed to migrate : ($error)"
}

log_debug "Alacritty configuration completed successfully."
}
27 changes: 27 additions & 0 deletions debian/distro/modules/system-config.nu
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,33 @@ export def set_config_dir_ownership [] {
}
}

export def set_alacritty_config_dir_ownership [] {
let themes_dir = $"/home/mecha/.alacritty-theme"
log_debug $"Setting ownership of ($themes_dir) to mecha:mecha"
try {
SUDO chown -R mecha:mecha $themes_dir
log_info "Ownership set successfully."
} catch {
|error| log_error $"Failed to set ownership : ($error)"
}

# set permissions to 700
try {
SUDO chmod 700 $themes_dir
log_info "Permissions set successfully."
} catch {
|error| log_error $"Failed to set permissions : ($error)"
}

# migrate alacritty
try {
alacritty migrate
log_info "Permissions set successfully."
} catch {
|error| log_error $"Failed to set permissions : ($error)"
}
}

export def configure_mecha_system_pref [] {
log_info "Configuring system settings:"
let rootfs_dir = $env.ROOTFS_DIR
Expand Down

0 comments on commit d7ee5a1

Please sign in to comment.