st

My build of suckless' st.
Log | Files | Refs | README | LICENSE

commit e9c6480234329cdf7a74bf8bf2fd14d460e0000c
parent 6ac9d2c715d262734db5425105834547acc72cd9
Author: Benjamin Chausse <benjamin@chausse.xyz>
Date:   Mon,  9 Mar 2020 00:01:50 -0400

Fixed Tex Format copy and begone rofi

Diffstat:
MREADME.md | 6+++++-
Mconfig.h | 9++++-----
Mst-copyout | 7++++---
Mst.c | 2+-
Mx.c | 6+-----
5 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/README.md b/README.md @@ -2,7 +2,7 @@ The [suckless terminal (st)](https://st.suckless.org/) with some additional features that make it literally the best terminal emulator ever: -## Unique features (using rofi) +## Unique features (using dmenu) + **follow urls** by pressing `alt-l` + **copy urls** in the same way with `alt-y` @@ -70,6 +70,10 @@ To be clear about the color settings: Note that when you run `wal`, it will negate the transparency of existing windows, but new windows will continue with the previously defined transparency. +## Crashing error + +If st crashes when viewing emojis, install `[libxft-bgra](https://aur.archlinux.org/packages/libxft-bgra/)` from the AUR. + ## Contact - Luke Smith <luke@lukesmith.xyz> diff --git a/config.h b/config.h @@ -5,9 +5,8 @@ * * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html */ -static char *font = "Hack Nerd Font Mono:pixelsize=18:antialias=true:autohint=true"; -/* static char *font = "Apercu Mono Nerd Font Complete:pixelsize=16:antialias=true:autohint=true"; */ -static char *font2[] = { "Inconsolata for Powerline:pixelsize=15:antialias=true:autohint=true" }; +static char *font = { "Apercu Nerd Font:pixelsize=18:antialias=true:autohint=true" }; +static char *font2[] = { "DejaVu Sans Mono Nerd Font:pixelsize=18:antialias=true:autohint=true" }; static int borderpx = 2; /* @@ -214,11 +213,11 @@ MouseKey mkeys[] = { }; static char *openurlcmd[] = { "/bin/sh", "-c", - "sed 's/.*│//g' | tr -d '\n' | grep -aEo '(((http|https)://|www\\.)[a-zA-Z0-9.]*[:]?[a-zA-Z0-9./&%?#=_-]*)|((magnet:\\?xt=urn:btih:)[a-zA-Z0-9]*)'| uniq | sed 's/^www./http:\\/\\/www\\./g' | rofi -dmenu -i -p 'Follow which url?' -l 10 | xargs -r xdg-open", + "sed 's/.*│//g' | tr -d '\n' | grep -aEo '(((http|https)://|www\\.)[a-zA-Z0-9.]*[:]?[a-zA-Z0-9./&%?#=_-]*)|((magnet:\\?xt=urn:btih:)[a-zA-Z0-9]*)'| uniq | sed 's/^www./http:\\/\\/www\\./g' | dmenu -i -p 'Follow which url?' -l 10 | xargs -r xdg-open", "externalpipe", NULL }; static char *copyurlcmd[] = { "/bin/sh", "-c", - "sed 's/.*│//g' | tr -d '\n' | grep -aEo '(((http|https)://|www\\.)[a-zA-Z0-9.]*[:]?[a-zA-Z0-9./&%?#=_-]*)|((magnet:\\?xt=urn:btih:)[a-zA-Z0-9]*)' | uniq | sed 's/^www./http:\\/\\/www\\./g' | rofi -dmenu -i -p 'Copy which url?' -l 10 | tr -d '\n' | xclip -selection clipboard", + "sed 's/.*│//g' | tr -d '\n' | grep -aEo '(((http|https)://|www\\.)[a-zA-Z0-9.]*[:]?[a-zA-Z0-9./&%?#=_-]*)|((magnet:\\?xt=urn:btih:)[a-zA-Z0-9]*)' | uniq | sed 's/^www./http:\\/\\/www\\./g' | dmenu -i -p 'Copy which url?' -l 10 | tr -d '\n' | xclip -selection clipboard", "externalpipe", NULL }; static char *copyoutput[] = { "/bin/sh", "-c", "st-copyout", "externalpipe", NULL }; diff --git a/st-copyout b/st-copyout @@ -7,19 +7,20 @@ tmpfile=$(mktemp /tmp/st-cmd-output.XXXXXX) trap 'rm "$tmpfile"' 0 1 15 sed -n "w $tmpfile" ps1="$(grep "\S" "$tmpfile" | tail -n 1 | sed 's/^\s*//' | cut -d' ' -f1)" -chosen="$(grep -F "$ps1" "$tmpfile" | sed '$ d' | tac | rofi -dmenu -p "Copy which command's output?" -i -l 10 | sed 's/[^^]/[&]/g; s/\^/\\^/g')" +chosen="$(grep -F "$ps1" "$tmpfile" | sed '$ d' | tac | dmenu -p "Copy which command's output?" -i -l 10 | sed 's/[^^]/[&]/g; s/\^/\\^/g')" eps1="$(echo "$ps1" | sed 's/[^^]/[&]/g; s/\^/\\^/g')" snippet=$(awk "/^$chosen$/{p=1;print;next} p&&/$eps1/{p=0};p" "$tmpfile" | sed "s/π\ sudo/#/; s/π/\$/; s/(master)//; s/\[sudo\].*$//") -method=$(printf "Plain\nMarkdown\nArch Forums\nLaTeX" | rofi -dmenu -p "What formating do you want?" -i -l 10) +method=$(printf "Plain\nMarkdown\nArch Forums\nLaTeX" | dmenu -p "What formating do you want?" -i -l 10) # awk "/^$chosen$/{p=1;print;next} p&&/$eps1/{p=0};p" "$tmpfile" | sxel -b +texbreak='\' case "$method" in *Markdown*) notify-send -i "$HOME/.fonts/svg/paste.svg" -a Clipboard "Copied entry with Markdown formating." && printf "\`\`\`\n$snippet\n\`\`\`" | xsel -b ;; *Arch*) notify-send -i "$HOME/.fonts/svg/paste.svg" -a Clipboard "Copied entry with Arch Forums formating." && printf "[code]\n$snippet\n[/code]" | xsel -b ;; - *TeX*) notify-send -i "$HOME/.fonts/svg/paste.svg" -a Clipboard "Copied entry with LaTeX formating." && printf '\\begin{verbatim}\n$snippet\n\\end{verbatim}' | xsel -b ;; + *TeX*) notify-send -i "$HOME/.fonts/svg/paste.svg" -a Clipboard "Copied entry with LaTeX formating." && printf "\\\begin{verbatim}\n$snippet\n\\\end{verbatim}" | xsel -b ;; *) notify-send -i "$HOME/.fonts/svg/paste.svg" -a Clipboard "Copied entry with plain formating." && printf "$snippet" | xsel -b ;; esac diff --git a/st.c b/st.c @@ -51,7 +51,7 @@ #define TLINE_HIST(y) ((y) <= HISTSIZE-term.row+2 ? term.hist[(y)] : term.line[(y-HISTSIZE+term.row-3)]) /* constants */ -#define ISO14755CMD "rofi -dmenu -w \"$WINDOWID\" -p codepoint: </dev/null" +#define ISO14755CMD "dmenu -w \"$WINDOWID\" -p codepoint: </dev/null" enum term_mode { MODE_WRAP = 1 << 0, diff --git a/x.c b/x.c @@ -1544,11 +1544,7 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i XftDrawSetClipRectangles(xw.draw, winx, winy, &r, 1); /* Render the glyphs. */ - FcBool b = FcFalse; - FcPatternGetBool(specs->font->pattern, FC_COLOR, 0, &b); - if (!b) { - XftDrawGlyphFontSpec(xw.draw, fg, specs, len); - } + XftDrawGlyphFontSpec(xw.draw, fg, specs, len); /* Render underline and strikethrough. */ if (base.mode & ATTR_UNDERLINE) {