feat: update files

This commit is contained in:
2023-12-30 20:16:14 +01:00
parent 4e301a71c7
commit d2f9104fe4
11 changed files with 7813 additions and 121 deletions

6
flake.lock generated
View File

@@ -188,11 +188,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1702312524, "lastModified": 1703438236,
"narHash": "sha256-gkZJRDBUCpTPBvQk25G0B7vfbpEYM5s5OZqghkjZsnE=", "narHash": "sha256-aqVBq1u09yFhL7bj1/xyUeJjzr92fXVvQSSEx6AdB1M=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a9bf124c46ef298113270b1f84a164865987a91c", "rev": "5f64a12a728902226210bf01d25ec6cbb9d9265b",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -35,7 +35,9 @@
experimental-features = "nix-command flakes"; experimental-features = "nix-command flakes";
}; };
overlays = [ overlays = [
(final: prev: {anyrunPlugins = anyrun.packages.${prev.system};}) (final: prev: {
anyrunPlugins = anyrun.packages.${prev.system};
})
]; ];
}); });

View File

@@ -1,15 +1,20 @@
// Import // Import
import { App, Utils } from './imports.js'; import { App, Utils } from "./imports.js";
// Windows // Windows
import Bar from './windows/bar.js'; import Bar from "./windows/bar.js";
import Cheatsheet from './windows/cheatsheet.js'; import Cheatsheet from "./windows/cheatsheet.js";
import { CornerTopleft, CornerTopright, CornerBottomleft, CornerBottomright } from './windows/corners.js'; import {
import Indicator from './windows/osd.js'; CornerTopleft,
import Osk from './windows/osk.js'; CornerTopright,
import Overview from './windows/overview.js'; CornerBottomleft,
import Session from './windows/session.js'; CornerBottomright,
import SideLeft from './windows/sideleft.js'; } from "./windows/corners.js";
import SideRight from './windows/sideright.js'; import Indicator from "./windows/osd.js";
import Osk from "./windows/osk.js";
import Overview from "./windows/overview.js";
import Session from "./windows/session.js";
import SideLeft from "./windows/sideleft.js";
import SideRight from "./windows/sideright.js";
const CLOSE_ANIM_TIME = 150; const CLOSE_ANIM_TIME = 150;
@@ -22,32 +27,32 @@ App.applyCss(`${App.configDir}/style.css`);
// Config object // Config object
export default { export default {
style: `${App.configDir}/style.css`, style: `${App.configDir}/style.css`,
stackTraceOnError: true, stackTraceOnError: true,
closeWindowDelay: { closeWindowDelay: {
// For animations // For animations
'sideright': CLOSE_ANIM_TIME, sideright: CLOSE_ANIM_TIME,
'sideleft': CLOSE_ANIM_TIME, sideleft: CLOSE_ANIM_TIME,
'osk': CLOSE_ANIM_TIME, osk: CLOSE_ANIM_TIME,
// No anims, but allow menu service update // No anims, but allow menu service update
'session': 1, session: 1,
'overview': 1, overview: 1,
'cheatsheet': 1, cheatsheet: 1,
}, },
windows: [ windows: [
Bar(), //Bar(),
...Array.from({length: 3}, (_, i) => [ ...Array.from({ length: 3 }, (_, i) => [
CornerTopleft(i), CornerTopleft(i),
CornerTopright(i), CornerTopright(i),
CornerBottomleft(i), CornerBottomleft(i),
CornerBottomright(i), CornerBottomright(i),
]), ]),
Overview(), //Overview(),
Indicator(), Indicator(),
Cheatsheet(), //Cheatsheet(),
SideRight(), SideRight(),
SideLeft(), SideLeft(),
Osk(), // On-screen keyboard //Osk(), // On-screen keyboard
Session(), //Session(),
], ],
}; };

View File

@@ -1,40 +1,43 @@
import { Widget } from '../imports.js'; import { Widget } from "../imports.js";
import { RoundedCorner } from "../modules/lib/roundedcorner.js"; import { RoundedCorner } from "../modules/lib/roundedcorner.js";
export const CornerTopleft = monitor => Widget.Window({ export const CornerTopleft = (monitor) =>
name: 'cornertl', Widget.Window({
layer: 'top', name: "cornertl",
layer: "top",
monitor, monitor,
anchor: ['top', 'left'], anchor: ["top", "left"],
exclusive: false, exclusive: false,
visible: true, visible: true,
child: RoundedCorner('topleft', { className: monitor === 1 ? 'corner' : 'corner-black', }), child: RoundedCorner("topleft", { className: "corner-black" }),
}); });
export const CornerTopright = monitor => Widget.Window({ export const CornerTopright = (monitor) =>
name: 'cornertr', Widget.Window({
layer: 'top', name: "cornertr",
layer: "top",
monitor, monitor,
anchor: ['top', 'right'], anchor: ["top", "right"],
exclusive: false, exclusive: false,
visible: true, visible: true,
child: RoundedCorner('topright', { className: monitor === 1 ? 'corner' : 'corner-black', }), child: RoundedCorner("topright", { className: "corner-black" }),
}); });
export const CornerBottomleft = monitor => Widget.Window({ export const CornerBottomleft = (monitor) =>
name: 'cornerbl', Widget.Window({
layer: 'top', name: "cornerbl",
layer: "top",
monitor, monitor,
anchor: ['bottom', 'left'], anchor: ["bottom", "left"],
exclusive: false, exclusive: false,
visible: true, visible: true,
child: RoundedCorner('bottomleft', { className: 'corner-black', }), child: RoundedCorner("bottomleft", { className: "corner-black" }),
}); });
export const CornerBottomright = monitor => Widget.Window({ export const CornerBottomright = (monitor) =>
name: 'cornerbr', Widget.Window({
layer: 'top', name: "cornerbr",
layer: "top",
monitor, monitor,
anchor: ['bottom', 'right'], anchor: ["bottom", "right"],
exclusive: false, exclusive: false,
visible: true, visible: true,
child: RoundedCorner('bottomright', { className: 'corner-black', }), child: RoundedCorner("bottomright", { className: "corner-black" }),
}); });

View File

@@ -9,7 +9,6 @@
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
enableNvidiaPatches = true;
settings = { settings = {
env = [ env = [
"LIBVA_DRIVER_NAME,nvidia" "LIBVA_DRIVER_NAME,nvidia"
@@ -29,16 +28,16 @@
]; ];
exec-once = [ exec-once = [
"swww init" "swww init"
"swww img ~/.local/state/wallpaper.jpg"
"ags" "ags"
"waybar"
"systemctl --user import-environment DISPLAY WAYLAND_DISPLAY XAUTHORITY" "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY XAUTHORITY"
"dbus-update-activation-environment DISPLAY WAYLAND_DISPLAY XAUTHORITY" "dbus-update-activation-environment DISPLAY WAYLAND_DISPLAY XAUTHORITY"
"gnome-keyring-daemon --start --components=secrets" "gnome-keyring-daemon --start --components=secrets"
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1" "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
]; ];
general = { general = {
gaps_in = 4; gaps_in = 16;
gaps_out = 5; gaps_out = 16;
border_size = 1; border_size = 1;
"col.active_border" = "rgba(0DB7D4FF)"; "col.active_border" = "rgba(0DB7D4FF)";
@@ -61,22 +60,13 @@
]; ];
monitor = import ./monitors.nix; monitor = import ./monitors.nix;
workspace = [ workspace = [
"1,monitor:DP-1" "100,monitor:DP-1,default:true"
"2,monitor:DP-1" "200,monitor:HDMI-A-1,default:true"
"3,monitor:DP-1" "300,monitor:DP-3:default:true"
"4,monitor:HDMI-A-1"
"5,monitor:HDMI-A-1"
"6,monitor:HDMI-A-1"
"7,monitor:DP-3"
"8,monitor:DP-3"
"9,monitor:DP-3"
"special:calc,border:false,gapsout:200,on-created-empty:[noanim;silent] kitty -e qalc" "special:calc,border:false,gapsout:200,on-created-empty:[noanim;silent] kitty -e qalc"
]; ];
windowrule = [ windowrule = [
"pseudo,^(discord)$"
"pseudo,^(Slack)$"
"pseudo,^(steam)$" "pseudo,^(steam)$"
"monitor DP-3,^(discord)$"
]; ];
windowrulev2 = [ windowrulev2 = [
# Games # Games
@@ -135,7 +125,7 @@
"fade,1,1,default" "fade,1,1,default"
]; ];
decoration = { decoration = {
rounding = 20; rounding = 8;
blur = { blur = {
enabled = true; enabled = true;
xray = false; xray = false;
@@ -159,11 +149,20 @@
programs.kitty = import ./kitty.nix {inherit pkgs;}; programs.kitty = import ./kitty.nix {inherit pkgs;};
programs.anyrun = import ./anyrun.nix {inherit pkgs;}; programs.anyrun = import ./anyrun.nix {inherit pkgs;};
programs.waybar = import ./waybar.nix {inherit pkgs;}; programs.waybar = import ./waybar.nix {inherit pkgs;};
programs.foot.enable = true;
services.udiskie.enable = true; services.udiskie.enable = true;
services.udiskie.tray = "never"; services.udiskie.tray = "never";
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
home.packages = with pkgs; [ home.packages = with pkgs; [
(callPackage ../../../overlays/wezterm {
Cocoa = pkgs.Cocoa;
CoreGraphics = pkgs.CoreGraphics;
Foundation = pkgs.Foundation;
System = pkgs.System;
UserNotifications = pkgs.UserNotifications;
})
libsForQt5.konsole
# fonts # fonts
noto-fonts noto-fonts
# essentials # essentials
@@ -228,6 +227,17 @@
platformTheme = "gtk"; platformTheme = "gtk";
}; };
programs.fish.loginShellInit =
/*
fish
*/
''
Hyprland && echo "goodbye" && exit 0 \
|| echo "$status couldn't launch Hyprland" && tty | grep tty1 \
&& echo "refusing to autologin without Hyprland on tty1" && exit 0 \
|| echo "not on tty1, letting in"
'';
home = { home = {
pointerCursor = { pointerCursor = {
gtk.enable = true; gtk.enable = true;
@@ -235,24 +245,14 @@
name = "capitaine-cursors"; name = "capitaine-cursors";
}; };
file.profile = {
enable = true;
target = ".zprofile"; # change to .profile if you're not using zsh
text =
/*
sh
*/
''
Hyprland && echo "goodbye" && exit 0 \
|| echo "$? couldn't launch Hyprland" && tty | grep tty1 \
&& echo "refusing to autologin without Hyprland on tty1" && exit 0 \
|| echo "not on tty1, letting in"
'';
};
file.".config/hypr/shaders" = { file.".config/hypr/shaders" = {
source = ./hypr/shaders; source = ./hypr/shaders;
recursive = true; recursive = true;
}; };
file.".config/wezterm" = {
source = ./wezterm;
recursive = true;
};
}; };
} }

View File

@@ -1,10 +1,19 @@
{pkgs}: { {pkgs}: {
enable = true; enable = true;
/*
package = pkgs.kitty.overrideAttrs (prev: {
src = pkgs.lib.fetchFromGitHub {
owner = "nightuser";
repo = "kitty";
rev = ""
};
});
*/
shellIntegration.enableFishIntegration = true; shellIntegration.enableFishIntegration = true;
font = { font = {
package = pkgs.jetbrains-mono; package = pkgs.jetbrains-mono;
name = "JetBrains Mono"; name = "JetBrains Mono";
size = 11; size = 13;
}; };
extraConfig = '' extraConfig = ''
symbol_map U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E6AA,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF,U+F0001-U+F1AF0 Symbols Nerd Font Mono symbol_map U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E6AA,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF,U+F0001-U+F1AF0 Symbols Nerd Font Mono

View File

@@ -3,41 +3,127 @@
settings = { settings = {
mainBar = { mainBar = {
layer = "top"; layer = "top";
position = "left"; position = "top";
width = 16;
modules-left = ["hyprland/workspaces"]; modules-left = ["hyprland/workspaces"];
modules-center = ["clock"]; modules-center = ["clock"];
modules-right = ["custom/weather"]; modules-right = ["tray" "group/power"];
"clock" = { "clock" = {
format = "<b>{%H}</b>\n{%M}"; format = "{:%H:%M}";
}; };
"custom/weather" = { "custom/weather" = {
format = "{}"; format = "{}";
tooltip = true; tooltip = true;
interval = 3600; interval = 3600;
exec = "wttrbar --location Berlin"; exec = "${pkgs.wttrbar}/bin/wttrbar --location Berlin --custom-indicator \"{ICON}{temp_C}°\"";
return-type = "json"; return-type = "json";
}; };
"group/power" = {
orientation = "inherit";
drawer = {
transition-duration = 500;
children-class = "not-power";
transition-left-to-right = false;
};
modules = [
"custom/launcher"
"custom/power"
#"custom/quit"
#"custom/lock"
"custom/reboot"
];
};
"custom/launcher" = {
format = " ";
tooltip = false;
on-click = "anyrun";
};
"custom/quit" = {
format = "󰗼 ";
tooltip = false;
on-click = "hyprctl dispatch exit";
};
"custom/lock" = {
format = "󰍁 ";
tooltip = false;
on-click = "swaylock";
};
"custom/reboot" = {
format = "󰜉 ";
tooltip = false;
on-click = "reboot";
};
"custom/power" = {
format = " ";
tooltip = false;
on-click = "shutdown now";
};
"hyprland/workspaces" = { "hyprland/workspaces" = {
format = "{windows}"; format = "{windows}";
format-window-separator = "\n"; format-window-separator = " ";
window-rewrite-default = "";
window-rewrite = { window-rewrite = {
"title<.*youtube.*>" = ""; "title<.*youtube.*>" = "";
"class<firefox>" = "";
"title<nvim.*>" = ""; "title<nvim.*>" = "";
"class<kitty>" = ""; "title<htop.*>" = "";
"title<p?npm.*>" = "󰢩";
"class<firefox>" = "";
"class<chromium-browser>" = "";
"class<lutris>" = "󰺵";
"class<.gimp.*>" = "";
"class<org.inkscape.Inkscape>" = "";
"class<kitty>" = "󰆍";
"class<blender>" = "󰂫";
"class<steam>" = "󰓓";
"class<libreoffice.*>" = "󰏆";
"class<Element>" = "󰭹";
"class<brave-browser>" = "";
"class<Jellyfin Media Player>" = "󰼁";
"class<VencordDesktop>" = "󰙯"; "class<VencordDesktop>" = "󰙯";
"class<org.gnome.Nautilus>" = "󰝰"; "class<org.gnome.Nautilus>" = "󰝰";
}; };
}; };
}; };
}; };
style = '' style =
window#waybar { /*
background: black; css
} */
''; ''
* {
font-weight: bold;
}
window#waybar {
background: black;
}
#workspaces {
}
#workspaces button {
opacity: 0.5;
padding: 0;
border-radius: 0;
border-width: 0;
font-size: 16px;
padding-left: 2px;
padding-right: 2px;
border-top: 2px solid transparent;
transition: all 250ms ease;
}
#workspaces button.active {
opacity: 1;
}
#workspaces button.visible {
border-top-color: currentcolor;
}
'';
} }

View File

@@ -0,0 +1,14 @@
local wezterm = require("wezterm")
local config = {
font = wezterm.font("JetBrains Mono"),
enable_tab_bar = false,
display_pixel_geometry = "BGR",
freetype_load_target = "HorizontalLcd",
freetype_load_flags = "NO_HINTING",
freetype_render_target = "HorizontalLcd",
font_size = 13.0,
default_prog = { "/run/current-system/sw/bin/fish" },
}
return config

View File

@@ -150,7 +150,6 @@
services.getty.extraArgs = ["--noclear" "--noissue" "--nonewline"]; services.getty.extraArgs = ["--noclear" "--noissue" "--nonewline"];
services.getty.loginOptions = "-p -f -- \\u"; # preserve environment services.getty.loginOptions = "-p -f -- \\u"; # preserve environment
programs.hyprland.enable = true; programs.hyprland.enable = true;
programs.hyprland.enableNvidiaPatches = true;
programs.fish.enable = true; programs.fish.enable = true;
users.defaultUserShell = pkgs.fish; users.defaultUserShell = pkgs.fish;
users.users.${username} = { users.users.${username} = {
@@ -188,12 +187,22 @@
docker-compose docker-compose
]; ];
fonts.packages = with pkgs; [ fonts = {
noto-fonts packages = with pkgs; [
noto-fonts-cjk noto-fonts
noto-fonts-emoji noto-fonts-cjk
(nerdfonts.override {fonts = ["JetBrainsMono" "Noto" "NerdFontsSymbolsOnly"];}) noto-fonts-emoji
]; (nerdfonts.override {fonts = ["JetBrainsMono" "Noto" "NerdFontsSymbolsOnly"];})
];
fontconfig = {
defaultFonts = {
monospace = ["JetBrainsMono Nerd Font"];
sansSerif = ["Noto Sans Nerd Font"];
};
subpixel.rgba = "bgr";
};
};
networking = { networking = {
firewall = { firewall = {

7411
overlays/wezterm/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,153 @@
{
stdenv,
rustPlatform,
lib,
fetchFromGitHub,
ncurses,
perl,
pkg-config,
python3,
fontconfig,
installShellFiles,
openssl,
libGL,
libX11,
libxcb,
libxkbcommon,
xcbutil,
xcbutilimage,
xcbutilkeysyms,
xcbutilwm,
wayland,
zlib,
CoreGraphics,
Cocoa,
Foundation,
System,
libiconv,
UserNotifications,
nixosTests,
runCommand,
vulkan-loader,
}:
rustPlatform.buildRustPackage rec {
pname = "wezterm";
version = "ff2743748c238e5cdd6e7cb4ed19517d08dd511f";
src = fetchFromGitHub {
owner = "wez";
repo = pname;
rev = version;
fetchSubmodules = true;
hash = "sha256-oogmLKoldUoAsLsDa+MmepWjVu/cuE8YjXrf+QyQ1Jo=";
};
postPatch = ''
echo ${version} > .tag
# tests are failing with: Unable to exchange encryption keys
rm -r wezterm-ssh/tests
'';
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"xcb-1.2.1" = "sha256-zkuW5ATix3WXBAj2hzum1MJ5JTX3+uVQ01R1vL6F1rY=";
"xcb-imdkit-0.2.0" = "sha256-L+NKD0rsCk9bFABQF4FZi9YoqBHr4VAZeKAWgsaAegw=";
};
};
nativeBuildInputs =
[
installShellFiles
ncurses # tic for terminfo
pkg-config
python3
]
++ lib.optional stdenv.isDarwin perl;
buildInputs =
[
fontconfig
zlib
]
++ lib.optionals stdenv.isLinux [
libX11
libxcb
libxkbcommon
openssl
wayland
xcbutil
xcbutilimage
xcbutilkeysyms
xcbutilwm # contains xcb-ewmh among others
]
++ lib.optionals stdenv.isDarwin [
Cocoa
CoreGraphics
Foundation
libiconv
System
UserNotifications
];
buildFeatures = ["distro-defaults"];
env.NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework System";
postInstall = ''
mkdir -p $out/nix-support
echo "${passthru.terminfo}" >> $out/nix-support/propagated-user-env-packages
install -Dm644 assets/icon/terminal.png $out/share/icons/hicolor/128x128/apps/org.wezfurlong.wezterm.png
install -Dm644 assets/wezterm.desktop $out/share/applications/org.wezfurlong.wezterm.desktop
install -Dm644 assets/wezterm.appdata.xml $out/share/metainfo/org.wezfurlong.wezterm.appdata.xml
install -Dm644 assets/shell-integration/wezterm.sh -t $out/etc/profile.d
installShellCompletion --cmd wezterm \
--bash assets/shell-completion/bash \
--fish assets/shell-completion/fish \
--zsh assets/shell-completion/zsh
install -Dm644 assets/wezterm-nautilus.py -t $out/share/nautilus-python/extensions
'';
preFixup =
lib.optionalString stdenv.isLinux ''
patchelf \
--add-needed "${libGL}/lib/libEGL.so.1" \
--add-needed "${vulkan-loader}/lib/libvulkan.so.1" \
$out/bin/wezterm-gui
''
+ lib.optionalString stdenv.isDarwin ''
mkdir -p "$out/Applications"
OUT_APP="$out/Applications/WezTerm.app"
cp -r assets/macos/WezTerm.app "$OUT_APP"
rm $OUT_APP/*.dylib
cp -r assets/shell-integration/* "$OUT_APP"
ln -s $out/bin/{wezterm,wezterm-mux-server,wezterm-gui,strip-ansi-escapes} "$OUT_APP"
'';
passthru = {
tests = {
all-terminfo = nixosTests.allTerminfo;
terminal-emulators = nixosTests.terminal-emulators.wezterm;
};
terminfo =
runCommand "wezterm-terminfo"
{
nativeBuildInputs = [ncurses];
} ''
mkdir -p $out/share/terminfo $out/nix-support
tic -x -o $out/share/terminfo ${src}/termwiz/data/wezterm.terminfo
'';
};
meta = with lib; {
description = "GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust";
homepage = "https://wezfurlong.org/wezterm";
license = licenses.mit;
mainProgram = "wezterm";
maintainers = with maintainers; [SuperSandro2000 mimame];
};
}