diff --git a/flake.nix b/flake.nix index 300a174..8d263fb 100644 --- a/flake.nix +++ b/flake.nix @@ -32,7 +32,7 @@ { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = inputs; + home-manager.extraSpecialArgs = inputs // specialArgs; home-manager.users.${username} = import ./users/${username}/home.nix; } diff --git a/home/core.nix b/home/core.nix index c386cfb..93e803e 100644 --- a/home/core.nix +++ b/home/core.nix @@ -3,6 +3,6 @@ inherit username; homeDirectory = "/home/${username}"; stateVersion = "24.05"; - } + }; programs.home-manager.enable = true; } \ No newline at end of file diff --git a/home/polybar/config.ini b/home/polybar/config.ini new file mode 100644 index 0000000..a302616 --- /dev/null +++ b/home/polybar/config.ini @@ -0,0 +1,231 @@ +;========================================================== +; +; +; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ +; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ +; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ +; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ +; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ +; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ +; +; +; To learn more about how to configure Polybar +; go to https://github.com/polybar/polybar +; +; The README contains a lot of information +; +;========================================================== + +[colors] +background = #282A2E +background-alt = #373B41 +foreground = #C5C8C6 +primary = #F0C674 +secondary = #8ABEB7 +alert = #A54242 +disabled = #707880 +rosewater = #f5e0dc +flamingo = #f2cdcd +pink = #f5c2e7 +mauve = #cba6f7 +red = #f38ba8 +maroon = #eba0ac +peach = #fab387 +yellow = #f9e2af +green = #a6e3a1 +teal = #94e2d5 +sky = #89dceb +sapphire = #74c7ec +blue = #89b4fa +lavender = #b4befe +text = #cdd6f4 +subtext1 = #bac2de +subtext0 = #a6adc8 +overlay2 = #9399b2 +overlay1 = #7f849c +overlay0 = #6c7086 +surface2 = #585b70 +surface1 = #45475a +surface0 = #313244 +base = #1e1e2e +mantle = #181825 +crust = #11111b +transparent = #FF00000 + +[bar/top] +width = 100% +height = 24pt +radius = 6 + +; dpi = 96 + +background = ${colors.base} +foreground = ${colors.text} + +line-size = 3pt + +border-size = 4pt +border-color = ${colors.crust} + +padding-left = 0 +padding-right = 1 + +module-margin = 1 + +separator = | +separator-foreground = ${colors.disabled} + +font-0 = FiraCode Nerd Font Mono;2 +font-1 = Symbols Nerd Font;2 + +modules-left = xworkspaces +modules-right = filesystem pulseaudio-control-output memory cpu wlan systray powermenu date + +cursor-click = pointer +cursor-scroll = ns-resize + +enable-ipc = true + +; wm-restack = generic +; wm-restack = bspwm +; wm-restack = i3 + +; override-redirect = true + + + + +[module/powermenu] +type = custom/menu + +label-open = %{T2}%{T-} +label-close = %{T2}%{T-} +label-open-foreground = ${colors.text} +label-open-padding = 1 +label-separator = " | " +label-padding = 2 + +menu-0-0 = %{T2}%{T-} +menu-0-0-exec = zenity --question --text="Shutdown now?" --title="Confirm Shutdown" && shutdown now +menu-0-0-foreground = ${colors.alert} + +menu-0-1 = %{T2}%{T-} +menu-0-1-exec = zenity --question --text="Reboot now?" --title="Confirm Reboot" && reboot +menu-0-1-foreground = ${colors.yellow} + + + + + +[module/systray] +type = internal/tray + +format-margin = 8pt +tray-spacing = 16pt + +[module/xworkspaces] +type = internal/xworkspaces + +label-active = %name% +label-active-background = ${colors.overlay0} +label-active-underline= ${colors.yellow} +label-active-padding = 1 + +label-occupied = %name% +label-occupied-padding = 1 + +label-urgent = %name% +label-urgent-background = ${colors.alert} +label-urgent-padding = 1 + +label-empty = %name% +label-empty-foreground = ${colors.disabled} +label-empty-padding = 1 + +[module/xwindow] +type = internal/xwindow +label = %title:0:60:...% + +[module/filesystem] +type = internal/fs +interval = 25 + +mount-0 = / +mount-1 = /home +mount-2 = /mnt/data + +label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%% + +label-unmounted = %mountpoint% not mounted +label-unmounted-foreground = ${colors.disabled} + +[module/pulseaudio-control-output] +type = custom/script +tail = true +format-underline = ${colors.cyan} +label-padding = 2 +label-foreground = ${colors.text} + +exec = pulseaudio-control --icons-volume "%{T2}%{T-},%{T2}%{T-}" --icon-muted "%{T2}%{T-} " --node-nicknames-from "device.description" --node-nickname "alsa_output.pci-0000_00_1f.3.analog-stereo:%{T2}󰓃%{T-} Speakers" --node-nickname "alsa_output.usb-SteelSeries_Arctis_Nova_7-00.analog-stereo:%{T2}󰋋%{T-} Headphones" listen +click-right = exec pavucontrol & +click-left = pulseaudio-control togmute +click-middle = pulseaudio-control --node-blacklist "alsa_output.pci-0000_01_00.1.hdmi-stereo" next-node +scroll-up = pulseaudio-control --volume-max 130 up +scroll-down = pulseaudio-control --volume-max 130 down + +[module/xkeyboard] +type = internal/xkeyboard +# blacklist-0 = num lock + +label-layout = %layout% +label-layout-foreground = ${colors.text} + +label-indicator-padding = 1 +label-indicator-margin = 1 +label-indicator-foreground = ${colors.text} +label-indicator-background = ${colors.surface0} + +[module/memory] +type = internal/memory +interval = 2 +format-prefix = "RAM " +format-prefix-foreground = ${colors.primary} +label = %percentage_used:2%% + +[module/cpu] +type = internal/cpu +interval = 2 +format-prefix = "CPU " +format-prefix-foreground = ${colors.primary} +label = %percentage:2%% + + +[module/wlan] +interface-type = wireless +type = internal/network +interval = 5 +format-connected = +format-disconnected = +label-connected = %signal%% %downspeed:9% %{T2}%{T-} %upspeed:9% %{T2}%{T-} +label-disconnected = %{T2}%{T-} +ramp-signal-0 = %{T2}󰤯%{T-} +ramp-signal-1 = %{T2}󰤟%{T-} +ramp-signal-2 = %{T2}󰤢%{T-} +ramp-signal-3 = %{T2}󰤥%{T-} +ramp-signal-4 = %{T2}󰤨%{T-} + +[module/date] +type = internal/date +interval = 1 + +date = %H:%M +date-alt = %A %d %B %Y %H:%M + +label = %date% +label-foreground = ${colors.primary} + +[settings] +screenchange-reload = true +pseudo-transparency = true + +; vim:ft=dosini \ No newline at end of file diff --git a/home/polybar/default.nix b/home/polybar/default.nix new file mode 100644 index 0000000..0c15bec --- /dev/null +++ b/home/polybar/default.nix @@ -0,0 +1,9 @@ +{ pkgs, config, ... }: + +{ + home.file.".config/polybar/config".source = ./config; + home.file.".config/polybar/launch.sh" = { + source = ./launch.sh; + executable = true; + }; +} diff --git a/home/polybar/launch.sh b/home/polybar/launch.sh new file mode 100644 index 0000000..ce342b2 --- /dev/null +++ b/home/polybar/launch.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# Terminate already running bar instances +killall -q polybar + +# Wait until the processes have been shut down +while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done + +# Launch bar1 and bar2 +MONITORS=$(xrandr --query | grep " connected" | cut -d" " -f1) + +MONITORS=$MONITORS polybar top; + +echo "Bars launched..." \ No newline at end of file diff --git a/hosts/vm/default.nix b/hosts/vm/default.nix index f2ce2ca..8ecb02d 100644 --- a/hosts/vm/default.nix +++ b/hosts/vm/default.nix @@ -16,7 +16,7 @@ useOSProber = true; }; - networking.hostName = "nixosvm"; # Define your hostname. + networking.hostName = "nixos"; # Define your hostname. networking.networkmanager.enable = true; diff --git a/modules/i3.nix b/modules/i3.nix index 0e6b1bc..2bc6fcf 100644 --- a/modules/i3.nix +++ b/modules/i3.nix @@ -6,6 +6,11 @@ enable = true; windowManager.i3 = { enable = true; + extraPackages = with pkgs; [ + rofi + picom + polybar + ]; }; displayManager = { lightdm.enable = true; @@ -14,12 +19,6 @@ layout = "fr"; variant = ""; }; - extraPackages = with pkgs; [ - i3status - dmenu - picom - arandr - ]; }; services.displayManager.defaultSession = "none+i3"; diff --git a/users/laurent/home.nix b/users/laurent/home.nix index 7100660..96e9944 100644 --- a/users/laurent/home.nix +++ b/users/laurent/home.nix @@ -3,8 +3,8 @@ { imports = [ ../../home/core.nix - ../../home/i3 + ../../home/polybar ]; programs.git = {