WIP wezterm and hypr

This commit is contained in:
Daniel Flanagan 2024-03-25 09:44:55 -05:00
parent 701be10014
commit fafd242e46
6 changed files with 24 additions and 172 deletions

View file

@ -94,9 +94,15 @@
}; };
}); });
devShell = forAllSystems (system: devShell = forAllSystems (system: let
nixpkgs.legacyPackages.${system}.mkShell { pkgs = nixpkgs.legacyPackages.${system};
in
pkgs.mkShell {
inherit (outputs.checks.${system}.pre-commit-check) shellHook; inherit (outputs.checks.${system}.pre-commit-check) shellHook;
buildInputs = with pkgs; [
lua-language-server
];
}); });
# Your custom packages and modifications, exported as overlays # Your custom packages and modifications, exported as overlays

View file

@ -5,75 +5,6 @@
home.file.".config/eww/eww.yuck" = { home.file.".config/eww/eww.yuck" = {
enable = true; enable = true;
text = '' text = builtins.readFile ./eww/eww.yuck;
(defwidget bar []
(centerbox :orientation "h"
(sidestuff)
(box)
(music)))
(defwindow bar
:monitor 0
:stacking "fg"
:exclusive true
:geometry
(geometry
:x "0%"
:y "0%"
:width "100%"
:height "31px"
:anchor "bottom center")
(bar))
(defwidget sidestuff []
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "start" :spacing 20
time
; TODO: idle inhibitor?
; TODO: get these to align properly?
(box :class "mic" (
box :class {micMuted == "false" ? "live" : "muted"} {micMuted == "false" ? " " : " "}
) {micVolume + "%"}
)
(box :class "vol" (
box :class {muted == "false" ? "live" : "muted"} {muted == "false" ? "󰕾 " : "󰖁 "}
) {volume + "%"}
)
{" " + round(EWW_CPU["avg"], 0) + "%"}
{" " + round(EWW_RAM["used_mem_perc"], 0) + "%"}
{isDesktop == "true" ? "" : " " + brightness + "%"}
{isDesktop == "true" ? "" : "󱊣 " + EWW_BATTERY["BAT0"]["capacity"] + "%/" + EWW_BATTERY["BAT1"]["capacity"] + "%"}
))
(defwidget music []
(box :class "music"
:orientation "h"
:halign "end"
:space-evenly false
{music != "" ? "''${music}" : ""}))
(deflisten music :initial ""
"playerctl --follow metadata --format '{{ title }} by {{ artist }}' || true")
(deflisten volume :initial "0"
"pamixer --get-volume; pactl subscribe | grep sink --line-buffered | while read i; do pamixer --get-volume; done")
(deflisten muted :initial "false"
"pamixer --get-mute; pactl subscribe | grep sink --line-buffered | while read i; do pamixer --get-mute; done")
(deflisten micVolume :initial "0"
"pamixer --default-source --get-volume; pactl subscribe | grep source --line-buffered | while read i; do pamixer --default-source --get-volume; done")
(deflisten micMuted :initial "false"
"pamixer --default-source --get-mute; pactl subscribe | grep source --line-buffered | while read i; do pamixer --default-source --get-mute; done")
(defpoll time :interval "1s"
"date '+%a %b %d %H:%M:%S'")
(defpoll isDesktop :interval "24h"
"if [ -d \"$HOME/.config/lytedev-env/host-desktop\" ]; then echo true; else echo false; fi")
(defpoll brightness :interval "10s"
"echo $(((100 * $(brightnessctl get)) / $(brightnessctl max)))")
'';
}; };
} }

View file

@ -89,6 +89,7 @@
natural_scroll = "yes"; natural_scroll = "yes";
tap-to-click = true; tap-to-click = true;
middle_button_emulation = true; middle_button_emulation = true;
disable_while_typing = false;
}; };
}; };
@ -174,6 +175,7 @@
", XF86AudioNext, exec, playerctl next" ", XF86AudioNext, exec, playerctl next"
", XF86AudioPrev, exec, playerctl previous" ", XF86AudioPrev, exec, playerctl previous"
"$mainMod, tab, workspace, previous" "$mainMod, tab, workspace, previous"
"ALT, tab, workspace, previous"
# Switch workspaces with mainMod + [0-9] # Switch workspaces with mainMod + [0-9]
"$mainMod, 1, workspace, 1" "$mainMod, 1, workspace, 1"

View file

@ -54,7 +54,7 @@
tab_bar_align = "left"; tab_bar_align = "left";
tab_bar_style = "separator"; tab_bar_style = "separator";
tab_separator = ''""''; tab_separator = ''""'';
tab_bar_edge = "top"; tab_bar_edge = "bottom";
tab_title_template = ''"{fmt.fg.tab}{fmt.bg.tab} {activity_symbol}{title} "''; tab_title_template = ''"{fmt.fg.tab}{fmt.bg.tab} {activity_symbol}{title} "'';
active_tab_font_style = "normal"; active_tab_font_style = "normal";

View file

@ -1,14 +1,10 @@
local wezterm = require'wezterm' local wezterm = require'wezterm'
-- rough duplication of colors.nix and font values from flake.nix
FONT = { FONT = {
name = "IosevkaLyteTerm"; name = "IosevkaLyteTerm";
size = 12.0; size = 12.0;
} }
COLORS = {
};
local config = {} local config = {}
if wezterm.config_builder then if wezterm.config_builder then
@ -53,101 +49,18 @@ wezterm.on('format-tab-title', function (tab, _, _, _, _, max_width)
return ' ' .. string.sub(title, 0, max_width - 2) .. ' ' return ' ' .. string.sub(title, 0, max_width - 2) .. ' '
end) end)
-- TODO: port colors ---@diagnostic disable-next-line: unused-local
config.colors = { local function scheme_for_appearance(appearance)
foreground = '${fg}', -- TODO: some way to detect if WM or something?
background = '${bg}', -- if appearance:find "Dark" then
cursor_bg = '${text}', -- return "Catppuccin Mocha"
cursor_fg = '${bg}', -- else
cursor_border = '${text}', -- return "Catppuccin Latte"
-- end
selection_fg = '${bg}', return "Catppuccin Mocha"
selection_bg = '${yellow}', end
scrollbar_thumb = '${bg2}',
split = '${bg5}',
ansi = {
'${colors.withHashPrefix."0"}',
'${colors.withHashPrefix."1"}',
'${colors.withHashPrefix."2"}',
'${colors.withHashPrefix."3"}',
'${colors.withHashPrefix."4"}',
'${colors.withHashPrefix."5"}',
'${colors.withHashPrefix."6"}',
'${colors.withHashPrefix."7"}',
},
brights = {
'${colors.withHashPrefix."8"}',
'${colors.withHashPrefix."9"}',
'${colors.withHashPrefix."10"}',
'${colors.withHashPrefix."11"}',
'${colors.withHashPrefix."12"}',
'${colors.withHashPrefix."13"}',
'${colors.withHashPrefix."14"}',
'${colors.withHashPrefix."15"}',
},
tab_bar = {
background = '${bg3}',
active_tab = {
bg_color = '${primary}',
fg_color = '${bg}',
italic = false,
},
inactive_tab = {
bg_color = '${bg2}',
fg_color = '${fgdim}',
italic = false,
},
inactive_tab_hover = {
bg_color = '${bg3}',
fg_color = '${primary}',
italic = false,
},
new_tab = {
bg_color = '${bg2}',
fg_color = '${fgdim}',
italic = false,
},
new_tab_hover = {
bg_color = '${bg3}',
fg_color = '${primary}',
italic = false,
},
},
-- Arbitrary colors of the palette in the range from 16 to 255
indexed = { [136] = '#af8700' },
-- Since: 20220319-142410-0fcdea07
-- When the IME, a dead key or a leader key are being processed and are effectively
-- holding input pending the result of input composition, change the cursor
-- to this color to give a visual cue about the compose state.
compose_cursor = 'orange',
-- Colors for copy_mode and quick_select
-- available since: 20220807-113146-c2fee766
-- In copy_mode, the color of the active text is:
-- 1. copy_mode_active_highlight_* if additional text was selected using the mouse
-- 2. selection_* otherwise
copy_mode_active_highlight_bg = { Color = '#000000' },
-- use `AnsiColor` to specify one of the ansi color palette values
-- (index 0-15) using one of the names "Black", "Maroon", "Green",
-- "Olive", "Navy", "Purple", "Teal", "Silver", "Grey", "Red", "Lime",
-- "Yellow", "Blue", "Fuchsia", "Aqua" or "White".
copy_mode_active_highlight_fg = { AnsiColor = 'Black' },
copy_mode_inactive_highlight_bg = { Color = '#52ad70' },
copy_mode_inactive_highlight_fg = { AnsiColor = 'White' },
quick_select_label_bg = { Color = 'peru' },
quick_select_label_fg = { Color = '#ffffff' },
quick_select_match_bg = { AnsiColor = 'Navy' },
quick_select_match_fg = { Color = '#ffffff' },
}
config.color_scheme = scheme_for_appearance(wezterm.gui.get_appearance())
config.inactive_pane_hsb = { config.inactive_pane_hsb = {
saturation = 0.8, saturation = 0.8,

View file

@ -20,7 +20,7 @@ in {
desktop-usage desktop-usage
# gnome # gnome
printing printing
kde-plasma # kde-plasma
podman podman
lutris lutris
# postgres # postgres