diff --git a/Xdefaults b/Xdefaults index a28bbc3..f08b7e2 100644 --- a/Xdefaults +++ b/Xdefaults @@ -1,10 +1,10 @@ #define FG #fefefe #define BG #191919 -! #define font1 minecraft enchantment:minispace=False:size=10:antialias=true -! #define spacing 2 +! #define font1 xft:minecraft enchantment:minispace=False:size=10:antialias=true +! #define spacing -2 -#define font1 mononoki:minispace=False:size=10:antialias=true +#define font1 xft:mononoki:minispace=False:size=14:antialias=true #define spacing 2 #define font2 xft:MesloLGM Nerd Font Mono:minispace=False:size=10 @@ -17,9 +17,8 @@ dzen2.font: mononoki *.foreground: FG *.background: BG -*.alpha: 100 *.borderColor: BG -*.cursorColor: FG +*.cursorColor: FG ! black *.color0: #282a2e @@ -56,7 +55,7 @@ dzen2.font: mononoki ! Set depth to make transparency work. URxvt*depth: 32 -*.font: font1 +*.font: mononoki:minispace=False:size=10:antialias=true URxvt.font: font1,font2,font3,font4 URxvt.boldFont: font1:style=bold,font2:style=bold,font3:style=bold,font4 URxvt.italicFont:font1:style=italic,font2:style=italic,font3:style=italic,font4 diff --git a/config/bspwm/bspwmrc b/config/bspwm/bspwmrc index 24a2743..fec65c2 100755 --- a/config/bspwm/bspwmrc +++ b/config/bspwm/bspwmrc @@ -14,8 +14,10 @@ pgrep -x sxhkd > /dev/null || sxhkd & pgrep -x picom > /dev/null || picom & pgrep -x xss-lock > /dev/null || xss-lock slock & pgrep -x bg.sh > /dev/null || $HOME/.scripts/bg.sh > /dev/null & +#pgrep -x xcompmgr > /dev/null || xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55 & [ -f "$HOME/.config/xrandr.sh" ] && . $HOME/.config/xrandr.sh +#xrandr > ~/XRANDR primary=$(bspc query --monitors -m primary) set -- a b c d e f g h i j k l m n o diff --git a/config/cava/config b/config/cava/config index 2ddd926..a8379c8 100644 --- a/config/cava/config +++ b/config/cava/config @@ -17,7 +17,7 @@ # Manual sensitivity in %. Autosens must be turned off for this to take effect. # 200 means double height. Accepts only non-negative values. -; sensitivity = 100 +; sensitivity = 200 # The number of bars (0-200). 0 sets it to auto (fill up console). # Bars' width and space between bars in number of characters. @@ -56,10 +56,10 @@ # For alsa 'source' will be the capture device. # For fifo 'source' will be the path to fifo-file. # For shmem 'source' will be /squeezelite-AA:BB:CC:DD:EE:FF where 'AA:BB:CC:DD:EE:FF' will be squeezelite's MAC address -; source = auto +source = auto -method = alsa - source = hw:Loopback,1 +; method = alsa +; source = hw:Loopback,1 ; method = fifo ; source = /tmp/mpd.fifo @@ -139,15 +139,15 @@ method = alsa # Percentage value for integral smoothing. Takes values from 0 - 100. # Higher values means smoother, but less precise. 0 to disable. -; integral = 76 +integral = 0 # Disables or enables the so-called "Monstercat smoothing" with or without "waves". Set to 0 to disable. -monstercat = 1 -; waves = 0 +monstercat = 0 +waves = 0 # Set gravity percentage for "drop off". Higher values means bars will drop faster. # Accepts only non-negative values. 50 means half gravity, 200 means double. Set to 0 to disable "drop off". -; gravity = 100 +gravity = 400 # In bar height, bars that would have been lower that this will not be drawn. diff --git a/config/compfy/compfy.conf b/config/compfy/compfy.conf index b2b508c..00c38a6 100644 --- a/config/compfy/compfy.conf +++ b/config/compfy/compfy.conf @@ -17,7 +17,7 @@ animation-stiffness = 240; # Change the mass of windows # Modifying the mass of windows makes them virtually heavier and therefore slower to animate. -animation-window-mass = 1; +animation-window-mass = 0.5; # Change dampening applied during the animation # This setting basically does what it says. It dampens the animation of windows. @@ -152,11 +152,11 @@ fading = true; # Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028) # fade-in-step = 0.028 -fade-in-step = 0.03; +fade-in-step = 0.01; # Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03) # fade-out-step = 0.03 -fade-out-step = 0.03; +fade-out-step = 0.01; # The time between steps in fade step, in milliseconds. (> 0, defaults to 10) fade-delta = 4 diff --git a/config/mpd/mpd.conf b/config/mpd/mpd.conf index b086d5e..5dd1296 100644 --- a/config/mpd/mpd.conf +++ b/config/mpd/mpd.conf @@ -15,14 +15,24 @@ audio_output { audio_output { type "pulse" - name "mpd" + name "mpd pulse" } +#audio_output { +# type "jack" +# name "MPD jack" +#} + +#audio_output { + #type "pipewire" + #name "MPD pipewire" +#} + audio_output { type "fifo" name "Visualizer feed" path "/tmp/mpd.fifo" - format "44100:16:2" + format "22050:16:2" } db_file "~/.config/mpd/database" diff --git a/config/picom/picom.conf b/config/picom/picom.conf index 1179a80..7e5ed20 100644 --- a/config/picom/picom.conf +++ b/config/picom/picom.conf @@ -2,7 +2,7 @@ # Corners # ################################# # requires: https://github.com/sdhand/compton -corner-radius = 4; +corner-radius = 6; round-borders = 0; # Specify a list of border width rules, in the format `PIXELS:PATTERN`, @@ -29,24 +29,24 @@ shadow = true; # The blur radius for shadows, in pixels. (defaults to 12) # shadow-radius = 12 -shadow-radius = 20; +shadow-radius = 50; # The opacity of shadows. (1.0 - 1.0, defaults to 0.75) -shadow-opacity = 0.7; +shadow-opacity = 1.0; # The left offset for shadows, in pixels. (defaults to -15) # shadow-offset-x = -15 -shadow-offset-x = -20; +shadow-offset-x = -50; # The top offset for shadows, in pixels. (defaults to -15) # shadow-offset-y = -15 -shadow-offset-y = -20; +shadow-offset-y = -50; # Don't draw shadows on drag-and-drop windows. This option is deprecated, # you should use the *wintypes* option in your config file instead. # #no-dnd-shadow = true -#no-dock-shadow = false +no-dock-shadow = false # Red color value of shadow (0.0 - 1.0, defaults to 0). #shadow-red = 0.86328125 @@ -140,13 +140,13 @@ fade-exclude = [ # Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows. # inactive-opacity-override = true -inactive-opacity-override = true; +inactive-opacity-override = false; # Default opacity for active windows. (0.0 - 1.0, defaults to 1.0) active-opacity = 1.0; # Dim inactive windows. (0.0 - 1.0, defaults to 0.0) -inactive-dim = 0.0 +# inactive-dim = 0.0 # Specify a list of conditions of windows that should always be considered focused. # focus-exclude = [] @@ -208,11 +208,12 @@ blur-background = true; blur: { # requires: https://github.com/ibhagwan/picom - #method = "none"; - method = "kawase"; - strength = 3; - deviation = 1.0; - background = true; + method = "none"; + #method = "kernel"; + strength = 0; + # deviation = 1.0; + # kernel = "11x11gaussian"; + background = false; background-frame = false; background-fixed = false; kern = "3x3box"; @@ -220,7 +221,7 @@ blur: { # Exclude conditions for background blur. blur-background-exclude = [ - "class_g != 'St'", + "class_g = 'slop'", "_GTK_FRAME_EXTENTS@:c" ]; @@ -238,7 +239,7 @@ daemon = true experimental-backends = true; backend = "glx"; -vsync = false +vsync = true # Enable remote control via D-Bus. See the *D-BUS API* section below for more details. # dbus = false diff --git a/config/polybar/config b/config/polybar/config index d8f670e..e1fcd5b 100644 --- a/config/polybar/config +++ b/config/polybar/config @@ -4,8 +4,8 @@ offsety = 24 [color] bg = #191919 -bga = #CC191919 -fg4 = #f58d44 +bga = #191919 +fg4= #f58d44 fg2 = #5f819d fg3 = #707880 fg1 = #fefefe @@ -40,7 +40,7 @@ modules-right = time [bar/ws] inherit = bar/base -width = 1870 +width = 2510 offset-x = 25 offset-y = 10 modules-left = workspaces xwindow diff --git a/config/rofi/colors-rofi-dark.rasi b/config/rofi/colors-rofi-dark.rasi index a4b5c0a..e861cd4 100644 --- a/config/rofi/colors-rofi-dark.rasi +++ b/config/rofi/colors-rofi-dark.rasi @@ -46,7 +46,7 @@ } #message { - border: 2px 0px 0px; + border: 0px 0px 0px; border-color: @border-color; padding: 1px; } @@ -68,7 +68,7 @@ #listview { fixed-height: 0; - border: 2px 0px 0px; + border: 0px 0px 0px; border-color: @border-color; spacing: 2px; scrollbar: true; diff --git a/config/sxhkd/sxhkdrc b/config/sxhkd/sxhkdrc index 7e4f781..40ddc7e 100644 --- a/config/sxhkd/sxhkdrc +++ b/config/sxhkd/sxhkdrc @@ -73,7 +73,7 @@ super + i # open audio mixer super + semicolon - bspc rule -a \* -o state=floating && $TERMINAL -e pulsemixer + bspc rule -a \* -o state=floating && $TERMINAL -e pulsemixer # xkill ctrl + alt + Escape @@ -233,7 +233,7 @@ super + f super + d [ -z "$(bspc query -N -n focused.sticky)" ] && \ bspc node focused -g sticky=on || \ - bspc node focused -g sticky=off; + bspc node focused -g stick=off; super + ctrl + f bspc node -t \~fullscreen diff --git a/config/vim/vimrc b/config/vim/vimrc index 0e37dc3..6a568a8 100644 --- a/config/vim/vimrc +++ b/config/vim/vimrc @@ -71,13 +71,13 @@ nmap re (coc-codeaction-refactor) xmap r (coc-codeaction-refactor-selected) " nmap r (coc-codeaction-refactor-selected) -"inoremap -" \ coc#pum#visible() ? coc#pum#next(1) : -" \ CheckBackspace() ? "\" : -" \ coc#refresh() -"inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" +inoremap + \ coc#pum#visible() ? coc#pum#next(1) : + \ CheckBackspace() ? "\" : + \ coc#refresh() +inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" -"inoremap coc#pum#visible() ? coc#pum#confirm() +inoremap coc#pum#visible() ? coc#pum#confirm() \: "\u\\=coc#on_enter()\" function! CheckBackspace() abort diff --git a/mkshrc b/mkshrc index 293c712..c0351ee 100644 --- a/mkshrc +++ b/mkshrc @@ -55,4 +55,4 @@ parse_git_dirty () { bind '^L=clear-screen' -export PS1="\${PWD/#\$HOME/\~}\`parse_git_branch\` > " +export PS1="\${PWD/#\$HOME/\~}\`parse_git_branch\` > ") diff --git a/profile b/profile index 09ce224..93a54ad 100644 --- a/profile +++ b/profile @@ -14,7 +14,7 @@ export FILE_MANAGER="/usr/bin/thunar" export EMAIL_CLIENT="/usr/bin/claws-mail" export EDITOR="/usr/bin/vim" -export JAVA_HOME=/usr/lib/jvm/java-17-openjdk/ +export JAVA_HOME=/usr/lib/jvm/java-19-openjdk/ export XINITRC="$HOME/.config/sx/sxrc" [ "$(fgconsole 2>/dev/null)" = "1" ] && exec sx diff --git a/scripts/mpc_add_query.sh b/scripts/mpc_add_query.sh index 08a1c20..adc820a 100755 --- a/scripts/mpc_add_query.sh +++ b/scripts/mpc_add_query.sh @@ -2,4 +2,4 @@ query=${1} cd ~/music -find . -iname "*$query*" -type f | while read -r line; do echo "$line"; mpc insert "${line#./}"; done +find . -iname "*$query*" -type f | while read -r line; do mpc insert "${line#./}"; done diff --git a/scripts/mpc_add_recent.sh b/scripts/mpc_add_recent.sh index 356ad6f..7465e0e 100755 --- a/scripts/mpc_add_recent.sh +++ b/scripts/mpc_add_recent.sh @@ -1,7 +1,7 @@ #!/bin/sh # add recently added files to the playlist -count=${1:-25} +count=${1:-10} cd ~/music find . -type f -print0 | xargs -0 stat -c"%Y %n" | sort -n | tail -${count} |cut -d' ' -f2- | while read -r line; do mpc insert "${line#./}"; done diff --git a/scripts/websearch b/scripts/websearch index 26e0896..7af5b57 100755 --- a/scripts/websearch +++ b/scripts/websearch @@ -1,7 +1,4 @@ #!/bin/sh -# -# -# TODO make this list results in rofi/dmenu that would be coo default_browser="links-launcher" BROWSER=${BROWSER:-$default_browser} diff --git a/st/davidovski.patch b/st/davidovski.patch index f991439..ee263b2 100644 --- a/st/davidovski.patch +++ b/st/davidovski.patch @@ -1,3 +1,26 @@ +From d71723fb393211ce03bae41e26d962b25e3dae98 Mon Sep 17 00:00:00 2001 +From: davidovski +Date: Mon, 4 Dec 2023 23:42:07 +0000 +Subject: [PATCH] davidovski + +--- + Makefile | 6 +- + boxdraw.c | 194 ++++++++++++++++++ + boxdraw_data.h | 214 ++++++++++++++++++++ + config.def.h | 60 +++++- + config.h | 532 +++++++++++++++++++++++++++++++++++++++++++++++++ + st.c | 164 ++++++++++++--- + st.desktop | 8 + + st.h | 12 ++ + st.info | 4 +- + win.h | 4 +- + x.c | 243 ++++++++++++++++++++-- + 11 files changed, 1393 insertions(+), 48 deletions(-) + create mode 100644 boxdraw.c + create mode 100644 boxdraw_data.h + create mode 100644 config.h + create mode 100644 st.desktop + diff --git a/Makefile b/Makefile index 15db421..bc75c1d 100644 --- a/Makefile @@ -453,7 +476,7 @@ index 0000000..7890500 + /* U+2571 - U+2573: unsupported (diagonals) */ +}; diff --git a/config.def.h b/config.def.h -index 91ab8ca..805e09d 100644 +index 91ab8ca..b55e689 100644 --- a/config.def.h +++ b/config.def.h @@ -5,7 +5,13 @@ @@ -490,17 +513,7 @@ index 91ab8ca..805e09d 100644 /* * bell volume. It must be a value between -100 and 100. Use 0 for disabling * it -@@ -93,6 +111,9 @@ char *termname = "st-256color"; - */ - unsigned int tabspaces = 8; - -+/* bg opacity */ -+float alpha = 0.8; -+ - /* Terminal colors (16 first used in escape sequence) */ - static const char *colorname[] = { - /* 8 normal colors */ -@@ -170,12 +191,50 @@ static unsigned int defaultattr = 11; +@@ -170,12 +188,50 @@ static unsigned int defaultattr = 11; */ static uint forcemousemod = ShiftMask; @@ -551,7 +564,7 @@ index 91ab8ca..805e09d 100644 { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 }, { ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} }, { XK_ANY_MOD, Button4, ttysend, {.s = "\031"} }, -@@ -201,6 +260,8 @@ static Shortcut shortcuts[] = { +@@ -201,6 +257,8 @@ static Shortcut shortcuts[] = { { TERMMOD, XK_Y, selpaste, {.i = 0} }, { ShiftMask, XK_Insert, selpaste, {.i = 0} }, { TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, @@ -562,10 +575,10 @@ index 91ab8ca..805e09d 100644 /* diff --git a/config.h b/config.h new file mode 100644 -index 0000000..206c72d +index 0000000..b55e689 --- /dev/null +++ b/config.h -@@ -0,0 +1,536 @@ +@@ -0,0 +1,532 @@ +/* See LICENSE file for copyright and license details. */ + +/* @@ -720,10 +733,6 @@ index 0000000..206c72d +unsigned int defaultcs = 256; +static unsigned int defaultrcs = 257; + -+/* -+ * Default alpha -+ */ -+float alpha = 0.75; +/* + * Default shape of cursor + * 2: Block ("█") @@ -1102,21 +1111,8 @@ index 0000000..206c72d + " !\"#$%&'()*+,-./0123456789:;<=>?" + "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" + "`abcdefghijklmnopqrstuvwxyz{|}~"; -diff --git a/config.mk b/config.mk -index 1e306f8..47c615e 100644 ---- a/config.mk -+++ b/config.mk -@@ -16,7 +16,7 @@ PKG_CONFIG = pkg-config - INCS = -I$(X11INC) \ - `$(PKG_CONFIG) --cflags fontconfig` \ - `$(PKG_CONFIG) --cflags freetype2` --LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \ -+LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft -lXrender\ - `$(PKG_CONFIG) --libs fontconfig` \ - `$(PKG_CONFIG) --libs freetype2` - diff --git a/st.c b/st.c -index 77c3e8a..df6d4c9 100644 +index d6478f5..1fd732e 100644 --- a/st.c +++ b/st.c @@ -35,6 +35,7 @@ @@ -1373,9 +1369,9 @@ index 77c3e8a..df6d4c9 100644 } int32_t -@@ -1730,11 +1795,11 @@ csihandle(void) +@@ -1729,11 +1794,11 @@ csihandle(void) + break; case 'S': /* SU -- Scroll line up */ - if (csiescseq.priv) break; DEFAULT(csiescseq.arg[0], 1); - tscrollup(term.top, csiescseq.arg[0]); + tscrollup(term.top, csiescseq.arg[0], 0); @@ -1387,7 +1383,7 @@ index 77c3e8a..df6d4c9 100644 break; case 'L': /* IL -- Insert blank lines */ DEFAULT(csiescseq.arg[0], 1); -@@ -1810,6 +1875,33 @@ csihandle(void) +@@ -1809,6 +1874,33 @@ csihandle(void) goto unknown; } break; @@ -1421,7 +1417,7 @@ index 77c3e8a..df6d4c9 100644 } } -@@ -1888,7 +1980,7 @@ strhandle(void) +@@ -1887,7 +1979,7 @@ strhandle(void) switch (par) { case 0: if (narg > 1) { @@ -1430,7 +1426,7 @@ index 77c3e8a..df6d4c9 100644 xseticontitle(strescseq.args[1]); } return; -@@ -1898,7 +1990,7 @@ strhandle(void) +@@ -1897,7 +1989,7 @@ strhandle(void) return; case 2: if (narg > 1) @@ -1439,7 +1435,7 @@ index 77c3e8a..df6d4c9 100644 return; case 52: if (narg > 2 && allowwindowops) { -@@ -1957,7 +2049,7 @@ strhandle(void) +@@ -1956,7 +2048,7 @@ strhandle(void) } break; case 'k': /* old title set compatibility */ @@ -1448,7 +1444,7 @@ index 77c3e8a..df6d4c9 100644 return; case 'P': /* DCS -- Device Control String */ case '_': /* APC -- Application Program Command */ -@@ -2310,7 +2402,7 @@ eschandle(uchar ascii) +@@ -2305,7 +2397,7 @@ eschandle(uchar ascii) return 0; case 'D': /* IND -- Linefeed */ if (term.c.y == term.bot) { @@ -1457,7 +1453,7 @@ index 77c3e8a..df6d4c9 100644 } else { tmoveto(term.c.x, term.c.y+1); } -@@ -2323,7 +2415,7 @@ eschandle(uchar ascii) +@@ -2318,7 +2410,7 @@ eschandle(uchar ascii) break; case 'M': /* RI -- Reverse index */ if (term.c.y == term.top) { @@ -1466,7 +1462,7 @@ index 77c3e8a..df6d4c9 100644 } else { tmoveto(term.c.x, term.c.y-1); } -@@ -2333,6 +2425,7 @@ eschandle(uchar ascii) +@@ -2328,6 +2420,7 @@ eschandle(uchar ascii) break; case 'c': /* RIS -- Reset to initial state */ treset(); @@ -1474,7 +1470,7 @@ index 77c3e8a..df6d4c9 100644 resettitle(); xloadcols(); xsetmode(0, MODE_HIDE); -@@ -2546,7 +2639,7 @@ twrite(const char *buf, int buflen, int show_ctrl) +@@ -2541,7 +2634,7 @@ twrite(const char *buf, int buflen, int show_ctrl) void tresize(int col, int row) { @@ -1483,7 +1479,7 @@ index 77c3e8a..df6d4c9 100644 int minrow = MIN(row, term.row); int mincol = MIN(col, term.col); int *bp; -@@ -2583,6 +2676,14 @@ tresize(int col, int row) +@@ -2578,6 +2671,14 @@ tresize(int col, int row) term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty)); term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs)); @@ -1498,7 +1494,7 @@ index 77c3e8a..df6d4c9 100644 /* resize each row to new width, zero-pad if needed */ for (i = 0; i < minrow; i++) { term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph)); -@@ -2628,7 +2729,7 @@ tresize(int col, int row) +@@ -2623,7 +2724,7 @@ tresize(int col, int row) void resettitle(void) { @@ -1507,7 +1503,7 @@ index 77c3e8a..df6d4c9 100644 } void -@@ -2641,7 +2742,7 @@ drawregion(int x1, int y1, int x2, int y2) +@@ -2636,7 +2737,7 @@ drawregion(int x1, int y1, int x2, int y2) continue; term.dirty[y] = 0; @@ -1516,7 +1512,7 @@ index 77c3e8a..df6d4c9 100644 } } -@@ -2662,8 +2763,9 @@ draw(void) +@@ -2657,8 +2758,9 @@ draw(void) cx--; drawregion(0, 0, term.col, term.row); @@ -1543,7 +1539,7 @@ index 0000000..49029d8 +Type=Application +Categories=System;TerminalEmulator; diff --git a/st.h b/st.h -index fd3b0d8..c248ec6 100644 +index fd3b0d8..f6bd3b4 100644 --- a/st.h +++ b/st.h @@ -33,6 +33,7 @@ enum glyph_attribute { @@ -1578,11 +1574,10 @@ index fd3b0d8..c248ec6 100644 /* config.h globals */ extern char *utmp; extern char *scroll; -@@ -124,3 +135,5 @@ extern unsigned int tabspaces; +@@ -124,3 +135,4 @@ extern unsigned int tabspaces; extern unsigned int defaultfg; extern unsigned int defaultbg; extern unsigned int defaultcs; -+extern float alpha; +extern const int boxdraw, boxdraw_bold, boxdraw_braille; diff --git a/st.info b/st.info index efab2cf..24dfc7d 100644 @@ -1622,7 +1617,7 @@ index 6de960d..2a40aa0 100644 void xsetmode(int, unsigned int); void xsetpointermotion(int); diff --git a/x.c b/x.c -index b36fb8c..458e4af 100644 +index b36fb8c..ccfb7e7 100644 --- a/x.c +++ b/x.c @@ -14,6 +14,7 @@ @@ -1663,15 +1658,7 @@ index b36fb8c..458e4af 100644 /* XEMBED messages */ #define XEMBED_FOCUS_IN 4 #define XEMBED_FOCUS_OUT 5 -@@ -105,6 +122,7 @@ typedef struct { - XSetWindowAttributes attrs; - int scr; - int isfixed; /* is fixed geometry? */ -+ int depth; /* bit depth */ - int l, t; /* left and top offset */ - int gm; /* geometry mask */ - } XWindow; -@@ -157,6 +175,8 @@ static void xhints(void); +@@ -157,6 +174,8 @@ static void xhints(void); static int xloadcolor(int, const char *, Color *); static int xloadfont(Font *, FcPattern *); static void xloadfonts(const char *, double); @@ -1680,7 +1667,7 @@ index b36fb8c..458e4af 100644 static void xunloadfont(Font *); static void xunloadfonts(void); static void xsetenv(void); -@@ -220,6 +240,8 @@ static DC dc; +@@ -220,6 +239,8 @@ static DC dc; static XWindow xw; static XSelection xsel; static TermWindow win; @@ -1689,15 +1676,7 @@ index b36fb8c..458e4af 100644 /* Font Ring Cache */ enum { -@@ -243,6 +265,7 @@ static char *usedfont = NULL; - static double usedfontsize = 0; - static double defaultfontsize = 0; - -+static char *opt_alpha = NULL; - static char *opt_class = NULL; - static char **opt_cmd = NULL; - static char *opt_embed = NULL; -@@ -306,6 +329,7 @@ zoomabs(const Arg *arg) +@@ -306,6 +327,7 @@ zoomabs(const Arg *arg) { xunloadfonts(); xloadfonts(usedfont, arg->f); @@ -1705,7 +1684,7 @@ index b36fb8c..458e4af 100644 cresize(0, 0); redraw(); xhints(); -@@ -686,6 +710,8 @@ setsel(char *str, Time t) +@@ -686,6 +708,8 @@ setsel(char *str, Time t) XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t); if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win) selclear(); @@ -1714,30 +1693,7 @@ index b36fb8c..458e4af 100644 } void -@@ -752,7 +778,7 @@ xresize(int col, int row) - - XFreePixmap(xw.dpy, xw.buf); - xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, -- DefaultDepth(xw.dpy, xw.scr)); -+ xw.depth); - XftDrawChange(xw.draw, xw.buf); - xclear(0, 0, win.w, win.h); - -@@ -812,6 +838,13 @@ xloadcols(void) - else - die("could not allocate color %d\n", i); - } -+ -+ /* set alpha value of bg color */ -+ if (opt_alpha) -+ alpha = strtof(opt_alpha, NULL); -+ dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha); -+ dc.col[defaultbg].pixel &= 0x00FFFFFF; -+ dc.col[defaultbg].pixel |= (unsigned char)(0xff * alpha) << 24; - loaded = 1; - } - -@@ -859,8 +892,8 @@ xclear(int x1, int y1, int x2, int y2) +@@ -859,8 +883,8 @@ xclear(int x1, int y1, int x2, int y2) void xhints(void) { @@ -1748,7 +1704,7 @@ index b36fb8c..458e4af 100644 XWMHints wm = {.flags = InputHint, .input = 1}; XSizeHints *sizeh; -@@ -1050,6 +1083,101 @@ xloadfonts(const char *fontstr, double fontsize) +@@ -1050,6 +1074,101 @@ xloadfonts(const char *fontstr, double fontsize) FcPatternDestroy(pattern); } @@ -1850,33 +1806,16 @@ index b36fb8c..458e4af 100644 void xunloadfont(Font *f) { -@@ -1134,11 +1262,22 @@ xinit(int cols, int rows) - Window parent; +@@ -1135,8 +1254,6 @@ xinit(int cols, int rows) pid_t thispid = getpid(); XColor xmousefg, xmousebg; -+ XWindowAttributes attr; -+ XVisualInfo vis; -+ - if (!(xw.dpy = XOpenDisplay(NULL))) - die("can't open display\n"); xw.scr = XDefaultScreen(xw.dpy); -- xw.vis = XDefaultVisual(xw.dpy, xw.scr); -+ -+ if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0)))) { -+ parent = XRootWindow(xw.dpy, xw.scr); -+ xw.depth = 32; -+ } else { -+ XGetWindowAttributes(xw.dpy, parent, &attr); -+ xw.depth = attr.depth; -+ } -+ -+ XMatchVisualInfo(xw.dpy, xw.scr, xw.depth, TrueColor, &vis); -+ xw.vis = vis.visual; + xw.vis = XDefaultVisual(xw.dpy, xw.scr); - /* font */ - if (!FcInit()) -@@ -1147,8 +1286,11 @@ xinit(int cols, int rows) +@@ -1147,6 +1264,9 @@ xinit(int cols, int rows) usedfont = (opt_font == NULL)? font : opt_font; xloadfonts(usedfont, 0); @@ -1884,35 +1823,9 @@ index b36fb8c..458e4af 100644 + xloadsparefonts(); + /* colors */ -- xw.cmap = XDefaultColormap(xw.dpy, xw.scr); -+ xw.cmap = XCreateColormap(xw.dpy, parent, xw.vis, None); + xw.cmap = XDefaultColormap(xw.dpy, xw.scr); xloadcols(); - - /* adjust fixed window geometry */ -@@ -1168,19 +1310,15 @@ xinit(int cols, int rows) - | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask; - xw.attrs.colormap = xw.cmap; - -- if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0)))) -- parent = XRootWindow(xw.dpy, xw.scr); - xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t, -- win.w, win.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput, -+ win.w, win.h, 0, xw.depth, InputOutput, - xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity - | CWEventMask | CWColormap, &xw.attrs); - - memset(&gcvalues, 0, sizeof(gcvalues)); - gcvalues.graphics_exposures = False; -- dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures, -- &gcvalues); -- xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, -- DefaultDepth(xw.dpy, xw.scr)); -+ xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, xw.depth); -+ dc.gc = XCreateGC(xw.dpy, xw.buf, GCGraphicsExposures, &gcvalues); - XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel); - XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h); - -@@ -1237,6 +1375,8 @@ xinit(int cols, int rows) +@@ -1237,6 +1357,8 @@ xinit(int cols, int rows) xsel.xtarget = XInternAtom(xw.dpy, "UTF8_STRING", 0); if (xsel.xtarget == None) xsel.xtarget = XA_STRING; @@ -1921,7 +1834,7 @@ index b36fb8c..458e4af 100644 } int -@@ -1283,8 +1423,13 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x +@@ -1283,8 +1405,13 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x yp = winy + font->ascent; } @@ -1937,7 +1850,7 @@ index b36fb8c..458e4af 100644 if (glyphidx) { specs[numspecs].font = font->match; specs[numspecs].glyph = glyphidx; -@@ -1488,8 +1633,12 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i +@@ -1488,8 +1615,12 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i r.width = width; XftDrawSetClipRectangles(xw.draw, winx, winy, &r, 1); @@ -1952,7 +1865,7 @@ index b36fb8c..458e4af 100644 /* Render underline and strikethrough. */ if (base.mode & ATTR_UNDERLINE) { -@@ -1532,7 +1681,7 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) +@@ -1532,7 +1663,7 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) /* * Select the right color for the right mode. */ @@ -1961,7 +1874,7 @@ index b36fb8c..458e4af 100644 if (IS_SET(MODE_REVERSE)) { g.mode |= ATTR_REVERSE; -@@ -1626,10 +1775,30 @@ xseticontitle(char *p) +@@ -1626,10 +1757,30 @@ xseticontitle(char *p) } void @@ -1995,7 +1908,7 @@ index b36fb8c..458e4af 100644 if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle, &prop) != Success) -@@ -1639,6 +1808,16 @@ xsettitle(char *p) +@@ -1639,6 +1790,16 @@ xsettitle(char *p) XFree(prop.value); } @@ -2012,7 +1925,7 @@ index b36fb8c..458e4af 100644 int xstartdraw(void) { -@@ -2014,6 +2193,59 @@ run(void) +@@ -2014,6 +2175,59 @@ run(void) } } @@ -2072,17 +1985,7 @@ index b36fb8c..458e4af 100644 void usage(void) { -@@ -2038,6 +2270,9 @@ main(int argc, char *argv[]) - case 'a': - allowaltscreen = 0; - break; -+ case 'A': -+ opt_alpha = EARGF(usage()); -+ break; - case 'c': - opt_class = EARGF(usage()); - break; -@@ -2087,6 +2322,11 @@ run: +@@ -2087,6 +2301,11 @@ run: setlocale(LC_CTYPE, ""); XSetLocaleModifiers(""); @@ -2094,3 +1997,6 @@ index b36fb8c..458e4af 100644 cols = MAX(cols, 1); rows = MAX(rows, 1); tnew(cols, rows); +-- +2.43.0 +