continue refactor, home modules are actual modules and remove some useless files
This commit is contained in:
20
homeConfigs/modules/alacritty.nix
Normal file
20
homeConfigs/modules/alacritty.nix
Normal file
@ -0,0 +1,20 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
{
|
||||
options.mods.alacritty.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "install and config alacritty";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mods.alacritty.enable {
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
settings = {
|
||||
window.opacity = 0.9;
|
||||
env.XTERM = "xterm-256color";
|
||||
font.size = 10;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
19
homeConfigs/modules/firefox.nix
Normal file
19
homeConfigs/modules/firefox.nix
Normal file
@ -0,0 +1,19 @@
|
||||
{ config, lib, inputs, ... }:
|
||||
|
||||
{
|
||||
options.mods.firefox.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "install and configure firefox";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mods.firefox.enable {
|
||||
programs.firefox = {
|
||||
enable = lib.mkDefault true;
|
||||
profiles.default = {
|
||||
extensions = with inputs.firefox-addons.packages."x86_64-linux";
|
||||
[vimium ublock-origin];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
27
homeConfigs/modules/git.nix
Normal file
27
homeConfigs/modules/git.nix
Normal file
@ -0,0 +1,27 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
options.mods.git.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "git configuration";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mods.git.enable {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userEmail = "tomoron@student.42angouleme.fr";
|
||||
userName = "tomoron";
|
||||
extraConfig = {
|
||||
init.defaultBranch="master";
|
||||
pull.rebase = true;
|
||||
push.autoSetupRemote = true;
|
||||
rerere.enabled = true;
|
||||
};
|
||||
aliases = {
|
||||
fuck = "!f() { git reset --hard \"@{upstream}\" && git restore . && git clean -f .; };f";
|
||||
back = "reset HEAD~";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
37
homeConfigs/modules/vim.nix
Normal file
37
homeConfigs/modules/vim.nix
Normal file
@ -0,0 +1,37 @@
|
||||
{config, lib, pkgs, ...}:
|
||||
|
||||
{
|
||||
options.mods.vim.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "install and configure vim";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mods.vim.enable {
|
||||
home.packages = with pkgs; [
|
||||
clang-tools
|
||||
neovim
|
||||
nixd
|
||||
nodejs_23
|
||||
];
|
||||
|
||||
home.file = {
|
||||
".config/nvim/init.vim".source = ../dotfiles/config/nvim/init.vim;
|
||||
".vimrc".source = ../dotfiles/vimrc;
|
||||
|
||||
#install plug.vim
|
||||
".local/share/nvim/site/autoload/plug.vim".source = "${builtins.fetchGit {
|
||||
url = "https://github.com/junegunn/vim-plug";
|
||||
rev = "d80f495fabff8446972b8695ba251ca636a047b0";
|
||||
ref = "master";
|
||||
}}/plug.vim";
|
||||
|
||||
#install stdheader 42
|
||||
".config/nvim/plugin/stdheader.vim".source = "${builtins.fetchGit {
|
||||
url = "https://github.com/42Paris/42header";
|
||||
rev = "71e6a4df6d72ae87a080282bf45bb993da6146b2";
|
||||
ref = "master";
|
||||
}}/plugin/stdheader.vim";
|
||||
};
|
||||
};
|
||||
}
|
28
homeConfigs/modules/wayland/hypridle.nix
Normal file
28
homeConfigs/modules/wayland/hypridle.nix
Normal file
@ -0,0 +1,28 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
{
|
||||
config = lib.mkIf config.mods.hyprland.enable {
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general.lock_cmd = "hyprlock";
|
||||
general.before_sleep_cmd = "loginctl lock-session";
|
||||
listener = [
|
||||
{
|
||||
timeout = 150;
|
||||
on-timeout = "brightnessctl -s set 0";
|
||||
on-resume = "brightnessctl -r";
|
||||
}
|
||||
{
|
||||
timeout = 150;
|
||||
on-timeout = "loginctl lock-session";
|
||||
}
|
||||
{
|
||||
timeout = 600;
|
||||
on-timeout = "systemctl suspend";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
175
homeConfigs/modules/wayland/hyprland.nix
Normal file
175
homeConfigs/modules/wayland/hyprland.nix
Normal file
@ -0,0 +1,175 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
options.mods.hyprland.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "install and configure hyprland and others";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mods.hyprland.enable {
|
||||
|
||||
wayland.windowManager.hyprland.enable = true;
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
"$mainMod" = "SUPER";
|
||||
bind = [
|
||||
" , Print, exec, grim -t jpeg -g \"$(slurp)\" ~/screenshots/$(date +%Y-%m-%d_%H-%m-%s).jpg"
|
||||
"$mainMod, Return, exec, alacritty"
|
||||
"CTRL_ALT, Q, killactive,"
|
||||
"SUPER_ALT, Q, exit,"
|
||||
"$mainMod, S, togglefloating,"
|
||||
"$mainMod, D, exec, rofi -show drun -show-icons"
|
||||
"$mainMod, M, fullscreen, 1"
|
||||
"$mainMod, F, fullscreen, 0"
|
||||
|
||||
# Move focus
|
||||
"$mainMod, h, movefocus, l"
|
||||
"$mainMod, l, movefocus, r"
|
||||
"$mainMod, k, movefocus, u"
|
||||
"$mainMod, j, movefocus, d"
|
||||
|
||||
#swap windows
|
||||
"$mainMod SHIFT, h, swapwindow, l"
|
||||
"$mainMod SHIFT, l, swapwindow, r"
|
||||
"$mainMod SHIFT, k, swapwindow, u"
|
||||
"$mainMod SHIFT, j, swapwindow, d"
|
||||
|
||||
# Switch workspaces with mainMod + [0-9]
|
||||
"$mainMod, 1, workspace, 1"
|
||||
"$mainMod, 2, workspace, 2"
|
||||
"$mainMod, 3, workspace, 3"
|
||||
"$mainMod, 4, workspace, 4"
|
||||
"$mainMod, 5, workspace, 5"
|
||||
"$mainMod, 6, workspace, 6"
|
||||
"$mainMod, 7, workspace, 7"
|
||||
"$mainMod, 8, workspace, 8"
|
||||
"$mainMod, 9, workspace, 9"
|
||||
"$mainMod, 0, workspace, 10"
|
||||
|
||||
# Move active window to a workspace with mainMod + SHIFT + [0-9]
|
||||
"$mainMod SHIFT, 1, movetoworkspacesilent, 1"
|
||||
"$mainMod SHIFT, 2, movetoworkspacesilent, 2"
|
||||
"$mainMod SHIFT, 3, movetoworkspacesilent, 3"
|
||||
"$mainMod SHIFT, 4, movetoworkspacesilent, 4"
|
||||
"$mainMod SHIFT, 5, movetoworkspacesilent, 5"
|
||||
"$mainMod SHIFT, 6, movetoworkspacesilent, 6"
|
||||
"$mainMod SHIFT, 7, movetoworkspacesilent, 7"
|
||||
"$mainMod SHIFT, 8, movetoworkspacesilent, 8"
|
||||
"$mainMod SHIFT, 9, movetoworkspacesilent, 9"
|
||||
"$mainMod SHIFT, 0, movetoworkspacesilent, 10"
|
||||
|
||||
# Scroll through existing workspaces with mainMod + scroll
|
||||
"$mainMod, mouse_down, workspace, e+1"
|
||||
"$mainMod, mouse_up, workspace, e-1"
|
||||
];
|
||||
|
||||
bindm = [
|
||||
"$mainMod, mouse:272, movewindow"
|
||||
"$mainMod, mouse:273, resizewindow"
|
||||
];
|
||||
|
||||
bindel = [
|
||||
" ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
|
||||
" ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
|
||||
" ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
" ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
||||
" ,XF86MonBrightnessUp, exec, brightnessctl s 10%+"
|
||||
" ,XF86MonBrightnessDown, exec, brightnessctl s 10%-"
|
||||
" ,XF86KbdBrightnessUp, exec, asusctl -n"
|
||||
" ,XF86KbdBrightnessDown, exec, asusctl -p"
|
||||
];
|
||||
|
||||
bindl = [
|
||||
" , XF86AudioNext, exec, playerctl next"
|
||||
" , XF86AudioPause, exec, playerctl play-pause"
|
||||
" , XF86AudioPlay, exec, playerctl play-pause"
|
||||
" , XF86AudioPrev, exec, playerctl previous"
|
||||
];
|
||||
|
||||
windowrulev2 = [
|
||||
#ignore maximize requests
|
||||
"suppressevent maximize, class:.*"
|
||||
#fix dragging issues with xwayland
|
||||
"nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0"
|
||||
];
|
||||
|
||||
input = {
|
||||
kb_layout = "fr";
|
||||
kb_variant = "us";
|
||||
follow_mouse = 2;
|
||||
kb_options = "caps:none";
|
||||
touchpad.natural_scroll = false;
|
||||
};
|
||||
|
||||
misc = {
|
||||
force_default_wallpaper = 1;
|
||||
disable_hyprland_logo = true;
|
||||
};
|
||||
|
||||
dwindle = {
|
||||
pseudotile = true;
|
||||
force_split = 2;
|
||||
};
|
||||
|
||||
animations = {
|
||||
enabled = true;
|
||||
|
||||
bezier = [
|
||||
"easeInOut, 0.77, 0, 0.175, 1"
|
||||
"easeOut, 0.24, 0.66, 0.04, 1"
|
||||
];
|
||||
|
||||
animation = [
|
||||
"windows, 1, 2, easeInOut"
|
||||
"windowsIn, 1, 2, easeInOut, slide"
|
||||
"windowsOut, 1, 2, easeInOut, slide"
|
||||
"fade, 1, 2, easeInOut"
|
||||
"workspaces, 1, 2, easeOut"
|
||||
];
|
||||
};
|
||||
|
||||
decoration = {
|
||||
rounding = 10;
|
||||
|
||||
shadow = {
|
||||
enabled = true;
|
||||
range = 4;
|
||||
render_power = 3;
|
||||
color = "rgba(1a1a1aee)";
|
||||
};
|
||||
|
||||
blur = {
|
||||
enabled = true;
|
||||
size = 3;
|
||||
passes = 1;
|
||||
vibrancy = 0.1696;
|
||||
};
|
||||
};
|
||||
|
||||
general = {
|
||||
gaps_in = 3;
|
||||
gaps_out = 7;
|
||||
border_size = 2;
|
||||
"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
|
||||
"col.inactive_border" = "rgba(595959aa)";
|
||||
resize_on_border = false;
|
||||
allow_tearing = false;
|
||||
layout = "dwindle";
|
||||
};
|
||||
|
||||
cursor.no_warps = true;
|
||||
|
||||
env = [
|
||||
"HYPRCURSOR_SIZE,17"
|
||||
"HYPRCURSOR_THEME,bibata-modern-classic"
|
||||
];
|
||||
|
||||
exec-once = [
|
||||
"swaybg -i ~/.config/nitrogen/wallpaper.png&"
|
||||
"(sleep 2;activate-linux)&"
|
||||
"waybar&"
|
||||
"alacritty&"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
32
homeConfigs/modules/wayland/hyprlock.nix
Normal file
32
homeConfigs/modules/wayland/hyprlock.nix
Normal file
@ -0,0 +1,32 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
{
|
||||
config = lib.mkIf config.mods.hyprland.enable {
|
||||
programs.hyprlock.enable = true;
|
||||
programs.hyprlock.settings = {
|
||||
general = {
|
||||
no_fade_out = true;
|
||||
ignore_empty_input = false;
|
||||
};
|
||||
|
||||
background = {
|
||||
monitor = "";
|
||||
path = "~/.config/nitrogen/wallpaper.png";
|
||||
blur_passes = 1;
|
||||
};
|
||||
|
||||
input-field = {
|
||||
monitor = "";
|
||||
size = "300, 50";
|
||||
dot_size = "0.2";
|
||||
dots_fade_time = 100;
|
||||
inner_color = "rgb(139,89,100)";
|
||||
outer_color = "rgb(139,89,100)";
|
||||
outline_thickness = 1;
|
||||
|
||||
fail_transition = "300";
|
||||
fail_text = "learn to write, idiot";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
13
homeConfigs/modules/wayland/packages.nix
Normal file
13
homeConfigs/modules/wayland/packages.nix
Normal file
@ -0,0 +1,13 @@
|
||||
{ pkgs, lib, config, ... }:
|
||||
|
||||
{
|
||||
config = lib.mkIf config.mods.hyprland.enable {
|
||||
home.packages = with pkgs; [
|
||||
rofi-wayland
|
||||
grim
|
||||
slurp
|
||||
wl-clipboard
|
||||
swaybg
|
||||
];
|
||||
};
|
||||
}
|
149
homeConfigs/modules/wayland/waybar.nix
Normal file
149
homeConfigs/modules/wayland/waybar.nix
Normal file
@ -0,0 +1,149 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config = lib.mkIf config.mods.hyprland.enable {
|
||||
programs.waybar.enable = true;
|
||||
programs.waybar.style = ''
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: "Iosevka Nerd Font";
|
||||
font-size: 15px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: transparent;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#window {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 0 5px;
|
||||
background: transparent;
|
||||
color: white;
|
||||
border-top: 2px solid transparent;
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
color: #c9545d;
|
||||
border-top: 2px solid #c9545d;
|
||||
}
|
||||
|
||||
#workspaces button.active {
|
||||
color : #88ff88;
|
||||
background-color : rgba(220,255, 220, 0.3)
|
||||
}
|
||||
|
||||
#mode {
|
||||
background: #64727D;
|
||||
border-bottom: 3px solid white;
|
||||
}
|
||||
|
||||
#network.disconnected {
|
||||
color: #f53c3c;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
#temperature.critical {
|
||||
color: #ff2222;
|
||||
}
|
||||
'';
|
||||
|
||||
programs.waybar.settings.mainBar = {
|
||||
layer = "top";
|
||||
position ="top";
|
||||
height = 24;
|
||||
margin-left = 5;
|
||||
margin-right = 5;
|
||||
modules-left = ["hyprland/workspaces" "custom/music"];
|
||||
modules-center = ["hyprland/window"];
|
||||
modules-right = ["disk" "pulseaudio" "network" "custom/pipe" "cpu" "temperature" "custom/pipe" "memory" "battery" "clock"];
|
||||
|
||||
"hyprland/workspaces" = {
|
||||
disable-scroll = true;
|
||||
all-outputs = false;
|
||||
format = "{id}";
|
||||
};
|
||||
|
||||
clock = {
|
||||
interval = 1;
|
||||
format-alt = " {:%Y-%m-%d}";
|
||||
format = " {:%H:%M:%S}";
|
||||
};
|
||||
|
||||
cpu = {
|
||||
format = " {usage}% |";
|
||||
interval = 5;
|
||||
};
|
||||
|
||||
memory = {
|
||||
format = " {}% |";
|
||||
interval = 5;
|
||||
};
|
||||
|
||||
battery = {
|
||||
bat = "BAT0";
|
||||
states = {
|
||||
good = 79;
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format-time = " {H}:{m}";
|
||||
format = " {icon} {capacity}%{time} |";
|
||||
format-icons = [" " " " " " " " " "];
|
||||
interval = 10;
|
||||
};
|
||||
|
||||
network = {
|
||||
format-wifi = " {icon} {essid} ";
|
||||
format-ethernet = " {ifname}: {ipaddr}/{cidr} ";
|
||||
format-disconnected = " ⚠ Disconnected ";
|
||||
format-icons =[" " " " " " " "];
|
||||
};
|
||||
|
||||
pulseaudio = {
|
||||
format = " {icon}{volume}% |";
|
||||
format-bluetooth = " {icon} {volume}% |";
|
||||
format-muted = "";
|
||||
format-icons = {
|
||||
headphones = " ";
|
||||
handsfree = " ";
|
||||
headset = " ";
|
||||
phone = " ";
|
||||
portable = " ";
|
||||
car = " ";
|
||||
default = [" " " " " "];
|
||||
};
|
||||
on-click = "pavucontrol";
|
||||
};
|
||||
|
||||
temperature = {
|
||||
thermal-zone = 0;
|
||||
critical-threshold = 80;
|
||||
interval = 5;
|
||||
format =" {icon} {temperatureC}°C ";
|
||||
format-icons = ["" "" "" "" ""];
|
||||
};
|
||||
|
||||
disk = {
|
||||
format =" {percentage_used}% |";
|
||||
};
|
||||
|
||||
"custom/pipe" = {
|
||||
format = "|";
|
||||
};
|
||||
|
||||
"custom/music" = {
|
||||
exec-if = "playerctl metadata 2>&1 >/dev/null";
|
||||
exec = "playerctl metadata --format ' {{ artist }} - {{title}}'";
|
||||
interval = 1;
|
||||
interval-if = 5;
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
}
|
39
homeConfigs/modules/x11/bspwm.nix
Normal file
39
homeConfigs/modules/x11/bspwm.nix
Normal file
@ -0,0 +1,39 @@
|
||||
# **************************************************************************** #
|
||||
# #
|
||||
# ::: :::::::: #
|
||||
# bspwm.nix :+: :+: :+: #
|
||||
# +:+ +:+ +:+ #
|
||||
# By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2025/02/10 00:21:11 by tomoron #+# #+# #
|
||||
# Updated: 2025/02/10 00:30:13 by tomoron ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
{lib, config, ... }:
|
||||
|
||||
{
|
||||
config = lib.mkIf config.mods.x11.enable {
|
||||
xsession.windowManager.bspwm.enable = true;
|
||||
xsession.windowManager.bspwm.extraConfig = ''
|
||||
#/bin/sh
|
||||
pgrep sxhkd > /dev/null || sxhkd &
|
||||
pgrep polybar >/dev/null || polybar -q main -c "$HOME/.config/polybar/config.ini"&
|
||||
|
||||
bspc config border_width 2
|
||||
bspc config window_gap 10
|
||||
|
||||
bspc config split_ratio 0.52
|
||||
bspc config borderless_monocle true
|
||||
bspc config gapless_monocle true
|
||||
|
||||
pgrep alacritty > /dev/null || alacritty &
|
||||
pgrep picom > /dev/null || picom &
|
||||
pgrep dunst >/dev/null || dunst &
|
||||
numlockx on &
|
||||
setxkbmap fr us&
|
||||
nitrogen --restore &
|
||||
pgrep activate-linux >/dev/null || (sleep 2;activate-linux -d)&
|
||||
''; # this is messy but i don't care, x11 isn't my default now.
|
||||
|
||||
};
|
||||
}
|
27
homeConfigs/modules/x11/picom.nix
Normal file
27
homeConfigs/modules/x11/picom.nix
Normal file
@ -0,0 +1,27 @@
|
||||
{ config, lib, pkgs, username,homeDir, ... }:
|
||||
|
||||
{
|
||||
config = lib.mkIf config.mods.x11.enable {
|
||||
services.picom = {
|
||||
enable = true;
|
||||
package = pkgs.picom-pijulius;
|
||||
backend = lib.mkDefault "glx";
|
||||
vSync = true;
|
||||
settings = {
|
||||
blur = {
|
||||
method = lib.mkDefault "gaussian";
|
||||
size = lib.mkDefault 20;
|
||||
deviation = lib.mkDefault 5.0;
|
||||
};
|
||||
corner-radius=20;
|
||||
rounded-corners-exclude = [
|
||||
"window_type = 'dock'"
|
||||
"class_g = 'Dunst'"
|
||||
];
|
||||
blur-background-exclude = [
|
||||
"class_g = 'activate-linux'"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
236
homeConfigs/modules/x11/polybar.nix
Normal file
236
homeConfigs/modules/x11/polybar.nix
Normal file
@ -0,0 +1,236 @@
|
||||
# **************************************************************************** #
|
||||
# #
|
||||
# ::: :::::::: #
|
||||
# polybar.nix :+: :+: :+: #
|
||||
# +:+ +:+ +:+ #
|
||||
# By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2025/02/10 02:51:32 by tomoron #+# #+# #
|
||||
# Updated: 2025/02/10 03:19:27 by tomoron ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
{ lib, config, ... }:
|
||||
|
||||
{
|
||||
config = lib.mkIf config.mods.x11.enable {
|
||||
services.polybar.enable = true;
|
||||
services.polybar.config = {
|
||||
"global/wm" = {
|
||||
margin-bottom = 0;
|
||||
margin-top = 0;
|
||||
};
|
||||
|
||||
color = {
|
||||
background = "#AA111111";
|
||||
foreground = "#CCCCCC";
|
||||
foreground-alt = "#FFFFFF";
|
||||
alpha = "#00000000";
|
||||
|
||||
shade1 = "#AAFFFFFF";
|
||||
shade2 = "#AAFF0000";
|
||||
};
|
||||
|
||||
"module/memory" = {
|
||||
type = "internal/memory";
|
||||
interval = 1;
|
||||
format = "<label>";
|
||||
format-prefix = "";
|
||||
format-prefix-font = 2;
|
||||
format-padding = 1;
|
||||
label = " %percentage_used%%";
|
||||
};
|
||||
|
||||
"module/filesystem" = {
|
||||
type = "internal/fs";
|
||||
mount-0 = "/";
|
||||
interval = 30;
|
||||
fixed-values = true;
|
||||
format-mounted = "<label-mounted>";
|
||||
format-mounted-prefix = "";
|
||||
format-mounted-prefix-font = 2;
|
||||
format-mounted-padding = 2;
|
||||
label-mounted = " %percentage_used%%";
|
||||
label-unmounted = " %mountpoint%: not mounted";
|
||||
};
|
||||
|
||||
"module/cpu" = {
|
||||
type = "internal/cpu";
|
||||
interval = 1;
|
||||
format = "<label>";
|
||||
format-prefix = " ";
|
||||
format-prefix-font = 2;
|
||||
format-foreground = "\${color.foreground}";
|
||||
format-padding = 1;
|
||||
label = " %percentage%%";
|
||||
};
|
||||
|
||||
"module/temperature" = {
|
||||
type = "internal/temperature";
|
||||
interval = 1;
|
||||
thermal-zone = 0;
|
||||
hwmon-path = "/sys/devices/virtual/thermal/thermal_zone0/temp";
|
||||
warn-temperature = 80;
|
||||
units = true;
|
||||
format = "<ramp> <label>";
|
||||
format-padding = 1;
|
||||
format-warn = "<ramp> <label-warn>";
|
||||
format-warn-foreground = "#FF0000";
|
||||
format-warn-padding = 1;
|
||||
label = "%temperature-c%";
|
||||
label-warn = "%temperature-c%";
|
||||
ramp-0 = "";
|
||||
ramp-1 = "";
|
||||
ramp-2 = "";
|
||||
ramp-3 = "";
|
||||
ramp-4 = "";
|
||||
ramp-font = 2;
|
||||
};
|
||||
|
||||
"module/sep" = {
|
||||
type = "custom/text";
|
||||
content = "|";
|
||||
content-foreground = "#FFFFFF";
|
||||
};
|
||||
|
||||
"module/space" = {
|
||||
type = "custom/text";
|
||||
content = " ";
|
||||
content-padding=1;
|
||||
};
|
||||
|
||||
"module/network" = {
|
||||
type = "internal/network";
|
||||
interface = "wlp2s0";
|
||||
interval = 1.0;
|
||||
accumulate-stats = true;
|
||||
unknown-as-up = true;
|
||||
format-connected = "<ramp-signal><label-connected>";
|
||||
format-connected-prefix = "";
|
||||
format-connected-prefix-font = 2;
|
||||
format-connected-padding = 1;
|
||||
format-disconnected = "<label-disconnected>";
|
||||
format-disconnected-prefix = " ";
|
||||
format-disconnected-prefix-font = 2;
|
||||
format-disconnected-padding = 1;
|
||||
label-connected = "%{A1:networkmanager_dmenu &:} %essid%%{A}";
|
||||
label-disconnected = "%{A1:networkmanager_dmenu &:}%{A}";
|
||||
ramp-signal-0 = " ";
|
||||
ramp-signal-1 = " ";
|
||||
ramp-signal-2 = " ";
|
||||
};
|
||||
|
||||
"module/date" = {
|
||||
type = "internal/date";
|
||||
interval = 1.0;
|
||||
time = " %H:%M:%S";
|
||||
time-alt = " %a, %d %b %Y";
|
||||
format = "<label>";
|
||||
format-prefix = " ";
|
||||
format-prefix-font = 2;
|
||||
format-foreground = "\${color.foreground}";
|
||||
format-padding = 1;
|
||||
label = "%time%";
|
||||
};
|
||||
|
||||
"module/workspaces" = {
|
||||
type = "internal/xworkspaces";
|
||||
pin-workspaces = false;
|
||||
enable-click = true;
|
||||
enable-scroll = false;
|
||||
icon-0 = "1;1";
|
||||
icon-1 = "2;2";
|
||||
icon-2 = "3;3";
|
||||
icon-3 = "4;4";
|
||||
icon-4 = "5;5";
|
||||
icon-5 = "A;A";
|
||||
icon-6 = "B;B";
|
||||
icon-default = 0;
|
||||
format = "<label-state>";
|
||||
format-font = 3;
|
||||
format-background = "#0000FF";
|
||||
format-foreground = "#FF0000";
|
||||
label-monitor = "%name%";
|
||||
label-active = "%icon%";
|
||||
label-active-background = "#44ffffff";
|
||||
label-active-foreground = "#00FF00";
|
||||
label-occupied = "%icon%";
|
||||
label-occupied-background = "#00FFFFFF";
|
||||
label-occupied-foreground = "#00FF00";
|
||||
label-urgent = "%icon%";
|
||||
label-urgent-background = "\${color.background}";
|
||||
label-urgent-foreground = "#CC6666";
|
||||
label-empty = "%icon%";
|
||||
label-empty-background = "#0000FFFF";
|
||||
label-empty-foreground = "#FFFFFF";
|
||||
label-active-padding = 1.85;
|
||||
label-urgent-padding = 1.85;
|
||||
label-occupied-padding = 1.85;
|
||||
label-empty-padding = 1.85;
|
||||
};
|
||||
|
||||
"module/mpris" = {
|
||||
type = "custom/script";
|
||||
exec-if = "playerctl metadata";
|
||||
exec = "playerctl metadata --format '{{ playerName }}:{{ artist }} - {{title}}'";
|
||||
interval = 1;
|
||||
interval-if = 1;
|
||||
};
|
||||
|
||||
"bar/main" = {
|
||||
monitor = "\${env:MONITOR:}";
|
||||
monitor-fallback = "";
|
||||
monitor-strict = false;
|
||||
override-redirect = false;
|
||||
bottom = false;
|
||||
fixed-center = true;
|
||||
width = "100%";
|
||||
height = 40;
|
||||
offset-x = 0;
|
||||
offset-y = 0;
|
||||
background = "\${color.alpha}";
|
||||
foreground = "\${color.foreground}";
|
||||
radius-top = 0.0;
|
||||
radius-bottom = 0.0;
|
||||
underline-size = 2;
|
||||
underline-color = "\${color.foreground}";
|
||||
border-size = 0;
|
||||
border-color = "\${color.background}";
|
||||
padding = 0;
|
||||
module-margin-left = 0;
|
||||
module-margin-right = 0;
|
||||
font-0 = "Iosevka Nerd Font:style=Bold:pixelsize=13;4";
|
||||
font-1 = "Iosevka Nerd Font:style=Bold:pixelsize=15;4";
|
||||
font-2 = "Iosevka Nerd Font:style=Bold:pixelsize=15;4";
|
||||
modules-left = "workspaces space mpris";
|
||||
modules-center = "";
|
||||
modules-right = "memory sep filesystem sep cpu sep temperature sep network sep date";
|
||||
separator = "";
|
||||
dim-value = 1.0;
|
||||
tray-position = "none";
|
||||
tray-detached = false;
|
||||
tray-maxsize = 16;
|
||||
tray-background = "\${color.background}";
|
||||
tray-offset-x = 0;
|
||||
tray-offset-y = 0;
|
||||
tray-padding = 0;
|
||||
tray-scale = 1.0;
|
||||
enable-ipc = true;
|
||||
};
|
||||
|
||||
settings = {
|
||||
throttle-output = 5;
|
||||
throttle-output-for = 10;
|
||||
screenchange-reload = false;
|
||||
|
||||
compositing-background = "source";
|
||||
compositing-foreground = "over";
|
||||
compositing-overline = "over";
|
||||
compositing-underline = "over";
|
||||
compositing-border = "over";
|
||||
|
||||
pseudo-transparency = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
77
homeConfigs/modules/x11/sxhkd.nix
Normal file
77
homeConfigs/modules/x11/sxhkd.nix
Normal file
@ -0,0 +1,77 @@
|
||||
# **************************************************************************** #
|
||||
# #
|
||||
# ::: :::::::: #
|
||||
# sxhkd.nix :+: :+: :+: #
|
||||
# +:+ +:+ +:+ #
|
||||
# By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2025/02/10 00:32:47 by tomoron #+# #+# #
|
||||
# Updated: 2025/02/10 01:17:29 by tomoron ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
{ lib, config, ... }:
|
||||
|
||||
{
|
||||
config = lib.mkIf config.mods.x11.enable {
|
||||
services.sxhkd.enable = true;
|
||||
services.sxhkd.keybindings = {
|
||||
"super + Return" = "alacritty";
|
||||
"super + d" = "dmenu_run";
|
||||
"super + shift + d" = "dmenu_run";
|
||||
"super + Escape" = "pkill -USR1 -x sxhkd";
|
||||
|
||||
"super + alt + {q,r}" = "bspc {quit,wm -r}";
|
||||
"control + alt + {_,shift + }q" = "bspc node -{c,k}";
|
||||
|
||||
"super + m" = "bspc desktop -l next";
|
||||
"super + y" = "bspc node newest.marked.local -n newest.!automatic.local";
|
||||
|
||||
"super + g" = "bspc node -s biggest.window";
|
||||
|
||||
"super + {t,shift + t,s,f}" = "bspc node -t {tiled,pseudo_tiled,floating,fullscreen}";
|
||||
"super + ctrl + {m,x,y,z}" = "bspc node -g {marked,locked,sticky,private}";
|
||||
|
||||
"super + {_,shift + }{h,j,k,l}" = "bspc node -{f,s} {west,south,north,east}";
|
||||
"super + {p,b,comma,period}" = "bspc node -f @{parent,brother,first,second}";
|
||||
"super + {_,shift + }c" = "bspc node -f {next,prev}.local.!hidden.window";
|
||||
|
||||
"super + bracket{left,right}" = "bspc desktop -f {prev,next}.local";
|
||||
"super + {grave,Tab}" = "bspc {node,desktop} -f last";
|
||||
|
||||
"super + {_,shift + }{1-9,0}" = "bspc {desktop -f,node -d} '^{1-9,10}'";
|
||||
|
||||
#
|
||||
# preselect
|
||||
#
|
||||
"super + ctrl + {h,j,k,l}" = "bspc node -p {west,south,north,east}";
|
||||
"super + ctrl + {1-9}" = "bspc node -o 0.{1-9}";
|
||||
"super + ctrl + space" = "bspc node -p cancel";
|
||||
"super + ctrl + shift + space" = "bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel";
|
||||
|
||||
#
|
||||
# move/resize
|
||||
#
|
||||
|
||||
"super + alt + {h,j,k,l}" = "bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}";
|
||||
"super + alt + shift + {h,j,k,l}" = "bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}";
|
||||
"super + {Left,Down,Up,Right}" = "bspc node -v {-20 0,0 20,0 -20,20 0}";
|
||||
|
||||
"XF86AudioLowerVolume" = "pactl set-sink-volume @DEFAULT_SINK@ -5%";
|
||||
|
||||
"XF86AudioRaiseVolume" = "pactl set-sink-volume @DEFAULT_SINK@ +5%";
|
||||
"XF86AudioMute" = "pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||
"XF86MonBrightnessUp" = "brightness up";
|
||||
"XF86MonBrightnessDown" = "brightness down";
|
||||
|
||||
"alt + F7" = "brightnessctl s 10-";
|
||||
"alt + F8" = "brightnessctl s 10+";
|
||||
|
||||
"super + shift + o" = "playerctl play-pause";
|
||||
"super + shift + p" = "playerctl previous";
|
||||
"super + shift + n" = "playerctl next";
|
||||
"super + shift + alt + b" = "polybar-msg cmd hide";
|
||||
"super + shift + b" = "polybar-msg cmd show";
|
||||
};
|
||||
};
|
||||
}
|
16
homeConfigs/modules/x11/x11.nix
Normal file
16
homeConfigs/modules/x11/x11.nix
Normal file
@ -0,0 +1,16 @@
|
||||
{ lib, pkgs, config , ... }:
|
||||
|
||||
{
|
||||
options.mods.x11.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "configure x11";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mods.x11.enable {
|
||||
home.packages = with pkgs; [
|
||||
nitrogen
|
||||
numlockx
|
||||
];
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user