diff --git a/README.md b/README.md index 1709efbe..fd1110a9 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,17 @@ This repository is home to the nix code that builds my systems. ## TODO +- custom hyprland configs + - monitor resolution - 4k + - bar adjustment + - vscode run in wayland mode + - xwayland adjustment + - references + - https://github.com/notusknot/dotfiles-nix + - https://wiki.hyprland.org/Configuring/Configuring-Hyprland/ + - https://github.com/notwidow/hyprland - vscode extensions - [nix-vscode-extensions](https://github.com/nix-community/nix-vscode-extensions) - secret management - [sops-nix](https://github.com/Mic92/sops-nix) -- switch from i3wm to hyprland - - i3wm: old and stable, only support X11 - - sway: compatible with i3wm, support Wayland. do not support Nvidia GPU officially. - - [hyprland](https://wiki.hyprland.org/Nix/Hyprland-on-NixOS/): project starts from 2022, support Wayland, envolving fast, good looking, support Nvidia GPU. - ## Why Nix? diff --git a/flake.lock b/flake.lock index bd6a8038..454b001f 100644 --- a/flake.lock +++ b/flake.lock @@ -16,6 +16,43 @@ "type": "github" } }, + "flake-compat_2": { + "locked": { + "lastModified": 1680531544, + "narHash": "sha256-8qbiDTYb1kGaDADRXTItpcMKQ1TeQVkuof6oEwHUvVA=", + "owner": "nix-community", + "repo": "flake-compat", + "rev": "95e78dc12268c5e4878621845c511077f3798729", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs-wayland", + "nix-eval-jobs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1680392223, + "narHash": "sha256-n3g7QFr85lDODKt250rkZj2IFS3i4/8HBU2yKHO3tqw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "dcc36e45d054d7bb554c9cdab69093debd91a0b5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1667395993, @@ -31,6 +68,24 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -38,11 +93,11 @@ ] }, "locked": { - "lastModified": 1682176386, - "narHash": "sha256-xwYjQ8PjfdHlggi8Dq0PXWby/1oXegSUuNuBvoTcnpA=", + "lastModified": 1683276742, + "narHash": "sha256-QURv/m81hd6TN5RMjlSHhE1zLpXHsvDEm66qv3MRBsM=", "owner": "nix-community", "repo": "home-manager", - "rev": "6169690ae38175295605d521bd778d999fbd85cd", + "rev": "38271ead8e7b291beb9d3b8312e66c3268796c0a", "type": "github" }, "original": { @@ -51,18 +106,98 @@ "type": "github" } }, + "hyprland": { + "inputs": { + "hyprland-protocols": "hyprland-protocols", + "nixpkgs": "nixpkgs", + "wlroots": "wlroots", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1683297722, + "narHash": "sha256-1uRVjPMCCjXC6MRErLkh+SJychOC2SKDGFajriBIfno=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "c0be1e2fd8221a362252c379811880224eee12a2", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1681065697, + "narHash": "sha256-QPzwwlGKX95tl6ZEshboZbEwwAXww6lNLdVYd6T9Mrc=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "4d29e48433270a2af06b8bc711ca1fe5109746cd", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "lib-aggregate": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1681214977, + "narHash": "sha256-pBaG4iKzF/YJQA06f87IZokB15Z13DYd6zsT/wlbWfI=", + "owner": "nix-community", + "repo": "lib-aggregate", + "rev": "19d70ca7a81956bd01a768297b84798f301e150f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "lib-aggregate", + "type": "github" + } + }, + "nix-eval-jobs": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1682480188, + "narHash": "sha256-4LG8Vl/fLWsJg+QAb5/PvZTdLtPFsYFxuGDfEAR5szA=", + "owner": "nix-community", + "repo": "nix-eval-jobs", + "rev": "73ee1712faeb5db609fc9f991e2dc1de265acff5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-eval-jobs", + "type": "github" + } + }, "nix-vscode-extensions": { "inputs": { "flake-compat": "flake-compat", "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1683076311, - "narHash": "sha256-xGvR07+fR5g/89oVEQieKG/ZveGHZZyhxXcRouW0WCk=", + "lastModified": 1683248756, + "narHash": "sha256-jB11TQX+CKvH+MpPzAQbc5/OVg9D28zoBN4ZwmUUKiU=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "70d48e0c7eafdbcdaa9dac6c17f46a88872f7285", + "rev": "288ddbb70b5befac24602bfe7e5d9fe09dfae8d0", "type": "github" }, "original": { @@ -72,6 +207,58 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1683014792, + "narHash": "sha256-6Va9iVtmmsw4raBc3QKvQT2KT/NGRWlvUlJj46zN8B8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1a411f23ba299db155a5b45d5e145b85a7aafc42", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1681001314, + "narHash": "sha256-5sDnCLdrKZqxLPK4KA8+f4A3YKO/u6ElpMILvX0g72c=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "367c0e1086a4eb4502b24d872cea2c7acdd557f4", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-wayland": { + "inputs": { + "flake-compat": "flake-compat_2", + "lib-aggregate": "lib-aggregate", + "nix-eval-jobs": "nix-eval-jobs", + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1683289443, + "narHash": "sha256-NIWJBHF9xag/KIYjwdmtcErSeGd5pQxcxLl1Hj+kX3w=", + "owner": "nix-community", + "repo": "nixpkgs-wayland", + "rev": "0148eb1d7bf4a0d63b72335e6efd3524e154bc7a", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs-wayland", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1675763311, "narHash": "sha256-bz0Q2H3mxsF1CUfk26Sl9Uzi8/HFjGFD/moZHz1HebU=", @@ -87,13 +274,45 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_3": { "locked": { - "lastModified": 1681920287, - "narHash": "sha256-+/d6XQQfhhXVfqfLROJoqj3TuG38CAeoT6jO1g9r1k0=", + "lastModified": 1683194677, + "narHash": "sha256-Am7aCGNy/h6RMnvg7Pn4PHQXZZq9FyIUA9klYxBwyDI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "645bc49f34fa8eff95479f0345ff57e55b53437e", + "rev": "0d8145a5d81ebf6698077b21042380a3a66a11c7", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1681347147, + "narHash": "sha256-B+hTioRc3Jdf4SJyeCiO0fW5ShIznJk2OTiW2vOV+mc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1a9d9175ecc48ecd033062fa09b1834d13ae9c69", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1683194677, + "narHash": "sha256-Am7aCGNy/h6RMnvg7Pn4PHQXZZq9FyIUA9klYxBwyDI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "0d8145a5d81ebf6698077b21042380a3a66a11c7", "type": "github" }, "original": { @@ -106,12 +325,71 @@ "root": { "inputs": { "home-manager": "home-manager", + "hyprland": "hyprland", "nix-vscode-extensions": "nix-vscode-extensions", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3", + "nixpkgs-wayland": "nixpkgs-wayland" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "wlroots": { + "flake": false, + "locked": { + "host": "gitlab.freedesktop.org", + "lastModified": 1682436395, + "narHash": "sha256-GGEjkQO9m7YLYIXIXM76HWdhjg4Ye+oafOtyaFAYKI4=", + "owner": "wlroots", + "repo": "wlroots", + "rev": "6830bfc17fd94709e2cdd4da0af989f102a26e59", + "type": "gitlab" + }, + "original": { + "host": "gitlab.freedesktop.org", + "owner": "wlroots", + "repo": "wlroots", + "type": "gitlab" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1682439384, + "narHash": "sha256-zHDa8LCZs05TZHQSIZ3ucwyMPglBGHcqTBzfkLjYXTM=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "c0e233955568fbea4e859336f6d3d14d51294d7c", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" } } }, "root": "root", "version": 7 } - diff --git a/flake.nix b/flake.nix index b8d03291..81d8cfe1 100644 --- a/flake.nix +++ b/flake.nix @@ -18,9 +18,12 @@ # nix community's cache server extra-substituters = [ "https://nix-community.cachix.org" + "https://nixpkgs-wayland.cachix.org" ]; extra-trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" ]; }; @@ -35,6 +38,11 @@ # 这里使 home-manager 的 nixpkgs 这个 inputs 与当前 flake 的 inputs.nixpkgs 保持一致,避免依赖的 nixpkgs 版本不一致导致问题 home-manager.inputs.nixpkgs.follows = "nixpkgs"; + # modern window compositor + hyprland.url = "github:hyprwm/Hyprland"; + # community wayland nixpkgs + nixpkgs-wayland = { url = "github:nix-community/nixpkgs-wayland"; }; + # vscode 插件库 nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions"; }; @@ -70,6 +78,7 @@ # # nix flake 的 modules 系统可将配置模块化,提升配置的可维护性 # 默认只能传上面这四个参数,如果需要传其他参数,必须使用 specialArgs + specialArgs = {inherit inputs;}; modules = [ ./hosts/nixos-test @@ -84,12 +93,20 @@ home-manager.extraSpecialArgs = inputs; home-manager.users.ryan = import ./home; } + + ({pkgs, config, ... }: { + config = { + # use it as an overlay + nixpkgs.overlays = [ inputs.nixpkgs-wayland.overlay ]; + }; + }) ]; }; msi-rtx4090 = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; + specialArgs = {inherit inputs;}; modules = [ ./hosts/msi-rtx4090 diff --git a/home/default.nix b/home/default.nix index c46ff673..ac589f0b 100644 --- a/home/default.nix +++ b/home/default.nix @@ -4,7 +4,7 @@ imports = [ ./fcitx5 - ./i3 + ./hyprland ./programs ./rofi ./shell diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix new file mode 100644 index 00000000..e1f690dc --- /dev/null +++ b/home/hyprland/default.nix @@ -0,0 +1,38 @@ +{ + pkgs, + config, + ... +}: { + # hyprland configs, based on https://github.com/notwidow/hyprland + home.file.".config/hypr" = { + source = ./hypr-conf; + # copy the scripts directory recursively + recursive = true; + }; + + home.packages = with pkgs; [ + waybar # for the status bar + swaybg # for setting the wallpaper + swayidle # for setting the idle timeout + swaylock # for locking the screen + wl-clipboard # for copying and pasting + wf-recorder # for screen recording + + xfce.xfce4-appfinder # for the application launcher + + wofi # for the application launcher + mako # for the notification daemon + grim # for taking screenshots + slurp # for selecting a region to screenshot + + light # for changing the screen brightness + yad # for the brightness popup + + # 用于播放系统音效 + mpd # for playing system sounds + mpc-cli # command-line mpd client + ncmpcpp # a mpd client with a UI + + viewnior # Elegant Image Viewer + ]; +} \ No newline at end of file diff --git a/home/hyprland/hypr-conf/hyprland.conf b/home/hyprland/hypr-conf/hyprland.conf new file mode 100644 index 00000000..eba22c75 --- /dev/null +++ b/home/hyprland/hypr-conf/hyprland.conf @@ -0,0 +1,219 @@ +## Hyprland configuration file for Archcraft + +#-- Output ---------------------------------------------------- +# Configure your Display resolution, offset, scale and Monitors here, use `hyprctl monitors` to get the info. + + # format: + # monitor=name,resolution,position,scale + monitor=DP-2,3840x2160@144,0x0,1.5 + workspace=DP-2,1 + +#-- Input ---------------------------------------------------- +# Configure mouse and touchpad here. +input { + kb_layout=us + kb_variant= + kb_model= + kb_options= + kb_rules= + follow_mouse=1 + natural_scroll=0 + force_no_accel=0 + # repeat_rate= + # repeat_delay= + numlock_by_default=1 +} + +#-- General ---------------------------------------------------- +# General settings like MOD key, Gaps, Colors, etc. +general { + sensitivity=2.0 + apply_sens_to_raw=0 + + gaps_in=5 + gaps_out=10 + + border_size=4 + col.active_border=0xFFB4A1DB + col.inactive_border=0xFF343A40 +} + +#-- Decoration ---------------------------------------------------- +# Decoration settings like Rounded Corners, Opacity, Blur, etc. +decoration { + rounding=8 # Original: rounding=-1 + multisample_edges=0 + + active_opacity=1.0 + inactive_opacity=0.9 + fullscreen_opacity=1.0 + + blur=0 + blur_size=3 # minimum 1 + blur_passes=1 # minimum 1, more passes = more resource intensive. + blur_ignore_opacity=0 + + # Your blur "amount" is blur_size * blur_passes, but high blur_size (over around 5-ish) will produce artifacts. + # if you want heavy blur, you need to up the blur_passes. + # the more passes, the more you can up the blur_size without noticing artifacts. +} + +#-- Animations ---------------------------------------------------- +animations { + enabled=1 + animation=windows,1,8,default,popin 80% + animation=fadeOut,1,8,default + animation=fadeIn,1,8,default + animation=workspaces,1,8,default + #animation=workspaces,1,6,overshot +} + +#-- Dwindle ---------------------------------------------------- +dwindle { + pseudotile=0 # enable pseudotiling on dwindle +} + +#-- Window Rules ---------------------------------------------------- +windowrule=float,foot-float +windowrule=float,yad|nm-connection-editor|pavucontrolk +windowrule=float,xfce-polkit|kvantummanager|qt5ct +windowrule=float,feh|Viewnior|Gpicview|Gimp|nomacs +windowrule=float,VirtualBox Manager|qemu|Qemu-system-x86_64 +windowrule=float,xfce4-appfinder + +windowrule=float,foot-full +windowrule=move 0 0,foot-full +windowrule=size 100% 100%,foot-full + +windowrule=float,wlogout +windowrule=move 0 0,wlogout +windowrule=size 100% 100%,wlogout +windowrule=animation slide,wlogout + +#windowrule=move 69 420,abc +#windowrule=size 420 69,abc +#windowrule=tile,xyz +#windowrule=pseudo,abc +#windowrule=monitor 0,xyz +#windowrule=workspace 12,abc +#windowrule=opacity 1.0,abc +#windowrule=animation slide left,abc +#windowrule=rounding 10,abc + +#-- Keybindings ---------------------------------------------------- +$term = alacritty +$menu1 = xfce4-appfinder --collapsed +$menu2 = ~/.config/hypr/scripts/menu +$menu3 = xfce4-appfinder +$powermenu = ~/.config/hypr/scripts/powermenu +$volume = ~/.config/hypr/scripts/volume +$backlight = ~/.config/hypr/scripts/brightness +$screenshot = ~/.config/hypr/scripts/screenshot +$lockscreen = ~/.config/hypr/scripts/lockscreen +$wlogout = ~/.config/hypr/scripts/wlogout +$colorpicker = ~/.config/hypr/scripts/colorpicker +$files = thunar +$editor = geany +$browser = firefox + +# -- Terminal -- +bind=SUPER,Return,exec,$term +bind=SUPERSHIFT,Return,exec,$term -s +bind=SUPERALT,Return,exec,$term -f +bind=SUPER,T,exec,$term -F + +# -- Apps -- +bind=SUPERSHIFT,F,exec,$files +bind=SUPERSHIFT,E,exec,$editor +bind=SUPERSHIFT,W,exec,$browser + +# -- Wofi -- +bind=ALT,F1,exec,$menu1 +bind=SUPER,D,exec,$menu2 +bind=ALT,F3,exec,$menu3 +#bind=SUPER,X,exec,$powermenu + +# -- Hyprland -- +bind=SUPER,Q,killactive, +bind=SUPER,C,killactive, +bind=CTRLALT,Delete,exit, +bind=SUPER,F,fullscreen, +bind=SUPER,Space,togglefloating, +bind=SUPER,S,pseudo, + +# -- Misc -- +bind=SUPER,N,exec,nm-connection-editor +bind=SUPER,P,exec,$colorpicker +bind=SUPER,X,exec,$wlogout +bind=CTRLALT,L,exec,$lockscreen + +# -- Some nice mouse binds -- +bindm=SUPER,mouse:272,movewindow +bindm=SUPER,mouse:273,resizewindow + +# -- Function keys -- +bind=,XF86MonBrightnessUp,exec,$backlight --inc +bind=,XF86MonBrightnessDown,exec,$backlight --dec +bind=,XF86AudioRaiseVolume,exec,$volume --inc +bind=,XF86AudioLowerVolume,exec,$volume --dec +bind=,XF86AudioMute,exec,$volume --toggle +bind=,XF86AudioMicMute,exec,$volume --toggle-mic +bind=,XF86AudioNext,exec,mpc next +bind=,XF86AudioPrev,exec,mpc prev +bind=,XF86AudioPlay,exec,mpc toggle +bind=,XF86AudioStop,exec,mpc stop + +# -- Screenshots -- +bind=,Print,exec,$screenshot --now +bind=SUPER,Print,exec,$screenshot --in5 +bind=SHIFT,Print,exec,$screenshot --in10 +bind=CTRL,Print,exec,$screenshot --win +bind=SUPERCTRL,Print,exec,$screenshot --area + +# Focus +bind=SUPER,left,movefocus,l +bind=SUPER,right,movefocus,r +bind=SUPER,up,movefocus,u +bind=SUPER,down,movefocus,d + +# Move +bind=SUPERSHIFT,left,movewindow,l +bind=SUPERSHIFT,right,movewindow,r +bind=SUPERSHIFT,up,movewindow,u +bind=SUPERSHIFT,down,movewindow,d + +# Resize +bind=SUPERCTRL,left,resizeactive,-20 0 +bind=SUPERCTRL,right,resizeactive,20 0 +bind=SUPERCTRL,up,resizeactive,0 -20 +bind=SUPERCTRL,down,resizeactive,0 20 + +# Workspaces +bind=SUPER,1,workspace,1 +bind=SUPER,2,workspace,2 +bind=SUPER,3,workspace,3 +bind=SUPER,4,workspace,4 +bind=SUPER,5,workspace,5 +bind=SUPER,6,workspace,6 +bind=SUPER,7,workspace,7 +bind=SUPER,8,workspace,8 +bind=SUPER,9,workspace,9 +bind=SUPER,0,workspace,10 + +# Send to Workspaces +bind=ALT,1,movetoworkspace,1 +bind=ALT,2,movetoworkspace,2 +bind=ALT,3,movetoworkspace,3 +bind=ALT,4,movetoworkspace,4 +bind=ALT,5,movetoworkspace,5 +bind=ALT,6,movetoworkspace,6 +bind=ALT,7,movetoworkspace,7 +bind=ALT,8,movetoworkspace,8 +bind=ALT,9,movetoworkspace,9 +bind=ALT,0,movetoworkspace,10 + +bind=SUPER,mouse_down,workspace,e+1 +bind=SUPER,mouse_up,workspace,e-1 + +#-- Startup ---------------------------------------------------- +exec-once=~/.config/hypr/scripts/startup diff --git a/home/hyprland/hypr-conf/mako/config b/home/hyprland/hypr-conf/mako/config new file mode 100644 index 00000000..b66b00ec --- /dev/null +++ b/home/hyprland/hypr-conf/mako/config @@ -0,0 +1,56 @@ +## Mako configuration file + +# GLOBAL CONFIGURATION OPTIONS +max-history=100 +sort=-time + +# BINDING OPTIONS +on-button-left=dismiss +on-button-middle=none +on-button-right=dismiss-all +on-touch=dismiss +on-notify=exec mpv /usr/share/sounds/freedesktop/stereo/message.oga + +# STYLE OPTIONS +font=JetBrains Mono 10 +width=300 +height=100 +margin=10 +padding=15 +border-size=2 +border-radius=0 +icons=1 +max-icon-size=48 +icon-location=left +markup=1 +actions=1 +history=1 +text-alignment=left +default-timeout=5000 +ignore-timeout=0 +max-visible=5 +layer=overlay +anchor=top-right + +background-color=#1e1e2e +text-color=#d9e0ee +border-color=#313244 +progress-color=over #89b4fa + +[urgency=low] +border-color=#313244 +default-timeout=2000 + +[urgency=normal] +border-color=#313244 +default-timeout=5000 + +[urgency=high] +border-color=#f38ba8 +text-color=#f38ba8 +default-timeout=0 + +[category=mpd] +border-color=#f9e2af +default-timeout=2000 +group-by=category diff --git a/home/hyprland/hypr-conf/mako/icons/brightness-100.png b/home/hyprland/hypr-conf/mako/icons/brightness-100.png new file mode 100644 index 00000000..1e28ac37 Binary files /dev/null and b/home/hyprland/hypr-conf/mako/icons/brightness-100.png differ diff --git a/home/hyprland/hypr-conf/mako/icons/brightness-20.png b/home/hyprland/hypr-conf/mako/icons/brightness-20.png new file mode 100644 index 00000000..aee9c523 Binary files /dev/null and b/home/hyprland/hypr-conf/mako/icons/brightness-20.png differ diff --git a/home/hyprland/hypr-conf/mako/icons/brightness-40.png b/home/hyprland/hypr-conf/mako/icons/brightness-40.png new file mode 100644 index 00000000..bbedd1c7 Binary files /dev/null and b/home/hyprland/hypr-conf/mako/icons/brightness-40.png differ diff --git a/home/hyprland/hypr-conf/mako/icons/brightness-60.png b/home/hyprland/hypr-conf/mako/icons/brightness-60.png new file mode 100644 index 00000000..4cd838bd Binary files /dev/null and b/home/hyprland/hypr-conf/mako/icons/brightness-60.png differ diff --git a/home/hyprland/hypr-conf/mako/icons/brightness-80.png b/home/hyprland/hypr-conf/mako/icons/brightness-80.png new file mode 100644 index 00000000..6684bdb8 Binary files /dev/null and b/home/hyprland/hypr-conf/mako/icons/brightness-80.png differ diff --git a/home/hyprland/hypr-conf/mako/icons/dropper.png b/home/hyprland/hypr-conf/mako/icons/dropper.png new file mode 100644 index 00000000..2e222a35 Binary files /dev/null and b/home/hyprland/hypr-conf/mako/icons/dropper.png differ diff --git a/home/hyprland/hypr-conf/mako/icons/microphone-mute.png b/home/hyprland/hypr-conf/mako/icons/microphone-mute.png new file mode 100644 index 00000000..1780e330 Binary files /dev/null and b/home/hyprland/hypr-conf/mako/icons/microphone-mute.png differ diff --git a/home/hyprland/hypr-conf/mako/icons/microphone.png b/home/hyprland/hypr-conf/mako/icons/microphone.png new file mode 100644 index 00000000..d1b6d767 Binary files /dev/null and b/home/hyprland/hypr-conf/mako/icons/microphone.png differ diff --git a/home/hyprland/hypr-conf/mako/icons/music.png b/home/hyprland/hypr-conf/mako/icons/music.png new file mode 100644 index 00000000..92bf4c65 Binary files /dev/null and b/home/hyprland/hypr-conf/mako/icons/music.png differ diff --git a/home/hyprland/hypr-conf/mako/icons/palette.png b/home/hyprland/hypr-conf/mako/icons/palette.png new file mode 100644 index 00000000..3ba73d05 Binary files /dev/null and b/home/hyprland/hypr-conf/mako/icons/palette.png differ diff --git a/home/hyprland/hypr-conf/mako/icons/picture.png b/home/hyprland/hypr-conf/mako/icons/picture.png new file mode 100644 index 00000000..4669bc30 Binary files /dev/null and b/home/hyprland/hypr-conf/mako/icons/picture.png differ diff --git a/home/hyprland/hypr-conf/mako/icons/timer.png b/home/hyprland/hypr-conf/mako/icons/timer.png new file mode 100644 index 00000000..420d1f15 Binary files /dev/null and b/home/hyprland/hypr-conf/mako/icons/timer.png differ diff --git a/home/hyprland/hypr-conf/mako/icons/volume-high.png b/home/hyprland/hypr-conf/mako/icons/volume-high.png new file mode 100644 index 00000000..200f17b2 Binary files /dev/null and b/home/hyprland/hypr-conf/mako/icons/volume-high.png differ diff --git a/home/hyprland/hypr-conf/mako/icons/volume-low.png b/home/hyprland/hypr-conf/mako/icons/volume-low.png new file mode 100644 index 00000000..17cfff78 Binary files /dev/null and b/home/hyprland/hypr-conf/mako/icons/volume-low.png differ diff --git a/home/hyprland/hypr-conf/mako/icons/volume-mid.png b/home/hyprland/hypr-conf/mako/icons/volume-mid.png new file mode 100644 index 00000000..1a3ad3a3 Binary files /dev/null and b/home/hyprland/hypr-conf/mako/icons/volume-mid.png differ diff --git a/home/hyprland/hypr-conf/mako/icons/volume-mute.png b/home/hyprland/hypr-conf/mako/icons/volume-mute.png new file mode 100644 index 00000000..0b9b0c3c Binary files /dev/null and b/home/hyprland/hypr-conf/mako/icons/volume-mute.png differ diff --git a/home/hyprland/hypr-conf/scripts/brightness b/home/hyprland/hypr-conf/scripts/brightness new file mode 100755 index 00000000..1dc74334 --- /dev/null +++ b/home/hyprland/hypr-conf/scripts/brightness @@ -0,0 +1,54 @@ +#!/usr/bin/env bash + +## Script To Manage Brightness For Archcraft (in Wayland). + +iDIR="$HOME/.config/hypr/mako/icons" + +# Get brightness +get_backlight() { + LIGHT=$(printf "%.0f\n" $(light -G)) + echo "${LIGHT}%" +} + +# Get icons +get_icon() { + backlight="$(get_backlight)" + current="${backlight%%%}" + if [[ ("$current" -ge "0") && ("$current" -le "20") ]]; then + icon="$iDIR/brightness-20.png" + elif [[ ("$current" -ge "20") && ("$current" -le "40") ]]; then + icon="$iDIR/brightness-40.png" + elif [[ ("$current" -ge "40") && ("$current" -le "60") ]]; then + icon="$iDIR/brightness-60.png" + elif [[ ("$current" -ge "60") && ("$current" -le "80") ]]; then + icon="$iDIR/brightness-80.png" + elif [[ ("$current" -ge "80") && ("$current" -le "100") ]]; then + icon="$iDIR/brightness-100.png" + fi +} + +# Notify +notify_user() { + notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$icon" "Brightness : $(get_backlight)" +} + +# Increase brightness +inc_backlight() { + light -A 5 && get_icon && notify_user +} + +# Decrease brightness +dec_backlight() { + light -U 5 && get_icon && notify_user +} + +# Execute accordingly +if [[ "$1" == "--get" ]]; then + get_backlight +elif [[ "$1" == "--inc" ]]; then + inc_backlight +elif [[ "$1" == "--dec" ]]; then + dec_backlight +else + get_backlight +fi diff --git a/home/hyprland/hypr-conf/scripts/colorpicker b/home/hyprland/hypr-conf/scripts/colorpicker new file mode 100755 index 00000000..f83e4f97 --- /dev/null +++ b/home/hyprland/hypr-conf/scripts/colorpicker @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +## Simple Script To Pick Color Quickly. + +color=$(grim -g "$(slurp -b 1B1F2800 -p)" -t ppm - | convert - -format '%[pixel:p{0,0}]' txt:- | tail -n1 | cut -d' ' -f4) +image=/tmp/${color}.png + +main() { + if [[ "$color" ]]; then + # copy color code to clipboard + echo $color | tr -d "\n" | wl-copy + # generate preview + convert -size 48x48 xc:"$color" ${image} + # notify about it + notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i ${image} "$color, copied to clipboard." + fi +} + +# Run the script +main diff --git a/home/hyprland/hypr-conf/scripts/gtkthemes-bkp b/home/hyprland/hypr-conf/scripts/gtkthemes-bkp new file mode 100755 index 00000000..8be7251d --- /dev/null +++ b/home/hyprland/hypr-conf/scripts/gtkthemes-bkp @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +## Set GTK Themes, Icons, Cursor and Fonts + +THEME='Arc-Dark' +ICONS='Zafiro-Blue' +FONT='Noto Sans 9' +CURSOR='Qogirr' + +SCHEMA='gsettings set org.gnome.desktop.interface' + +apply_themes () { + ${SCHEMA} gtk-theme "$THEME" + ${SCHEMA} icon-theme "$ICONS" + ${SCHEMA} cursor-theme "$CURSOR" + ${SCHEMA} font-name "$FONT" +} + +apply_themes diff --git a/home/hyprland/hypr-conf/scripts/lockscreen b/home/hyprland/hypr-conf/scripts/lockscreen new file mode 100755 index 00000000..46fc2195 --- /dev/null +++ b/home/hyprland/hypr-conf/scripts/lockscreen @@ -0,0 +1,70 @@ +#!/usr/bin/env bash + +# Background Image +IMAGE="$HOME/.config/hypr/wallpapers/lockscreen.png" + +# Colors +bg='1e1e2e' bgl='313244' fg='d9e0ee' +red='f38ba8' green='a6e3a1' yellow='f9e2af' +blue='89b4fa' magenta='cba6f7' cyan='89dceb' +alpha='00000000' + +# CMD +swaylock -f \ + \ + `# General` \ + --ignore-empty-password \ + --show-failed-attempts \ + --hide-keyboard-layout \ + --indicator-caps-lock \ + \ + `# Appearance` \ + --color ${bg}E6 \ + `#--image ${IMAGE} --scaling fill` \ + --font 'JetBrainsMono Nerd Font' --font-size 18 \ + \ + `# Backspace Key` \ + --key-hl-color ${green} \ + --caps-lock-key-hl-color ${blue} \ + --bs-hl-color ${red} \ + --caps-lock-bs-hl-color ${red} \ + \ + `# Indicator` \ + --indicator-radius 120 \ + --indicator-thickness 10 \ + \ + `# Inside Circle Colors` \ + --inside-color ${alpha} \ + --inside-clear-color ${alpha} \ + --inside-caps-lock-color ${alpha} \ + --inside-ver-color ${blue} \ + --inside-wrong-color ${red} \ + \ + `# Layout Colors` \ + --layout-bg-color ${cyan} \ + --layout-border-color ${cyan} \ + --layout-text-color ${bg} \ + \ + `# Line Colors` \ + --line-color ${bg} \ + --line-clear-color ${red} \ + --line-caps-lock-color ${bg} \ + --line-ver-color ${bg} \ + --line-wrong-color ${bg} \ + \ + `# Ring Colors` \ + --ring-color ${cyan} \ + --ring-clear-color ${bg} \ + --ring-caps-lock-color ${magenta} \ + --ring-ver-color ${blue} \ + --ring-wrong-color ${red} \ + \ + `# Separator Color` \ + --separator-color ${bg} \ + \ + `# Text Colors` \ + --text-color ${fg} \ + --text-clear-color ${fg} \ + --text-caps-lock-color ${fg} \ + --text-ver-color ${bg} \ + --text-wrong-color ${bg} diff --git a/home/hyprland/hypr-conf/scripts/menu b/home/hyprland/hypr-conf/scripts/menu new file mode 100755 index 00000000..d497b6d3 --- /dev/null +++ b/home/hyprland/hypr-conf/scripts/menu @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +## launch wofi with alt config + +CONFIG="$HOME/.config/hypr/wofi/config" +STYLE="$HOME/.config/hypr/wofi/style.css" +COLORS="$HOME/.config/hypr/wofi/colors" + +if [[ ! $(pidof wofi) ]]; then + wofi --show drun --prompt 'Search...' --conf ${CONFIG} --style ${STYLE} --color ${COLORS} +else + pkill wofi +fi diff --git a/home/hyprland/hypr-conf/scripts/notifications b/home/hyprland/hypr-conf/scripts/notifications new file mode 100755 index 00000000..cf214567 --- /dev/null +++ b/home/hyprland/hypr-conf/scripts/notifications @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +## launch mako with alt config + +CONFIG="$HOME/.config/hypr/mako/config" + +if [[ ! $(pidof mako) ]]; then + mako --config ${CONFIG} +fi diff --git a/home/hyprland/hypr-conf/scripts/powermenu b/home/hyprland/hypr-conf/scripts/powermenu new file mode 100755 index 00000000..99cd369a --- /dev/null +++ b/home/hyprland/hypr-conf/scripts/powermenu @@ -0,0 +1,83 @@ +#!/usr/bin/env bash + +## Wofi Powermenu + +## Files +CONFIG="$HOME/.config/hypr/wofi/config" +STYLE="$HOME/.config/hypr/wofi/style.css" +COLORS="$HOME/.config/hypr/wofi/colors" + +## Wofi Command +wofi_command="wofi --show dmenu \ + --conf ${CONFIG} --style ${STYLE} --color ${COLORS} \ + --width=300 --height=165 \ + --cache-file=/dev/null \ + --hide-scroll --no-actions \ + --define=matching=fuzzy" + +uptime=$(uptime -p | sed -e 's/up //g') + +## Entries +shutdown=" Shutdown" +reboot=" Restart" +lock=" Lock" +suspend=" Sleep" +logout=" Logout" + +# Ask for confirmation +cdialog () { + yad --title='Confirm?' --borders=15 --center --fixed --undecorated --button=Yes:0 --button=No:1 --text="Are you sure?" --text-align=center +} + +# Variable passed to rofi +open_menu () { + options="$lock\n$suspend\n$logout\n$reboot\n$shutdown" + + chosen="$(echo -e "$options" | $wofi_command --prompt "UP - $uptime")" + case $chosen in + $shutdown) + cdialog + if [[ "$?" == 0 ]]; then + systemctl poweroff + else + exit + fi + ;; + $reboot) + cdialog + if [[ "$?" == 0 ]]; then + systemctl reboot + else + exit + fi + ;; + $lock) + ~/.config/hypr/scripts/lockscreen + ;; + $suspend) + cdialog + if [[ "$?" == 0 ]]; then + mpc -q pause + amixer set Master mute + ~/.config/hypr/scripts/lockscreen + systemctl suspend + else + exit + fi + ;; + $logout) + cdialog + if [[ "$?" == 0 ]]; then + kill -9 -1 + else + exit + fi + ;; + esac +} + +if [[ ! $(pidof wofi) ]]; then + open_menu +else + pkill wofi +fi diff --git a/home/hyprland/hypr-conf/scripts/screenshot b/home/hyprland/hypr-conf/scripts/screenshot new file mode 100755 index 00000000..cd29a82f --- /dev/null +++ b/home/hyprland/hypr-conf/scripts/screenshot @@ -0,0 +1,79 @@ +#!/usr/bin/env bash + +## Script to take screenshots with grim, slurp (in Wayland) + +iDIR="$HOME/.config/hypr/mako/icons" + +time=$(date +%Y-%m-%d-%H-%M-%S) +dir="$(xdg-user-dir PICTURES)/Screenshots" +file="Screenshot_${time}_${RANDOM}.png" + +# notify and view screenshot +notify_cmd_shot="notify-send -h string:x-canonical-private-synchronous:shot-notify -u low -i ${iDIR}/picture.png" +notify_view () { + ${notify_cmd_shot} "Copied to clipboard." + viewnior ${dir}/"$file" + if [[ -e "$dir/$file" ]]; then + ${notify_cmd_shot} "Screenshot Saved." + else + ${notify_cmd_shot} "Screenshot Deleted." + fi +} + +# countdown +countdown () { + for sec in $(seq $1 -1 1); do + notify-send -h string:x-canonical-private-synchronous:shot-notify -t 1000 -i "$iDIR"/timer.png "Taking shot in : $sec" + sleep 1 + done +} + +# take shots +shotnow () { + cd ${dir} && grim - | tee "$file" | wl-copy + notify_view +} + +shot5 () { + countdown '5' + sleep 1 && cd ${dir} && grim - | tee "$file" | wl-copy + notify_view +} + +shot10 () { + countdown '10' + sleep 1 && cd ${dir} && grim - | tee "$file" | wl-copy + notify_view +} + +shotwin () { + w_pos=$(hyprctl activewindow | grep 'at:' | cut -d':' -f2 | tr -d ' ' | tail -n1) + w_size=$(hyprctl activewindow | grep 'size:' | cut -d':' -f2 | tr -d ' ' | tail -n1 | sed s/,/x/g) + cd ${dir} && grim -g "$w_pos $w_size" - | tee "$file" | wl-copy + notify_view +} + +shotarea () { + cd ${dir} && grim -g "$(slurp -b 1B1F28CC -c E06B74ff -s C778DD0D -w 2)" - | tee "$file" | wl-copy + notify_view +} + +if [[ ! -d "$dir" ]]; then + mkdir -p "$dir" +fi + +if [[ "$1" == "--now" ]]; then + shotnow +elif [[ "$1" == "--in5" ]]; then + shot5 +elif [[ "$1" == "--in10" ]]; then + shot10 +elif [[ "$1" == "--win" ]]; then + shotwin +elif [[ "$1" == "--area" ]]; then + shotarea +else + echo -e "Available Options : --now --in5 --in10 --win --area" +fi + +exit 0 diff --git a/home/hyprland/hypr-conf/scripts/startup b/home/hyprland/hypr-conf/scripts/startup new file mode 100755 index 00000000..b5178059 --- /dev/null +++ b/home/hyprland/hypr-conf/scripts/startup @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +## Autostart Programs + +# Kill already running process +_ps=(waybar mako mpd xfce-polkit) +for _prs in "${_ps[@]}"; do + if [[ $(pidof ${_prs}) ]]; then + killall -9 ${_prs} + fi +done + +# Polkit agent +/usr/lib/xfce-polkit/xfce-polkit & + +# Set wallpaper +swaybg --output '*' --mode fill --image ~/.config/hypr/wallpapers/wallpaper.png & + +# Apply themes +~/.config/hypr/scripts/gtkthemes & + +# Lauch notification daemon (mako) +~/.config/hypr/scripts/notifications & + +# Lauch statusbar (waybar) +~/.config/hypr/scripts/statusbar & + +# Start mpd +exec mpd & diff --git a/home/hyprland/hypr-conf/scripts/statusbar b/home/hyprland/hypr-conf/scripts/statusbar new file mode 100755 index 00000000..217feada --- /dev/null +++ b/home/hyprland/hypr-conf/scripts/statusbar @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +## launch waybar with alt config + +CONFIG="$HOME/.config/hypr/waybar/config" +STYLE="$HOME/.config/hypr/waybar/style.css" + +if [[ ! $(pidof waybar) ]]; then + waybar --bar main-bar --log-level error --config ${CONFIG} --style ${STYLE} +fi diff --git a/home/hyprland/hypr-conf/scripts/terminal b/home/hyprland/hypr-conf/scripts/terminal new file mode 100755 index 00000000..5dd573ad --- /dev/null +++ b/home/hyprland/hypr-conf/scripts/terminal @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +## launch terminal with alt config + +CONFIG="$HOME/.config/hypr/foot/foot.ini" + +if [ "$1" == "-f" ]; then + foot --app-id='foot-float' --config="$CONFIG" +elif [ "$1" == "-F" ]; then + foot --fullscreen --app-id='foot-full' --font="Iosevka Nerd Font:size=14" --override=pad=35x35 --config="$CONFIG" +elif [ "$1" == "-s" ]; then + foot --app-id='foot-float' --config="$CONFIG" \ + --window-size-pixels=$(slurp -b 1B1F28CC -c E06B74ff -s C778DD0D -w 2 -f "%wx%h") +else + foot --config="$CONFIG" +fi diff --git a/home/hyprland/hypr-conf/scripts/volume b/home/hyprland/hypr-conf/scripts/volume new file mode 100755 index 00000000..3bc7ea46 --- /dev/null +++ b/home/hyprland/hypr-conf/scripts/volume @@ -0,0 +1,76 @@ +#!/usr/bin/env bash + +## Script To Manage Speaker Volume For Archcraft (in Wayland). + +iDIR="$HOME/.config/hypr/mako/icons" + +# Get Volume +get_volume() { + volume=$(amixer get Master | tail -n1 | awk -F ' ' '{print $5}' | tr -d '[]') + echo "$volume" +} + +# Get icons +get_icon() { + vol="$(get_volume)" + current="${vol%%%}" + if [[ "$current" -eq "0" ]]; then + icon="$iDIR/volume-mute.png" + elif [[ ("$current" -ge "0") && ("$current" -le "30") ]]; then + icon="$iDIR/volume-low.png" + elif [[ ("$current" -ge "30") && ("$current" -le "60") ]]; then + icon="$iDIR/volume-mid.png" + elif [[ ("$current" -ge "60") && ("$current" -le "100") ]]; then + icon="$iDIR/volume-high.png" + fi +} + +# Notify +notify_user() { + notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$icon" "Volume : $(get_volume)" +} + +# Increase Volume +inc_volume() { + amixer -Mq set Master,0 5%+ unmute && get_icon && notify_user +} + +# Decrease Volume +dec_volume() { + amixer -Mq set Master,0 5%- unmute && get_icon && notify_user +} + +# Toggle Mute +toggle_mute() { + amixer get Master | grep '\[on\]' &>/dev/null + if [[ "$?" == 0 ]]; then + amixer set Master toggle && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/volume-mute.png" "Mute" + else + amixer set Master toggle && get_icon && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$icon" "Unmute" + fi +} + +# Toggle Mic +toggle_mic() { + amixer get Capture | grep '\[on\]' &>/dev/null + if [[ "$?" == 0 ]]; then + amixer -D pulse sset Capture toggle && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/microphone-mute.png" "Microphone Switched OFF" + else + amixer -D pulse sset Capture toggle && get_icon && notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$iDIR/microphone.png" "Microphone Switched ON" + fi +} + +# Execute accordingly +if [[ "$1" == "--get" ]]; then + get_volume +elif [[ "$1" == "--inc" ]]; then + inc_volume +elif [[ "$1" == "--dec" ]]; then + dec_volume +elif [[ "$1" == "--toggle" ]]; then + toggle_mute +elif [[ "$1" == "--toggle-mic" ]]; then + toggle_mic +else + get_volume +fi diff --git a/home/hyprland/hypr-conf/scripts/weather.sh b/home/hyprland/hypr-conf/scripts/weather.sh new file mode 100755 index 00000000..262c5547 --- /dev/null +++ b/home/hyprland/hypr-conf/scripts/weather.sh @@ -0,0 +1,79 @@ +#!/usr/bin/env bash + +cachedir=~/.cache/rbn +cachefile=${0##*/}-$1 + +if [ ! -d $cachedir ]; then + mkdir -p $cachedir +fi + +if [ ! -f $cachedir/$cachefile ]; then + touch $cachedir/$cachefile +fi + +# Save current IFS +SAVEIFS=$IFS +# Change IFS to new line. +IFS=$'\n' + +cacheage=$(($(date +%s) - $(stat -c '%Y' "$cachedir/$cachefile"))) +if [ $cacheage -gt 1740 ] || [ ! -s $cachedir/$cachefile ]; then + data=($(curl -s https://en.wttr.in/$1\?0qnT 2>&1)) + echo ${data[0]} | cut -f1 -d, > $cachedir/$cachefile + echo ${data[1]} | sed -E 's/^.{15}//' >> $cachedir/$cachefile + echo ${data[2]} | sed -E 's/^.{15}//' >> $cachedir/$cachefile +fi + +weather=($(cat $cachedir/$cachefile)) + +# Restore IFSClear +IFS=$SAVEIFS + +temperature=$(echo ${weather[2]} | sed -E 's/([[:digit:]])+\.\./\1 to /g') + +#echo ${weather[1]##*,} + +# https://fontawesome.com/icons?s=solid&c=weather +case $(echo ${weather[1]##*,} | tr '[:upper:]' '[:lower:]') in +"clear" | "sunny") + condition="" + ;; +"partly cloudy") + condition="杖" + ;; +"cloudy") + condition="" + ;; +"overcast") + condition="" + ;; +"mist" | "fog" | "freezing fog") + condition="" + ;; +"patchy rain possible" | "patchy light drizzle" | "light drizzle" | "patchy light rain" | "light rain" | "light rain shower" | "rain") + condition="" + ;; +"moderate rain at times" | "moderate rain" | "heavy rain at times" | "heavy rain" | "moderate or heavy rain shower" | "torrential rain shower" | "rain shower") + condition="" + ;; +"patchy snow possible" | "patchy sleet possible" | "patchy freezing drizzle possible" | "freezing drizzle" | "heavy freezing drizzle" | "light freezing rain" | "moderate or heavy freezing rain" | "light sleet" | "ice pellets" | "light sleet showers" | "moderate or heavy sleet showers") + condition="ﭽ" + ;; +"blowing snow" | "moderate or heavy sleet" | "patchy light snow" | "light snow" | "light snow showers") + condition="流" + ;; +"blizzard" | "patchy moderate snow" | "moderate snow" | "patchy heavy snow" | "heavy snow" | "moderate or heavy snow with thunder" | "moderate or heavy snow showers") + condition="ﰕ" + ;; +"thundery outbreaks possible" | "patchy light rain with thunder" | "moderate or heavy rain with thunder" | "patchy light snow with thunder") + condition="" + ;; +*) + condition="" + echo -e "{\"text\":\""$condition"\", \"alt\":\""${weather[0]}"\", \"tooltip\":\""${weather[0]}: $temperature ${weather[1]}"\"}" + ;; +esac + +#echo $temp $condition + +echo -e "{\"text\":\""$temperature $condition"\", \"alt\":\""${weather[0]}"\", \"tooltip\":\""${weather[0]}: $temperature ${weather[1]}"\"}" diff --git a/home/hyprland/hypr-conf/scripts/wlogout b/home/hyprland/hypr-conf/scripts/wlogout new file mode 100755 index 00000000..e423c937 --- /dev/null +++ b/home/hyprland/hypr-conf/scripts/wlogout @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +## wlogout with alt layout and style file + +LAYOUT="$HOME/.config/hypr/wlogout/layout" +STYLE="$HOME/.config/hypr/wlogout/style.css" + +if [[ ! $(pidof wlogout) ]]; then + wlogout --layout ${LAYOUT} --css ${STYLE} \ + --buttons-per-row 5 \ + --column-spacing 50 \ + --row-spacing 50 \ + --margin-top 390 \ + --margin-bottom 390 \ + --margin-left 150 \ + --margin-right 150 +else + pkill wlogout +fi diff --git a/home/hyprland/hypr-conf/wallpapers/lockscreen.png b/home/hyprland/hypr-conf/wallpapers/lockscreen.png new file mode 100644 index 00000000..b7069360 Binary files /dev/null and b/home/hyprland/hypr-conf/wallpapers/lockscreen.png differ diff --git a/home/hyprland/hypr-conf/wallpapers/wallpaper.png b/home/hyprland/hypr-conf/wallpapers/wallpaper.png new file mode 100644 index 00000000..29578428 Binary files /dev/null and b/home/hyprland/hypr-conf/wallpapers/wallpaper.png differ diff --git a/home/hyprland/hypr-conf/waybar/config b/home/hyprland/hypr-conf/waybar/config new file mode 100644 index 00000000..1a32172e --- /dev/null +++ b/home/hyprland/hypr-conf/waybar/config @@ -0,0 +1,223 @@ +{ + "name": "main-bar", + "id": "main-bar", + "layer": "top", + "mode": "dock", + "exclusive": true, + "passthrough": false, + "height": 32, + "spacing": 6, + "margin": 0, + "margin-top": 0, + "margin-bottom": 0, + "margin-left": 0, + "margin-right": 0, + "fixed-center": true, + "ipc": true, + + "modules-left": [ + "custom/menu", + "wlr/workspaces", + "cpu", + "memory", + "disk" + ], + "modules-center": [ + "mpd", + "tray" + ], + "modules-right": [ + "pulseaudio", + "custom/weather", + "network", + "battery", + "clock", + "custom/power" + ], + + // waybar-backlight + "backlight": { + "interval": 2, + "align": 0, + "rotate": 0, + //"device": "amdgpu_bl0", + "format": "{icon} {percent}%", + "format-icons": [ + "", + "", + "", + "" + ], + // Commands to execute on events + "on-click": "", + "on-click-middle": "", + "on-click-right": "", + "on-update": "", + "on-scroll-up": "light -A 5%", + "on-scroll-down": "light -U 5%", + "smooth-scrolling-threshold": 1, + }, + "wlr/workspaces": { + "format": "{icon}", + "on-click": "activate", + "all-outputs": true, + "format-icons": { + "1": "", + "2": "", + "3": "", + "4": "", + "5": "ﭮ", + "6": "", + "7": "", + "8": "", + "9": "", + "10": "﮼", + "focused": "", + "default": "" + } + }, + // waybar-battery + "battery": { + "interval": 60, + "align": 0, + "rotate": 0, + //"bat": "BAT1", + //"adapter": "ACAD", + "full-at": 100, + "design-capacity": false, + "states": { + "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{icon} {capacity}%", + "format-charging": " {capacity}%", + "format-plugged": " {capacity}%", + "format-full": "{icon} Full", + //"format-good": "", + "format-alt": "{icon} {time}", + "format-icons": [ + "", + "", + "", + "", + "" + ], + "format-time": "{H}h {M}min", + "tooltip": true, + }, + // waybar-clock + "clock": { + "interval": 60, + "align": 0, + "rotate": 0, + //"timezone": "America/New_York", + "tooltip-format": "{:%B %Y}\n{calendar}", + "format": " {:%H:%M}", + "format-alt": " {:%a %b %d, %G}" + }, + // waybar-cpu + "cpu": { + "interval": 5, + "format": " LOAD: {usage}%", + }, + // waybar-custom + "custom/menu": { + "format": "", + "tooltip": false, + "on-click": "$HOME/.config/hypr/scripts/menu", + }, + "custom/power": { + "format": "襤", + "tooltip": false, + "on-click": "$HOME/.config/hypr/scripts/wlogout", + }, + // waybar-disk + "disk": { + "interval": 30, + "format": " FREE: {free}", + }, + // waybar-memory + "memory": { + "interval": 10, + "format": " USED: {used:0.1f}G", + }, + // waybar-mpd + "mpd": { + "interval": 2, + "unknown-tag": "N/A", + "format": "{stateIcon} {artist} - {title}", + "format-disconnected": " Disconnected", + "format-paused": "{stateIcon} {artist} - {title}", + "format-stopped": "Stopped ", + "state-icons": { + "paused": "", + "playing": "" + }, + "tooltip-format": "MPD (connected)", + "tooltip-format-disconnected": "MPD (disconnected)", + // Commands to execute on events + "on-click": "mpc toggle", + "on-click-middle": "mpc prev", + "on-click-right": "mpc next", + "on-update": "", + "on-scroll-up": "mpc seek +00:00:01", + "on-scroll-down": "mpc seek -00:00:01", + "smooth-scrolling-threshold": 1, + }, + // waybar-network + "network": { + "interval": 5, + //"interface": "wlan*", // (Optional) To force the use of this interface, set it for netspeed to work + "format-wifi": " {essid}", + "format-ethernet": " {ipaddr}/{cidr}", + "format-linked": " {ifname} (No IP)", + "format-disconnected": "睊 Disconnected", + "format-disabled": "睊 Disabled", + "format-alt": " {bandwidthUpBits} |  {bandwidthDownBits}", + "tooltip-format": " {ifname} via {gwaddr}", + }, + // weather-custom + "custom/weather": { + "format": "{}", + "format-alt": "{alt}: {}", + "format-alt-click": "click-right", + "interval": 1800, + "return-type": "json", + "exec": "~/.config/hypr/scripts/weather.sh", + "exec-if": "ping wttr.in -c1" + }, + // waybar-pulseaudio + "pulseaudio": { + //"format": "{volume}% {icon} {format_source}", + "format": "{icon} {volume}%", + "format-muted": " Mute", + "format-bluetooth": " {volume}% {format_source}", + "format-bluetooth-muted": " Mute", + "format-source": " {volume}%", + "format-source-muted": "", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": [ + "", + "", + "" + ] + }, + "scroll-step": 5.0, + // Commands to execute on events + "on-click": "amixer set Master toggle", + "on-click-right": "pavucontrol", + "smooth-scrolling-threshold": 1, + }, + // waybar-tray + "tray": { + "icon-size": 16, + "spacing": 10 + } +} \ No newline at end of file diff --git a/home/hyprland/hypr-conf/waybar/style.css b/home/hyprland/hypr-conf/waybar/style.css new file mode 100644 index 00000000..37918e02 --- /dev/null +++ b/home/hyprland/hypr-conf/waybar/style.css @@ -0,0 +1,184 @@ +/** ********** Fonts ********** **/ +* { + font-family: "JetBrains Mono", "Iosevka Nerd Font", archcraft, sans-serif; + font-size: 12px; +} + +/** ********** Waybar Window ********** **/ +window#waybar { + background-color: #1e1e2e; + color: #1e1e2e; + border-bottom: 2px solid #313244; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.5; +} + +/** ********** Backlight ********** **/ +#backlight { + background-color: #cba6f7; +} + +/** ********** Battery ********** **/ +#battery { + background-color: #f9e2af; +} + +#battery.charging { +} + +#battery.plugged { +} + +@keyframes blink { + to { + color: #000000; + } +} + +#battery.critical:not(.charging) { + background-color: #f38ba8; + color: #f38ba8; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +/** ********** Clock ********** **/ +#clock { + background-color: #a6e3a1; +} + +/** ********** CPU ********** **/ +#cpu { + background-color: #89dceb; +} + +/** ********** Memory ********** **/ +#memory { + background-color: #eba0ac; +} + +/** ********** Disk ********** **/ +#disk { + background-color: #b4befe; +} + +/** ********** Tray ********** **/ +#tray { + background-color: #cdd6f4; +} +#tray > .passive { + -gtk-icon-effect: dim; +} +#tray > .needs-attention { + -gtk-icon-effect: highlight; +} +#tray > .active { +} + +/** ********** MPD ********** **/ +#mpd { + background-color: #94e2d5; +} + +#mpd.disconnected { + background-color: #f38ba8; +} + +#mpd.stopped { + background-color: #f5c2e7; +} + +#mpd.playing { + background-color: #74c7ec; +} + +#mpd.paused { +} + +/** ********** Pulseaudio ********** **/ +#pulseaudio { + background-color: #fab387; +} + +#pulseaudio.bluetooth { + background-color: #f5c2e7; +} +#pulseaudio.muted { + background-color: #313244; + color: #cdd6f4; +} + +/** ********** Network ********** **/ +#network { + background-color: #89b4fa; +} + +#network.disconnected,#network.disabled { + background-color: #313244; + color: #cdd6f4; +} +#network.linked { +} +#network.ethernet { +} +#network.wifi { +} + +/** ********** Custom ********** **/ +#custom-menu, #custom-power, #custom-weather, #custom-updater { + border-radius: 4px; + margin: 6px 0px; + padding: 2px 8px; +} + +#custom-menu { + background-color: #f5c2e7; + margin-left: 6px; + padding: 2px 6px; + font-size: 16px; +} + +#custom-power { + background-color: #f38ba8; + margin-right: 6px; + padding: 2px 8px; + font-size: 16px; +} + +#custom-updater { + background-color: #e6ed7b; + margin-right: 6px; + padding: 2px 8px; + font-size: 12px; +} + +#custom-weather { + background-color: #cba6f7; + margin-right: 6px; + padding: 2px 8px; + font-size: 12px; +} + +/** Common style **/ +#backlight, +#battery, +#clock, +#cpu, +#disk, +#mode, +#memory, +#mpd, +#tray, +#pulseaudio, +#network { + border-radius: 4px; + margin: 6px 0px; + padding: 2px 8px; +} \ No newline at end of file diff --git a/home/hyprland/hypr-conf/wlogout/actions b/home/hyprland/hypr-conf/wlogout/actions new file mode 100644 index 00000000..426dcb80 --- /dev/null +++ b/home/hyprland/hypr-conf/wlogout/actions @@ -0,0 +1,50 @@ +#!/usr/bin/env bash + +## wlogout actions + +# Ask for confirmation +cdialog () { + yad --title='Confirm?' --borders=15 --center --fixed --undecorated --button=Yes:0 --button=No:1 --text="Are you sure?" --text-align=center +} + +if [[ "$1" == '--shutdown' ]]; then + cdialog + if [[ "$?" == 0 ]]; then + systemctl poweroff + else + exit + fi +elif [[ "$1" == '--reboot' ]]; then + cdialog + if [[ "$?" == 0 ]]; then + systemctl reboot + else + exit + fi +elif [[ "$1" == '--hibernate' ]]; then + cdialog + if [[ "$?" == 0 ]]; then + systemctl hibernate + else + exit + fi +elif [[ "$1" == '--lock' ]]; then + ~/.config/hypr/scripts/lockscreen +elif [[ "$1" == '--suspend' ]]; then + cdialog + if [[ "$?" == 0 ]]; then + mpc -q pause + amixer set Master mute + ~/.config/hypr/scripts/lockscreen + systemctl suspend + else + exit + fi +elif [[ "$1" == '--logout' ]]; then + cdialog + if [[ "$?" == 0 ]]; then + kill -9 -1 + else + exit + fi +fi diff --git a/home/hyprland/hypr-conf/wlogout/icons/hibernate.png b/home/hyprland/hypr-conf/wlogout/icons/hibernate.png new file mode 100644 index 00000000..6e3ba13e Binary files /dev/null and b/home/hyprland/hypr-conf/wlogout/icons/hibernate.png differ diff --git a/home/hyprland/hypr-conf/wlogout/icons/lock.png b/home/hyprland/hypr-conf/wlogout/icons/lock.png new file mode 100644 index 00000000..72530d68 Binary files /dev/null and b/home/hyprland/hypr-conf/wlogout/icons/lock.png differ diff --git a/home/hyprland/hypr-conf/wlogout/icons/logout.png b/home/hyprland/hypr-conf/wlogout/icons/logout.png new file mode 100644 index 00000000..cf1ab313 Binary files /dev/null and b/home/hyprland/hypr-conf/wlogout/icons/logout.png differ diff --git a/home/hyprland/hypr-conf/wlogout/icons/reboot.png b/home/hyprland/hypr-conf/wlogout/icons/reboot.png new file mode 100644 index 00000000..b433e24c Binary files /dev/null and b/home/hyprland/hypr-conf/wlogout/icons/reboot.png differ diff --git a/home/hyprland/hypr-conf/wlogout/icons/shutdown.png b/home/hyprland/hypr-conf/wlogout/icons/shutdown.png new file mode 100644 index 00000000..80e89d1d Binary files /dev/null and b/home/hyprland/hypr-conf/wlogout/icons/shutdown.png differ diff --git a/home/hyprland/hypr-conf/wlogout/icons/suspend.png b/home/hyprland/hypr-conf/wlogout/icons/suspend.png new file mode 100644 index 00000000..a425d19b Binary files /dev/null and b/home/hyprland/hypr-conf/wlogout/icons/suspend.png differ diff --git a/home/hyprland/hypr-conf/wlogout/layout b/home/hyprland/hypr-conf/wlogout/layout new file mode 100644 index 00000000..c0afb9ab --- /dev/null +++ b/home/hyprland/hypr-conf/wlogout/layout @@ -0,0 +1,30 @@ +{ + "label" : "suspend", + "text" : "Suspend", + "action" : "~/.config/hypr/wlogout/actions --suspend", + "keybind" : "u" +} +{ + "label" : "logout", + "text" : "Logout", + "action" : "~/.config/hypr/wlogout/actions --logout", + "keybind" : "e" +} +{ + "label" : "lock", + "text" : "Lock", + "action" : "~/.config/hypr/wlogout/actions --lock", + "keybind" : "l" +} +{ + "label" : "reboot", + "text" : "Reboot", + "action" : "~/.config/hypr/wlogout/actions --reboot", + "keybind" : "r" +} +{ + "label" : "shutdown", + "text" : "Shutdown", + "action" : "~/.config/hypr/wlogout/actions --shutdown", + "keybind" : "s" +} diff --git a/home/hyprland/hypr-conf/wlogout/style.css b/home/hyprland/hypr-conf/wlogout/style.css new file mode 100644 index 00000000..095f510e --- /dev/null +++ b/home/hyprland/hypr-conf/wlogout/style.css @@ -0,0 +1,52 @@ +/** ********** Fonts ********** **/ +* { + font-family: "JetBrains Mono", "Iosevka Nerd Font", archcraft, sans-serif; + font-size: 14px; + font-weight: bold; +} + +/** ********** Main Window ********** **/ +window { + background-color: #1E1E2E; +} + +/** ********** Buttons ********** **/ +button { + background-color: #242434; + color: #FFFFFF; + border: 2px solid #282838; + border-radius: 20px; + background-repeat: no-repeat; + background-position: center; + background-size: 35%; +} + +button:focus, button:active, button:hover { + background-color: #89B4FA; + outline-style: none; +} + +/** ********** Icons ********** **/ +#lock { + background-image: image(url("icons/lock.png"), url("/usr/share/wlogout/icons/lock.png")); +} + +#logout { + background-image: image(url("icons/logout.png"), url("/usr/share/wlogout/icons/logout.png")); +} + +#suspend { + background-image: image(url("icons/suspend.png"), url("/usr/share/wlogout/icons/suspend.png")); +} + +#hibernate { + background-image: image(url("icons/hibernate.png"), url("/usr/share/wlogout/icons/hibernate.png")); +} + +#shutdown { + background-image: image(url("icons/shutdown.png"), url("/usr/share/wlogout/icons/shutdown.png")); +} + +#reboot { + background-image: image(url("icons/reboot.png"), url("/usr/share/wlogout/icons/reboot.png")); +} diff --git a/home/hyprland/hypr-conf/wofi/colors b/home/hyprland/hypr-conf/wofi/colors new file mode 100644 index 00000000..d0c68887 --- /dev/null +++ b/home/hyprland/hypr-conf/wofi/colors @@ -0,0 +1,6 @@ +#1e1e2e +#262636 +#d9e0ee +#89b4fa +#f38ba8 +#cba6f7 diff --git a/home/hyprland/hypr-conf/wofi/config b/home/hyprland/hypr-conf/wofi/config new file mode 100644 index 00000000..4288fa20 --- /dev/null +++ b/home/hyprland/hypr-conf/wofi/config @@ -0,0 +1,39 @@ +## Wofi Config + +## General +show=drun +prompt=Apps +normal_window=true +layer=top +term=alacritty + +## Geometry +width=500px +height=305px +location=0 +orientation=vertical +halign=fill +line_wrap=off +dynamic_lines=false + +## Images +allow_markup=true +allow_images=true +image_size=24 + +## Search +exec_search=false +hide_search=false +parse_search=false +insensitive=false + +## Other +hide_scroll=true +no_actions=true +sort_order=default +gtk_dark=true +filter_rate=100 + +## Keys +key_expand=Tab +key_exit=Escape diff --git a/home/hyprland/hypr-conf/wofi/style.css b/home/hyprland/hypr-conf/wofi/style.css new file mode 100644 index 00000000..a6ed1026 --- /dev/null +++ b/home/hyprland/hypr-conf/wofi/style.css @@ -0,0 +1,60 @@ +/** ********** Fonts ********** **/ +* { + font-family: "JetBrains Mono", "Iosevka Nerd Font", archcraft, sans-serif; + font-size: 12px; +} + +#window { + background-color: --wofi-color0; + color: --wofi-color2; + border: 2px solid --wofi-color1; + border-radius: 0px; +} + +#outer-box { + padding: 20px; +} + +#input { + background-color: --wofi-color1; + border: 0px solid --wofi-color3; + padding: 8px 12px; +} + +#scroll { + margin-top: 20px; +} + +#inner-box { +} + +#img { + padding-right: 8px; +} + +#text { + color: --wofi-color2; +} + +#text:selected { + color: --wofi-color0; +} + +#entry { + padding: 6px; +} + +#entry:selected { + background-color: --wofi-color3; + color: --wofi-color0; +} + +#unselected { +} + +#selected { +} + +#input, #entry:selected { + border-radius: 4px; +} diff --git a/home/programs/media.nix b/home/programs/media.nix index d4e817f3..342357b7 100644 --- a/home/programs/media.nix +++ b/home/programs/media.nix @@ -13,8 +13,10 @@ pavucontrol playerctl pulsemixer + # images imv + imagemagick ]; programs = { diff --git a/hosts/msi-rtx4090/default.nix b/hosts/msi-rtx4090/default.nix index 7e53d7f3..c527848b 100644 --- a/hosts/msi-rtx4090/default.nix +++ b/hosts/msi-rtx4090/default.nix @@ -8,7 +8,8 @@ imports = [ ../../modules/system.nix - ../../modules/i3.nix + ../../modules/hyprland.nix + ../../modules/nixpkgs-wayland.nix # Include the results of the hardware scan. ./hardware-configuration.nix @@ -23,16 +24,25 @@ systemd-boot.enable = true; }; - networking.hostName = "msi-rtx4090"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking = { + hostName = "msi-rtx4090"; # Define your hostname. + wireless.enable = false; # Enables wireless support via wpa_supplicant. - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + # Configure network proxy if necessary + # proxy.default = "http://user:password@proxy:port/"; + # proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + networkmanager.enable = true; + interfaces.ens18 = { + useDHCP = false; + ipv4.addresses = [ { + address = "192.168.5.66"; + prefixLength = 24; + } ]; + }; + defaultGateway = "192.168.5.201"; + }; - # Enable networking - networking.networkmanager.enable = true; - networking.defaultGateway = "192.168.5.201"; # for Nvidia GPU services.xserver.videoDrivers = ["nvidia"]; diff --git a/hosts/nixos-test/default.nix b/hosts/nixos-test/default.nix index 06168321..b4876a8f 100644 --- a/hosts/nixos-test/default.nix +++ b/hosts/nixos-test/default.nix @@ -8,7 +8,8 @@ imports = [ ../../modules/system.nix - ../../modules/i3.nix + ../../modules/hyprland.nix + ../../modules/nixpkgs-wayland.nix # Include the results of the hardware scan. ./hardware-configuration.nix @@ -16,10 +17,6 @@ # Bootloader. boot.loader = { - # efi = { - # canTouchEfiVariables = true; - # efiSysMountPoint = "/boot/efi"; # ← use the same mount point here. - # }; grub = { enable = true; device = "/dev/sda"; # "nodev" @@ -29,16 +26,24 @@ }; }; - networking.hostName = "nixos-test"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking = { + hostName = "nixos-test"; # Define your hostname. + wireless.enable = false; # Enables wireless support via wpa_supplicant. - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + # Configure network proxy if necessary + # proxy.default = "http://user:password@proxy:port/"; + # proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - # Enable networking - networking.networkmanager.enable = true; - networking.defaultGateway = "192.168.5.201"; + networkmanager.enable = true; + interfaces.ens18 = { + useDHCP = false; + ipv4.addresses = [ { + address = "192.168.5.48"; + prefixLength = 24; + } ]; + }; + defaultGateway = "192.168.5.201"; + }; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions diff --git a/modules/hyprland.nix b/modules/hyprland.nix new file mode 100644 index 00000000..858796c7 --- /dev/null +++ b/modules/hyprland.nix @@ -0,0 +1,45 @@ +{pkgs, ...}: + + +{ + # i3wm: old and stable, only support X11 + # sway: compatible with i3wm, support Wayland. do not support Nvidia GPU officially. + # hyprland: project starts from 2022, support Wayland, envolving fast, good looking, support Nvidia GPU. + + environment.pathsToLink = [ "/libexec" ]; # links /libexec from derivations to /run/current-system/sw + services.xserver = { + enable = true; + + desktopManager = { + xterm.enable = false; + }; + + displayManager = { + defaultSession = "hyprland"; + lightdm.enable = false; + gdm.enable = true; + }; + }; + + programs.hyprland = { + enable = true; + + xwayland = { + enable = true; + hidpi = true; + }; + + nvidiaPatches = true; + }; + + + # thunar file manager(part of xfce) related options + programs.thunar.plugins = with pkgs.xfce; [ + thunar-archive-plugin + thunar-volman + ]; + services.gvfs.enable = true; # Mount, trash, and other functionalities + services.tumbler.enable = true; # Thumbnail support for images + + +} diff --git a/modules/nixpkgs-wayland.nix b/modules/nixpkgs-wayland.nix new file mode 100644 index 00000000..2647e740 --- /dev/null +++ b/modules/nixpkgs-wayland.nix @@ -0,0 +1,2 @@ +{pkgs, config, ... }: { +} \ No newline at end of file diff --git a/modules/system.nix b/modules/system.nix index 3e54a0ba..e74dbac6 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -34,7 +34,13 @@ noto-fonts-emoji # nerdfonts - (nerdfonts.override { fonts = [ "FiraCode" "JetBrainsMono" ]; }) + (nerdfonts.override { fonts = [ + "FiraCode" + "JetBrainsMono" + "Iosevka" + ];}) + + ]; # use fonts specified by user rather than default ones @@ -81,9 +87,11 @@ git sysstat lm_sensors # for `sensors` command + # minimal screen capture tool, used by i3 blur lock to take a screenshot # print screen key is also bound to this tool in i3 config scrot + neofetch xfce.thunar # xfce4's file manager nnn # terminal file manager @@ -92,6 +100,7 @@ # Enable sound with pipewire. sound.enable = true; hardware.pulseaudio.enable = false; + services.power-profiles-daemon = { enable = true; };