1
Fork 0

Polybar and many others

This commit is contained in:
Matei Adriel 2022-09-18 01:00:32 +02:00
parent 67fc636397
commit c1d4107b9e
21 changed files with 334 additions and 82 deletions

View file

@ -0,0 +1,6 @@
# KMonad config
## Useful links
- [Config tutorial](https://github.com/kmonad/kmonad/blob/master/keymap/tutorial.kbd)
- [Homerow mod stuff](https://precondition.github.io/home-row-mods#using-home-row-mods-with-kmonad)

View file

@ -17,6 +17,7 @@
allow-cmd false
)
;; Layer template:
#|
(deflayer qwerty
_ _ _ _ _ _ _ _ _ _ _ _ _ _
@ -79,6 +80,7 @@
mathExtra (layer-toggle math-extra)
sft (tap-macro lsft (layer-toggle shiftedQwerty)) ;; make this work differently based on the next key pressed
j (tap-macro 7 lsft)
;; spc (spc) ;; (tap-hold-next-release 130 spc lsft)
)
;; more "special" stuff
@ -99,7 +101,7 @@
(deflayer qwerty
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del
grv 1 2 3 4 5 6 @j 8 9 0 - = bspc
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] \
@mth a s d f g h j k l ; ' ret
@sft z x c v b n m , . / rsft
@ -112,7 +114,7 @@
S-tab Q W E R T Y U I O P { } |
@Mth A S D F G H J K L : " S-ret
XX Z X C V B N M < > ? _
_ _ _ _ S-spc S-ralt S-rctl
_ _ _ _ spc S-ralt S-rctl
)
(deflayer movement

View file

@ -11,18 +11,19 @@ local abbreviations = {
-- Greek chars
{ "eps", "\\epsilon" },
{ "delta", "\\delta" },
{ "pi", "\\pi" },
{ "nuls", "\\varnothing" },
-- Exponents
{ "en1", "^{-1}" },
{ "e1", "^{0}" },
{ "ei", "^{-1}" },
{ "e0", "^{0}" },
{ "e1", "^{1}" },
{ "e2", "^{2}" },
{ "e3", "^{3}" },
{ "e4", "^{4}" },
{ "en", "^{n}" },
{ "enn", "^{-}" },
{ "epp", "^{+}" },
{ "etn", "^{-}" },
{ "etp", "^{+}" },
-- Subscripts
{ "s0", "_{0}" },
@ -37,9 +38,18 @@ local abbreviations = {
{ "gx", "g(x)" },
{ "hx", "h(x)" },
{ "Px", "P(x)" },
{ "Pn", "P(n)" },
{ "foa", "f(a)" },
{ "goa", "g(a)" },
{ "hoa", "h(a)" },
{ "dfx", "f'(x)" },
{ "dgx", "g'(x)" },
{ "dhx", "h'(x)" },
-- Basic commands
{ "leq", "\\leq" },
{ "geq", "\\geq" },
{ "sdiff", "\\setminus" },
{ "sst", "\\subset" },
{ "sseq", "\\subseteq" },
{ "neq", "\\neq" },
@ -52,6 +62,17 @@ local abbreviations = {
{ "lor", "\\lor" },
{ "frl", "\\forall" },
{ "exs", "\\exists" },
{ "iinf", "\\infty" },
{ "ninf", "-\\infty" },
{ "nlnl", "\\pm" }, -- had this as npnp first but it was hard-ish to type
{ "ccup", "\\cup" },
{ "ccap", "\\cap" },
{ "nope", "\\bot" },
{ "yee", "\\top" },
{ "mul", "\\cdot" },
{ "smul", "\\times" },
{ "texpl", "&& \\text{}" },
{ "card", "\\#" }
}
A.manyLocalAbbr(abbreviations)

View file

@ -1,13 +1,13 @@
local M = {}
function M.setup()
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local cmp = require('cmp')
cmp.event:on(
'confirm_done',
cmp_autopairs.on_confirm_done()
)
-- local cmp_autopairs = require('nvim-autopairs.completion.cmp')
-- local cmp = require('cmp')
--
-- cmp.event:on(
-- 'confirm_done',
-- cmp_autopairs.on_confirm_done()
-- )
require('nvim-autopairs').setup({
enable_abbr = false

View file

@ -16,7 +16,9 @@ function M.on_attach(client, bufnr)
vim.api.nvim_create_autocmd("BufWritePre", {
group = vim.api.nvim_create_augroup("LspFormatting", {}),
callback = vim.lsp.buf.format
callback = function()
vim.lsp.buf.format({async = false})
end
})
end

View file

@ -0,0 +1,6 @@
# Polybar config
## Useful links:
- [Home manager polybar docs](https://rycee.gitlab.io/home-manager/options.html#opt-services.polybar.enable)
- [General config](https://github.com/polybar/polybar/wiki/Configuration)

110
dotfiles/polybar/config.ini Normal file
View file

@ -0,0 +1,110 @@
[module/battery]
type = internal/battery
; Use the following command to list batteries and adapters:
; $ ls -1 /sys/class/power_supply/
battery = BAT0
adapter = AC
format-charging = <animation-charging> <label-charging>
format-discharging = <animation-discharging> <label-discharging>
format-low = <animation-low> <label-low>
; Only applies if <animation-charging> is used
animation-charging-0 =
animation-charging-1 =
animation-charging-2 =
animation-charging-3 =
animation-charging-4 =
; Framerate in milliseconds
animation-charging-framerate = 750
; Only applies if <animation-discharging> is used
animation-discharging-0 =
animation-discharging-1 =
animation-discharging-2 =
animation-discharging-3 =
animation-discharging-4 =
; Framerate in milliseconds
animation-discharging-framerate = 500
; Only applies if <animation-low> is used
; New in version 3.6.0
animation-low-0 = !
animation-low-1 =
animation-low-framerate = 200
[module/cpu]
type = internal/cpu
[module/date]
type = internal/date
date = %d-%m-%Y%
time = %H:%M
label =  %date%  %time%
[module/wireless-network]
type = internal/network
interface = wlp0s20f3
format-connected = <label-connected>
format-packetloss = <animation-packetloss> <label-connected>
format-disconnected = <label-disconnected>
label-connected =  %essid%  %downspeed%  %upspeed%
label-disconnected =
label-packetloss = %essid%
animation-packetloss-0 =
animation-packetloss-0-foreground = #ffa64c
animation-packetloss-1 = 📶
animation-packetloss-1-foreground = #000000
animation-packetloss-framerate = 500
[module/ewmh]
type = internal/xworkspaces
icon-0 = 1:dev;
icon-1 = 2:browser;
icon-2 = 3:chat;ﭮ
icon-3 = 4:reading;
icon-default =
format = <label-state>
label-active = %icon%
label-active-background = ${colors.text}
label-active-foreground = ${colors.base}
label-active-padding = 2
label-urgent = %icon%
label-urgent-background = ${colors.peach}
label-urgent-foreground = ${colors.base}
label-urgent-padding = 2
label-occupied = %icon%
label-occupied-padding = 2
label-empty =
[bar/main]
font-0 = FiraCode Nerd Font:style=Regular
font-1 = Source Code Pro Nerd Font:style=Regular
modules-left = date battery
modules-center = ewmh
modules-right = wireless-network
padding-right = 2
padding-left = 2
padding-top = 4
module-margin = 2
height=4%
border-top-size = 1
border-top-color = ${colors.text}
background = ${colors.base}
foreground = ${colors.text}
bottom = true

View file

@ -108,6 +108,16 @@
"description": "Create a limit",
"body": "\\lim _{$1 \\to $2}$0"
},
"Limit to infinity": {
"prefix": "ilim",
"description": "Create a limit as a variable goes to infinity",
"body": "\\lim _{$1 \\to \\infty}$0"
},
"Limit to negative infinity": {
"prefix": "nlim",
"description": "Create a limit as a variable goes to negative infinity",
"body": "\\lim _{$1 \\to -\\infty}$0"
},
"Sqrt": {
"prefix": "sqrt",
"description": "Create a sqrt",
@ -148,6 +158,21 @@
"description": "Create an aligned environment",
"body": ["\\begin{aligned}", "\t$0", "\\end{aligned}"]
},
"Explanation in math mode": {
"prefix": "texpl",
"description": "Explain a step in math mode",
"body": "&& \\text{$1}$0"
},
"Let": {
"prefix": "let",
"description": "Let something equal something else",
"body": "Let $$1 = $2$. $0"
},
"Force newline": {
"prefix": "cr",
"description": "Force newline in math mode",
"body": "{\\ \\\\}"
},
"Aligned display math": {
"prefix": "maligned",
"description": "Create an aligned display math environment",

View file

@ -10,14 +10,22 @@ in
}
];
home-manager.users.adrielus.programs.alacritty = {
home-manager.users.adrielus = {
xdg.configFile."alacritty/extraConfig.yml".text = theme.alacritty.extraConfig or "";
programs.alacritty = {
enable = true;
settings = {
import = [ "~/.config/alacritty/extraConfig.yml" ];
window.decorations = "none";
fonts.normal.family = "Nerd Font Source Code Pro";
env = { TERM = "xterm-256color"; };
working_directory = "~/Projects";
};
};
};
}

View file

@ -24,6 +24,7 @@
./direnv.nix
# ./chromium.nix
./vieb.nix
./polybar.nix
];
}

View file

@ -0,0 +1,21 @@
{ pkgs, lib, paths, ... }:
{
home-manager.users.adrielus.services.polybar = {
enable = true;
extraConfig = ''
${pkgs.myThemes.current.polybar.config or ""}
include-file = ${paths.dotfiles}/polybar/config.ini
'';
script = ''
polybar main &
'';
};
home-manager.users.adrielus.xsession = {
enable = true;
initExtra = ''
polybar main &
'';
};
}

View file

@ -33,12 +33,14 @@ main =
handleEventHook = handleEventHook kdeConfig <+> fullscreenEventHook,
terminal = myTerminal,
workspaces = myWorkspaces,
borderWidth = 0
borderWidth = 5,
focusedBorderColor = "#4c4f69",
normalBorderColor = "#4c4f69"
}
`additionalKeysP` keymap
where
myWorkspaces =
["1:dev", "2:browser", "3:chat", "4:terminal", "5", "6", "7", "8", "9", "0"]
["1:dev", "2:browser", "3:chat", "4:reading", "5", "6"]
appWorkspaceConfig =
[ (3, "Discord"),
@ -100,6 +102,4 @@ main =
myLayoutHook = desktopLayoutModifiers $ spacingHook layouts
startup :: X ()
startup = do
-- The file is dynamically set in wallpaper.nix
spawn "xwallpaper --zoom ~/.config/wallpaper"
startup = pure ()

View file

@ -13,7 +13,7 @@
# "export KDEWM=/home/adrielus/.nix-profile/bin/xmonad";
services.picom = {
enable = true;
enable = false;
blur = true;
shadow = false;
extraOptions = ''

View file

@ -3,7 +3,7 @@ self: super:
let
allThemes = self.callPackage (import ../themes/themes.nix) { };
# currentTheme = "github-light";
currentTheme = "catppuccin-macchiato";
currentTheme = "catppuccin-latte";
in
with self; {
myHelpers = self.callPackage (import ../helpers.nix) { };

View file

@ -2,9 +2,10 @@
let
githubTheme = pkgs.myVimPlugins.githubNvimTheme; # github theme for neovim
foreign = pkgs.callPackage (import ./foreign.nix) { };
v = (a: b: if variant == "latte" then a else b);
rofi-variant = "basic";
# rofi-variant = "deathemonic";
in
{
name = "catppuccin-${variant}";
@ -19,12 +20,10 @@ in
lualineTheme = "catppuccin";
};
# grub.path = "${foreign.grub}/catppuccin-grub-theme/theme.txt";
tmux.path = "${foreign.tmux}/catppuccin-${variant}.conf";
sddm.path = "${foreign.sddm}";
grub.path = pkgs.nixos-grub2-theme;
xresources = builtins.readFile "${foreign.xresources}/${variant}.Xresources";
xresources.config = builtins.readFile "${foreign.xresources}/${variant}.Xresources";
rofi = {
themes = "${foreign.rofi}/${rofi-variant}/.local/share/rofi/themes/";
@ -35,14 +34,21 @@ in
'';
};
chromium.extensions = [
# https://github.com/catppuccin/chrome
(v
"cmpdlhmnmjhihmcfnigoememnffkimlk"
"bkkmolkhemgaeaeggcmfbghljjjoofoh")
];
fish.dangerousColors = lib.strings.concatStringsSep " "
(v
[
"dc8a78"
"dd7878"
"ea76cb"
"8839ef"
"d20f39"
"e64553"
"fe640b"
"df8e1d"
"40a02b"
"179299"
"04a5e5"
]
[
"F2CDCD"
"DDB6F2"
@ -55,7 +61,7 @@ in
"B5E8E0"
"96CDFB"
"89DCEB"
];
]);
zathura = {
enable = true;
@ -63,19 +69,25 @@ in
name = "catppuccin-${variant}";
};
alacritty.settings = {
import = [ "${foreign.alacritty}/catppuccin.yml" ];
# colors = "*${variant}";
polybar.config = builtins.readFile "${foreign.polybar}/${variant}.ini";
alacritty = {
extraConfig = ''
${builtins.readFile "${foreign.alacritty}/catppuccin.yml"}
colors: *${variant}
'';
settings = {
window = {
padding = {
x = 0;
y = 0;
x = 4;
y = 4;
};
opacity = transparency;
gtk_theme_variant = v "light" "dark";
};
};
};
}

View file

@ -53,4 +53,10 @@
sha256 = "17q2jn8bx712c0789vc00y9jb2vng7g7mnmqm8ypivrl616igzli";
rev = "b9553c7e398c1a157e5543ea52d20e570f730dd6";
};
polybar = fetchFromGitHub {
owner = "catppuccin";
repo = "polybar";
sha256 = "0842kqxgq1sm17rm29qglj2wwb3zvy0apfx39y7cvl4248jxhzgj";
rev = "94ffe6ed93ff5c54fe938c60dc2babde89046083";
};
}

View file

@ -13,9 +13,22 @@ lib.lists.map (theme: pkgs.callPackage theme { }) [
# wallpaper = "landscapes/salty_mountains.png";
# wallpaper = "misc/rainbow.png";
# wallpaper.foreign = ./wallpapers/eye.png;
# wallpaper.foreign = ./wallpapers/mountain.png;
transparency = 0.93;
variant = "macchiato";
})
(catppuccin {
# wallpaper = "os/nix-magenta-pink-1920x1080.png";
# wallpaper = "minimalistic/tetris.png";
# wallpaper = "misc/comfy-home.png";
# wallpaper = "landscapes/forrest.png";
# wallpaper = "landscapes/salty_mountains.png";
# wallpaper = "misc/rainbow.png";
# wallpaper.foreign = ./wallpapers/eye.png;
wallpaper.foreign = ./wallpapers/mountain.png;
transparency = 1;
variant = "latte";
})
(githubVariant {
variant = "light";
# wallpaper = ./wallpapers/wall.png;

View file

@ -1,5 +1,14 @@
{ pkgs, ... }: {
# Tutorial regarding this:
# https://www.codyhiar.com/blog/how-to-set-desktop-wallpaper-on-nixos/
{ pkgs, config, ... }: {
home-manager.users.adrielus = {
xdg.configFile.wallpaper.source = pkgs.myThemes.current.wallpaper;
xdg.configFile."wallpaper".source = pkgs.myThemes.current.wallpaper;
xsession = {
enable = true;
initExtra = ''
xwallpaper --zoom ~/.config/wallpaper
'';
};
};
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View file

@ -4,6 +4,6 @@ let
in
{
home-manager.users.adrielus.xresources = {
extraConfig = theme.xresources or "";
extraConfig = theme.xresources.config or "";
};
}

View file

@ -30,22 +30,12 @@ in
};
};
# displayManager.gdm.enable = true;
desktopManager.gnome.enable = false;
# Enable xmonad
windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
};
# Enable xfce I think?
# desktopManager = {
# xterm.enable = false;
# xfce = {
# enable = true;
# noDesktop = true;
# enableXfwm = false;
# };
# };
windowManager.xmonad.enable = true;
libinput = {
# Enable touchpad support.
@ -61,10 +51,30 @@ in
};
};
# I think this has to do with multiple monitors and stuff?
services.xserver.displayManager.sessionCommands = ''
${lib.getBin pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource 2 0
'';
services.fractalart.enable = true;
hardware.opengl.enable = true;
environment.gnome.excludePackages = (with pkgs; [
# gnome-photos
# gnome-tour
]) ++ (with pkgs.gnome; [
cheese # webcam tool
gnome-music
gnome-terminal
gedit # text editor
epiphany # web browser
geary # email reader
evince # document viewer
gnome-characters
totem # video player
tali # poker game
iagno # go game
hitori # sudoku game
atomix # puzzle game
]);
}