From 6a6a24b560274d4e009144b050ca9e55d31a0ff8 Mon Sep 17 00:00:00 2001 From: subcrip Date: Thu, 25 Jul 2024 19:26:15 +0800 Subject: [PATCH] backup --- .zshrc | 4 +- contour.yml | 2 +- home-manager/home.nix | 10 +++- profile.d/nix-profile.sh | 2 + waybar/config.jsonc | 124 ++++++++++++++++++++++----------------- waybar/mprisquery | 2 + waybar/style.css | 20 +++++-- 7 files changed, 102 insertions(+), 62 deletions(-) create mode 100644 profile.d/nix-profile.sh create mode 100644 waybar/mprisquery diff --git a/.zshrc b/.zshrc index e30891f..b66bbca 100644 --- a/.zshrc +++ b/.zshrc @@ -117,8 +117,8 @@ alias pip3="python3 -m pip" alias pip="python -m pip" alias comp="cd ~/RustIsBestLang/src/bin && nvim" alias backup="git add . && git commit -S -m 'backup' && git push" -# export LD_LIBRARY_PATH=/usr/lib:/usr/local/cuda/lib65:$LD_LIBRARY_PATH -export PATH=/home/user/.cabal/bin:/home/user/.ghcup/bin:/home/linuxbrew/.linuxbrew/bin:/home/user/.cargo/bin:/home/user/.local/bin:/usr/local/cuda/bin:$PATH +export LD_LIBRARY_PATH=/home/user/.local/lib/mojo:$LD_LIBRARY_PATH +export PATH=/home/user/.modular/pkg/packages.modular.com_mojo/bin/:/home/user/.npm-packages/bin:/home/user/.cabal/bin:/home/user/.ghcup/bin:/home/linuxbrew/.linuxbrew/bin:/home/user/.cargo/bin:/home/user/.local/bin:/usr/local/cuda/bin:$PATH export PAGER=less me () { diff --git a/contour.yml b/contour.yml index 39db4ed..f241373 100644 --- a/contour.yml +++ b/contour.yml @@ -540,7 +540,7 @@ profiles: # When this profile is *activated*, this flag decides # whether or not the title bar will be shown - show_title_bar: false + show_title_bar: true # When this profile is *activated*, this flag decides # whether or not the size indicator on resize will be shown. diff --git a/home-manager/home.nix b/home-manager/home.nix index a1ce83b..af71f7f 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -1,3 +1,5 @@ +# vim: set expandtab tabstop=2 softtabstop=2 shiftwidth=2: + { config, pkgs, ... }: { @@ -6,6 +8,9 @@ home.username = "user"; home.homeDirectory = "/home/user"; + targets.genericLinux.enable = true; + xdg.mime.enable = true; + # This value determines the Home Manager release that your configuration is # compatible with. This helps avoid breakage when a new Home Manager release # introduces backwards incompatible changes. @@ -21,13 +26,16 @@ pkgs.mtr pkgs.neovim pkgs.htop - pkgs.python3 + pkgs.python312 pkgs.pyright pkgs.nodejs_22 pkgs.pipx pkgs.fx pkgs.gdb pkgs.lua-language-server + pkgs.waybar + pkgs.waybar-mpris + pkgs.zed-editor # # It is sometimes useful to fine-tune packages, for example, by applying # # overrides. You can do that directly here, just don't forget the diff --git a/profile.d/nix-profile.sh b/profile.d/nix-profile.sh new file mode 100644 index 0000000..74cd13a --- /dev/null +++ b/profile.d/nix-profile.sh @@ -0,0 +1,2 @@ +# should be placed under /etc/profile.d +export XDG_DATA_DIRS=$HOME/.nix-profile/share:$XDG_DATA_DIRS diff --git a/waybar/config.jsonc b/waybar/config.jsonc index f235dc0..d8e2a64 100644 --- a/waybar/config.jsonc +++ b/waybar/config.jsonc @@ -8,10 +8,10 @@ // Choose the order of the modules "modules-left": [ "hyprland/workspaces", - "custom/wofi" + "hyprland/window", ], "modules-center": [ - "sway/window" + "custom/waybar-mpris", ], "modules-right": [ // "idle_inhibitor", @@ -24,27 +24,27 @@ "backlight", "keyboard-state", "battery", - "clock", + "custom/clock", "tray", - "custom/wlogout" + "custom/wlogout", ], // Modules configuration - // "sway/workspaces": { - // "disable-scroll": true, - // "all-outputs": true, - // "warp-on-scroll": false, - // "format": "{name}: {icon}", - // "format-icons": { - // "1": "", - // "2": "", - // "3": "", - // "4": "", - // "5": "", - // "urgent": "", - // "focused": "", - // "default": "" - // } - // }, + "hyprland/workspaces": { + "disable-scroll": true, + "all-outputs": true, + "warp-on-scroll": false, + "format": "{name} {icon} ", + "format-icons": { + "1": "", + "2": "", + "3": "", + "4": "", + "5": "", + "urgent": "", + "focused": "", + "default": "" + } + }, "keyboard-state": { "numlock": true, "capslock": true, @@ -60,32 +60,32 @@ "sway/scratchpad": { "format": "{icon} {count}", "show-empty": false, - "format-icons": ["", ""], + "format-icons": ["", " "], "tooltip": true, "tooltip-format": "{app}: {title}" }, "mpd": { - "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ", - "format-disconnected": "Disconnected ", - "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ", + "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}%  ", + "format-disconnected": "Disconnected  ", + "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped  ", "unknown-tag": "N/A", "interval": 5, "consume-icons": { "on": " " }, "random-icons": { - "off": " ", + "off": " ", "on": " " }, "repeat-icons": { "on": " " }, "single-icons": { - "on": "1 " + "on": " 1 " }, "state-icons": { - "paused": "", - "playing": "" + "paused": " ", + "playing": " " }, "tooltip-format": "MPD (connected)", "tooltip-format-disconnected": "MPD (disconnected)" @@ -93,8 +93,8 @@ "idle_inhibitor": { "format": "{icon}", "format-icons": { - "activated": "", - "deactivated": "" + "activated": " ", + "deactivated": " " } }, "tray": { @@ -107,11 +107,11 @@ "format-alt": "{:%Y-%m-%d}" }, "cpu": { - "format": "{usage}% ", + "format": "{usage}%  ", "tooltip": false }, "memory": { - "format": "{}% " + "format": "{}%  " }, "temperature": { // "thermal-zone": 2, @@ -119,12 +119,12 @@ "critical-threshold": 80, // "format-critical": "{temperatureC}°C {icon}", "format": "{temperatureC}°C {icon}", - "format-icons": ["", "", ""] + "format-icons": [""] }, "backlight": { // "device": "acpi_video1", "format": "{percent}% {icon}", - "format-icons": ["", "", "", "", "", "", "", "", ""] + "format-icons": [" ", " ", " ", " ", " ", " ", " ", " ", " "] }, "battery": { "states": { @@ -134,22 +134,22 @@ }, "format": "{capacity}% {icon}", "format-full": "{capacity}% {icon}", - "format-charging": "{capacity}% ", - "format-plugged": "{capacity}% ", + "format-charging": "{capacity}%  ", + "format-plugged": "{capacity}%  ", "format-alt": "{time} {icon}", // "format-good": "", // An empty format will hide the module // "format-full": "", - "format-icons": ["", "", "", "", ""] + "format-icons": [" ", " ", " ", " ", " "] }, "power-profiles-daemon": { "format": "{icon}", "tooltip-format": "Power profile: {profile}\nDriver: {driver}", "tooltip": true, "format-icons": { - "default": "", - "performance": "", - "balanced": "", - "power-saver": "" + "default": " ", + "performance": " ", + "balanced": " ", + "power-saver": " " } }, "network": { @@ -168,21 +168,39 @@ "format-bluetooth": "{volume}% {icon} {format_source}", "format-bluetooth-muted": "󰝟 {icon} {format_source}", "format-muted": "󰝟 {format_source}", - "format-source": "{volume}% ", - "format-source-muted": "", + "format-source": "{volume}%  ", + "format-source-muted": " ", "format-icons": { - "headphone": "", - "hands-free": "", - "headset": "", - "phone": "", - "portable": "", - "car": "", - "default": ["", "", ""] + "headphone": " ", + "hands-free": " ", + "headset": " ", + "phone": " ", + "portable": " ", + "car": " ", + "default": [" ", " ", " "] }, "on-click": "pavucontrol" }, "custom/wlogout": { - "format": "L", - "on-click": "wlogout" - } + "format": "󰠚 ", + "on-click": "wlogout" + }, + "custom/waybar-mpris": { + "return-type": "json", + "exec": "waybar-mpris --position --autofocus --order 'SYMBOL:TITLE:ARTIST:POSITION'", + "on-click": "waybar-mpris --send toggle", + // This option will switch between players on right click. + "on-click-right": "waybar-mpris --send player-next", + // The options below will switch the selected player on scroll + // "on-scroll-up": "waybar-mpris --send player-next", + // "on-scroll-down": "waybar-mpris --send player-prev", + // The options below will go to next/previous track on scroll + // "on-scroll-up": "waybar-mpris --send next", + // "on-scroll-down": "waybar-mpris --send prev", + "escape": true, + }, + "custom/clock": { + "exec": "LC_TIME=en_US.UTF8 date +'%-m-%-d[%a] %H:%M'", + "interval": 1, + }, } diff --git a/waybar/mprisquery b/waybar/mprisquery new file mode 100644 index 0000000..8da7a17 --- /dev/null +++ b/waybar/mprisquery @@ -0,0 +1,2 @@ +#!/usr/bin/python3 +import mpris2 diff --git a/waybar/style.css b/waybar/style.css index c368623..31a71d0 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -1,15 +1,25 @@ * { border: none; border-radius: 0px; - font-family: FiraCode Nerd Font; + font-family: JetBrainsMono Nerd Font; font-size: 18px; font-style: normal; min-height: 0; } -window#waybar { +window > box { + border-radius: 15px; background: rgba(76,86,106,0.8); - color: #cdd6f4 + margin-top: 5px; + margin-bottom: 3px; + margin-left: 5px; + margin-right: 5px; + color: #cdd6f4; + box-shadow: 3px 3px lightblue; +} + +window#waybar { + background: transparent; } #workspaces { @@ -30,7 +40,7 @@ window#waybar { transition: all 0.3s ease-in-out; } #workspaces button.active { - color: #cdd6f4; + color: #2e3440; background-color: #cdd6f4; border-radius: 16px; min-width: 50px; @@ -39,7 +49,7 @@ window#waybar { } #workspaces button:hover { background-color: #cdd6f4; - color: #cdd6f4; + color: #2e3440; border-radius: 16px; min-width: 50px; background-size: 400% 400%;