diff --git a/Makefile b/Makefile index b5c6270..b344972 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,9 @@ lanath-laptop: lanath-desktop: sudo nixos-rebuild switch -I nixos-config=config/lanath-desktop/configuration.nix +imsike-desktop: + sudo nixos-rebuild switch -I nixos-config=config/imsike-desktop/configuration.nix + build-lanath-iso: nixos-generate -f iso -c config/lanath-laptop/configuration.nix diff --git a/config/common/configuration.nix b/config/common/configuration.nix index de1c95b..aa2a786 100644 --- a/config/common/configuration.nix +++ b/config/common/configuration.nix @@ -31,7 +31,6 @@ in ''; }; - system.autoUpgrade.enable = true; system.stateVersion = "23.05"; nixpkgs.config.allowUnfree = true; @@ -164,6 +163,7 @@ in htop lxqt.lxqt-openssh-askpass ssh-askpass-fullscreen + # maintenance zip unzip diff --git a/config/imsike-desktop/configuration.nix b/config/imsike-desktop/configuration.nix new file mode 100644 index 0000000..e1b5150 --- /dev/null +++ b/config/imsike-desktop/configuration.nix @@ -0,0 +1,110 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, lib, ... }: + +let + unstable = import + (builtins.fetchTarball https://github.com/nixos/nixpkgs/tarball/nixos-unstable) + # reuse the current configuration + { config = config.nixpkgs.config; }; + nur-no-pkgs = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") {}; +in +{ + imports = + [ # Include the results of the hardware scan. + ../common/configuration.nix + ./hardware-configuration.nix + ../common/terms.nix + ../../home/imsike-desktop/home.nix + nur-no-pkgs.repos.LuisChDev.modules.nordvpn + ]; + + # Bootloader. + + boot.plymouth = { + theme = "hexagon_hud"; + }; + + environment.sessionVariables.NIX_CONFIG_USER = "imsike-desktop"; + environment.sessionVariables.MOZ_ENABLE_WAYLAND = "1"; + # environment.sessionVariables.NIXOS_OZONE_WL = "1"; + + + networking.hostName = "desktop"; + + i18n.defaultLocale = "fr_FR.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ALL="fr_FR.UTF-8"; + LC_ADDRESS = "fr_FR.UTF-8"; + LC_IDENTIFICATION = "fr_FR.UTF-8"; + LC_MEASUREMENT = "fr_FR.UTF-8"; + LC_MONETARY = "fr_FR.UTF-8"; + LC_NAME = "fr_FR.UTF-8"; + LC_NUMERIC = "fr_FR.UTF-8"; + LC_PAPER = "fr_FR.UTF-8"; + LC_TELEPHONE = "fr_FR.UTF-8"; + LC_TIME = "fr_FR.UTF-8"; + }; + + services.xserver.displayManager.sddm = { + theme = "Nordic/Nordic"; + }; + + users.users.imsike = { + isNormalUser = true; + description = "imsike"; + extraGroups = [ "networkmanager" "wheel" "docker" "audio" "storage" ]; + initialHashedPassword = "$6$KZaSYVev$bulibbTCC0axwdOGHNkaoRFFAS6RaNHoTIlLw3S90J9kzNseWHI1XUGN.sJKw4Yv5wYK/p9qzQTCt0TKdF3on/"; + openssh.authorizedKeys.keyFiles = [ ./id_rsa.pub ]; + packages = with pkgs; [ + ]; + }; + + hardware.bluetooth.enable = true; + + environment.systemPackages = with pkgs; [ + nordic + + # browsers + firefox-wayland + google-chrome + chromium + + # utils + bluez + brightnessctl + + # devtools + docker-compose + android-udev-rules + android-studio + android-tools + unstable.nodePackages.pnpm + + # tui + lazygit + + # sddm modules + libsForQt5.plasma-framework + libsForQt5.plasma-workspace + libsForQt5.qt5.qtgraphicaleffects + + # gui + thunderbird + pavucontrol + ]; + + fonts.fonts = with pkgs; [ + ]; + + nixpkgs.config.permittedInsecurePackages = [ + "electron-12.2.3" + ]; + + services.xserver = { + layout = "fr"; + }; +} diff --git a/config/imsike-desktop/hardware-configuration.nix b/config/imsike-desktop/hardware-configuration.nix new file mode 100644 index 0000000..74b06e0 --- /dev/null +++ b/config/imsike-desktop/hardware-configuration.nix @@ -0,0 +1,37 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/82305aa5-04f4-45e6-848a-0d429e0718fe"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/862E-EC6D"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp5s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/config/imsike-desktop/id_rsa.pub b/config/imsike-desktop/id_rsa.pub new file mode 100644 index 0000000..1a7696d --- /dev/null +++ b/config/imsike-desktop/id_rsa.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3EYnJPBB7phPd2x+r8Nz4sOB0Yk6rlBr93zF+j355V3AJgPVjOhk4TscwwpEnWV5rhaEidT/8J3UyDYY7XzoEKLx2dTYxB6fFqXB0TbDY5nxdXsmvtRdIWzS4yVSIzAxugNXc5D/PydsNn8wx7MqsT5oOrXQuNXVlmVTP3M0VRUuE7e0odiNy0aK+qg2KvkqwhJ1cRYnMtxMR51msUzI0kjFzGsduqdZ5Fg552CBm9ktdmgXjvZlxXD24IOP+2cEj98+IJpYijW6cyqoaH+Q097ez2zWjplMfbLl1IHAntI0OGpgzWyGn0l/SNWVxjw2pA0bGrQDVFl+Azne0nyN7 lanath2@fedora.home diff --git a/home/imsike-desktop/dunst.nix b/home/imsike-desktop/dunst.nix new file mode 100644 index 0000000..e63e78d --- /dev/null +++ b/home/imsike-desktop/dunst.nix @@ -0,0 +1,65 @@ +{ ... }: +{ + + services.dunst = { + enable = true; + settings = { + global = { + font = "Iosevka Term 11"; + markup = "yes"; + format = "%a\n%s: %b"; + sort = "no"; + indicate_hidden = "yes"; + alignment = "center"; + show_age_threshold = 60; + word_wrap = "yes"; + ignore_newline = "no"; + stack_duplicates = "yes"; + hide_duplicate_count = "yes"; + width = 400; + height = 150; + origin = "bottom-right"; + offset = "5x10"; + shrink = "no"; + transparency = 5; + idle_threshold = 120; + monitor = 0; + follow = "keyboard"; + sticky_history = "yes"; + history_length = 15; + show_indicators = "yes"; + line_height = 3; + separator_height = 2; + padding = 6; + horizontal_padding = 6; + separator_color = "auto"; + dmenu = "/usr/bin/dmenu -p dunst:"; + browser = "/usr/bin/firefox -new-tab"; + icon_position = "off"; + max_icon_size = 80; + icon_path = "/usr/share/icons/Paper/16x16/mimetypes/:/usr/share/icons/Paper/48x48/status/:/usr/share/icons/Paper/16x16/devices/:/usr/share/icons/Paper/48x48/notifications/:/usr/share/icons/Paper/48x48/emblems/"; + frame_width = 2; + }; + base16_low = { + frame_color = "#5e81ac77"; + msg_urgency = "low"; + background = "#3b4252"; + foreground = "#e5e9f0"; + }; + + base16_normal = { + frame_color = "#a3be8c77"; + msg_urgency = "normal"; + background = "#3b4252"; + foreground = "#e5e9f0"; + }; + + base16_critical = { + frame_color = "#bf616a77"; + msg_urgency = "critical"; + background = "#3b4252"; + foreground = "#e5e9f0"; + }; + }; + }; +} \ No newline at end of file diff --git a/home/imsike-desktop/home.nix b/home/imsike-desktop/home.nix new file mode 100644 index 0000000..11ba5ef --- /dev/null +++ b/home/imsike-desktop/home.nix @@ -0,0 +1,244 @@ +{ config, lib, pkgs, modulesPath, ... }: + +let + unstable = import + (builtins.fetchTarball https://github.com/nixos/nixpkgs/tarball/nixos-unstable) + # reuse the current configuration + { config = config.nixpkgs.config; }; + + flake-compat = builtins.fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz"; + hyprland = (import flake-compat { + src = builtins.fetchTarball "https://github.com/hyprwm/Hyprland/archive/master.tar.gz"; + }).defaultNix; + +in +{ + + home-manager.users.imsike = { pkgs, ... }: { + imports = [ + ./dunst.nix + ./waybar/waybar.nix + ../common/home.nix + ]; + + home.packages = with pkgs; [ + rofi-mpd + rofi-bluetooth + rofi-power-menu + rofi-systemd + discord + gnome.gnome-calculator + sway-contrib.grimshot + react-native-debugger + gum + ]; + + + wayland.windowManager.hyprland = { + extraConfig = import ./hypr.nix; + }; + + programs.swaylock = { + enable = true; + settings = lib.mkDefault { + ignore-empty-password = true; + show-failed-attempt = true; + show-keyboard-layout = true; + line-uses-ring = true; + color = "2e3440"; + bs-hl-color = "b48eadff"; + caps-lock-bs-hl-color = "d08770ff"; + caps-lock-key-hl-color = "ebcb8bff"; + indicator-radius = "100"; + indicator-thickness = "10"; + inside-color = "2e3440ff"; + inside-clear-color = "81a1c1ff"; + inside-ver-color = "5e81acff"; + inside-wrong-color = "bf616aff"; + key-hl-color = "a3be8cff"; + layout-bg-color = "2e3440ff"; + ring-color = "3b4252ff"; + ring-clear-color = "88c0d0ff"; + ring-ver-color = "81a1c1ff"; + ring-wrong-color = "d08770ff"; + separator-color = "3b4252ff"; + text-color = "eceff4ff"; + text-clear-color = "3b4252ff"; + text-ver-color = "3b4252ff"; + text-wrong-color = "3b4252ff"; + }; + }; + + programs.vscode = { + enable = true; + package = unstable.vscode; + extensions = with pkgs; [ + vscode-extensions.bbenoist.nix + vscode-extensions.arcticicestudio.nord-visual-studio-code + vscode-extensions.dbaeumer.vscode-eslint + vscode-extensions.esbenp.prettier-vscode + ]; + userSettings = { + "editor.renderWhitespace" = "trailing"; + "files.trimFinalNewlines" = true; + "files.trimTrailingWhitespace" = true; + "git.enableSmartCommit" = true; + "git.confirmSync" = false; + "javascript.updateImportsOnFileMove.enabled" = "always"; + "vs-kubernetes" = { + }; + "editor.defaultFormatter" = "esbenp.prettier-vscode"; + "editor.formatOnSave" = true; + "eslint.validate" = ["javascript" "typescript"]; + "prettier.jsxSingleQuote" = true; + "prettier.printWidth" = 100; + "prettier.semi" = false; + "prettier.singleQuote" = true; + "prettier.singleAttributePerLine" = true; + "prettier.tabWidth" = 4; + "prettier.useTabs" = true; + "explorer.confirmDragAndDrop" = false; + "prettier.ignorePath" = "~/.prettierignore"; + "git.autofetch" = true; + "debug.onTaskErrors" = "showErrors"; + "editor.inlineSuggest.enabled" = true; + "github.copilot.enable" = { + "*" = true; + "plaintext" = true; + "markdown" = false; + "scminput" = false; + "yaml" = false; + }; + "settingsSync.ignoredExtensions" = []; + "workbench.colorTheme" = "Nord"; + "editor.fontFamily" = "'Fira Code', 'Font Awesome 5', 'Font Awesome 5 Free Regular', 'Font Awesome 5 Free Solid', 'Font Awesome 5 Brands Regular', 'FiraCode Nerd Font Mono', CaskaydiaCoveNerdFont, 'Droid Sans Mono', 'monospace', monospace"; + "redhat.telemetry.enabled" = false; + "editor.fontLigatures" = true; + "[python]" = { + "editor.formatOnType" = true; + }; + "[helm]" = { + "editor.formatOnSave" = false; + }; + "[javascript]" = { + "editor.formatOnSave" = true; + "editor.codeActionsOnSave" = [ + "source.fixAll.eslint" + "source.fixAll" + "source.organizeImports" + ]; + "editor.defaultFormatter" = "esbenp.prettier-vscode"; + }; + "[typescript]" = { + "editor.formatOnSave" = true; + "editor.codeActionsOnSave" = [ + "source.fixAll.eslint" + "source.fixAll" + "source.organizeImports" + ]; + "editor.defaultFormatter" = "esbenp.prettier-vscode"; + }; + "[javascriptreact]" = { + "editor.formatOnSave" = true; + "editor.codeActionsOnSave" = [ + "source.fixAll.eslint" + "source.fixAll" + "source.organizeImports" + ]; + "editor.defaultFormatter" = "esbenp.prettier-vscode"; + }; + "[typescriptreact]" = { + "editor.formatOnSave" = true; + "editor.codeActionsOnSave" = [ + "source.fixAll.eslint" + "source.fixAll" + "source.organizeImports" + ]; + "editor.defaultFormatter" = "esbenp.prettier-vscode"; + }; + }; + }; + + services.udiskie = { + enable = true; + automount = true; + notify = true; + tray = "auto"; + settings = { + program_options = { + tray = true; + }; + }; + }; + + programs.git = { + enable = true; + userName = "imsike"; + userEmail = "aurelien.tacheau@bhc-it.com"; + signing = { + signByDefault = true; + key = "CC58F561775134D5F049BB7909A6A4B200ED83C7"; + }; + }; + + programs.kitty = { + theme = lib.mkDefault "Nord"; + }; + + programs.rofi = { + theme = ./nord.rasi; + package = unstable.rofi-wayland.override { plugins = with pkgs; [ rofi-power-menu rofi-mpd rofi-bluetooth ]; }; + plugins = with pkgs; lib.mkDefault [ + rofi-calc + rofi-emoji + ]; + }; + + gtk = { + enable = true; + theme = { + name = "Nordic"; + package = pkgs.nordic; + }; + iconTheme = { + name = "Papirus-Dark"; + package = pkgs.papirus-icon-theme; + }; + }; + + xdg.mimeApps = { + associations.added = { + "text/plain" = ["code.desktop"]; + }; + defaultApplications = { + "application/pdf" = ["firefox.desktop"]; + "application/javascript" = ["code.desktop"]; + "text/plain" = ["code.desktop"]; + "text/*" = ["code.desktop"]; + "text/html" = ["code.desktop"]; + "text/xml" = ["code.desktop"]; + "text/javascript" = ["code.desktop"]; + "text/json" = ["code.desktop"]; + "text/x-csrc" = ["code.desktop"]; # ts files + "image/gif" = ["firefox.desktop"]; + "image/jpeg" = ["firefox.desktop"]; + "image/png" = ["firefox.desktop"]; + "image/webp" = ["firefox.desktop"]; + "x-scheme-handler/http" = ["firefox.desktop"]; + "x-scheme-handler/https" = ["firefox.desktop"]; + "x-scheme-handler/about" = ["firefox.desktop"]; + "x-scheme-handler/unknown" = ["firefox.desktop"]; + "x-scheme-handler/mailto" = ["thunderbird.desktop"]; + "x-scheme-handler/sms" = ["thunderbird.desktop"]; + "x-scheme-handler/mms" = ["thunderbird.desktop"]; + "x-scheme-handler/chrome" = ["thunderbird.desktop"]; + "x-scheme-handler/spotify" = ["spotify.desktop"]; + "x-scheme-handler/steam" = ["steam.desktop"]; + }; + }; + + home.file.".wallpapers/wallpaper.png" = { + source = ./nord-city.jpeg; + }; + }; +} diff --git a/home/imsike-desktop/hypr.nix b/home/imsike-desktop/hypr.nix new file mode 100644 index 0000000..4b44045 --- /dev/null +++ b/home/imsike-desktop/hypr.nix @@ -0,0 +1,248 @@ +'' +monitor=DP-3,1600x1200@60,0x0,1,transform,1 +monitor=HDMI-A-1,1920x1080@60,1200x0,1 +monitor=DP-1,highres,3120x0,1 + +env = XCURSOR_SIZE,24 +exec-once = swww init && swww img ${./nord-city.jpeg} +exec-once = wl-paste --watch cliphist store + +input { + kb_layout = fr + kb_variant = + kb_model = + kb_options = + kb_rules = + + follow_mouse = 1 + + touchpad { + natural_scroll = no + } + + numlock_by_default = true + + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. +} + +general { + gaps_in = 5 + gaps_out = 20 + border_size = 2 + col.active_border = rgba(81a1c1ee) rgba(8fbcbbee) 45deg + col.inactive_border = rgba(4c566aee) + + layout = dwindle + resize_on_border = yes +} + +group { + col.border_active = rgba(81a1c1ee) + col.border_inactive = rgba(4c566aee) +} + +decoration { + rounding = 10 + blurls = lockscreen + drop_shadow = no + shadow_range = 0 + shadow_render_power = 0 + col.shadow = 0x44000000 + col.shadow_inactive=0x33000000 + blur { + enabled = true + size = 2 + passes = 4 + new_optimizations = on + ignore_opacity = true + brightness = 1 + } +} + +misc { + mouse_move_enables_dpms = true + key_press_enables_dpms = true + disable_hyprland_logo = true + disable_splash_rendering = true +} + +animations { + enabled = yes + bezier = myBezier,0.05,0.9,0.1,1.0 + bezier = newBezier, 0.68, -0.6, 0.34, 1.4 + bezier = secondBezier, 0.0, -1, 0.1, 2.0 + bezier = overshot, 0.05, 0.9, 0.1, 1.05 + bezier = md3_standard, 0.2, 0, 0, 1 + bezier = md3_decel, 0.05, 0.7, 0.1, 1 + bezier = md3_accel, 0.3, 0, 0.8, 0.15 + bezier = overshot, 0.05, 0.9, 0.1, 1.1 + bezier = crazyshot, 0.1, 1.6, 0.76, 0.92 + bezier = easeInOutQuint, 0.85, 0, 0.15, 1 + bezier = back, 0.68, -0.6, 0.32, 1.6 + bezier = hyprnostretch, 0.05, 0.9, 0.1, 1.0 + bezier = fluent_decel, 0.1, 1, 0, 1 + bezier = borderCurve, 0.51, 0.54, 0.38, 0.41 + + animation = windows, 1, 5, crazyshot, slide + # animation = borderangle, 1, 40, borderCurve, loop + animation = workspaces, 1, 5, back +} + +dwindle { + pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = yes # you probably want this +} + +master { + new_is_master = true +} + +gestures { + workspace_swipe = on + workspace_swipe_fingers = 3; + workspace_swipe_min_speed_to_force = 30; +} + +device:epic-mouse-v1 { + sensitivity = -0.5 +} + + + +windowrule = float,^(spotify)$ +windowrule = float,^(nm-connection-editor)$ +windowrule = float,^(pavucontrol)$ +windowrule = dimaround,^(pavucontrol)$ +windowrule = opacity 0.7 0.7,^(pavucontrol)$ +windowrule = opacity 0.9 0.9,^(discord)$ + +windowrule=float,title:^(Open File)(.*)$ +windowrule=float,title:^(Select a File)(.*)$ +windowrule=float,title:^(Choose wallpaper)(.*)$ +windowrule=float,title:^(Open Folder)(.*)$ +windowrule=float,title:^(Save As)(.*)$ +windowrule=float,title:^(Library)(.*)$ +windowrule=float,title:^(Home)(.*)$ + +windowrulev2 = float,class:^(.*blueman-manager.*)$ +windowrulev2 = dimaround,class:^(.*blueman-manager.*)$ +windowrulev2 = opacity 0.7 0.7,class:^(Wofi|Rofi|rofi)$ +windowrulev2 = float, class:^(.*[W|R|w|r]ofi.*)$ +windowrulev2 = dimaround, class:^(.*[W|R|w|r]ofi.*)$ +windowrulev2 = opacity 0.8 0.8, class:^(kitty)$ +windowrulev2 = center,class:^(discord)$ +windowrulev2 = opacity 0.8 0.8,floating:1 +windowrulev2 = float,class:^(.*orage.*)$ +windowrulev2 = dimaround,class:^(.*orage.*)$ +windowrulev2 = opacity 0.8 0.8, class:^(.*orage.*)$ +windowrulev2 = float,class:^(.*lxqt-openssh-askpass.*)$ +windowrulev2 = dimaround,class:^(.*lxqt-openssh-askpass.*)$ +windowrulev2 = opacity 0.8 0.8, class:^(.*lxqt-openssh-askpass.*)$ +windowrulev2 = float,class:^(.*ssh-askpass-fullscreen.*)$ +windowrulev2 = dimaround,class:^(.*ssh-askpass-fullscreen.*)$ +windowrulev2 = opacity 0.8 0.8, class:^(.*ssh-askpass-fullscreen.*)$ + + +# layerrules for better blurs +layerrule = blur, gtk-layer-shell +layerrule = blur, swaync-control-center +# layerrule = ignorealpha 0.4, swaync-control-center +layerrule = blur, rofi +layerrule = ignorealpha 0.4, rofi + + + + + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more +$mainMod = SUPER +$secMod = SUPER_SHIFT + +# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more + +# Windows +bind = $mainMod, A, killactive, +bind = $mainMod, F, fullscreen, +bind = $mainMod, delete, exit, +bind = $mainMod, V, togglefloating, +bind = $mainMod, P, pseudo, # dwindle +bind = $mainMod, J, togglesplit, # dwindle +bind = $mainMod, g, togglegroup + +# rofi +bind = $mainMod, Space, exec, rofi -show drun -modi ssh,calc,filebrowser -show-icons +bind = $mainMod, C, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy, +bind = $secMod, C, exec, gnome-calculator, +bind = $mainMod, S, exec, rofi -show ssh -modi ssh,calc,filebrowser, +bind = $mainMod, backspace, exec, rofi -show p -modi p:"rofi-power-menu", + +# launch app +bind = $mainMod, Return, exec, kitty +bind = $mainMod, b, exec, blueman-manager, +bind = $mainMod, E, exec, thunar ~ + + +# Take screenshots +bind = , Print, exec, grimshot --notify copy area +# Cassés sur NiqueSauce +# bind = ALT , Print, exec, grimshot --notify copy window +# bind = CTRL , Print, exec, grimshot --notify copy active +# bind = SHIFT, Print, exec, grimshot --notify copy screen + +# misc +bind = $mainMod, l, exec, swaylock + + +# Move focus with mainMod + arrow keys +bind = $mainMod, left, movefocus, l +bind = $mainMod, right, movefocus, r +bind = $mainMod, up, movefocus, u +bind = $mainMod, down, movefocus, d + +bind = $mainMod, left, changegroupactive, b +bind = $mainMod, right, changegroupactive, f + +# Move focus with mainMod + arrow keys +bind = $secMod, left, movewindow, l +bind = $secMod, right, movewindow, r +bind = $secMod, up, movewindow, u +bind = $secMod, down, movewindow, d + +bind = $mainMod CTRL, left, moveintogroup, l +bind = $mainMod CTRL, right, moveoutofgroup + + +bind = $mainMod, ampersand, workspace, 1 +bind = $mainMod SHIFT, ampersand, movetoworkspace, 1 +bind = $mainMod, eacute, workspace, 2 +bind = $mainMod SHIFT, eacute, movetoworkspace, 2 +bind = $mainMod, quotedbl, workspace, 3 +bind = $mainMod SHIFT, quotedbl, movetoworkspace, 3 +bind = $mainMod, apostrophe, workspace, 4 +bind = $mainMod SHIFT, apostrophe, movetoworkspace, 4 +bind = $mainMod, parenleft, workspace, 5 +bind = $mainMod SHIFT, parenleft, movetoworkspace, 5 +bind = $mainMod, minus, workspace, 6 +bind = $mainMod SHIFT, minus, movetoworkspace, 6 +bind = $mainMod, egrave, workspace, 7 +bind = $mainMod SHIFT, egrave, movetoworkspace, 7 +bind = $mainMod, underscore, workspace, 8 +bind = $mainMod SHIFT, underscore, movetoworkspace, 8 +bind = $mainMod, ccedilla, workspace, 9 +bind = $mainMod SHIFT, ccedilla, movetoworkspace, 9 +bind = $mainMod, agrave, workspace, 10 +bind = $mainMod SHIFT, agrave, movetoworkspace, 10 + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, mouse_down, workspace, e+1 +bind = $mainMod, mouse_up, workspace, e-1 + +bind = ALT, Tab, cyclenext +bind = ALT, Tab, bringactivetotop, + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow + +exec-once = nm-applet --indicator +'' diff --git a/home/imsike-desktop/nord-city.jpeg b/home/imsike-desktop/nord-city.jpeg new file mode 100644 index 0000000..13068c8 Binary files /dev/null and b/home/imsike-desktop/nord-city.jpeg differ diff --git a/home/imsike-desktop/nord.rasi b/home/imsike-desktop/nord.rasi new file mode 100644 index 0000000..9de46cc --- /dev/null +++ b/home/imsike-desktop/nord.rasi @@ -0,0 +1,221 @@ +/** + * Nordic rofi theme + * Adapted by undiabler + * + * Nord Color palette imported from https://www.nordtheme.com/ + * + */ + + +* { + nord0: #2e3440; + nord1: #3b4252; + nord2: #434c5e; + nord3: #4c566a; + + nord4: #d8dee9; + nord5: #e5e9f0; + nord6: #eceff4; + + nord7: #8fbcbb; + nord8: #88c0d0; + nord9: #81a1c1; + nord10: #5e81ac; + nord11: #bf616a; + + nord12: #d08770; + nord13: #ebcb8b; + nord14: #a3be8c; + nord15: #b48ead; + + foreground: @nord4; + backlight: #ccffeedd; + background-color: transparent; + background: #3b4252a0; + urgent: @nord11; + selected: @nord3; + active: @nord3; + + highlight: underline bold #eceff4; + + transparent: rgba(46,52,64,0); +} + +/*****----- Main Window -----*****/ +window { + /* properties for window widget */ + transparency: "real"; + location: center; + anchor: center; + fullscreen: false; + width: 900px; + x-offset: 0px; + y-offset: 0px; + + /* properties for all widgets */ + enabled: true; + border-radius: 24px; + cursor: "default"; + background-color: @background; +} + +/*****----- Main Box -----*****/ +mainbox { + enabled: true; + spacing: 0px; + background-color: transparent; + orientation: horizontal; + children: [ "imagebox", "listbox" ]; +} + +imagebox { + padding: 30px; + background-color: transparent; + background-image: url("~/.wallpapers/wallpaper.png", height); + orientation: vertical; + children: [ "inputbar", "dummy", "mode-switcher" ]; +} + +listbox { + spacing: 20px; + padding: 20px; + background-color: transparent; + orientation: vertical; + children: [ "message", "listview" ]; +} + +/*****----- Inputbar -----*****/ +inputbar { + enabled: true; + spacing: 10px; + padding: 15px; + border-radius: 24px; + background-color: @nord0; + text-color: @foreground; + children: [ "textbox-prompt-colon", "entry" ]; +} + +textbox-prompt-colon { + enabled: true; + expand: false; + str: " "; + background-color: inherit; + text-color: inherit; +} +entry { + enabled: true; + background-color: inherit; + text-color: inherit; + cursor: text; + placeholder: "Search"; + placeholder-color: inherit; +} + + +/*****----- Listview -----*****/ +listview { + enabled: true; + columns: 2; + lines: 8; + cycle: true; + dynamic: true; + scrollbar: false; + layout: vertical; + reverse: false; + fixed-height: true; + fixed-columns: true; + + spacing: 10px; + background-color: transparent; + text-color: @foreground; + cursor: "default"; +} + + +/*****----- Mode Switcher -----*****/ +mode-switcher { + enabled: true; + spacing: 20px; + background-color: transparent; + text-color: @foreground; +} + +button { + padding: 15px; + border-radius: 24px; + background-color: @background; + text-color: inherit; + cursor: pointer; +} +button selected { + background-color: @nord2; + text-color: @foreground; +} + +/*****----- Elements -----*****/ +element { + enabled: true; + spacing: 15px; + padding: 8px; + border-radius: 24px; + background-color: transparent; + text-color: @foreground; + cursor: pointer; +} +element normal.normal { + background-color: inherit; + text-color: inherit; +} +element normal.urgent { + background-color: @urgent; + text-color: @foreground; +} +element normal.active { + background-color: @active; + text-color: @foreground; +} +element selected.normal { + background-color: @selected; + text-color: @foreground; +} +element selected.urgent { + background-color: @urgent; + text-color: @foreground; +} +element selected.active { + background-color: @urgent; + text-color: @foreground; +} +element-icon { + background-color: transparent; + text-color: inherit; + size: 32px; + cursor: inherit; +} +element-text { + background-color: transparent; + text-color: inherit; + cursor: inherit; + vertical-align: 0.5; + horizontal-align: 0.0; +} + + +/*****----- Message -----*****/ +message { + background-color: transparent; +} +textbox { + padding: 15px; + border-radius: 24px; + background-color: @nord0; + text-color: @foreground; + vertical-align: 0.5; + horizontal-align: 0.0; +} +error-message { + padding: 16px; + border-radius: 24px; + background-color: @background; + text-color: @foreground; +} \ No newline at end of file diff --git a/home/imsike-desktop/nord1.png b/home/imsike-desktop/nord1.png new file mode 100644 index 0000000..62211e7 Binary files /dev/null and b/home/imsike-desktop/nord1.png differ diff --git a/home/imsike-desktop/waybar/style.css b/home/imsike-desktop/waybar/style.css new file mode 100644 index 0000000..c92fc54 --- /dev/null +++ b/home/imsike-desktop/waybar/style.css @@ -0,0 +1,237 @@ +@keyframes blink-warning { + 70% { + color: @light; + } + + to { + color: @light; + background-color: @warning; + } +} + +@keyframes blink-critical { + 70% { + color: @light; + } + + to { + color: @light; + background-color: @critical; + } +} + +/* ----------------------------------------------------------------------------- + * Styles + * -------------------------------------------------------------------------- */ + +/* COLORS */ + +/* Nord */ +@define-color bg #2E3440; +/*@define-color bg #353C4A;*/ +@define-color light #D8DEE9; +/*@define-color dark @nord_dark_font;*/ +@define-color warning #ebcb8b; +@define-color critical #BF616A; +@define-color mode #434C5E; +/*@define-color workspaces @bg;*/ +/*@define-color workspaces @nord_dark_font;*/ +/*@define-color workspacesfocused #434C5E;*/ +@define-color workspacesfocused #4C566A; +@define-color tray @workspacesfocused; +@define-color sound #EBCB8B; +@define-color network #5D7096; +@define-color memory #546484; +@define-color cpu #596A8D; +@define-color memory #596A8D; +@define-color temp #4D5C78; +@define-color layout #5e81ac; +@define-color battery #5D7096; +@define-color date #434C5E; +@define-color time #434C5E; +@define-color backlight #434C5E; +@define-color nord_bg #434C5E; +@define-color nord_bg_blue #546484; +@define-color nord_light #D8DEE9; +@define-color nord_light_font #D8DEE9; +@define-color nord_dark_font #434C5E; + +/* Reset all styles */ +* { + border: none; + min-height: 0; +} + +/* The whole bar */ +#waybar { + background: transparent; + color: @light; + font-family: 'Fira Code', 'Font Awesome 5', 'Font Awesome 5 Free Regular', + 'Font Awesome 5 Free Solid', 'Font Awesome 5 Brands Regular', 'FiraCode Nerd Font Mono'; + font-size: 12px; + font-weight: bold; +} + +/* Each module */ +#idle_inhibitor, +#battery, +#clock, +#cpu, +#memory, +#disk, +#network, +#bluetooth, +#pulseaudio, +#temperature, +#tray, +#backlight, +#custom-weather, +#custom-powermenu { + margin: 0em 0.1em 0em 0.1em; + padding: 0.3rem 0.5em 0.3em 0.5em; +} + +#idle_inhibitor, +#cpu, +#memory, +#temperature, +#battery, +#custom-weather { + background: @nord_bg; + color: #d8dee9; +} + +#network, +#bluetooth, +#disk, +#backlight, +#clock, +#pulseaudio, +#custom-powermenu { + /* Unsused but kept for those who needs it */ + background: @nord_bg_blue; + color: #d8dee9; +} + +/* Each module that should blink */ +#mode, +#memory, +#temperature, +#battery { + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +/* Each critical module */ +#memory.critical, +#cpu.critical, +#memory.critical, +#temperature.critical, +#disk.critical, +#battery.critical { + color: @critical; +} + +/* Each critical that should blink */ +#mode, +#memory.critical, +#temperature.critical, +#battery.critical.discharging { + animation-name: blink-critical; + animation-duration: 2s; +} + +/* Each warning */ +#network.disconnected, +#memory.warning, +#cpu.warning, +#memory.warning, +#temperature.warning, +#disk.warning, +#battery.warning { + background: @warning; + color: @nord_dark_font; +} + +/* Each warning that should blink */ +#battery.warning.discharging { + animation-name: blink-warning; + animation-duration: 3s; +} + +/* And now modules themselves in their respective order */ + +#mode { + /* Shown current wlr mode (resize etc.) */ + color: @light; + background: @mode; +} + +/* Workspaces stuff */ + +#workspaces { + margin: 0.3em 0.3em 0.3em 0.3em; + padding: 0rem 0em 0em 0em; +} + +#workspaces button { + background: none; + font-weight: bold; /* Somewhy the bar-wide setting is ignored*/ + opacity: 0.3; + padding: 0.3em 0.3em 0.3em 0.3em; +} + +#workspaces button.active { + background: @workspacesfocused; + color: #d8dee9; + opacity: 1; +} + +#workspaces button.urgent { + border-color: #c9545d; + color: #c9545d; + opacity: 1; +} + +#window { + margin-right: 40px; + margin-left: 40px; + font-weight: normal; +} + +#idle_inhibitor { + background: @mode; + /*font-size: 1.6em;*/ + font-weight: bold; + padding: 0 0.6em; +} + +#cpu.critical { + color: @nord_dark_font; +} + +#temperature.critical { + background: @critical; +} + +#pulseaudio.muted { + color: #434c5e; +} + +#pulseaudio.source-muted { + background: #bf616a; +} + +#tray { + background: #434c5e; +} + +#bluetooth.disabled, +#bluetooth.off { + background: #bf616a; +} + +#bluetooth.connected { + background: #a3be8c; +} diff --git a/home/imsike-desktop/waybar/waybar.nix b/home/imsike-desktop/waybar/waybar.nix new file mode 100644 index 0000000..0f53a99 --- /dev/null +++ b/home/imsike-desktop/waybar/waybar.nix @@ -0,0 +1,220 @@ +{ config, pkgs, lib, ... }: +let + unstable = import + (builtins.fetchTarball https://github.com/nixos/nixpkgs/tarball/nixos-unstable) + # reuse the current configuration + { config = config.nixpkgs.config; }; +in +{ + + nixpkgs.overlays = [ + (final: prev: { + weatherScript = pkgs.stdenv.mkDerivation rec { + name = "weather"; + version = "0.1"; + src = ./weather.sh; + nativeBuildInputs = [ pkgs.makeWrapper ]; + buildInputs = with pkgs; [ coreutils jq curl ]; + unpackCmd = '' + mkdir weather + + cp $curSrc weather/weather.sh + ''; + installPhase = '' + install -Dm755 weather.sh $out/bin/weather.sh + + wrapProgram $out/bin/weather.sh --prefix PATH : '${lib.strings.makeBinPath buildInputs}' + ''; + }; + }) + + (final: prev: { + rofi-override = pkgs.rofi-wayland.override { plugins = [ pkgs.rofi-power-menu ]; }; + rofi-with-power-menu = pkgs.stdenv.mkDerivation rec { + name = "rofi-with-power-menu"; + nativeBuildInputs = [ pkgs.makeWrapper ]; + buildInputs = with pkgs; [ final.rofi-override rofi-power-menu util-linux ]; + version = "0.1"; + src = pkgs.writeShellScript "rofi-with-power-menu.sh" ''rofi -show p -modi p:"rofi-power-menu"''; + unpackCmd = '' + mkdir rofi-with-power-menu + cp $curSrc rofi-with-power-menu/rofi-with-power-menu.sh + ''; + installPhase = '' + install -Dm755 rofi-with-power-menu.sh $out/bin/rofi-with-power-menu.sh + + wrapProgram $out/bin/rofi-with-power-menu.sh --prefix PATH : '${lib.strings.makeBinPath buildInputs}' + ''; + }; + }) + ]; + + programs.waybar = { + enable = true; + package = unstable.waybar; + settings = { + topBar = { + layer = "top"; + position = "top"; + modules-left = ["clock" "idle_inhibitor" "custom/media"]; + modules-center = ["mpris"]; + modules-right = ["cpu" "memory" "temperature" "disk" ]; + mpris = { + format = "{player_icon} {dynamic}"; + format-paused = "Paused: {status_icon} {dynamic}"; + player-icons = { + default = "▶"; + mpv = "🎵"; + }; + status-icons = { + paused = "⏸"; + }; + ignored-players = ["firefox"]; + }; + idle_inhibitor = { + format = "{icon}"; + format-icons = { + activated = ""; + deactivated = ""; + }; + tooltip = "true"; + }; + clock = { + format = " {:%H:%M  %e %b}"; + tooltip-format = "{:%Y %B}\n{calendar}"; + today-format = "{}"; + on-click = "${pkgs.xfce.orage}/bin/orage"; + }; + cpu = { + interval = "1"; + format = " {max_frequency}GHz | {usage}%"; + on-click = "${pkgs.kitty}/bin/kitty -e btop"; + tooltip = false; + }; + memory = { + format = " {used}Go/{total}Go"; + on-click = "${pkgs.kitty}/bin/kitty -e btop"; + tooltip = false; + }; + disk = { + interval = 30; + format = " {used}/{total}Go"; + path = "/"; + on-click = "${pkgs.xfce.thunar}/bin/thunar /home/imsike"; + on-right-click = "${pkgs.baobab}/bin/baobab /"; + }; + temperature = { + interval = "4"; + critical-threshold = 74; + format-critical = " {temperatureC}°C"; + format = "{icon} {temperatureC}°C"; + format-icons = ["" "" ""]; + max-length = 7; + min-length = 7; + }; + }; + bottomBar = { + layer = "top"; + position = "bottom"; + modules-left = ["custom/powermenu" "custom/weather"]; + modules-center = ["hyprland/workspaces"]; + modules-right = ["pulseaudio" "network" "tray"]; + "hyprland/workspaces" = { + disable-scroll = true; + all-outputs = false; + format = "{icon}"; + format-icons = { + "1" = "1"; + "2" = "2"; + "3" = "3"; + "4" = "4"; + "5" = "5"; + "6" = "6"; + "7" = "7"; + "8" = "8"; + "9" = "9"; + "10" = "10"; + urgent = ""; + focused = ""; + default = ""; + }; + }; + tray = { + icon-size = 10; + spacing = 4; + }; + pulseaudio = { + scroll-step = 3; + max-volume = 200; + format = "{icon} {volume}%"; + format-icons = { + headphone = ""; + hands-free = ""; + headset = ""; + phone = ""; + portable = ""; + car = ""; + default = ["" "" ""]; + }; + on-click = "${pkgs.pavucontrol}/bin/pavucontrol"; + on-click-right = "${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle"; + }; + backlight = { + format = "{icon} {percent}%"; + format-icons = ["" ""]; + on-scroll-up = "light -A 3"; + on-scroll-down = "light -U 3"; + }; + battery = { + states = { + good = 95; + warning = 30; + critical = 15; + }; + format = "{icon} {capacity}%"; + format-charging = " {capacity}%"; + format-plugged = " {capacity}%"; + format-alt = "{icon} {time}"; + format-good = "{icon} {capacity}%"; + format-full = "{icon} {capacity}%"; + format-icons = ["" "" "" "" ""]; + }; + network = { + format-wifi = " {essid}"; + format-ethernet = "{ifname}: {ipaddr}/{cidr} "; + format-linked = "{ifname} (No IP) "; + format-disconnected = ""; + format-alt = "{ifname}: {ipaddr}/{cidr}  {bandwidthDownBits}  {bandwidthUpBits}"; + family = "ipv4"; + tooltip-format-wifi = " {ifname} @ {essid}\nIP: {ipaddr}\nStrength: {signalStrength}%\nFreq: {frequency}MHz\n {bandwidthDownBits}  {bandwidthUpBits}"; + tooltip-format-ethernet = " {ifname}\nIP: {ipaddr}\n {bandwidthDownBits}  {bandwidthUpBits}"; + }; + bluetooth = { + interval = 30; + format = "{icon}"; + format-connected-battery = "{icon} {status}: {device_alias} |  {device_battery_percentage}"; + format-connected = "{icon} {status}: {device_alias}"; + format-icons = { + enabled = ""; + disabled = ""; + }; + on-click = "${pkgs.blueman}/bin/blueman-manager"; + }; + "custom/weather" = { + exec = "${pkgs.weatherScript}/bin/weather.sh"; + format = "{}"; + }; + "custom/powermenu" = { + format = ""; + on-click = "${pkgs.rofi-with-power-menu}/bin/rofi-with-power-menu.sh"; + }; + }; + }; + systemd = { + enable = true; + target = "basic.target"; + }; + + style = builtins.readFile ./style.css; + }; +} \ No newline at end of file diff --git a/home/imsike-desktop/waybar/weather.sh b/home/imsike-desktop/waybar/weather.sh new file mode 100755 index 0000000..6494a7b --- /dev/null +++ b/home/imsike-desktop/waybar/weather.sh @@ -0,0 +1,20 @@ +# This script is to get weather data from openweathermap.com in the form of a json file +# so that conky will still display the weather when offline even though it doesn't up to date + +# you can use this or replace with yours +api_key=d37eb85e8d3acf7628468fa5005a45e4 +# get your city id at https://openweathermap.org/find and replace + +url='http://api.openweathermap.org/data/2.5/weather?lat=47.13&lon=1.33&APPID=0c993f03599686bea10cfe3a06c127d8&cnt=5&units=metric&lang=en' + +curl ${url} -s -o ~/.cache/weather.json + +data=$(cat ~/.cache/weather.json) +description=$(echo "$data" | jq -r '.weather[0].description') +temp=$(echo "$data" | jq -r '.main.temp | round') + + + +capitalized_description=$(echo "${description^}") +iconifiedtemp=$(echo "$temp°C") +echo "$capitalized_description | $iconifiedtemp" \ No newline at end of file