patches

Patches for various other programs
git clone https://git.regexghost.com/patches.git
Log | Files | Refs | README

commit 03ebb023b501e8229c228acd33279936b487adeb
parent 84808c6329a58122ceb127d1d3a453c551118543
Author: regexghost <dev@regexghost.com>
Date:   Mon,  6 Jul 2026 01:33:43 +0100

added more patches and readme update

Diffstat:
MREADME.md | 26++++++++++++++++++++++++++
Alemonbar-xft-font-offset.diff | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apipe-viewer-copy.diff | 56++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 142 insertions(+), 0 deletions(-)

diff --git a/README.md b/README.md @@ -3,3 +3,29 @@ Patches I have made for various other programs Note: Doesn't include suckless programs as I have seperate repos for my builds of those + +## Lemonbar-xft + +https://github.com/silentz/lemonbar-xft + +Adds font offset support per-font + +Patch from https://github.com/drscream/lemonbar-xft slightly modified + +## oksh + +https://github.com/ibara/oksh + +Case insensitive auto-complete, and removing certain commands from history file + +## pipe-viewer + +https://github.com/trizen/pipe-viewer + +:copy=i command to copy links to clipboard + +## less + +https://github.com/gwsw/less + +bsu and esu sync signals, not perfectly implemented but it works diff --git a/lemonbar-xft-font-offset.diff b/lemonbar-xft-font-offset.diff @@ -0,0 +1,60 @@ +diff --git a/lemonbar.c b/lemonbar.c +index de4cf73..6a2f7cd 100644 +--- a/lemonbar.c ++++ b/lemonbar.c +@@ -26,6 +26,8 @@ + #define max(a,b) ((a) > (b) ? (a) : (b)) + #define min(a,b) ((a) < (b) ? (a) : (b)) + ++#define MAX_FONT_COUNT 5 ++ + typedef struct font_t { + xcb_font_t ptr; + int descent, height, width; +@@ -98,6 +100,9 @@ static int font_index = -1; + static uint32_t attrs = 0; + static bool dock = false; + static bool topbar = true; ++static int offsets_y[MAX_FONT_COUNT]; ++static int offset_y_count = 0; ++static int offset_y_index = 0; + static int bw = -1, bh = -1, bx = 0, by = 0; + static int bu = 1; // Underline height + static rgba_t fgc, bgc, ugc; +@@ -260,7 +265,7 @@ int xft_char_width (uint16_t ch, font_t *cur_font) { + int draw_char_xft(monitor_t *mon, font_t *cur_font, int x, int align, uint16_t ch) { + int ch_width = xft_char_width(ch, cur_font); + x = shift(mon, x, align, ch_width); +- int y = bh / 2 + cur_font->height / 2- cur_font->descent; ++ int y = bh / 2 + cur_font->height / 2- cur_font->descent + offsets_y[offset_y_index]; + XftDrawString16(xft_draw, &sel_fg, cur_font->xft_font, x, y, &ch, 1); + draw_lines(mon, x, ch_width); + return ch_width; +@@ -530,8 +535,10 @@ select_drawable_font (const uint16_t c) + // If the end is reached without finding an appropriate font, return NULL. + // If the font can draw the character, return it. + for (int i = 0; i < font_count; i++) { +- if (font_has_glyph(font_list[i], c)) ++ if (font_has_glyph(font_list[i], c)) { ++ offset_y_index = i; + return font_list[i]; ++ } + } + return NULL; + } +@@ -1583,7 +1590,14 @@ main (int argc, char **argv) + "\t-F Set foreground color in #AARRGGBB\n", argv[0]); + exit (EXIT_SUCCESS); + case 'g': (void)parse_geometry_string(optarg, geom_v); break; +- case 'o': (void)parse_output_string(optarg); break; ++ case 'o': offsets_y[offset_y_count] = strtol(optarg, NULL, 10); ++ if (offset_y_count == 0) { ++ for (int i=1; i<MAX_FONT_COUNT; i++) { ++ offsets_y[i] = offsets_y[0]; ++ } ++ } ++ ++offset_y_count; ++ break; + case 'p': permanent = true; break; + case 'n': wm_name = xstrdup(optarg); break; + case 'b': topbar = false; break; diff --git a/pipe-viewer-copy.diff b/pipe-viewer-copy.diff @@ -0,0 +1,56 @@ +diff --git a/bin/pipe-viewer b/bin/pipe-viewer +index b98db2f..c1bea19 100644 +--- a/bin/pipe-viewer ++++ b/bin/pipe-viewer +@@ -3462,6 +3462,21 @@ sub print_playlists { + } + } + ++ elsif ($opt =~ /^c(?:opy)?${digit_or_equal_re}(.*)/) { ++ if (my @nums = get_valid_numbers($#{$playlists}, $1)) { ++ foreach my $num (@nums) { ++ my $id1 = sprintf($opt{youtube_playlist_url}, $yv_utils->get_playlist_id($playlists->[$num])); ++ print STDOUT $id1; ++ my $cmdstring = sprintf("echo -n \"%s\" | xclip -selection clipboard", $id1); ++ system($cmdstring); ++ } ++ press_enter_to_continue(); ++ } ++ else { ++ warn_no_thing_selected('video'); ++ } ++ } ++ + # :pp=i + elsif ($opt =~ /^pp${digit_or_equal_re}(.*)/) { + if (my @ids = get_valid_numbers($#{$playlists}, $1)) { +@@ -4688,7 +4703,7 @@ sub print_videos { + warn colored("\n[!] The playlist is empty!", 'bold red') . "\n"; + } + } +- elsif ($opt =~ /^c(?:omments?)?${digit_or_equal_re}(.*)/) { ++ elsif ($opt =~ /^comments?${digit_or_equal_re}(.*)/) { + if (my @nums = get_valid_numbers($#{$videos}, $1)) { + get_and_print_comments(map { $yv_utils->get_video_id($videos->[$_]) } @nums); + } +@@ -4752,6 +4767,20 @@ sub print_videos { + warn_no_thing_selected('video'); + } + } ++ elsif ($opt =~ /^c(?:opy)?${digit_or_equal_re}(.*)/) { ++ if (my @nums = get_valid_numbers($#{$videos}, $1)) { ++ foreach my $num (@nums) { ++ my $id1 = sprintf($opt{youtube_video_url}, $yv_utils->get_video_id($videos->[$num])); ++ print STDOUT $id1; ++ my $cmdstring = sprintf("echo -n \"%s\" | xclip -selection clipboard", $id1); ++ system($cmdstring); ++ } ++ press_enter_to_continue(); ++ } ++ else { ++ warn_no_thing_selected('video'); ++ } ++ } + elsif ($opt eq 'anp') { # auto-next-page + $opt{auto_next_page} = 1; + }