From 680d299dffdcc91a3ef77077f464378e35dda09c Mon Sep 17 00:00:00 2001 From: TrudeEH Date: Sat, 11 May 2024 00:30:24 +0100 Subject: [PATCH] improved waybar and new music player --- dotfiles/.bashrc | 1 + dotfiles/.config/waybar/config | 6 +++--- dotfiles/.config/waybar/style.css | 21 +++++++++++---------- dwl/config.def.h | 18 +++++++++--------- dwl/config.h | 18 +++++++++--------- install.sh | 3 ++- 6 files changed, 35 insertions(+), 32 deletions(-) diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc index ee7ba49d..7937f423 100644 --- a/dotfiles/.bashrc +++ b/dotfiles/.bashrc @@ -99,6 +99,7 @@ alias ll='ls -lhi' alias ta='tmux attach' alias t='tmux' alias v='nvim' +alias mp='ncmpcpp' #Music Player set completion-ignore-case On diff --git a/dotfiles/.config/waybar/config b/dotfiles/.config/waybar/config index 236381fe..c030d7a2 100644 --- a/dotfiles/.config/waybar/config +++ b/dotfiles/.config/waybar/config @@ -9,7 +9,7 @@ "margin-left": 5, "margin-bottom": 0, // Choose the order of the modules - "modules-left": ["clock", "backlight", "battery", "tray"], + "modules-left": ["clock", "backlight", "battery", "sway/scratchpad", "mpd", "tray"], "modules-center": ["sway/workspaces"], "modules-right": ["wireplumber", "network", "cpu", "memory", "temperature"], // Modules configuration @@ -48,7 +48,7 @@ "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-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon} Stopped ", "unknown-tag": "N/A", "interval": 2, "consume-icons": { @@ -126,7 +126,7 @@ // "thermal-zone": 2, "hwmon-path": "/sys/class/hwmon/hwmon3/temp1_input", "critical-threshold": 80, - "format-critical": " {temperatureC}°C 󰈸", + "format-critical": "{temperatureC}°C 󰈸", "format": "{temperatureC}°C {icon}", "format-icons": ["󱃃", "󰔏"], "interval": 1 diff --git a/dotfiles/.config/waybar/style.css b/dotfiles/.config/waybar/style.css index d9ac32dd..f3b377af 100644 --- a/dotfiles/.config/waybar/style.css +++ b/dotfiles/.config/waybar/style.css @@ -186,11 +186,11 @@ label:focus { } #backlight { - color: @pink; + color: @yellow; } #network { - color: @cyan; + color: @pink; } #network.disconnected { @@ -198,7 +198,7 @@ label:focus { } #pulseaudio { - color: @green; + color: @cyan; } #pulseaudio.muted { @@ -206,7 +206,7 @@ label:focus { } #wireplumber { - color: @pink; + color: @cyan; } #wireplumber.muted { @@ -264,20 +264,21 @@ label:focus { } #mpd { - background-color: #66cc99; color: @purple; } #mpd.disconnected { - background-color: #f53c3c; + background-color: @red; + color: @base; + box-shadow: inset 0px 0px 0px 3px @base; } #mpd.stopped { - background-color: #90b1b1; + color: @red; } #mpd.paused { - background-color: #51a37a; + color: @yellow; } #language { @@ -299,9 +300,9 @@ label:focus { } #scratchpad { - background: rgba(0, 0, 0, 0.2); + color: @yellow; } #scratchpad.empty { - background-color: transparent; + color: @cyan; } diff --git a/dwl/config.def.h b/dwl/config.def.h index 9f0c0ca9..c1ab848f 100644 --- a/dwl/config.def.h +++ b/dwl/config.def.h @@ -53,9 +53,8 @@ static const Layout layouts[] = { /* NOTE: ALWAYS add a fallback rule, even if you are completely sure it won't be used */ static const MonitorRule monrules[] = { /* name mfact nmaster scale layout rotate/reflect x y */ - /* example of a HiDPI laptop monitor: - { "eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 }, - */ + /* example of a HiDPI monitor: */ + { "DP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 }, /* defaults */ { NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 }, }; @@ -67,6 +66,7 @@ static const struct xkb_rule_names xkb_rules = { .options = "ctrl:nocaps", */ .options = NULL, + .layout = "pt", }; static const int repeat_rate = 25; @@ -76,7 +76,7 @@ static const int repeat_delay = 600; static const int tap_to_click = 1; static const int tap_and_drag = 1; static const int drag_lock = 1; -static const int natural_scrolling = 1; +static const int natural_scrolling = 0; static const int disable_while_typing = 1; static const int left_handed = 0; static const int middle_button_emulation = 1; @@ -136,8 +136,8 @@ static const Key keys[] = { /* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */ /* modifier key function argument */ { MODKEY, XKB_KEY_p, spawn, {.v = menucmd} }, - { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} }, - { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_q, spawn, {.v = lockcmd} }, + { MODKEY, XKB_KEY_Return, spawn, {.v = termcmd} }, + { MODKEY, XKB_KEY_q, spawn, {.v = lockcmd} }, { MODKEY, XKB_KEY_b, togglebar, {0} }, { MODKEY, XKB_KEY_j, focusstack, {.i = +1} }, { MODKEY, XKB_KEY_k, focusstack, {.i = -1} }, @@ -145,16 +145,16 @@ static const Key keys[] = { { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} }, { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} }, { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} }, - { MODKEY, XKB_KEY_Return, zoom, {0} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, zoom, {0} }, { MODKEY, XKB_KEY_Tab, view, {0} }, { MODKEY, XKB_KEY_g, togglegaps, {0} }, - { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} }, + { MODKEY, XKB_KEY_c, killclient, {0} }, { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} }, { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} }, { MODKEY, XKB_KEY_space, setlayout, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} }, - { MODKEY, XKB_KEY_e, togglefullscreen, {0} }, + { MODKEY, XKB_KEY_e, togglefullscreen, {0} }, { MODKEY, XKB_KEY_0, view, {.ui = ~0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} }, { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} }, diff --git a/dwl/config.h b/dwl/config.h index 9f0c0ca9..c1ab848f 100644 --- a/dwl/config.h +++ b/dwl/config.h @@ -53,9 +53,8 @@ static const Layout layouts[] = { /* NOTE: ALWAYS add a fallback rule, even if you are completely sure it won't be used */ static const MonitorRule monrules[] = { /* name mfact nmaster scale layout rotate/reflect x y */ - /* example of a HiDPI laptop monitor: - { "eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 }, - */ + /* example of a HiDPI monitor: */ + { "DP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 }, /* defaults */ { NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 }, }; @@ -67,6 +66,7 @@ static const struct xkb_rule_names xkb_rules = { .options = "ctrl:nocaps", */ .options = NULL, + .layout = "pt", }; static const int repeat_rate = 25; @@ -76,7 +76,7 @@ static const int repeat_delay = 600; static const int tap_to_click = 1; static const int tap_and_drag = 1; static const int drag_lock = 1; -static const int natural_scrolling = 1; +static const int natural_scrolling = 0; static const int disable_while_typing = 1; static const int left_handed = 0; static const int middle_button_emulation = 1; @@ -136,8 +136,8 @@ static const Key keys[] = { /* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */ /* modifier key function argument */ { MODKEY, XKB_KEY_p, spawn, {.v = menucmd} }, - { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} }, - { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_q, spawn, {.v = lockcmd} }, + { MODKEY, XKB_KEY_Return, spawn, {.v = termcmd} }, + { MODKEY, XKB_KEY_q, spawn, {.v = lockcmd} }, { MODKEY, XKB_KEY_b, togglebar, {0} }, { MODKEY, XKB_KEY_j, focusstack, {.i = +1} }, { MODKEY, XKB_KEY_k, focusstack, {.i = -1} }, @@ -145,16 +145,16 @@ static const Key keys[] = { { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} }, { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} }, { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} }, - { MODKEY, XKB_KEY_Return, zoom, {0} }, + { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, zoom, {0} }, { MODKEY, XKB_KEY_Tab, view, {0} }, { MODKEY, XKB_KEY_g, togglegaps, {0} }, - { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} }, + { MODKEY, XKB_KEY_c, killclient, {0} }, { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} }, { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} }, { MODKEY, XKB_KEY_space, setlayout, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} }, - { MODKEY, XKB_KEY_e, togglefullscreen, {0} }, + { MODKEY, XKB_KEY_e, togglefullscreen, {0} }, { MODKEY, XKB_KEY_0, view, {.ui = ~0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} }, { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} }, diff --git a/install.sh b/install.sh index c34153b2..29aa74ab 100755 --- a/install.sh +++ b/install.sh @@ -15,7 +15,8 @@ fi paru -Sy curl git stow bat fzf less nextcloud-client # Install DE -paru -Sy dunst xdg-desktop-portal-wlr xdg-desktop-portal swaybg swaylock waybar wofi foot grim slurp wl-clipboard wlroots wayland-protocols xorg-xwayland +paru -Sy mpd ncmpcpp dunst xdg-desktop-portal-wlr xdg-desktop-portal swaybg swaylock waybar wofi foot grim slurp wl-clipboard wlroots wayland-protocols xorg-xwayland +sudo systemctl enable mpd cd dwl sudo make clean install cd ..