feat: add custom alacritty package and update desktop entry configuration

This commit is contained in:
2025-11-05 21:05:43 +00:00
parent b1f071d92b
commit abb8b2c9dd
6 changed files with 75 additions and 5 deletions

2
.gitignore vendored
View File

@@ -11,3 +11,5 @@ result-*
# Hardware configuration (may contain sensitive info) # Hardware configuration (may contain sensitive info)
# Uncomment if you don't want to commit hardware configs # Uncomment if you don't want to commit hardware configs
# hosts/*/hardware-configuration.nix # hosts/*/hardware-configuration.nix
node_modules

View File

@@ -2,7 +2,7 @@ import { Astal, Gtk } from "ags/gtk4";
import { Tray } from "./widgets/Tray"; import { Tray } from "./widgets/Tray";
import { Workspaces } from "./widgets/Workspaces"; import { Workspaces } from "./widgets/Workspaces";
import { FocusedClient } from "./widgets/FocusedClient"; import { FocusedClient } from "./widgets/FocusedClient";
import { Apps } from "./widgets/Apps"; // import { Apps } from "./widgets/Apps";
import { Clock } from "./widgets/Clock"; import { Clock } from "./widgets/Clock";
import { Status } from "./widgets/Status"; import { Status } from "./widgets/Status";
import { Media } from "./widgets/Media"; import { Media } from "./widgets/Media";
@@ -21,7 +21,6 @@ export const Bar = (mon: number) => {
halign={Gtk.Align.START} spacing={widgetSpacing} halign={Gtk.Align.START} spacing={widgetSpacing}
$type="start"> $type="start">
<Apps />
<Workspaces /> <Workspaces />
<FocusedClient /> <FocusedClient />
</Gtk.Box> </Gtk.Box>

View File

@@ -31,7 +31,29 @@
# chromium # chromium
# Terminal emulators # Terminal emulators
alacritty (pkgs.runCommand "alacritty-no-desktop" {
buildInputs = [ pkgs.alacritty ];
} ''
mkdir -p $out/bin
ln -s ${pkgs.alacritty}/bin/* $out/bin/
# Copy all other directories except share/applications
for dir in ${pkgs.alacritty}/*; do
if [[ "$dir" != "${pkgs.alacritty}/bin" && "$dir" != "${pkgs.alacritty}/share" ]]; then
ln -s "$dir" $out/$(basename "$dir")
fi
done
# Copy share but exclude applications
if [ -d ${pkgs.alacritty}/share ]; then
mkdir -p $out/share
for item in ${pkgs.alacritty}/share/*; do
if [[ "$(basename $item)" != "applications" ]]; then
ln -s "$item" $out/share/$(basename "$item")
fi
done
fi
'')
# kitty # kitty
# wezterm # wezterm
@@ -135,7 +157,7 @@
# Alacritty terminal emulator # Alacritty terminal emulator
programs.alacritty = { programs.alacritty = {
enable = true; enable = false; # Disabled to avoid duplicate desktop file, using custom package in home.packages instead
settings = { settings = {
window = { window = {
opacity = 0.9; opacity = 0.9;
@@ -206,8 +228,18 @@
x11.enable = true; x11.enable = true;
}; };
# Override desktop entries to use Wayland flags for Electron apps # Override desktop entries
xdg.desktopEntries = { xdg.desktopEntries = {
# Add "cmd" to alacritty's comment so it shows up when searching "cmd"
alacritty = {
name = "Alacritty";
genericName = "Terminal cmd";
comment = "A fast, cross-platform, OpenGL terminal emulator";
exec = "alacritty";
icon = "Alacritty";
type = "Application";
categories = [ "System" "TerminalEmulator" ];
};
legcord = { legcord = {
name = "Discord"; name = "Discord";
exec = "${pkgs.legcord}/bin/legcord --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland %U"; exec = "${pkgs.legcord}/bin/legcord --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland %U";

29
package-lock.json generated Normal file
View File

@@ -0,0 +1,29 @@
{
"name": "nix-flake",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"devDependencies": {
"@types/node": "^24.10.0"
}
},
"node_modules/@types/node": {
"version": "24.10.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.0.tgz",
"integrity": "sha512-qzQZRBqkFsYyaSWXuEHc2WR9c0a0CXwiE5FWUvn7ZM+vdy1uZLfCunD38UzhuB7YN/J11ndbDBcTmOdxJo9Q7A==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~7.16.0"
}
},
"node_modules/undici-types": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
"integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
"dev": true,
"license": "MIT"
}
}
}

5
package.json Normal file
View File

@@ -0,0 +1,5 @@
{
"devDependencies": {
"@types/node": "^24.10.0"
}
}

View File

@@ -28,6 +28,9 @@
# Enable X11 for XWayland support # Enable X11 for XWayland support
services.xserver.enable = true; services.xserver.enable = true;
# Exclude xterm (we use alacritty instead)
services.xserver.excludePackages = [ pkgs.xterm ];
# Display manager - SDDM with Wayland support # Display manager - SDDM with Wayland support
services.displayManager.sddm = { services.displayManager.sddm = {
enable = true; enable = true;