From c4008e190ff7de37ae2e390e99c4fbbfe0df4639 Mon Sep 17 00:00:00 2001 From: Jurn Wubben Date: Mon, 17 Feb 2025 21:03:02 +0100 Subject: [PATCH] :Remvoed waybar; added screenshot utilities; updated todo; --- home/wayland/default.nix | 8 +- home/wayland/hyprland/binds.nix | 7 +- .../hyprland/{status.nix => scripts.nix} | 2 +- home/wayland/hyprland/settings.nix | 4 + home/wayland/waybar/config.nix | 257 ------------------ home/wayland/waybar/default.nix | 22 -- home/wayland/waybar/style.nix | 214 --------------- todo | 2 +- 8 files changed, 14 insertions(+), 502 deletions(-) rename home/wayland/hyprland/{status.nix => scripts.nix} (84%) delete mode 100644 home/wayland/waybar/config.nix delete mode 100644 home/wayland/waybar/default.nix delete mode 100644 home/wayland/waybar/style.nix diff --git a/home/wayland/default.nix b/home/wayland/default.nix index 73711b7..964194f 100644 --- a/home/wayland/default.nix +++ b/home/wayland/default.nix @@ -3,14 +3,10 @@ ./fuzzel.nix ./hyprlock.nix ./hyprland - ./waybar ]; - home.packages = with pkgs; [ - grim - slurp - wl-clipboard - wlr-randr + home.packages = [ + pkgs.wl-clipboard ]; home.sessionVariables = { diff --git a/home/wayland/hyprland/binds.nix b/home/wayland/hyprland/binds.nix index 6b9b4d6..9b87e23 100644 --- a/home/wayland/hyprland/binds.nix +++ b/home/wayland/hyprland/binds.nix @@ -25,6 +25,8 @@ playerctl = appE pkgs.playerctl; brightnessctl = appE pkgs.brightnessctl; wpctl = app "${pkgs.wireplumber}/bin/wpctl"; + grimblast = appE pkgs.grimblast; + annotator = appE pkgs.annotator; pulsemixer = termappE pkgs.pulsemixer; bluetui = termappE pkgs.bluetui; @@ -74,9 +76,12 @@ in { "$mod, B, exec, ${bluetui}" "$mod, N, exec, ${nmtui}" '' - $mod, S, exec, bash -c 'hyprctl notify -1 5000 "rgb(${base0D})" "$(${getExe (import ./status.nix {inherit pkgs;}).script})"' + $mod, S, exec, bash -c 'hyprctl notify -1 5000 "rgb(${base0D})" "$(${getExe (import ./scripts.nix {inherit pkgs;}).statusnotify})"' '' + "$mod, Print, exec, ${grimblast} copy area" + ", Print, exec, ${grimblast} save area - | ${annotator} -i" + "$mod, h, movefocus, l" "$mod, l, movefocus, r" "$mod, k, movefocus, u" diff --git a/home/wayland/hyprland/status.nix b/home/wayland/hyprland/scripts.nix similarity index 84% rename from home/wayland/hyprland/status.nix rename to home/wayland/hyprland/scripts.nix index dc263f7..5c80160 100644 --- a/home/wayland/hyprland/status.nix +++ b/home/wayland/hyprland/scripts.nix @@ -1,5 +1,5 @@ {pkgs, ...}: { - script = pkgs.writeShellScriptBin "statusnotify" '' + statusnotify = pkgs.writeShellScriptBin "statusnotify" '' DATE=$(date +%R) upower -e | grep 'BAT' 2>&1 > /dev/null diff --git a/home/wayland/hyprland/settings.nix b/home/wayland/hyprland/settings.nix index beba136..dfdcb4c 100644 --- a/home/wayland/hyprland/settings.nix +++ b/home/wayland/hyprland/settings.nix @@ -84,5 +84,9 @@ animate_mouse_windowdragging = false; vrr = 1; }; + + windowrulev2 = [ + "float, class:com.github.phase1geo.annotator" + ]; }; } diff --git a/home/wayland/waybar/config.nix b/home/wayland/waybar/config.nix deleted file mode 100644 index 1c201b4..0000000 --- a/home/wayland/waybar/config.nix +++ /dev/null @@ -1,257 +0,0 @@ -{ - config, - pkgs, - lib, - osConfig, - ... -}: { - mainBar = { - layer = "top"; - position = "left"; - # monitor configuration, kind of dirty since it assumes DP-1 is my main monitor - # output = primaryMonitor osConfig; #builtins.elemAt monitors 0; - width = 25; - spacing = 6; - margin-left = null; - margin-top = 6; - margin-bottom = 6; - margin-right = null; - fixed-center = true; - exclusive = true; - modules-left = [ - "custom/search" - "group/info" - ]; - modules-center = ["hyprland/workspaces"]; - modules-right = [ - "group/info-right" - "battery" - "group/network" - "clock" - "custom/lock" - ]; - - ##### LEFT MODULES ##### - "custom/search" = { - format = " "; - tooltip = false; - on-click = "${lib.getExe pkgs.killall} rofi || run-as-service $(rofi -show drun)"; - }; - - #### INFO MODULE - START #### - "group/info" = { - orientation = "inherit"; - drawer = { - "transition-duration" = 500; - "transition-left-to-right" = false; - }; - modules = [ - "custom/dmark" - "group/gcpu" - "memory" - "disk" - ]; - }; - - "custom/dmark" = { - format = ""; - tooltip = false; - }; - - #### CPU MODULE - START #### - "group/gcpu" = { - orientation = "inherit"; - modules = [ - "custom/cpu-icon" - "cpu" - ]; - }; - - "custom/cpu-icon" = { - format = "󰻠"; - tooltip = false; - }; - - cpu = { - format = "{usage}󱉸"; - "on-click" = "foot btop"; - }; - ##### CPU MODULE - END ##### - - memory = { - format = "  \n{:2}󱉸"; - }; - - disk = { - interval = 600; - format = " 󰋊 \n{percentage_used}󱉸"; - path = "/"; - }; - #### INFO MODULE - END #### - - ##### CENTER MODULES ##### - "river/tags" = { - num-tags = 9; - tag-labels = ["一" "二" "三" "四" "五" "六" "七" "八" "九" "十"]; - }; - - ##### RIGHT MODULES ##### - ##### RIGHT INFO MODULE - START #### - "group/info-right" = { - orientation = "inherit"; - drawer = { - "transition-duration" = 500; - "transition-left-to-right" = false; - }; - modules = [ - "custom/dmark-up" - "pulseaudio" - "backlight" - "bluetooth" - "tray" - ]; - }; - - "custom/dmark-up" = { - format = ""; - tooltip = false; - }; - - pulseaudio = { - scroll-step = 5; - tooltip = true; - tooltip-format = "{volume}"; - on-click = "${pkgs.killall}/bin/killall pavucontrol || ${pkgs.pavucontrol}/bin/pavucontrol"; - format = "{icon}"; - format-muted = "󰝟"; - format-icons = { - default = ["" "" ""]; - }; - }; - - backlight = let - brightnessctl = lib.getExe pkgs.brightnessctl; - in { - format = "{icon}"; - format-icons = ["󰋙" "󰫃" "󰫄" "󰫅" "󰫆" "󰫇" "󰫈"]; - on-scroll-up = "${brightnessctl} s 5%-"; - on-scroll-down = "${brightnessctl} s +5%"; - tooltip = true; - tooltip-format = "Brightness: {percent}% "; - smooth-scrolling-threshold = 1; - }; - - bluetooth = { - # controller = "controller1", // specify the alias of the controller if there are more than 1 on the system - format = ""; - format-disabled = "󰂲"; # an empty format will hide the module - format-connected = "󰂱"; - tooltip-format = "{controller_alias}\t{controller_address}"; - tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{device_enumerate}"; - tooltip-format-disabled = ""; - tooltip-format-enumerate-connected = "{device_alias}\t{device_address}"; - }; - - "tray" = { - spacing = 10; - }; - - ##### RIGHT INFO MODULE - END #### - - battery = { - rotate = 270; - states = { - good = 80; - warning = 30; - critical = 15; - }; - format = "{icon}"; - format-charging = "{icon} "; - format-full = "{icon}"; - format-plugged = "󰂄"; - format-icons = ["󰂃" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"]; - tooltip-format = "{timeTo} {capacity} % | {power} W"; - }; - - #### NETWORK MODULE - START #### - "group/network" = { - orientation = "inherit"; - drawer = { - "transition-duration" = 500; - "transition-left-to-right" = true; - }; - modules = [ - "network" - "network#speed" - ]; - }; - - network = { - format-wifi = "󰤨"; - format-ethernet = "󰈀"; - format-alt = "󱛇"; - format-disconnected = "󰤭"; - }; - - "network#speed" = let - nm-editor = "${pkgs.networkmanagerapplet}/bin/nm-connection-editor"; - in { - format = " {bandwidthDownBits} "; - rotate = 90; - interval = 5; - tooltip-format = "{ipaddr}"; - tooltip-format-wifi = "{essid} ({signalStrength}%)  \n{ipaddr} | {frequency} MHz{icon} "; - tooltip-format-ethernet = "{ifname} 󰈀 \n{ipaddr} | {frequency} MHz{icon} "; - tooltip-format-disconnected = "Not Connected to any type of Network"; - tooltip = true; - on-click = "${nm-editor}"; - }; - - #### NETWORK MODULE - END #### - - clock = { - format = '' - {:%H - %M}''; - tooltip-format = '' - {:%Y %B} - {calendar} - ''; - }; - - "custom/lock" = { - tooltip = false; - on-click = "${pkgs.bash}/bin/bash -c '(sleep 0.5s; ${lib.getExe pkgs.swaylock-effects} --grace 0)' & disown"; - format = ""; - }; - - "custom/power" = { - tooltip = false; - on-click = let - sudo = pkgs.sudo + "/bin/sudo"; - rofi = config.programs.rofi.package + "/bin/rofi"; - poweroff = pkgs.systemd + "/bin/poweroff"; - reboot = pkgs.systemd + "/bin/reboot"; - in - pkgs.writeShellScript "shutdown-waybar" '' - - #!/bin/sh - - off=" Shutdown" - reboot=" Reboot" - cancel="󰅖 Cancel" - - sure="$(printf '%s\n%s\n%s' "$off" "$reboot" "$cancel" | - ${rofi} -dmenu -p ' Are you sure?')" - - if [ "$sure" = "$off" ]; then - ${sudo} ${poweroff} - elif [ "$sure" = "$reboot" ]; then - ${sudo} ${reboot} - fi - ''; - format = "󰐥"; - }; - }; -} - diff --git a/home/wayland/waybar/default.nix b/home/wayland/waybar/default.nix deleted file mode 100644 index 9e9543d..0000000 --- a/home/wayland/waybar/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - pkgs, - lib, - config, - osConfig, - ... -}: let - inherit (config.lib.stylix) colors; - - waybar_config = import ./config.nix {inherit osConfig config lib pkgs;}; - waybar_style_content = import ./style.nix {inherit colors;}; - waybar_style = pkgs.writeText "waybar-style.css" waybar_style_content; -in { - home.packages = with pkgs.python3Packages; [requests]; - programs.waybar = { - enable = true; - systemd.enable = true; - package = pkgs.waybar; - settings = waybar_config; - # style = waybar_style; - }; -} diff --git a/home/wayland/waybar/style.nix b/home/wayland/waybar/style.nix deleted file mode 100644 index 4595067..0000000 --- a/home/wayland/waybar/style.nix +++ /dev/null @@ -1,214 +0,0 @@ -{colors}: -with colors; let - OSLogo = builtins.fetchurl rec { - name = "OSLogo-${sha256}.png"; - sha256 = "1cifj774r4z4m856fva1mamnpnhsjl44kw3asklrc57824f5lyz3"; - url = "https://raw.githubusercontent.com/NixOS/nixos-artwork/master/logo/nix-snowflake-colours.svg"; - }; -in '' - * { - font-family: Material Design Icons, Iosevka Nerd Font Mono; - font-size: 19px; - } - - window#waybar { - background-color: #${base00}; - border: .5px solid #${base01}; - border-radius: 0px; - color: #${base05}; - margin: 8px 8px; - transition-property: background-color; - transition-duration: .5s; - } - - window#waybar.hidden { - opacity: 0.2; - } - - .modules-left { - margin: 7px 7px 7px 7px; - background-color: #${base02}; - border: .5px solid #${base01}; - border-radius: 15px; - padding: 2px 2px; - } - - .modules-center { - margin: 7px 7px 7px 7px; - background-color: #${base02}; - border: .5px solid #${base01}; - border-radius: 15px; - padding: 2px 0px 2px 0px; - } - - .modules-right { - margin: 7px 7px 7px 7px; - background-color: #${base02}; - border: .5px solid #${base01}; - border-radius: 15px; - padding: 2px 0px 2px 0px; - } - - #custom-weather, - #clock, - #network, - #custom-swallow, - #custom-power, - #cpu, - #battery, - #backlight, - #memory, - #tags, - #custom-search, - #custom-power, - #custom-todo, - #custom-lock, - #custom-weather, - #volume, - #cpu, - #bluetooth, - #gamemode, - #gcpu, - #memory, - #disk, - #submap, - #pulseaudio { - padding: 4px 0px 4px 0px; - margin: 0px 0px; - border-radius: 15px; - } - - #tags button { - background-color: transparent; - /* Use box-shadow instead of border so the text isn't offset */ - color: #${base07}; - font-size: 21px; - /* padding-left: 6px; */ - box-shadow: inset 0 -3px transparent; - } - - #tags button:hover { - color: #${base05}; - background-color: #${base03}; - } - - #tags button.focused { - border-radius: 20px; - border-color: #${base0E}; - } - - #tags button.occupied { - color: #${base0E}; - } - - #tags button.urgent { - color: #${base08}; - } - - #custom-power { - color: #${base08}; - margin-bottom: 7px; - } - - #tags { - background-color: #${base02}; - } - - #network { - color: #${base07}; - - } - - #gamemode { - color: #${base07}; - } - - #custom-weather { - color: #${base05}; - background-color: #${base02}; - } - - #bluetooth { - color: #${base0E}; - } - - #bluetooth.off, - #bluetooth.pairable, - #bluetooth.discovering, - #bluetooth.disabled { - color: rgba(0, 0, 0, 0.0); - background-color: rgba(0, 0, 0, 0.0); - margin: -50; - } - - #clock { - color: #${base05}; - background-color: #${base02}; - font-weight: 700; - font-size: 20px; - font-family: "Iosevka Term"; - } - - #pulseaudio { - color: #${base0B}; - } - - #pulseaudio.source-muted, - #pulseaudio.muted { - color: #${base08}; - } - - #custom-swallow { - color: #${base0E}; - - } - - #custom-lock { - color: #${base07}; - - } - - #custom-todo { - color: #${base05}; - } - - #custom-cpu { - color: #${base0B}; - } - - #custom-search { - background-image: url("${OSLogo}"); - background-size: 65%; - background-position: center; - background-repeat: no-repeat; - margin-top: 7px; - } - - #backlight { - color: #${base0A}; - } - - #battery { - color: #${base0C}; - } - - #battery.warning { - color: #${base09}; - } - - #battery.critical:not(.charging) { - color: #${base08}; - } - - tooltip { - font-family: 'Lato', sans-serif; - border-radius: 15px; - padding: 20px; - margin: 30px; - } - - tooltip label { - font-family: 'Lato', sans-serif; - padding: 20px; - } -'' diff --git a/todo b/todo index 2854a70..269fbfd 100644 --- a/todo +++ b/todo @@ -1,2 +1,2 @@ Networkmanager permissions -Remove bar +moving windows