From e9c6480234329cdf7a74bf8bf2fd14d460e0000c Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Mon, 9 Mar 2020 00:01:50 -0400 Subject: Fixed Tex Format copy and begone rofi --- README.md | 6 +++++- config.h | 9 ++++----- st-copyout | 7 ++++--- st.c | 2 +- x.c | 6 +----- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 6bc9cd5..6117f8b 100644 --- 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 diff --git a/config.h b/config.h index 717f365..1606798 100644 --- 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 index e3e4f09..86f705b 100755 --- 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 index 5c81a15..21c6739 100644 --- 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: 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) { -- cgit v1.2.3