diff --git a/configuration.nix b/configuration.nix index 7ea8da1..24e3566 100644 --- a/configuration.nix +++ b/configuration.nix @@ -17,7 +17,7 @@ }; }; - boot.initrd.kernelModules = [ "amdgpu" ]; + boot.initrd.kernelModules = [ "amdgpu" "coretemp"]; services.hardware.bolt.enable = true; @@ -55,7 +55,7 @@ displayManager = { setupCommands = '' - ${pkgs.xorg.xrandr}/bin/xrandr --output eDP-1 --mode 3840x2160; + ${pkgs.xorg.xrandr}/bin/xrandr --output eDP-1 --dpi 240 --mode 3840x2160; ''; }; @@ -107,6 +107,14 @@ # Allow unfree packages nixpkgs.config.allowUnfree = true; + nixpkgs.config = { + packageOverrides = pkgs: rec { + polybar = pkgs.polybar.override { + i3Support = true; + }; + }; + }; + # systemwide packages environment.systemPackages = with pkgs; [ vim diff --git a/home.nix b/home.nix index 96c788b..4e5ae21 100644 --- a/home.nix +++ b/home.nix @@ -28,6 +28,8 @@ in ./programm_configs/zsh.nix ./programm_configs/gnome.nix ./programm_configs/autorandr.nix + ./programm_configs/polybar/polybar.nix + ./programm_configs/redshift.nix ]; # The home.packages option allows you to install Nix packages into your @@ -44,12 +46,14 @@ in arandr thunderbird signal-desktop - redshift nextcloud-client nixpkgs-fmt powerline-fonts + font-manager ]; + fonts.fontconfig.enable = true; + # dotfiles home.file = { rofitheme = { diff --git a/programm_configs/i3.nix b/programm_configs/i3.nix index 143c44c..15b6ab1 100644 --- a/programm_configs/i3.nix +++ b/programm_configs/i3.nix @@ -7,6 +7,7 @@ in xsession.windowManager.i3 = { enable = true; config = { + bars = [ ]; modifier = mod; fonts = { names = [ "DejaVu Sans Mono" "FontAwesome 6" ]; @@ -28,6 +29,25 @@ in # Terminal "${mod}+Return" = "exec alacritty"; }; + + + startup = [ + { + command = "systemctl --user restart polybar"; + always = true; + notification = false; + } + { + command = "nextcloud"; + always = true; + notification = false; + } + { + command = "systemcrl --user restart redshift"; + always = true; + notification = false; + } + ]; }; extraConfig = "floating_modifier ${mod}\n diff --git a/programm_configs/polybar/polybar.nix b/programm_configs/polybar/polybar.nix new file mode 100644 index 0000000..4dcfe90 --- /dev/null +++ b/programm_configs/polybar/polybar.nix @@ -0,0 +1,199 @@ +{ pkgs, ... }: +let + colors = { + background = "#222"; + background-alt = "#444"; + foreground = "#dfdfdf"; + foreground-alt = "#555"; + primary = "#ffb52a"; + secondary = "#e60053"; + alert = "#bd2c40"; + accent = "#ffbb00"; + }; +in +{ + services.polybar = { + + enable = true; + script = "polybar main &"; + config = { + "bar/main" = { + dpi = 100; + width = "100%"; + height = 30; + offset-x = "1%"; + offset-y = "1%"; + radius = "10.0"; + fixed-center = false; + background = colors.background; + foreground = colors.foreground; + underline-size = 3; + underline-color = "#f00"; + border-size = 4; + padding-left = 0; + padding-right = 2; + module-margin-left = 1; + module-margin-right = 2; + border-top-size = 4; + + font-0 = "DejaVu Sans Mono:style=Book:size=10"; + font-1 = "Siji:style=Regular"; + + modules-left = "i3"; + modules-right = "filesystem pulseaudio memory cpu wlan eth battery temperature date tray"; + wm-restack = "i3"; + + cursor-click = "pointer"; + cursor-scroll = "ns-resize"; + + }; + + "module/cpu" = { + type = "internal/cpu"; + interval = 2; + format-prefix = "CPU "; + format-prefix-foreground = colors.foreground-alt; + format-underline = "#f90000"; + label = "%percentage:2%%"; + }; + + "module/filesystem" = { + type = "internal/fs"; + interval = 25; + + mount-0 = "/"; + + label-mounted = "%{F#0a81f5}%mountpoint%%{F-}: %percentage_used%%"; + label-unmounted = "%mountpoint% not mounted"; + format-mounted-background = colors.background; + }; + + "module/eth" = { + type = "internal/network"; + interface = "enp12s0"; + interval = "3.0"; + interface-type = "wired"; + + format-connected-underline = "#55aa55"; + format-connected-prefix-foreground = colors.foreground-alt; + label-connected = "%local_ip%"; + + format-disconnected = ""; + label-disconnected = "%ifname% disconnected"; + format-disconnected-underline = "#2f5e2f"; + + }; + + "module/date" = { + type = "internal/date"; + interval = "5"; + + date = ""; + date-alt = "%d.%m.%Y"; + + time = "%H:%M"; + time-alt = "%H:%M:%S"; + + format-prefix-foreground = colors.foreground-alt; + format-underline = "#0a6cf5"; + + label = "%date% %time%"; + }; + + + "module/i3" = { + type = "internal/i3"; + format = " "; + index-sort = true; + wrapping-scroll = false; + + label-mode-padding = 2; + label-mode-foreground = "#000"; + label-mode-background = colors.primary; + + #focused = Active workspace on focused monitor + label-focused = "%index%"; + label-focused-background = colors.background-alt; + label-focused-underline = colors.primary; + label-focused-padding = 2; + + #unfocused = Inactive workspace on any monitor + label-unfocused = "%index%"; + label-unfocused-padding = 2; + + #visible = Active workspace on unfocused monitor + label-visible = "%index%"; + label-visible-background = colors.background-alt; + label-visible-underline = colors.primary; + label-visible-padding = 2; + + #urgent = Workspace with urgency hint set + label-urgent = "%index%"; + label-urgent-background = colors.alert; + label-urgent-padding = 2; + }; + + "module/tray" = { + type = "internal/tray"; + tray-spacing = 6; + }; + "module/battery" = { + type = "internal/battery"; + battery = "BAT0"; + adapter = "AC"; + full-at = 94; + + format-charging = " "; + format-charging-underline = "#ffb52a"; + + format-discharging = " "; + format-discharging-underline = "#ffb52a"; + + + animation-charging-0 = "|– |"; + animation-charging-1 = "|–– |"; + animation-charging-2 = "|–––|"; + animation-charging-foreground = colors.foreground-alt; + animation-charging-framerate = 750; + + animation-discharging-0 = "|–––|"; + animation-discharging-1 = "|–– |"; + animation-discharging-2 = "|– |"; + animation-discharging-foreground = colors.foreground-alt; + animation-discharging-framerate = 750; + }; + + "module/temperature" = { + type = "internal/temperature"; + thermal-zone = 0; + warn-temperature = 70; + + format = "