diff --git a/homes/x86_64-linux/julian@aspi/default.nix b/homes/x86_64-linux/julian@aspi/default.nix index fb00227..a82e4db 100644 --- a/homes/x86_64-linux/julian@aspi/default.nix +++ b/homes/x86_64-linux/julian@aspi/default.nix @@ -80,11 +80,13 @@ zotero xfce.mousepad + tor-browser ## My scripts pkgs.frajul.deploy-to-pianopi pkgs.frajul.edit-config pkgs.frajul.open-messaging + pkgs.frajul.pulseaudio-popup ] ++ lib.lists.concatMap (packages-list-file: import packages-list-file { inherit pkgs; }) [ ./fonts.nix diff --git a/modules/home/hyprland/default.nix b/modules/home/hyprland/default.nix index fb01556..7a1edc5 100644 --- a/modules/home/hyprland/default.nix +++ b/modules/home/hyprland/default.nix @@ -37,52 +37,86 @@ in home.packages = with pkgs; [ wofi xfce.thunar - hyprlock - hyprpicker + # hyprlock + # hyprpicker hyprcursor ]; + programs.hyprlock.enable = true; + programs.hyprlock.settings = { + general = { + disable_loading_bar = true; + hide_cursor = true; + ignore_empty_input = true; + }; + + background = [ + { + path = "screenshot"; + blur_passes = 3; + blur_size = 8; + } + ]; + + input-field = [ + { + size = "200, 50"; + position = "0, -80"; + monitor = ""; + dots_center = true; + fade_on_empty = false; + font_color = "rgb(202, 211, 245)"; + inner_color = "rgb(91, 96, 120)"; + outer_color = "rgb(24, 25, 38)"; + outline_thickness = 5; + placeholder_text = "Password..."; + shadow_passes = 2; + } + ]; + }; + programs.waybar = { enable = true; systemd.enable = true; - style = builtins.readFile ./style-dracula.css; - settings = { - mainBar = { - layer = "top"; - position = "bottom"; - height = 30; - output = [ - "eDP-1" - "HDMI-A-1" - ]; - modules-left = [ - "hyprland/workspaces" - "hyprland/submap" - ]; - modules-center = [ "hyprland/window" ]; - modules-right = [ - # "mpd" - # "idle_inhibitor" - "pulseaudio" - # "network" - "power-profiles-daemon" - "cpu" - "memory" - # "temperature" - # "backlight" - # "keyboard-state" - "battery" - # "battery#bat2" - "clock" - "tray" - ]; + style = builtins.readFile ./style.css; + settings.mainBar = builtins.fromJSON (builtins.readFile ./waybar-config.json); + # settings = { + # mainBar = { + # layer = "top"; + # position = "bottom"; + # height = 30; + # output = [ + # "eDP-1" + # "HDMI-A-1" + # ]; + # modules-left = [ + # "hyprland/workspaces" + # "hyprland/submap" + # ]; + # modules-center = [ "hyprland/window" ]; + # modules-right = [ + # # "mpd" + # # "idle_inhibitor" + # "pulseaudio" + # # "network" + # "power-profiles-daemon" + # "cpu" + # "memory" + # # "temperature" + # # "backlight" + # # "keyboard-state" + # "battery" + # # "battery#bat2" + # "clock" + # "tray" + # ]; - # "sway/workspaces" = { - # disable-scroll = true; - # all-outputs = true; - # }; - }; - }; + # # "sway/workspaces" = { + # # disable-scroll = true; + # # all-outputs = true; + # # }; + # }; + # }; }; programs.wlogout.enable = true; # can be configured @@ -120,8 +154,8 @@ in # Look and Feel general = { - # gaps_in = 5 - # gaps_out = 20 + gaps_in = 5; + gaps_out = 5; # border_size = 2 @@ -215,7 +249,7 @@ in # other commands "$mod, Escape, exec, wlogout -p layer-shell" - "$mod, TAB, exec, loginctl lock-session" + "$mod, TAB, exec, hyprlock" "$mod SHIFT, R, exec, hyprctl reload" ", Print, exec, grimblast --notify copysave area" diff --git a/modules/home/hyprland/style.css b/modules/home/hyprland/style.css new file mode 100644 index 0000000..eaa2e87 --- /dev/null +++ b/modules/home/hyprland/style.css @@ -0,0 +1,189 @@ +* { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: "Noto Sans CJK KR Regular"; + font-size: 16px; + min-height: 0; +} + +window#waybar { + background: transparent; + /* background-color: rgba(43, 48, 59, 0.5); */ + /* border-bottom: 3px solid rgba(100, 114, 125, 0.5); */ + color: #ffffff; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + +#waybar.empty #window { + background-color: transparent; +} + +#workspaces { +} + +#window { + margin: 2; + padding-left: 8; + padding-right: 8; + background-color: rgba(0,0,0,0.6); + font-size:14px; + font-weight: bold; +} + +button { + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; + /* Avoid rounded borders under each button name */ + border: none; + border-radius: 0; +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +button:hover { + background: inherit; + border-top: 2px solid #c9545d; +} + +#workspaces button { + padding: 0 4px; +/* background-color: rgba(0,0,0,0.6); */ +} + +#workspaces button:hover { +} + +#workspaces button.focused { + background-color: #ecf0f1; + color: #2d3436; + /* box-shadow: inset 0 -2px #c9545d; */ + border-top: 2px solid #c9545d; +} + +#workspaces button.urgent { + background-color: #eb4d4b; +} + +#mode { + background-color: #64727D; + border-bottom: 3px solid #ffffff; +} + +#clock, +#battery, +#cpu, +#memory, +#disk, +#temperature, +#backlight, +#network, +#pulseaudio, +#wireplumber, +#custom-media, +#tray, +#mode, +#idle_inhibitor, +#scratchpad, +#mpd { + margin: 2px; + padding-left: 4px; + padding-right: 4px; + background-color: rgba(0,0,0,0.6); + color: #ffffff; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left > widget:first-child > #workspaces { + margin-left: 0; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right > widget:last-child > #workspaces { + margin-right: 0; +} + +#clock { + font-size:14px; + font-weight: bold; +} + +#battery icon { + color: red; +} + +#battery.charging, #battery.plugged { + color: #ffffff; + /* background-color: #26A65B; */ +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +#battery.warning:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +label:focus { + background-color: #000000; +} + +#network.disconnected { + background-color: #f53c3c; +} + +#temperature.critical { + background-color: #eb4d4b; +} + +#idle_inhibitor.activated { + background-color: #ecf0f1; + color: #2d3436; +} + +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} + +/* + +window#waybar.solo { +background-color: #FFFFFF; +} + +window#waybar.termite { +background-color: #3F3F3F; +} + +window#waybar.chromium { +background-color: #000000; +border: none; +} + */ diff --git a/modules/home/hyprland/waybar-config.json b/modules/home/hyprland/waybar-config.json new file mode 100644 index 0000000..5216aa1 --- /dev/null +++ b/modules/home/hyprland/waybar-config.json @@ -0,0 +1,50 @@ +{ + "position": "bottom", + "height": 35, + + "modules-left": ["hyprland/workspaces"], + "modules-right": ["idle_inhibitor", "cpu", "memory", "pulseaudio", "battery", "clock", "tray"], + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "tray": { + "spacing": 10 + }, + "clock": { + "tooltip-format": "{calendar}", + "format": "{:%a %d.%m %H:%M:%S}", + "interval": 1 + }, + "cpu": { + "format": " {usage}%" + }, + "memory": { + "format": " {}%" + }, + "battery": { + "states": { + "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{icon} {capacity}% ({time})", + "format-charging": " {capacity}% ({time})", + "format-plugged": " {capacity}% ({time})", + "format-full": "{icon}", + "format-icons": ["", "", "", "", ""] + }, + "pulseaudio": { + "format": "{icon} {volume}%", + "format-muted": " {format_source}", + "format-icons": { + "headphone": "", + "default": ["", "", ""] + }, + "scroll-step": 5.0, + "on-click": "pulseaudio-popup" + } +} diff --git a/packages/pulseaudio-popup/default.nix b/packages/pulseaudio-popup/default.nix new file mode 100644 index 0000000..6c058d1 --- /dev/null +++ b/packages/pulseaudio-popup/default.nix @@ -0,0 +1,43 @@ +{ + # Snowfall Lib provides a customized `lib` instance with access to your flake's library + # as well as the libraries available from your flake's inputs. + lib, + # You also have access to your flake's inputs. + inputs, + + # All other arguments come from NixPkgs. You can use `pkgs` to pull packages or helpers + # programmatically or you may add the named attributes as arguments here. + pkgs, + stdenv, + ... +}: + +pkgs.writeShellApplication { + name = "pulseaudio-popup"; + + runtimeInputs = with pkgs; [ + pavucontrol + jgmenu + ]; + + text = '' + HDMI_SINK="alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_3__sink" + LAPTOP_SINK="alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink" + + HDMI_ICON=$(pactl info | grep -q $HDMI_SINK && echo "checkbox") + LAPTOP_ICON=$(pactl info | grep -q $LAPTOP_SINK && echo "checkbox") + + HDMI_VOLUME=$(pactl get-sink-volume $HDMI_SINK | head -n 1 | awk '{print $5}') + LAPTOP_VOLUME=$(pactl get-sink-volume $LAPTOP_SINK | head -n 1 | awk '{print $5}') + + read -r -d "" CONF <