From 622a6afcb0249f50231bc92c53b977bb7361011b Mon Sep 17 00:00:00 2001 From: Adrian G L Date: Tue, 17 Sep 2024 18:14:26 +0200 Subject: [PATCH] wallpaper --- flake.nix | 8 +++ home/assets/default.nix | 19 +++++++ home/colors.nix | 26 --------- home/foot.nix | 37 +++++++++++- home/full.nix | 2 + home/sshconfig.nix | 35 ++++++++++++ home/stylix.nix | 42 ++++++++++++++ home/sway.nix | 35 ++++++------ home/wallpapers.nix | 18 ++++++ home/waybar.nix | 122 ++++++++++++++++++++++++---------------- 10 files changed, 250 insertions(+), 94 deletions(-) create mode 100644 home/assets/default.nix create mode 100644 home/stylix.nix create mode 100644 home/wallpapers.nix diff --git a/flake.nix b/flake.nix index 9fc0451..cdd9ced 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,11 @@ home-manager.inputs.nixpkgs.follows = "nixpkgs"; nix-colors.url = "github:misterio77/nix-colors"; + + # stylix.url = "github:bluskript/stylix/6bc871ab352c9f18d1179daab9e392a4d46393af"; + # stylix.inputs.nixpkgs.follows = "nixpkgs"; + # stylix.inputs.home-manager.follows = "home-manager"; + ozai.url = "git+https://git.pvv.ntnu.no/Projects/ozai.git"; ozai.inputs.nixpkgs.follows = "unstable"; @@ -65,6 +70,9 @@ home-manager.users."gunalx" = import ./home/full.nix; home-manager.extraSpecialArgs = {inherit nix-colors inputs;}; } + #need to choose one. The nixos one has bootloader and display manager in addition to the home manager one. + #inputs.stylix.nixosModules.stylix + #inputs.stylix.homeManagerModules.stylix ]; }; diff --git a/home/assets/default.nix b/home/assets/default.nix new file mode 100644 index 0000000..f256b12 --- /dev/null +++ b/home/assets/default.nix @@ -0,0 +1,19 @@ +{ stdenv, lib }: + +stdenv.mkDerivation rec { + pname = "wallpapers"; + version = "1.0"; + + src = ./; + + installPhase = '' + mkdir -p $out/share/wallpapers + cp -r * $out/share/wallpapers/ + ''; + + meta = with lib; { + description = "My Collection of wallpapers"; + license = licenses.unfree; + maintainers = with maintainers; [ adriangl ]; + }; +} diff --git a/home/colors.nix b/home/colors.nix index 3e7276d..e75f617 100644 --- a/home/colors.nix +++ b/home/colors.nix @@ -56,32 +56,6 @@ in{ }; }; - programs.foot.settings.colors = { - alpha = "0.85"; - #set based on https://github.com/tinted-theming/base16-foot/blob/main/colors/base16-apathy.ini and https://github.com/tinted-theming/base16-schemes/blob/main/apathy.yaml - foreground = "${config.colorScheme.palette.base05}"; - background = "${config.colorScheme.palette.base00}"; - - regular0 = "${config.colorScheme.palette.base00}"; - regular1 = "${config.colorScheme.palette.base08}"; - regular2 = "${config.colorScheme.palette.base0B}"; - regular3 = "${config.colorScheme.palette.base0A}"; - regular4 = "${config.colorScheme.palette.base0D}"; - regular5 = "${config.colorScheme.palette.base0E}"; - regular6 = "${config.colorScheme.palette.base0C}"; - regular7 = "${config.colorScheme.palette.base05}"; - - bright0 = "${config.colorScheme.palette.base03}"; - bright1 = "${config.colorScheme.palette.base08}"; - bright2 = "${config.colorScheme.palette.base0B}"; - bright3 = "${config.colorScheme.palette.base0A}"; - bright4 = "${config.colorScheme.palette.base0D}"; - bright5 = "${config.colorScheme.palette.base0E}"; - bright6 = "${config.colorScheme.palette.base0C}"; - bright7 = "${config.colorScheme.palette.base07}"; - selection-foreground = "${config.colorScheme.palette.base00}"; - selection-background = "${config.colorScheme.palette.base0A}"; - }; } diff --git a/home/foot.nix b/home/foot.nix index 0012a33..35519ad 100644 --- a/home/foot.nix +++ b/home/foot.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: +{ pkgs, lib, config, ... }: { home.packages = with pkgs; [ foot @@ -14,7 +14,40 @@ }; mouse = { hide-when-typing = "yes"; - }; + }; + + + colors = { + alpha = "0.7"; + #set based on https://github.com/tinted-theming/base16-foot/blob/main/colors/base16-apathy.ini and https://github.com/tinted-theming/base16-schemes/blob/main/apathy.yaml + + foreground = "${config.colorScheme.palette.base05}"; + background = "${config.colorScheme.palette.base00}"; + + regular0 = "${config.colorScheme.palette.base00}"; + regular1 = "${config.colorScheme.palette.base08}"; + regular2 = "${config.colorScheme.palette.base0B}"; + regular3 = "${config.colorScheme.palette.base0A}"; + regular4 = "${config.colorScheme.palette.base0D}"; + regular5 = "${config.colorScheme.palette.base0E}"; + regular6 = "${config.colorScheme.palette.base0C}"; + regular7 = "${config.colorScheme.palette.base05}"; + + bright0 = "${config.colorScheme.palette.base03}"; + bright1 = "${config.colorScheme.palette.base08}"; + bright2 = "${config.colorScheme.palette.base0B}"; + bright3 = "${config.colorScheme.palette.base0A}"; + bright4 = "${config.colorScheme.palette.base0D}"; + bright5 = "${config.colorScheme.palette.base0E}"; + bright6 = "${config.colorScheme.palette.base0C}"; + bright7 = "${config.colorScheme.palette.base07}"; + selection-foreground = "${config.colorScheme.palette.base00}"; + selection-background = "${config.colorScheme.palette.base0A}"; + }; + + + + }; diff --git a/home/full.nix b/home/full.nix index 1292885..22bfab2 100644 --- a/home/full.nix +++ b/home/full.nix @@ -6,6 +6,8 @@ ./sway.nix ./colors.nix + #./stylix.nix + #inputs.nix-colors.homeManagerModules.default ]; home.packages = with pkgs; [ diff --git a/home/sshconfig.nix b/home/sshconfig.nix index fa37969..2eaff63 100644 --- a/home/sshconfig.nix +++ b/home/sshconfig.nix @@ -13,6 +13,41 @@ programs.ssh = { enable = true; compression = true; + + matchBlocks = { + "*.ntnu.no !*.pvv.ntnu.no" = { + user="adriangl"; + proxyJump="isvegg.pvv.ntnu.no"; + }; + "snotra" = { + user="adriangl"; + proxyJump="isvegg.pvv.ntnu.no"; + host="snotra.idi.ntnu.no"; + }; + + #pvv + "pvv" = { + user="adriangl"; + host="login.pvv.ntnu.no"; + match="pvv"; + }; + "isvegg" = { + user="adriangl"; + host="isvegg.pvv.ntnu.no"; + }; + + #home + "aragon" = { + port = 6969; + user="gunalx"; + host = "100.74.34.149"; + + }; + + + + }; + extraConfig = ""; }; } diff --git a/home/stylix.nix b/home/stylix.nix new file mode 100644 index 0000000..672810c --- /dev/null +++ b/home/stylix.nix @@ -0,0 +1,42 @@ +{ pkgs, lib, ... }: +{ + + stylix.enable = true; + + stylix.image = ./assets/wallpaper.jpg; + + stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/apathy.yaml"; + + stylix.fonts = { + monospace = { + package = pkgs.nerdfonts.override {fonts = [“JetBrainsMono”];}; + name = “JetBrainsMono Nerd Font Mono”; + }; + sansSerif = { + package = pkgs.dejavu_fonts; + name = “DejaVu Sans”; + }; + serif = { + package = pkgs.dejavu_fonts; + name = “DejaVu Serif”; + }; + }; + + stylix.fonts.sizes = { + applications = 16; + terminal = 12; + desktop = 12; + popups = 12; + }; + + stylix.opacity = { + applications = 0.9; + terminal = 0.7; + desktop = 0.9; + popups = 0.9; + }; + + stylix.polarity = "dark"; # “light” or “either” + +} + diff --git a/home/sway.nix b/home/sway.nix index b1b523c..220c9d1 100644 --- a/home/sway.nix +++ b/home/sway.nix @@ -1,12 +1,11 @@ { pkgs, config, lib, ... }: let + wallpapers = import ./wallpaper.nix { inherit pkgs; }; palette = config.colorScheme.palette; in { imports = [ - #./fuzzle.nix - #./wofi.nix - #./waybar.nix + ./waybar.nix ./foot.nix ./fonts.nix ./kanshi.nix @@ -30,7 +29,8 @@ in wdisplays kanshi wlr-randr - swaybg + #swaybg + swww #bar applets and notifications waybar @@ -83,7 +83,7 @@ in ]; qt.enable = true; - qt.style.name = "breeze"; + qt.style.name = "adwaita-dark"; home.sessionVariables = { @@ -91,7 +91,7 @@ in MOZ_USE_XINPUT2 = "1"; XDG_SESSION_TYPE = "wayland"; XDG_CURRENT_DESKTOP = "sway"; - XKB_DEFAULT_OPTIONS = "terminate:ctrl_alt_bksp,caps:escape,altwin:swap_alt_win"; + XKB_DEFAULT_OPTIONS = "terminate:ctrl_alt_bksp,caps:escape"; SDL_VIDEODRIVER = "wayland"; # needs qt5.qtwayland in systemPackages @@ -111,14 +111,16 @@ wayland.windowManager.sway = let cfg = config.wayland.windowManager.sway; in { wrapperFeatures.gtk = true; - systemd.enable = true; enable = true; + systemd.enable = true; + + config = rec { modifier = "Mod4"; terminal = "footclient"; - menu = "fuzzel"; + menu = "fuzzel -b ${palette.base00}BB -t ${palette.base05}FF"; bars = [{ fonts.size = 16.0; command = "waybar"; @@ -126,6 +128,9 @@ in { }]; startup = [ {command = "foot --server";} + {command = "swww-daemon";} + {command = ''while true; do for wallpaper in $WALLPAPER_DIR/*; do swww img "$wallpaper"; sleep 300; done; done'';} + {command = "firefox";} {command = "nm-applet";} {command = "autotiling-rs";} @@ -214,9 +219,7 @@ in { "${cfg.config.modifier}+r" = "mode resize"; "XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%"; - "F3" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%"; "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%"; - "F2" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%"; "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; "XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle"; "XF86MonBrightnessDown" = "exec brightnessctl set 5%-"; @@ -230,12 +233,12 @@ in { "${cfg.config.modifier}+Shift+c" = "exec code"; "${cfg.config.modifier}+f11" = "exec grim -g \"$(slurp)\" ~/Pictures/screenshots/\"screenshot-`date +%F-%T`\".png"; "${cfg.config.modifier}+Print" = "exec grim -g \"$(slurp)\" ~/Pictures/screenshots/\"screenshot-`date +%F-%T`\".png"; - "${cfg.config.modifier}+tab" = "workspace back_and_forth"; + "${cfg.config.modifier}+tab" = "workspace next"; + "Alt+tab" = "workspace back_and_forth"; }; }; extraConfig = '' - set $mod Mod4 input type:keyboard xkb_capslock disabled input type:keyboard xkb_numlock enabled xwayland enable @@ -247,10 +250,10 @@ in { default_floating_border pixel 2 titlebar_border_thickness 1 - client.focused ${palette.base0D} ${palette.base00} ${palette.base05} ${palette.base0D} ${palette.base0D} - client.focused_inactive ${palette.base0D} ${palette.base00} ${palette.base05} ${palette.base0D} ${palette.base0D} - client.unfocused ${palette.base0D} ${palette.base03} ${palette.base05} ${palette.base0D} ${palette.base00} - client.urgent ${palette.base0D} ${palette.base0D} ${palette.base03} ${palette.base0D} + client.focused #${palette.base0D} #${palette.base00} #${palette.base05} #${palette.base0D} #${palette.base0D} + client.focused_inactive #${palette.base0D} #${palette.base00} #${palette.base05} #${palette.base0D} #${palette.base0D} + client.unfocused #${palette.base0D} #${palette.base03} #${palette.base05} #${palette.base0D} #${palette.base00} + client.urgent #${palette.base0D} #${palette.base0D} #${palette.base03} #${palette.base0D} #${palette.base00} for_window [title="(?:Open|Save) (?:File|Folder|As)"] floating enable for_window [title="(?:Open|Save) (?:File|Folder|As)"] resize set 1920 1080 diff --git a/home/wallpapers.nix b/home/wallpapers.nix new file mode 100644 index 0000000..16bf5a2 --- /dev/null +++ b/home/wallpapers.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: + +let + wallpapers = pkgs.callPackage ./assets {}; +in +{ + environment.systemPackages = [ + wallpapers + ]; + + home.packages = [ + wallpapers + ]; + + home.sessionVariables = { + WALLPAPER_DIR = "${wallpapers}/share/wallpapers"; + }; +} diff --git a/home/waybar.nix b/home/waybar.nix index 78b1185..8cd8002 100644 --- a/home/waybar.nix +++ b/home/waybar.nix @@ -1,14 +1,17 @@ -{ pkgs, config, nix-colors, ... }: +{ pkgs, inputs, lib, config, nix-colors, ... }: -let - palette = config.colorScheme.palette; -in{ +{ imports = [ ]; - programs.waybar = { + programs.waybar = let + inherit (inputs.nix-colors.lib.conversions) hexToRGBString; + inherit (config.colorscheme) colors; + inherit (config.colorscheme) palette; + toRGBA = color: opacity: "rgba(${hexToRGBString "," (lib.removePrefix "#" color)},${opacity})"; + in { enable = true; @@ -22,9 +25,9 @@ in{ } window#waybar { - background-color: #${palette.base00}50; - border-bottom: 3px solid #${palette.base03}50; - color: ${palette.base05}; + background-color: #${palette.base00}; + border-bottom: 3px solid #${palette.base03}; + color: ${toRGBA palette.base05 "0.7"}; transition-property: background-color; transition-duration: .5s; } @@ -77,7 +80,7 @@ button:hover { } #workspaces button:hover { - background: #${palette.base00}20; + background: #${palette.base00}; } #workspaces button.focused { @@ -166,48 +169,55 @@ button:hover { padding-right: 15px; } +/*0b also looked good though. */ #power-profiles-daemon.performance { - background-color: #${palette.base08}; - color: #${palette.base05}; + background-color: #${palette.base04}; + color: #${palette.base00}; } #power-profiles-daemon.balanced { - background-color: #${palette.base0D}; - color: #${palette.base05}; + background-color: #${palette.base04}; + color: #${palette.base00}; } #power-profiles-daemon.power-saver { - background-color: #${palette.base0B}; - color: ${palette.base00}; + background-color: #${palette.base04}; + color: #${palette.base00}; } label:focus { - background-color: #${palette.base00}; + background-color: #${palette.base04}; + color: #${palette.base00}; } #cpu { - background-color: #${palette.base0B}; - color: ${palette.base00}; + background-color: #${palette.base04}; + color: #${palette.base00}; } #memory { - background-color: #${palette.base0E}; + background-color: #${palette.base04}; + color: #${palette.base00}; } #disk { - background-color: #${palette.base09}; + background-color: #${palette.base04}; + color: #${palette.base00}; } #backlight { - background-color: #${palette.base0C}; + background-color: #${palette.base04}; + color: #${palette.base00}; } #network { - background-color: #${palette.base0D}; + background-color: #${palette.base04}; + color: #${palette.base00}; } #network.disconnected { - background-color: #${palette.base08}; + background-color: #${palette.base0E}; + color: #${palette.base00}; } #pulseaudio { @@ -216,7 +226,7 @@ label:focus { } #pulseaudio.muted { - background-color: #${palette.base0C}; + background-color: #${palette.base0E}; color: #${palette.base03}; } @@ -226,33 +236,39 @@ label:focus { } #wireplumber.muted { - background-color: #${palette.base08}; + background-color: #${palette.base0E}; + color: #${palette.base00}; } #custom-media { - background-color: #${palette.base0B}; - color: #${palette.base03}; + background-color: #${palette.base04}; + color: #${palette.base00}; min-width: 100px; } #custom-media.custom-spotify { - background-color: #${palette.base0B}; + background-color: #${palette.base04}; + color: #${palette.base00}; } #custom-media.custom-vlc { - background-color: #${palette.base09}; + background-color: #${palette.base04}; + color: #${palette.base00}; } #temperature { - background-color: #${palette.base0A}; + background-color: #${palette.base04}; + color: #${palette.base00}; } #temperature.critical { - background-color: #${palette.base08}; + background-color: #${palette.base0E}; + color: #${palette.base00}; } #tray { - background-color: #${palette.base0D}; + background-color: #${palette.base04}; + color: #${palette.base00}; } #tray > .passive { @@ -261,25 +277,28 @@ label:focus { #tray > .needs-attention { -gtk-icon-effect: highlight; - background-color: #${palette.base08}; -} - -#idle_inhibitor { - background-color: #${palette.base00}; -} - -#idle_inhibitor.activated { background-color: #${palette.base07}; color: #${palette.base00}; } +#idle_inhibitor { + background-color: #${palette.base04}; + color: #${palette.base00}; +} + +#idle_inhibitor.activated { + background-color: #${palette.base06}; + color: #${palette.base00}; +} + #mpd { - background-color: #${palette.base0B}; - color: #${palette.base03}; + background-color: #${palette.base04}; + color: #${palette.base00}; } #mpd.disconnected { - background-color: #${palette.base08}; + background-color: #${palette.base06}; + color: #${palette.base00}; } #mpd.stopped { @@ -291,15 +310,15 @@ label:focus { } #language { - background: #${palette.base0C}; - color: #${palette.base0E}; + background: #${palette.base04}; + color: #${palette.base00}; padding: 0 5px; margin: 0 5px; min-width: 16px; } #keyboard-state { - background: #${palette.base0B}; + background: #${palette.base04}; color: #${palette.base00}; padding: 0 0px; margin: 0 5px; @@ -311,11 +330,13 @@ label:focus { } #keyboard-state > label.locked { - background: #${palette.base00}20; + background: #${palette.base04}; + color: #${palette.base00}; } #scratchpad { - background: #${palette.base00}20; + background: #${palette.base00}; + color: #${palette.base00}; } #scratchpad.empty { @@ -324,15 +345,16 @@ label:focus { #privacy { padding: 0; + color: #${palette.base04}; } #privacy-item { + color: #${palette.base00}; padding: 0 5px; - color: #${palette.base05}; } #privacy-item.screenshare { - background-color: #${palette.base09}; + background-color: #${palette.base00}; } #privacy-item.audio-in {