feat: partial feature parity merge

This commit is contained in:
2024-12-27 14:11:23 +01:00
parent 697d8236b2
commit 4e172607d5
3 changed files with 297 additions and 17 deletions

179
bar.sh Normal file
View File

@@ -0,0 +1,179 @@
#!/bin/bash
function lighten_color() {
offset=20
hex_color=$1
hex_color=${hex_color:1}
red=${hex_color:0:2}
green=${hex_color:2:2}
blue=${hex_color:4:2}
red_dec=$(printf "%d" 0x$red)
green_dec=$(printf "%d" 0x$green)
blue_dec=$(printf "%d" 0x$blue)
if [[ $red_dec -lt 128 ]]; then
red_dec_l=$((red_dec+offset))
green_dec_l=$((green_dec+offset))
blue_dec_l=$((blue_dec+offset))
else
red_dec_l=$((red_dec-offset))
green_dec_l=$((green_dec-offset))
blue_dec_l=$((blue_dec-offset))
fi
red=$(printf "%02X" $red_dec_l)
green=$(printf "%02X" $green_dec_l)
blue=$(printf "%02X" $blue_dec_l)
echo "#$red$green$blue"
}
# ^c$var^ = fg color
# ^b$var^ = bg color
interval=0
# load colors
# . ~/.config/bar_themes/onedark
# colors
rosewater=#f4dbd6
flamingo=#f0c6c6
pink=#f5bde6
mauve=#c6a0f6
red=#fb4934
maroon=#ee99a0
peach=#f5a97f
yellow=#eed49f
green=#b8bb26
teal=#8bd5ca
sky=#91d7e3
sapphire=#7dc4e4
blue=#8aadf4
lavender=#b7bdf8
text=#cad3f5
subtext1=#b8c0e0
subtext0=#a5adcb
overlay2=#939ab7
overlay1=#8087a2
overlay0=#6e738d
surface2=#5b6078
surface1=#494d64
surface0=#363a4f
base=#24273a
mantle=#1e2030
crust=#181926
# Special
background=#282828
foreground=#ebdbb2
cursor=#ebdbb2
# Colors
color0=#05090e
color1=#425965
color2=#016b86
color3=#1f7284
color4=#48717a
color5=#358292
color6=#79796b
color7=#828486
color8=#43464a
color9=#597787
color10=#028FB3
color11=#2A99B1
color12=#6097A3
color13=#47AEC3
color14=#A2A28F
color15=#c0c1c2
background0=$(lighten_color $background)
background1=$(lighten_color $background0)
background2=$(lighten_color $background1)
pulse () {
VOL=$(pamixer --get-volume)
STATE=$(pamixer --get-mute)
printf "%s" "$SEP1"
if [ "$STATE" = "true" ] || [ "$VOL" -eq 0 ]; then
printf "AMUT%%"
elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then
printf "A%s%%" "$VOL"
elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then
printf "A%s%%" "$VOL"
else
printf "A%s%%" "$VOL"
fi
printf "%s\n" "$SEP2"
}
cpu() {
cpu_val=$(grep -o "^[^ ]*" /proc/loadavg)
printf "^c$background^ ^b$yellow^ 󰇄 "
printf "^c$background^ ^b$yellow^$cpu_val"
}
battery() {
capacity_0="$(cat /sys/class/power_supply/BAT0/capacity)"
capacity_1="$(cat /sys/class/power_supply/BAT1/capacity)"
capacity="$capacity_0+$capacity_1"
# capacity=$(((capacity_0 + capacity_1) / 2))
printf " B$capacity%% "
}
brightness() {
value=$(cat /sys/class/backlight/*/brightness)
percentage=$(echo "scale=2; $value / 8.54" | bc)
printf "L%.0f%%" "$percentage"
}
mem() {
printf "^c$background^^b$green^  "
printf "^c$background^^b$green^ $(free -h | awk '/^Mem/ { print $3 }' | sed s/i//g)"
}
wlan() {
case "$(cat /sys/class/net/wl*/operstate 2>/dev/null)" in
up) printf "^c$background^ ^b$blue^ 󰤨 ^c$background^ ^b$blue^Connected" ;;
down) printf "^c$background^ ^b$blue^ 󰤭 ^c$background^ ^b$blue^Disconnected" ;;
esac
}
clock() {
printf " $(date '+%I:%M %P') "
}
today() {
printf " $(date '+%b %e') "
}
net() {
if nc -zw1 c2yz.com 443; then
printf "^c$background^^b$green^ i "
else
printf "^c$background^^b$red^ ! "
fi
}
while true; do
# [ $interval = 0 ] || [ $(($interval % 3600)) = 0 ] && updates=$(pkg_updates)
# interval=$((interval + 1))
# sleep 1 && xsetroot -name "$updates $(battery) $(brightness) $(cpu) $(mem) $(wlan) $(clock)"
# sleep 1 && xsetroot -name "$(battery) $(brightness) $(cpu) $(mem) $(wlan) $(clock)"
if hash dockd 2>/dev/null; then
sleep 1 && xsetroot -name "^c$foreground^^b$background1^ $(brightness) ^b$background0^ $(battery) $(net)^c$foreground^^b$background0^ $(today) ^b$background1^ $(clock) ^b$background2^ $(pulse) "
else
sleep 1 && xsetroot -name "^c$foreground^$(net)^c$foreground^^b$background0^ $(today) ^b$background1^ $(clock) ^b$background2^ $(pulse) "
fi
done

View File

@@ -19,7 +19,7 @@ static const unsigned int borderpx = 1; /* border pixel of windows */
* automatically update with setborderpx. */
static const unsigned int barborderpx = 0; /* border pixel of bar */
#endif // BAR_BORDER_PATCH
static const unsigned int snap = 32; /* snap pixel */
static const unsigned int snap = 28; /* snap pixel */
#if SWALLOW_PATCH
static const int swallowfloating = 0; /* 1 means swallow floating windows by default */
#endif // SWALLOW_PATCH
@@ -62,7 +62,7 @@ static const int showtab = showtab_auto; /* Default tab b
static const int toptab = False; /* False means bottom tab bar */
#endif // TAB_PATCH
#if BAR_HEIGHT_PATCH
static const int bar_height = 0; /* 0 means derive from font, >= 1 explicit height */
static const int bar_height = 32; /* 0 means derive from font, >= 1 explicit height */
#endif // BAR_HEIGHT_PATCH
#if BAR_PADDING_PATCH
static const int vertpad = 10; /* vertical padding of bar */
@@ -100,7 +100,7 @@ static const int horizpadbar = 2; /* horizontal padding for status
static const int vertpadbar = 0; /* vertical padding for statusbar */
#endif // BAR_STATUSPADDING_PATCH
#if BAR_STATUSBUTTON_PATCH
static const char buttonbar[] = "<O>";
static const char buttonbar[] = "";
#endif // BAR_STATUSBUTTON_PATCH
#if BAR_SYSTRAY_PATCH
static const unsigned int systrayspacing = 2; /* systray spacing */
@@ -113,7 +113,7 @@ static const int lcaselbl = 0; /* 1 means make tag label lowerc
#endif // BAR_TAGLABELS_PATCH
#if BAR_UNDERLINETAGS_PATCH
static const unsigned int ulinepad = 5; /* horizontal padding between the underline and tag */
static const unsigned int ulinestroke = 2; /* thickness / height of the underline */
static const unsigned int ulinestroke = 4; /* thickness / height of the underline */
static const unsigned int ulinevoffset = 0; /* how far above the bottom of the bar the line should appear */
static const int ulineall = 0; /* 1 to show underline on all tags, 0 for just the active ones */
#endif // BAR_UNDERLINETAGS_PATCH
@@ -166,26 +166,47 @@ static void (*bartabmonfns[])(Monitor *) = { NULL /* , customlayoutfn */ };
#endif // MONOCLE_LAYOUT
#endif // BAR_TABGROUPS_PATCH
#if BAR_PANGO_PATCH
static const char font[] = "monospace 10";
static const char font[] = "monospace 11";
#else
static const char *fonts[] = { "monospace:size=10" };
static const char *fonts[] = { "JetBrainsMono Nerd Font:size=16:antialias=true", "monospace:size=16:antialias=true" };
#endif // BAR_PANGO_PATCH
static const char dmenufont[] = "monospace:size=10";
static const char dmenufont[] = "JetBrainsMono Nerd Font:size=16:antialias=true";
static char base = "#191724";
static char surface = "#1f1d2e";
static char overlay = "#26233a";
static char muted = "#6e6a86";
static char subtle = "#908caa";
static char text = "#e0def4";
static char love = "#eb6f92";
static char gold = "#f6c177";
static char rose = "#ebbcba";
static char pine = "#31748f";
static char foam = "#9ccfd8";
static char iris = "#c4a7e7";
static char highlightLow = "#21202e";
static char highlightMed = "#403d52";
static char highlightHigh = "#524f67";
static char c000000[] = "#000000"; // placeholder value
static char normfgcolor[] = "#bbbbbb";
static char normbgcolor[] = "#222222";
static char normbordercolor[] = "#444444";
static char normfloatcolor[] = "#db8fd9";
static char normfgcolor[] = text;
static char normbgcolor[] = surface;
static char normbordercolor[] = overlay;
static char normfloatcolor[] = highlightMed;
static char selfgcolor[] = "#eeeeee";
static char selfgcolor[] = ;
static char selbgcolor[] = "#005577";
static char selbordercolor[] = "#005577";
static char selfloatcolor[] = "#005577";
static char titlenormfgcolor[] = "#bbbbbb";
static char titlenormbgcolor[] = "#222222";
static char titlenormbgcolor[] = "#1f1d2e";
static char titlenormbordercolor[] = "#444444";
static char titlenormfloatcolor[] = "#db8fd9";
@@ -462,7 +483,8 @@ static char tagicons[][NUMTAGS][MAX_TAGLEN] =
static char *tagicons[][NUMTAGS] =
#endif // NAMETAG_PATCH
{
[DEFAULT_TAGS] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" },
/*[DEFAULT_TAGS] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" },*/
[DEFAULT_TAGS] = { "", "", "", "", "", "", "", "", "" },
[ALTERNATIVE_TAGS] = { "A", "B", "C", "D", "E", "F", "G", "H", "I" },
[ALT_TAGS_DECORATION] = { "<1>", "<2>", "<3>", "<4>", "<5>", "<6>", "<7>", "<8>", "<9>" },
};
@@ -779,13 +801,13 @@ static const Layout layouts[] = {
#if XKB_PATCH
/* xkb frontend */
static const char *xkb_layouts[] = {
"pl",
"en",
"ru",
};
#endif // XKB_PATCH
/* key definitions */
#define MODKEY Mod1Mask
#define MODKEY Mod4Mask
#if COMBO_PATCH && SWAPTAGS_PATCH && TAGOTHERMONITOR_PATCH
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, comboview, {.ui = 1 << TAG} }, \
@@ -882,7 +904,35 @@ static const char *dmenucmd[] = {
#endif // BAR_DMENUMATCHTOP_PATCH
NULL
};
static const char *termcmd[] = { "st", NULL };
static const char *termcmd[] = { "kitty", NULL };
static const char *prtscrcmd[] = { "flameshot", "gui", NULL };
static const char *mutevol[] = {"pactl", "set-sink-mute", "0", "toggle", NULL};
static const char *downvol[] = {"pactl", "set-sink-volume", "0", "-3%", NULL};
static const char *upvol[] = {"pactl", "set-sink-volume", "0", "+3%", NULL};
static const char *mutemic[] = {"pactl", "set-source-mute", "0", "toggle", NULL};
static const char *downbrt[] = {"brightnessctl", "s", "5%-", NULL};
static const char *upbrt[] = {"brightnessctl", "s", "5%+", NULL};
static const char *displ[] = {"arandr", NULL};
static const char *wlan[] = {"kitty", "-e", "nmtui", NULL};
static const char *tools[] = {"lxappearance"};
// static const char *search[] = {"rofi", "-show", "drun", NULL};
// static const char *launcha[] = {alttabstart};
static const char *nemo[] = {"nemo", NULL};
static const char *explorer[] = {"kitty", "-e", "lf", NULL};
static const char *editor[] = {"neovide", NULL};
static const char *mail[] = {"kitty", "-e", "neomutt", NULL};
static const char *music[] = {"kitty", "-e", "ncmpcpp", NULL};
static const char *spotify[] = {"kitty", "-e", "ncspot", NULL};
static const char *audio[] = {"kitty", "-e", "ncpamixer", NULL};
static const char *locksession[] = {"loginctl", "lock-session", NULL};
// static const char *websearch[] = {".config/rofi/scripts/websearch", NULL};
// static const char *emoji[] = {".config/rofi/scripts/emoji", NULL};
static const char *launcher[] = {"rofi", "-show", "drun", NULL};
// static const char *wallpaper[] = {".config/rofi/scripts/wallpaper", NULL};
// static const char *theme[] = {".config/rofi/scripts/theme", NULL};
// static const char *powermenu[] = {".config/rofi/scripts/powermenu", NULL};
#if BAR_STATUSCMD_PATCH
#if BAR_DWMBLOCKS_PATCH
@@ -910,6 +960,36 @@ static const Key on_empty_keys[] = {
static const Key keys[] = {
/* modifier key function argument */
{ 0, XF86XK_AudioMute, spawn, {.v = mutevol}},
{ 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol}},
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol}},
{ 0, XF86XK_AudioMicMute, spawn, {.v = mutemic}},
{ 0, XF86XK_MonBrightnessDown, spawn, {.v = downbrt}},
{ 0, XF86XK_MonBrightnessUp, spawn, {.v = upbrt}},
{ 0, XF86XK_Display, spawn, {.v = displ}},
{ 0, XF86XK_WLAN, spawn, {.v = wlan}},
{ 0, XF86XK_Tools, spawn, {.v = tools}},
// { 0, XF86XK_Search, spawn, {.v = search}},
{ 0, XF86XK_LaunchA, alttabstart, {0}},
{ 0, XF86XK_Explorer, spawn, {.v = explorer}},
{ MODKEY|Mod1Mask, XK_F1, spawn, {.v = upvol}},
{ MODKEY|Mod1Mask, XK_F3, spawn, {.v = downvol}},
{ MODKEY, XK_n, spawn, {.v = nemo} },
{ MODKEY, XK_w, spawn, {.v = editor} },
{ MODKEY, XK_e, spawn, {.v = explorer} },
{ MODKEY|ShiftMask, XK_l, spawn, {.v = locksession} },
{ 0, XK_Print, spawn, {.v = prtscrcmd} },
{ MODKEY|ShiftMask, XK_s, spawn, {.v = prtscrcmd} },
{ MODKEY, XK_a, spawn, {.v = spotify} },
{ MODKEY, XK_s, spawn, {.v = music} },
{ MODKEY, XK_d, spawn, {.v = audio} },
{ MODKEY, XK_x, spawn, {.v = mail} },
// { MODKEY, XK_z, spawn, {.v = websearch} },
// { MODKEY, XK_semicolon, spawn, {.v = emoji} },
{ MODKEY, XK_space, spawn, {.v = launcher} },
// { MODKEY, XK_w, spawn, {.v = wallpaper} },
// { MODKEY, XK_e, spawn, {.v = theme} },
// { MODKEY, XK_x, spawn, {.v = powermenu} },
#if KEYMODES_PATCH
{ MODKEY, XK_Escape, setkeymode, {.ui = COMMANDMODE} },
#endif // KEYMODES_PATCH

21
default.nix Normal file
View File

@@ -0,0 +1,21 @@
{ stdenv, fetchurl, libX11, libXft, libXinerama }:
stdenv.mkDerivation {
name = "dwm-HEAD";
src = builtins.filterSource
(path: type: (toString path) != (toString ./.git)) ./.;
buildInputs = [ libX11 libXft libXinerama ];
prePatch = ''
substituteInPlace config.mk --replace '/usr/local' $out
'';
meta = with stdenv.lib; {
description = "Dynamic window manager for X";
homepage = http://dwm.suckless.org/;
license = licenses.mit;
platforms = platforms.all;
};
}