From ceae2d7422545ae493c6dbf0217d234fb28e2ebc Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 1 Mar 2019 21:45:36 +0100 Subject: remove most things --- debug/font-issues.zsh | 421 -------------------------------------------------- debug/iterm.zsh | 86 ----------- 2 files changed, 507 deletions(-) delete mode 100755 debug/font-issues.zsh delete mode 100755 debug/iterm.zsh (limited to 'debug') diff --git a/debug/font-issues.zsh b/debug/font-issues.zsh deleted file mode 100755 index 5712fc6d..00000000 --- a/debug/font-issues.zsh +++ /dev/null @@ -1,421 +0,0 @@ -#!/usr/bin/env zsh -#vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 - -source functions/colors.zsh -source functions/icons.zsh -source functions/utilities.zsh -# Map our $OS to neofetch $os -os="$OS" - - -trim() { - set -f - # shellcheck disable=2048,2086 - set -- $* - printf '%s\n' "${*//[[:space:]]/}" - set +f -} - -trim_quotes() { - trim_output="${1//\'}" - trim_output="${trim_output//\"}" - printf "%s" "$trim_output" -} - -get_ppid() { - # Get parent process ID of PID. - case "$os" in - "Windows") - ppid="$(ps -p "${1:-$PPID}" | awk '{printf $2}')" - ppid="${ppid/PPID}" - ;; - - "Linux") - ppid="$(grep -i -F "PPid:" "/proc/${1:-$PPID}/status")" - ppid="$(trim "${ppid/PPid:}")" - ;; - - *) - ppid="$(ps -p "${1:-$PPID}" -o ppid=)" - ;; - esac - - printf "%s" "$ppid" -} - -get_process_name() { - # Get PID name. - case "$os" in - "Windows") - name="$(ps -p "${1:-$PPID}" | awk '{printf $8}')" - name="${name/COMMAND}" - name="${name/*\/}" - ;; - - "Linux") - name="$(< "/proc/${1:-$PPID}/comm")" - ;; - - *) - name="$(ps -p "${1:-$PPID}" -o comm=)" - ;; - esac - - printf "%s" "$name" -} - -# Taken from NeoFetch (slightly modified) -get_term() { - local term - - # If function was run, stop here. - # ((term_run == 1)) && return - - # Workaround for macOS systems that - # don't support the block below. - case "$TERM_PROGRAM" in - "iTerm.app") term="iTerm2" ;; - "Terminal.app") term="Apple Terminal" ;; - "Hyper") term="HyperTerm" ;; - *) term="${TERM_PROGRAM/\.app}" ;; - esac - - # Most likely TosWin2 on FreeMiNT - quick check - [[ "$TERM" == "tw52" || "$TERM" == "tw100" ]] && \ - term="TosWin2" - - [[ "$SSH_CONNECTION" ]] && \ - term="$SSH_TTY" - - # Check $PPID for terminal emulator. - while [[ -z "$term" ]]; do - parent="$(get_ppid "$parent")" - [[ -z "$parent" ]] && break - name="$(get_process_name "$parent")" - - case "${name// }" in - "${SHELL/*\/}"|*"sh"|"screen"|"su"*) ;; - - "login"*|*"Login"*|"init"|"(init)") - term="$(tty)" - ;; - - "ruby"|"1"|"tmux"*|"systemd"|"sshd"*|"python"*|"USER"*"PID"*|"kdeinit"*|"launchd"*) - break - ;; - - "gnome-terminal-") term="gnome-terminal" ;; - "urxvtd") term="urxvt" ;; - *"nvim") term="Neovim Terminal" ;; - *"NeoVimServer"*) term="VimR Terminal" ;; - *) term="${name##*/}" ;; - esac - done - - # Log that the function was run. - # term_run=1 - - echo "${term}" -} - -get_term_font() { - local confs term_font mateterm_config role profile xrdb child profile_filename - local term="${1}" - # ((term_run != 1)) && get_term - - case "$term" in - "alacritty"*) - setopt nullglob - confs=({$XDG_CONFIG_HOME,$HOME}/{alacritty,}/{.,}alacritty.ym?) - unsetopt nullglob - - [[ -f "${confs[1]}" ]] || return - - term_font="$(awk -F ':|#' '/normal:/ {getline; print}' "${confs[1]}")" - term_font="${term_font/*family:}" - term_font="${term_font/$'\n'*}" - term_font="${term_font/\#*}" - ;; - - "Apple_Terminal") - term_font="$(osascript </dev/null | \ - grep -w -c "Guid")" - - for ((i=0; i/dev/null)" - - if [[ "$profile_name" == "$current_profile_name" ]]; then - # "Normal Font" - term_font="$(/usr/libexec/PlistBuddy -c "Print ':New Bookmarks:${i}:Normal Font:'" \ - "$font_file" 2>/dev/null)" - - # Font for non-ascii characters - # Only check for a different non-ascii font, if the user checked - # the "use a different font for non-ascii text" switch. - diff_font="$(/usr/libexec/PlistBuddy -c "Print ':New Bookmarks:${i}:Use Non-ASCII Font:'" \ - "$font_file" 2>/dev/null)" - - if [[ "$diff_font" == "true" ]]; then - non_ascii="$(/usr/libexec/PlistBuddy -c "Print ':New Bookmarks:${i}:Non Ascii Font:'" \ - "$font_file" 2>/dev/null)" - - [[ "$term_font" != "$non_ascii" ]] && \ - term_font="$term_font (normal) / $non_ascii (non-ascii)" - fi - fi - done - ;; - - "deepin-terminal"*) - term_font="$(awk -F '=' '/font=/ {a=$2} /font_size/ {b=$2} END {print a,b}' \ - "${XDG_CONFIG_HOME}/deepin/deepin-terminal/config.conf")" - ;; - - "GNUstep_Terminal") - term_font="$(awk -F '>|<' '/>TerminalFontTerminalFontSize/dev/null | grep -c "Guid") -for idx in $(seq 0 "${profilesCount}"); do - local profileName=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Name:" ~/Library/Preferences/com.googlecode.iterm2.plist 2>/dev/null) - if [[ "${profileName}" == "${currentProfileName}" ]]; then - # "Normal Font" - normalFont=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Normal\ Font:" ~/Library/Preferences/com.googlecode.iterm2.plist) - type=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Terminal\ Type:" ~/Library/Preferences/com.googlecode.iterm2.plist) - command=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Command:" ~/Library/Preferences/com.googlecode.iterm2.plist) - ambiguousDoubleWidth=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Ambiguous\ Double\ Width:" ~/Library/Preferences/com.googlecode.iterm2.plist) - minimumContrast=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Minimum\ Contrast:" ~/Library/Preferences/com.googlecode.iterm2.plist) - - # Font for non-ascii characters - # Only check for a different non-ASCII font, if the user checked - # the "use a different font for non-ascii text" switch. - useDifferentFont=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Use\ Non-ASCII\ Font:" ~/Library/Preferences/com.googlecode.iterm2.plist) - if [[ "$useDifferentFont" == "true" ]]; then - nonAsciiFont=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Non\ Ascii\ Font:" ~/Library/Preferences/com.googlecode.iterm2.plist) - if [[ "$normalFont" != "$nonAsciiFont" ]]; then - normalFont="$normalFont (normal) / $nonAsciiFont (non-ascii)" - fi - fi - break - fi -done - -print -P "You use %F{blue}iTerm2%f with the following settings:" -print -P " Font: ${normalFont}" -print -P " Terminal-Type: ${type}" -print -P " Command: ${command}" - -############################# -# Analyse possible problems # -############################# -local problemsFound -if [[ "${ambiguousDoubleWidth}" == "true" ]]; then - problemsFound="${problemsFound}\n * Please uncheck 'Treat ambiguous characters as double-width'." -fi -if (( minimumContrast > 0 )); then - problemsFound="${problemsFound}\n * Please set minimum contrast to zero." -fi -if [[ $(echo "${normalFont}" | grep -c -E "Powerline|Awesome|Nerd|Source Code Pro") -eq 0 ]]; then - problemsFound="${problemsFound}\n * It does not seem like you use an Powerline-enabled or Awesome Terminal Font!" -fi - -############################# -# Output problems # -############################# -if [[ -n "${problemsFound}" ]]; then - print -P "\n" - print -P "%F{yellow}Possible Problems found:%f" - print -P "${problemsFound}" -else - print -P "%F{green}No Problems found%f. Yay!" -fi -- cgit v1.2.3