From 305a47a3fbf396abb981f225e9bea06fa6066339 Mon Sep 17 00:00:00 2001 From: zoe Date: Tue, 28 Feb 2023 19:20:19 +0100 Subject: [PATCH] basi barc --- configuration.nix | 1 + dunst/settings.nix | 10 +-- home.nix | 1 + hyprland/hyprland.conf | 90 ++++++++++++++----------- hyprland/hypup.sh | 22 +++++++ hyprland/settings.nix | 146 +++-------------------------------------- rofi/settings.nix | 6 +- sync.sh | 2 +- user.nix | 12 +++- waybar/settings.nix | 40 +++++++++++ 10 files changed, 141 insertions(+), 189 deletions(-) create mode 100755 hyprland/hypup.sh create mode 100644 waybar/settings.nix diff --git a/configuration.nix b/configuration.nix index e4760dd..c458a26 100644 --- a/configuration.nix +++ b/configuration.nix @@ -138,6 +138,7 @@ alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; + wireplumber.enable = true; # jack.enable = true; # use the example session manager (no others are packaged yet so this is enabled by default, diff --git a/dunst/settings.nix b/dunst/settings.nix index afb41f9..5871007 100644 --- a/dunst/settings.nix +++ b/dunst/settings.nix @@ -4,12 +4,12 @@ enable = true; settings = { global = { - font = "${config.font.regular} 12"; + font = "#${config.font.regular} 12"; timeout = 3; - background = config.color.background; - foreground = config.color.foreground; - highlight = config.color.green; - frame_color = config.color.green; + background = "#${config.color.background}"; + foreground = "#${config.color.foreground}"; + highlight = "#${config.color.green}"; + frame_color = "#${config.color.green}"; }; }; }; diff --git a/home.nix b/home.nix index 51ce308..562e0ab 100644 --- a/home.nix +++ b/home.nix @@ -12,6 +12,7 @@ in { ./i3/i3status-rust.nix ./dunst/settings.nix ./hyprland/settings.nix + ./waybar/settings.nix ]; home-manager.users.zoe = { diff --git a/hyprland/hyprland.conf b/hyprland/hyprland.conf index 3f30b31..0498ef2 100644 --- a/hyprland/hyprland.conf +++ b/hyprland/hyprland.conf @@ -1,8 +1,6 @@ -######################################################################################## -AUTOGENERATED HYPR CONFIG. -PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT, -OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS. -######################################################################################## +# This is an example Hyprland config file. +# +# Refer to the wiki for more information. # # Please note not all available settings / options are set here. @@ -16,14 +14,15 @@ monitor=,preferred,auto,auto # See https://wiki.hyprland.org/Configuring/Keywords/ for more # Execute your favorite apps at launch -# exec-once = waybar & hyprpaper & firefox +exec-once = swaybg -i /etc/nixos/wallpaper.png +exec-once = dunst # Source a file (multi-file configs) -source = ~/.config/hypr/myColors.conf +source = ~/.config/hypr/colors.conf # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ input { - kb_layout = us + kb_layout = us_intl kb_variant = kb_model = kb_options = @@ -32,7 +31,7 @@ input { follow_mouse = 1 touchpad { - natural_scroll = no + natural_scroll = false } sensitivity = 0 # -1.0 - 1.0, 0 means no modification. @@ -41,32 +40,21 @@ input { general { # See https://wiki.hyprland.org/Configuring/Variables/ for more - gaps_in = 5 - gaps_out = 20 + gaps_in = 4 + gaps_out = 4 border_size = 2 - col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg - col.inactive_border = rgba(595959aa) - layout = dwindle } decoration { # See https://wiki.hyprland.org/Configuring/Variables/ for more - - rounding = 10 - blur = yes - blur_size = 3 - blur_passes = 1 - blur_new_optimizations = on - - drop_shadow = yes - shadow_range = 4 - shadow_render_power = 3 - col.shadow = rgba(1a1a1aee) + rounding = 4 + blur = false + drop_shadow = false } animations { - enabled = yes + enabled = true # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more @@ -82,8 +70,8 @@ animations { dwindle { # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more - pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below - preserve_split = yes # you probably want this + pseudotile = true # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = true # you probably want this } master { @@ -93,7 +81,7 @@ master { gestures { # See https://wiki.hyprland.org/Configuring/Variables/ for more - workspace_swipe = off + workspace_swipe = false } # Example per-device config @@ -113,20 +101,19 @@ device:epic mouse V1 { $mainMod = SUPER # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more -bind = $mainMod, Q, exec, kitty -bind = $mainMod, C, killactive, -bind = $mainMod, M, exit, -bind = $mainMod, E, exec, dolphin -bind = $mainMod, V, togglefloating, -bind = $mainMod, R, exec, wofi --show drun +bind = $mainMod, return, exec, kitty +bind = $mainMod SHIFT, Q, killactive, +bind = $mainMod SHIFT, W, exit, +bind = $mainMod SHIFT, Space, togglefloating, +bind = $mainMod, D, exec, wofi --show drun bind = $mainMod, P, pseudo, # dwindle -bind = $mainMod, J, togglesplit, # dwindle +bind = $mainMod, Tab, togglesplit, # dwindle # 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, h, movefocus, l +bind = $mainMod, l, movefocus, r +bind = $mainMod, k, movefocus, u +bind = $mainMod, j, movefocus, d # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 @@ -159,3 +146,26 @@ bind = $mainMod, mouse_up, workspace, e-1 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow + +# resize submap +bind=$mainMod,R,submap,resize # will switch to a submap called resize + +submap=resize # will start a submap called "resize" + +binde=,l,resizeactive,10 0 +binde=,h,resizeactive,-10 0 +binde=,k,resizeactive,0 -10 +binde=,j,resizeactive,0 10 + +bind=,escape,submap,reset # use reset to go back to the global submap + +submap=reset # will reset the submap, meaning end the current one and return to the global one. + + +# media submap +bind=$mainMod, M, submap, media +submap=media +binde=,j,exec, python3 /etc/nixos/i3/volume.py 5%- +binde=,k,exec, python3 /etc/nixos/i3/volume.py 5%+ +bind=,escape,submap,reset +submap=reset \ No newline at end of file diff --git a/hyprland/hypup.sh b/hyprland/hypup.sh new file mode 100755 index 0000000..ba97e30 --- /dev/null +++ b/hyprland/hypup.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +cd ~ + +# Log WLR errors and logs to the hyprland log. Recommended +export HYPRLAND_LOG_WLR=1 + +# Tell XWayland to use a cursor theme +export XCURSOR_THEME=Bibata-Modern-Classic + +# Set a cursor size +export XCURSOR_SIZE=24 + +# Example IME Support: fcitx +export GTK_IM_MODULE=fcitx +export QT_IM_MODULE=fcitx +export XMODIFIERS=@im=fcitx +export SDL_IM_MODULE=fcitx +export GLFW_IM_MODULE=ibus + +exec Hyprland + diff --git a/hyprland/settings.nix b/hyprland/settings.nix index 368c1fa..a66221e 100644 --- a/hyprland/settings.nix +++ b/hyprland/settings.nix @@ -3,145 +3,15 @@ let terminal = "kitty"; in { - home-manager.users.zoe.xdg.configFile."hypr/hyprland.conf".text = '' - exec-once dunst - input { - kb_layout = us - kb_variant = - kb_model = - kb_options = - kb_rules = - - follow_mouse = 1 - - touchpad { - natural_scroll = false - } - - sensitivity = 0 # -1.0 - 1.0, 0 means no modification. - } - + home-manager.users.zoe.home.file.".hypup.sh" = { + executable = true; + source = ./hypup.sh; + }; + home-manager.users.zoe.xdg.configFile."hypr/hyprland.conf".source = ./hyprland.conf; + home-manager.users.zoe.xdg.configFile."hypr/colors.conf".text = '' general { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - - gaps_in = 5 - gaps_out = 20 - border_size = 2 - col.active_border = rgb(${config.color.green}) - col.inactive_border = rgb(${config.color.cyan}) - - layout = dwindle + col.active_border = rgb(${config.color.green}) + col.inactive_border = rgb(${config.color.cyan}) } - - decoration { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - - rounding = 10 - blur = true - blur_size = 3 - blur_passes = 1 - blur_new_optimizations = true - - drop_shadow = true - shadow_range = 4 - shadow_render_power = 3 - col.shadow = rgba(1a1a1aee) - } - - animations { - enabled = true - - # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more - - bezier = myBezier, 0.05, 0.9, 0.1, 1.05 - - animation = windows, 1, 7, myBezier - animation = windowsOut, 1, 7, default, popin 80% - animation = border, 1, 10, default - animation = borderangle, 1, 8, default - animation = fade, 1, 7, default - animation = workspaces, 1, 6, default - } - - dwindle { - # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more - pseudotile = true # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below - preserve_split = true # you probably want this - } - - master { - # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more - new_is_master = true - } - - gestures { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - workspace_swipe = false - } - - # Example per-device config - # See https://wiki.hyprland.org/Configuring/Keywords/#executing for mor - device:epic mouse V1 { - sensitivity = -0.5 - } - - # Example windowrule v1 - # windowrule = float, ^(kitty)$ - # Example windowrule v2 - # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ - # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more - - - # See https://wiki.hyprland.org/Configuring/Keywords/ for more - $mainMod = ALT - - # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more - bind = $mainMod, return, exec, kitty - bind = $mainMod, C, killactive, - bind = $mainMod, M, exit, - bind = $mainMod, E, exec, dolphin - bind = $mainMod, V, togglefloating, - bind = $mainMod, D, exec, rofi -combi-modi window#drun#ssh -show-icons -show combi -modi combi - bind = $mainMod, P, pseudo, # dwindle - bind = $mainMod, J, togglesplit, # dwindle - - # 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 - - # Switch workspaces with mainMod + [0-9] - bind = $mainMod, 1, workspace, 1 - bind = $mainMod, 2, workspace, 2 - bind = $mainMod, 3, workspace, 3 - bind = $mainMod, 4, workspace, 4 - bind = $mainMod, 5, workspace, 5 - bind = $mainMod, 6, workspace, 6 - bind = $mainMod, 7, workspace, 7 - bind = $mainMod, 8, workspace, 8 - bind = $mainMod, 9, workspace, 9 - bind = $mainMod, 0, workspace, 10 - - # Move active window to a workspace with mainMod + SHIFT + [0-9] - bind = $mainMod SHIFT, 1, movetoworkspace, 1 - bind = $mainMod SHIFT, 2, movetoworkspace, 2 - bind = $mainMod SHIFT, 3, movetoworkspace, 3 - bind = $mainMod SHIFT, 4, movetoworkspace, 4 - bind = $mainMod SHIFT, 5, movetoworkspace, 5 - bind = $mainMod SHIFT, 6, movetoworkspace, 6 - bind = $mainMod SHIFT, 7, movetoworkspace, 7 - bind = $mainMod SHIFT, 8, movetoworkspace, 8 - bind = $mainMod SHIFT, 9, movetoworkspace, 9 - bind = $mainMod SHIFT, 0, movetoworkspace, 10 - - # Scroll through existing workspaces with mainMod + scroll - bind = $mainMod, mouse_down, workspace, e+1 - bind = $mainMod, mouse_up, workspace, e-1 - - # Move/resize windows with mainMod + LMB/RMB and dragging - bindm = $mainMod, mouse:272, movewindow - bindm = $mainMod, mouse:273, resizewindow - ''; } diff --git a/rofi/settings.nix b/rofi/settings.nix index e59e4f5..87bd7bd 100644 --- a/rofi/settings.nix +++ b/rofi/settings.nix @@ -4,7 +4,7 @@ let rofi-theme = { "*" = { background-color = mkLiteral "#${config.color.background}"; - text-color = mkLiteral "#${config.color.background}"; + text-color = mkLiteral "#${config.color.foreground}"; margin = 0; padding = 4; @@ -14,7 +14,7 @@ let "window" = { width = mkLiteral "100%"; height = mkLiteral "100%"; - border = mkLiteral "4px"; + border = mkLiteral "0px"; border-color = mkLiteral "#${config.color.green}"; }; @@ -31,7 +31,7 @@ in { home-manager.users.zoe.programs.rofi = { enable = true; - package = pkgs.rofi-wayland; + package = pkgs.rofi; plugins = with pkgs; [ rofi-calc rofi-power-menu ]; theme = rofi-theme; font = "${config.font.regular} 16"; diff --git a/sync.sh b/sync.sh index 0b10591..3c0513c 100755 --- a/sync.sh +++ b/sync.sh @@ -7,7 +7,7 @@ git pull # cp -r /etc/nixos/ ./backup # copy over all the files to /etc/nixos/ -sudo cp -ru ./flake.nix ./configuration.nix ./wallpaper.png ./dunst ./helix ./rofi ./i3 ./hyprland ./fish ./kitty ./nvim/ ./disks.nix ./variables.nix ./programs.nix ./defaults.nix ./packages.nix ./home.nix ./services.nix ./user.nix /etc/nixos/ +sudo cp -ru ./flake.nix ./configuration.nix ./wallpaper.png ./dunst ./helix ./rofi ./i3 ./hyprland ./waybar ./fish ./kitty ./nvim/ ./disks.nix ./variables.nix ./programs.nix ./defaults.nix ./packages.nix ./home.nix ./services.nix ./user.nix /etc/nixos/ cp -u ./.xinitrc $HOME cp -ur ./cursors $HOME/.local/share/icons diff --git a/user.nix b/user.nix index c14012d..85946d6 100644 --- a/user.nix +++ b/user.nix @@ -34,6 +34,7 @@ in xarchiver tree writedisk + libreoffice # music / sound cmus @@ -48,7 +49,15 @@ in ffmpeg kdenlive vulkan-tools - + + #wayland + slurp + swaybg + wl-clipboard + wofi + wofi-emoji + unstable.waybar + # images feh gnome.eog @@ -79,7 +88,6 @@ in kitty # window manager - rofi rofimoji dmenu diff --git a/waybar/settings.nix b/waybar/settings.nix new file mode 100644 index 0000000..a07fd0e --- /dev/null +++ b/waybar/settings.nix @@ -0,0 +1,40 @@ +{ config, pkgs, ... }: +let + unstable = import (builtins.fetchTarball https://github.com/nixos/nixpkgs/tarball/master) + { config = config.nixpkgs.config; }; +in +{ + home-manager.users.zoe.programs.waybar = { + enable = true; + package = unstable.waybar; + settings = { + mainBar = { + layer = "top"; + position = "top"; + height = 30; + modules-left = [ "wlr/workspaces" "wlr/taskbar" "hyprland/submap" ]; + modules-center = [ "clock" ]; + modules-right = [ "battery" "clock" ]; + + "wlr/taskbar" = { + "format" = "{icon}"; + "on-click" = "activate"; + "on-click-middle" = "close"; + }; + + "hyprland/submap" = { + "format" = "{}"; + }; + + "clock" = { + "format" = "{:%H:%M} "; + }; + + "battery" = { + "format" = "{capacity}{icon}"; + "format-icons" = "['', '', '', '', '']"; + }; + }; + }; + }; +}