feat: i3!

This commit is contained in:
Kat Inskip 2025-02-27 12:29:13 -08:00
parent add8b013a4
commit d463824ef1
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
35 changed files with 2150 additions and 156 deletions

View file

@ -0,0 +1,10 @@
{ config, lib, ... }: let
inherit (config.catppuccin) sources;
inherit (lib) mkBefore;
cfg = config.catppuccin.sway;
theme = "${sources.sway}/catppuccin-${cfg.flavor}";
in {
xsession.windowManager.i3.extraConfigEarly = ''
${builtins.readFile theme}
'';
}

View file

@ -0,0 +1,5 @@
_: {
services.dunst = {
enable = true;
};
}

157
home/environments/i3/i3.nix Normal file
View file

@ -0,0 +1,157 @@
{
pkgs,
lib,
std,
config,
...
}:
let
inherit (std) list;
inherit (lib.modules) mkMerge;
inherit (lib) mkOptionDefault mkDefault mapAttrs;
in {
home.packages = with pkgs; [
maim
pcmanfm
pavucontrol
xclip
];
services.i3gopher.enable = true;
xsession.windowManager.i3 = {
enable = true;
package = pkgs.i3-gaps;
extraConfig = ''
workspace 1 output DP-2
workspace 11 output HDMI-0
'';
config = let
modifier = "Mod4";
other_modifier = "Mod1";
mod = modifier;
mod2 = other_modifier;
in {
inherit modifier;
fonts = [
"Monaspace Krypton"
"FontAwesome 6"
];
startup = [
{ command = "~/.screenlayout/main.sh"; }
{ command = "blueman-applet"; }
];
keybindings = let
bindWorkspace = key: workspace: {
"${mod}+${key}" = "workspace number ${workspace}";
"${mod}+shift+${key}" = "move container to workspace number ${workspace}";
};
mapDefaultAttrs = e: mapAttrs (_: mkDefault) e;
workspaceBindings =
list.map (v: bindWorkspace v "${v}") (list.map builtins.toString (list.range 1 9))
++ [
(
bindWorkspace "0" "10"
)
]
++ list.imap (i: v: bindWorkspace v "${toString (11 + i)}") (list.map (n: "F${builtins.toString n}") (std.list.range 1 12));
normalBindings = {
"Print" = "exec --no-startup-id maim \"/home/$USER/Pictures/$(date)\"";
"${mod2}+Print" = "exec --no-startup-id maim --window $(xdotool getactivewindow) \"/home/$USER/Pictures/$(date)\"";
"Shift+Print" = "exec --no-startup-id maim --select \"/home/$USER/Pictures/$(date)\"";
"Ctrl+Print" = "exec --no-startup-id maim | xclip -selection clipboard -t image/png";
"Ctrl+${mod2}+Print" = "exec --no-startup-id maim --window $(xdotool getactivewindow) | xclip -selection clipboard -t image/png";
"Ctrl+Shift+Print" = "exec --no-startup-id maim --select | xclip -selection clipboard -t image/png";
"${mod}+p" = "exec ${pkgs.dmenu}/bin/dmenu_run";
"${mod}+x" = "exec sh -c '${pkgs.maim}/bin/maim -s | xclip -selection clipboard -t image/png'";
"${mod}+Shift+x" = "exec sh -c '${pkgs.i3lock}/bin/i3lock -c 222222 & sleep 5 && xset dpms force of'";
"${mod}+Return" = "exec ${config.programs.wezterm.package}/bin/wezterm";
"${mod}+Tab" = "workspace back_and_forth";
"${mod}+Shift+Tab" = "exec ${config.services.i3gopher.focus-last}";
};
in mkMerge (map mapDefaultAttrs ([ normalBindings ] ++ workspaceBindings));
workspaceAutoBackAndForth = true;
colors = {
focused = {
border = "$lavender";
background = "$base";
text = "$text";
indicator = "$rosewater";
childBorder = "$lavender";
};
focusedInactive = {
border = "$overlay0";
background = "$base";
text = "$text";
indicator = "$rosewater";
childBorder = "$overlay0";
};
unfocused = {
border = "$overlay0";
background = "$base";
text = "$text";
indicator = "$rosewater";
childBorder = "$overlay0";
};
urgent = {
border = "$peach";
background = "$base";
text = "$peach";
indicator = "$overlay0";
childBorder = "$peach";
};
placeholder = {
border = "$overlay0";
background = "$base";
text = "$text";
indicator = "$overlay0";
childBorder = "$overlay0";
};
background = "$base";
};
bars = [
{
# as if anyone was questioning that,
position = "bottom";
fonts = {
names = [
"Monaspace Krypton"
"FontAwesome 6 Free"
"FontAwesome 6 Brands"
];
size = "8";
};
colors = {
background = "$base";
statusline = "$text";
separator = "$text";
focusedBackground = "$base";
focusedStatusline = "$text";
focusedSeparator = "$base";
focusedWorkspace = {
border ="$base";
background = "$mauve";
text = "$crust";
};
activeWorkspace = {
border = "$base";
background = "$surface2";
text = "$text";
};
inactiveWorkspace = {
border = "$base";
background = "$base";
text = "$text";
};
urgentWorkspace = {
border = "$base";
background = "$red";
text = "$crust";
};
};
trayOutput = "primary";
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${config.xdg.configHome}/i3status-rust/config-gaybar.toml";
}
];
};
};
}

View file

@ -0,0 +1,55 @@
_: {
programs.i3status-rust = {
enable = true;
bars = {
# YOU! I WANNA TAKE YOU TO A
gaybar = {
blocks = [
{
block = "cpu";
interval = 1;
}
{
block = "load";
interval = 1;
format = " $icon $1m ";
}
{
block = "memory";
format = " $icon $mem_total_used_percents.eng(w:2) ";
}
{
block = "memory";
format = " $icon_swap $swap_used_percents.eng(w:2) ";
}
{
block = "nvidia_gpu";
format = " $icon $utilization $memory $temperature ";
}
{
block = "hueshift";
}
{
block = "music";
format = " $icon {$combo.str(max_w:60) $play |}";
}
{
block = "sound";
format = " $icon {$volume.eng(w:2) |}";
}
{
block = "notify";
format = " $icon {($notification_count.eng(w:1)) |}";
}
{
block = "time";
interval = 1;
format = " $icon $timestamp.datetime(f:'%F %T %Z') ";
}
];
theme = "ctp-latte";
icons = "awesome6";
};
};
};
}

View file

@ -0,0 +1,42 @@
{
inputs,
pkgs,
config,
...
}: let
konawallConfig = {
interval = 30 * 60;
rotate = true;
source = "konachan";
tags = [
#"rating:s"
"touhou"
"score:>=50"
"width:>=1500"
];
logging = {
file = "INFO";
console = "DEBUG";
};
};
in {
home.packages = [
inputs.konawall-py.packages.${pkgs.system}.konawall-py
];
xdg.configFile = {
"konawall/config.toml".source = (pkgs.formats.toml {}).generate "konawall-config" konawallConfig;
};
systemd.user.services.konawall-py-gnome = {
Unit = {
Description = "konawall-py";
X-Restart-Triggers = [(toString config.xdg.configFile."konawall/config.toml".source)];
After = ["graphical-session.target" "network-online.target"];
};
Service = {
ExecStart = "${inputs.konawall-py.packages.${pkgs.system}.konawall-py}/bin/konawall";
Restart = "on-failure";
RestartSec = "1s";
};
Install = {WantedBy = ["graphical-session.target"];};
};
}

View file

@ -0,0 +1,5 @@
_: {
services.picom = {
enable = true;
};
}

View file

@ -0,0 +1,6 @@
_: {
services.gammastep = {
enable = true;
provider = "geoclue2";
};
}

View file

@ -1,6 +1,9 @@
{pkgs, ...}: {
home.sessionVariables = {
QT_QPA_PLATFORMTHEME = "qt5ct";
QT_QPA_PLATFORMTHEME = "qt6ct";
#XDG_BACKEND = "x11";
XDG_CURRENT_DESKTOP = "kde";
#GDK_BACKEND = "x11";
};
home.packages = with pkgs.kdePackages; [
kscreen
@ -54,14 +57,9 @@
systemsettings
kcmutils
];
xdg.configFile."Kvantum/kvantum.kvconfig".source = (pkgs.formats.ini {}).generate "kvantum.kvconfig" {
General.theme = "commonalitysol";
};
programs.plasma = {
enable = true;
workspace = {
colorScheme = "CommonalitySol";
theme = "CommonalitySol";
};
fonts = let
katFont = {
@ -80,7 +78,7 @@
"kdeglobals"."General"."BrowserApplication" = "firefox.desktop";
"kdeglobals"."General"."TerminalApplication" = "konsole";
"kxkbrc"."Layout"."ResetOldOptions" = true;
"kxkbrc"."Layout"."Options" = "terminate:ctrl_alt_bksp,ctrl:hyper_capscontrol";
"kxkbrc"."Layout"."Options" = "terminate:ctrl_alt_bksp,ctrl:capscontrol";
};
};
}

View file

@ -3,12 +3,12 @@
pkgs,
...
}: let
konawallWithDelay = pkgs.writeShellScriptBin "konawall" ''
sleep 5 && ${inputs.konawall-py.packages.${pkgs.system}.konawall-py}/bin/konawall
konawallWithDelay = pkgs.writeShellScriptBin "konawally" ''
sleep 5 && XDG_BACKEND=x11 GDK_BACKEND=x11 ${inputs.konawall-py.packages.${pkgs.system}.konawall-py}/bin/konawall
'';
desktop_entry = ''
[Desktop Entry]
Exec=${konawallWithDelay}/bin/konawall
Exec=${konawallWithDelay}/bin/konawally
Icon=
Name=konawall
Path=
@ -31,6 +31,10 @@
};
};
in {
home.packages = [
konawallWithDelay
inputs.konawall-py.packages.${pkgs.system}.konawall-py
];
xdg.configFile = {
"konawall/config.toml".source = (pkgs.formats.toml {}).generate "konawall-config" konawallConfig;
"autostart/konawall.desktop".text = desktop_entry;

View file

@ -14,14 +14,14 @@ in {
shell.enable = true;
schemes = {
light = {
schemeData = schemeSources.atelier.schemes.atelier-heath-light;
schemeData = schemeSources.tinted.schemes.catppuccin-latte;
ansi.palette.background.alpha = "d000";
};
dark = {
schemeData = schemeSources.outrun.schemes.outrun-dark;
schemeData = schemeSources.tinted.schemes.catppuccin-mocha;
ansi.palette.background.alpha = "ee00";
};
};
defaultSchemeName = "dark";
defaultSchemeName = "light";
};
}

View file

@ -0,0 +1,7 @@
_: {
catppuccin = {
enable = true;
flavor = "latte";
gtk.enable = true;
};
}

View file

@ -0,0 +1,5 @@
_: {
disabledModules = [
"services/window-managers/i3-sway/i3.nix"
];
}

View file

@ -9,7 +9,7 @@
main = {
id = 0;
isDefault = true;
extensions = with nur.repos.rycee.firefox-addons; [
extensions.packages = with nur.repos.rycee.firefox-addons; [
sponsorblock
link-cleaner
canvasblocker

View file

@ -5,9 +5,7 @@
...
}: let
inherit (lib.attrsets) mapAttrsToList;
ytdlp = inputs.nixpkgs-current.legacyPackages.x86_64-linux.yt-dlp;
in {
# TODO: remove the libs
programs.mpv = {
enable = true;
scripts = with pkgs.mpvScripts; [
@ -23,7 +21,7 @@ in {
script-opts =
builtins.concatStringsSep ","
(mapAttrsToList (k: v: "${k}=${builtins.toString v}") {
ytdl_hook-ytdl_path = "${ytdlp}/bin/yt-dlp";
ytdl_hook-ytdl_path = "${pkgs.yt-dlp}/bin/yt-dlp";
osc-layout = "slimbox";
osc-vidscale = "no";
osc-deadzonesize = 0.75;
@ -42,7 +40,7 @@ in {
yt = "mpv --ytdl-format='bestvideo[height<=?720][fps<=?30][vcodec!=?vp9]+bestaudio/best[height<=720]'"; # Laptop doesn't like above 720p :c
};
home.packages = with pkgs; [
ytdlp # Watch videos from multiple sources without having to use a browser for it
yt-dlp # Watch videos from multiple sources without having to use a browser for it
ytcc # Subscriptions manager and RSS feed exporter for YouTube
];
}

View file

@ -21,7 +21,7 @@
dino # XMPP
signal-desktop
mumble
keymapp
# Archivery
unzip
zip

View file

@ -0,0 +1,30 @@
_: {
programs.syncplay = {
enable = true;
username = "kat";
defaultRoom = "lounge";
server = {
host = "syncplay.local.gensokyo.zone";
};
playerArgs = [
"--ytdl-format=bestvideo[height<=1080]+bestaudio/best[height<=1080]/bestvideo+bestaudio/best"
];
# gui = false;
config = {
client_settings = {
onlyswitchtotrusteddomains = false;
autoplayrequiresamefiles = false;
readyatstart = true;
pauseonleave = false;
rewindondesync = false;
rewindthreshold = 6.0;
fastforwardthreshold = 6.0;
unpauseaction = "Always";
};
gui = {
#autosavejoinstolist = false;
showdurationnotification = false;
};
};
};
}

View file

@ -26,7 +26,7 @@
window_decorations = "TITLE | RESIZE",
enable_wayland = true,
warn_about_missing_glyphs = false,
font_size = 10.0,
font_size = 12.0,
check_for_updates = false,
enable_tab_bar = false
}

View file

@ -43,7 +43,7 @@ in {
# EasyMotion Equivalent
hop-nvim
# org-mode for vim
# neorg
neorg
# base16
config.base16.vim.plugin
# Fonts

View file

@ -9,30 +9,30 @@ local api = vim.api -- Lua API
-----------------------------------------------------------
-- Base16
-----------------------------------------------------------
vim.g.base16colorspace = 256
vim.g.base16background = "@defaultSchemeName@"
g.base16_shell_path = "@base16ShellPath@"
vim.cmd("colorscheme base16-@defaultSchemeSlug@")
g.colors_name = "@defaultSchemeSlug@"
--vim.g.base16colorspace = 256
--vim.g.base16background = "@defaultSchemeName@"
--g.base16_shell_path = "@base16ShellPath@"
--vim.cmd("colorscheme base16-@defaultSchemeSlug@")
--g.colors_name = "@defaultSchemeSlug@"
local base16 = {
base00 = "@base00@",
base01 = "@base01@",
base02 = "@base02@",
base03 = "@base03@",
base04 = "@base04@",
base05 = "@base05@",
base06 = "@base06@",
base07 = "@base07@",
base08 = "@base08@",
base09 = "@base09@",
base0A = "@base0A@",
base0B = "@base0B@",
base0C = "@base0C@",
base0D = "@base0D@",
base0E = "@base0E@",
base0F = "@base0F@"
}
--local base16 = {
-- base00 = "@base00@",
-- base01 = "@base01@",
-- base02 = "@base02@",
-- base03 = "@base03@",
-- base04 = "@base04@",
-- base05 = "@base05@",
-- base06 = "@base06@",
-- base07 = "@base07@",
-- base08 = "@base08@",
-- base09 = "@base09@",
-- base0A = "@base0A@",
-- base0B = "@base0B@",
-- base0C = "@base0C@",
-- base0D = "@base0D@",
-- base0E = "@base0E@",
-- base0F = "@base0F@"
--}
api.nvim_create_autocmd("vimenter", {
command = "highlight Normal guibg=NONE ctermbg=NONE"
@ -74,6 +74,8 @@ opt.laststatus = 3 -- Set global statusline
opt.cursorline = true -- Highlight cursor screenline
opt.cmdheight = 1 -- Command entry line height
opt.hlsearch = true -- Highlight matches with last search pattern
vim.g.mapleader = " "
vim.g.maplocalleader = ","
-----------------------------------------------------------
-- Tabs, indent
@ -184,23 +186,22 @@ api.nvim_create_autocmd('BufWritePre', {
command = 'lua vim.lsp.buf.formatting_sync()'
})
--[[
-- neorg
require('neorg').setup {
-- Tell Neorg what modules to load
load = {
['core.defaults'] = {}, -- Load all the default modules
['core.norg.concealer'] = {}, -- Allows for use of icons
['core.norg.dirman'] = { -- Manage your directories with Neorg
['core.concealer'] = {}, -- Allows for use of icons
['core.dirman'] = { -- Manage your directories with Neorg
config = {
engine = 'nvim-cmp',
workspaces = {
home = '~/neorg'
}
notes = '~/Notes',
},
default_workspace = "notes",
}
}
},
}]]--
}
-- telescope
local telescope = require('telescope.builtin')
@ -298,7 +299,7 @@ require('bufferline').setup {
}
}
local barColor = base16.base00;
--local barColor = base16.base00;
local highlightItems = {
BufferLineFill = "bg",
@ -310,13 +311,13 @@ local highlightItems = {
local commandString = ""
for item, ground in pairs(highlightItems) do
commandString = "highlight " .. item .. " cterm" .. ground .. "=" .. barColor .. " | " .. commandString
end
--for item, ground in pairs(highlightItems) do
-- commandString = "highlight " .. item .. " cterm" .. ground .. "=" .. barColor .. " | " .. commandString
--end
api.nvim_create_autocmd("ColorScheme", {
command = commandString;
})
--api.nvim_create_autocmd("ColorScheme", {
-- command = commandString;
--})
-- hop
local hop = require('hop')
@ -338,3 +339,5 @@ end, {remap=true})
vim.keymap.set("", "F", function()
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true })
end, {remap=true})
vim.cmd("colorscheme catppuccin-latte")