From e0b26ff48b1a11595fd3928359e1a33d63ac644e Mon Sep 17 00:00:00 2001 From: kiana-S Date: Sat, 24 Sep 2022 23:30:38 -0400 Subject: [PATCH] Misc changes --- common/config/config.nix | 4 +- common/home-manager/default.nix | 2 + common/home-manager/wayland/rofi/window.sh | 5 +- common/home-manager/wayland/rofi/workspace.sh | 3 ++ common/home-manager/wayland/sway.nix | 2 +- common/home-manager/wayland/swaylock.nix | 2 +- common/home-manager/wayland/waybar.nix | 52 ++++++++++--------- 7 files changed, 40 insertions(+), 30 deletions(-) diff --git a/common/config/config.nix b/common/config/config.nix index 45b88d9..62dd722 100644 --- a/common/config/config.nix +++ b/common/config/config.nix @@ -1,6 +1,4 @@ -{ config, pkgs, nur, -nixpkgs, # The flake's input version of nixpkgs -... }: +{ config, pkgs, nur, ... }: { nix.package = pkgs.nixFlakes; nix.extraOptions = '' diff --git a/common/home-manager/default.nix b/common/home-manager/default.nix index 21518db..02d20cd 100644 --- a/common/home-manager/default.nix +++ b/common/home-manager/default.nix @@ -3,6 +3,8 @@ home.username = username; home.homeDirectory = "/home/" + username; + home.stateVersion = "21.11"; + imports = [ ./shell ./wayland ]; xdg.enable = true; diff --git a/common/home-manager/wayland/rofi/window.sh b/common/home-manager/wayland/rofi/window.sh index b0569a5..2b658d3 100755 --- a/common/home-manager/wayland/rofi/window.sh +++ b/common/home-manager/wayland/rofi/window.sh @@ -1,8 +1,11 @@ #!/usr/bin/env bash if [ $# -ne 0 ]; then - id=echo "$@" | cut -d ' ' -f1 + id=$(echo "$@" | cut -d ' ' -f1) swaymsg "[con_id=$id]" focus + + # Hack to get around weird bug + pkill rofi exit 0 fi diff --git a/common/home-manager/wayland/rofi/workspace.sh b/common/home-manager/wayland/rofi/workspace.sh index ead2bb7..d4e491d 100755 --- a/common/home-manager/wayland/rofi/workspace.sh +++ b/common/home-manager/wayland/rofi/workspace.sh @@ -2,6 +2,9 @@ if [ $# -ne 0 ]; then swaymsg workspace "$@" + + # Hack to get around weird bug + pkill rofi exit 0 fi diff --git a/common/home-manager/wayland/sway.nix b/common/home-manager/wayland/sway.nix index ac1924d..7601f61 100644 --- a/common/home-manager/wayland/sway.nix +++ b/common/home-manager/wayland/sway.nix @@ -85,7 +85,7 @@ in { # Screenshot "Print" = ''exec grim ${filename}''; "Shift+Print" = ''exec grim -g "$(slurp)" ${filename}''; - "Ctrl+Print" = ''exec grim -g "$(swaymsg -t get_tree | jq -j '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"')" ${filename}''; + "Control+Print" = ''exec grim -g "$(swaymsg -t get_tree | jq -j '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"')" ${filename}''; # Special XF86 key bindings "XF86AudioRaiseVolume" = audio "-ui 2"; diff --git a/common/home-manager/wayland/swaylock.nix b/common/home-manager/wayland/swaylock.nix index 4171dc4..29fe6ee 100644 --- a/common/home-manager/wayland/swaylock.nix +++ b/common/home-manager/wayland/swaylock.nix @@ -13,7 +13,7 @@ screenshots font=UbuntuMono - text-color=a9b1d6 + text-color=ffffff color=00000000 ring-color=7da6ff diff --git a/common/home-manager/wayland/waybar.nix b/common/home-manager/wayland/waybar.nix index a302c31..1ac2d3a 100644 --- a/common/home-manager/wayland/waybar.nix +++ b/common/home-manager/wayland/waybar.nix @@ -9,7 +9,7 @@ modules-right: settings = let spanfa = ""; in [{ - height = 30; + height = 32; margin = "8 8 0"; inherit modules-left modules-center modules-right; @@ -94,7 +94,7 @@ modules-right: "temperature" = { # thermal-zone = 2; # hwmon-path = "/sys/class/hwmon/hwmon2/temp1_input"; - critical-threshold = 70; + critical-threshold = 80; format = "${spanfa}{icon} {temperatureC}°C"; format-icons = [ "" "" "" "" "" ]; }; @@ -147,22 +147,14 @@ modules-right: '' @define-color background #1a1b26; @define-color foreground #a9b1d6; - @define-color black #32344a; @define-color red #ce7284; @define-color green #7dc5a0; @define-color yellow #caaa6a; @define-color blue #7bc5e4; @define-color magenta #ad8ee6; - @define-color cyan #449dab; - @define-color white #787c99; - @define-color altblack #444b6a; @define-color altred #d5556f; @define-color altgreen #b9f27c; @define-color altyellow #ff9e64; - @define-color altblue #7da6ff; - @define-color altmagenta #bb9af7; - @define-color altcyan #0db9d7; - @define-color altwhite #acb0d0; @define-color altblend #282e49; @define-color empty #474f6f; @define-color pink #c386c0; @@ -178,7 +170,7 @@ modules-right: background-color: @background; border-radius: 8px; color: @foreground; - padding: 3px 0; + padding: 3px 0px; } #custom-sep { @@ -191,8 +183,8 @@ modules-right: } #workspaces button { - padding: 0 3px; - border-radius: 0; + padding: 0px 3px; + border-radius: 0px; color: @blue; } @@ -201,13 +193,13 @@ modules-right: text-shadow: inherit; background: @background; border: none; - padding: 0 3px; + padding: 0px 3px; } #workspaces button.persistent {color: @empty;} #workspaces button.focused { color: shade(@pink, 1.1); - text-shadow: 0 0 2 shade(@pink, 1.2); + text-shadow: 0px 0px 2px shade(@pink, 1.2); } #workspaces button.urgent { background-color: @altred; @@ -226,34 +218,34 @@ modules-right: #mode, #idle_inhibitor, #mpd { - margin: 0 8px; + margin: 0px 8px; } #idle_inhibitor { - padding: 0 8px 0 0; + padding: 0px 8px 0px 0px; } #cpu, #pulseaudio { background-color: @altblend; - margin: 3px 0 3px 2px; + margin: 3px 0px 3px 2px; padding-right: 5px; padding-left: 8px; - border-radius: 18px 0 0 18px; + border-radius: 18px 0px 0px 18px; } #backlight, #memory { background-color: @altblend; - margin: 3px 4px 3px 0; + margin: 3px 4px 3px 0px; padding-left: 5px; padding-right: 8px; - border-radius: 0 18px 18px 0; + border-radius: 0px 18px 18px 0px; } #network { background-color: @altblend; margin: 3px 4px; - padding: 0 6px; + padding: 0px 6px; border-radius: 18px; } @@ -263,16 +255,28 @@ modules-right: font-size: 12px; } - #mode {color: @cyan;} + #mode {color: @magenta;} #cpu {color: @green;} #memory {color: @yellow;} #temperature {color: @blue;} #clock {color: @blue;} + #temperature {color: @blue;} + #temperature.critical {color: @altyellow;} + + @keyframes blink { to { color: @background; } } + #battery {color: @green;} #battery.warning:not(.charging) {color: @altyellow;} #battery.low:not(.charging) {color: @altred;} - #battery.critical:not(.charging) {color: #ff2525;} + #battery.critical:not(.charging) { + color: #ff2525; + animation-name: blink; + animation-duration: 1s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } #backlight {color: @yellow;} #network {color: @green;}