diff --git a/screenfetch/PKGBUILD b/screenfetch/PKGBUILD new file mode 100644 index 00000000..75923b44 --- /dev/null +++ b/screenfetch/PKGBUILD @@ -0,0 +1,41 @@ +# Maintainer: Alexey Pavlov + +pkgname=screenfetch +_pkgname=screenFetch +pkgver=3.7.0 +pkgrel=1 +pkgdesc="Bash screenshot information tool" +arch=('any') +url="https://github.com/KittyKatt/screenFetch" +license=('GPL') +depends=('bash') +optdepends=('curl: screenshot uploading') +#optdepends=('scrot: screenshot taking' +# 'curl: screenshot uploading') +source=(https://github.com/KittyKatt/${_pkgname}/archive/v${pkgver}.tar.gz + msys2.patch + screenshot.patch) +sha256sums=('6711fe924833919d53c1dfbbb43f3777d33e20357a1b1536c4472f6a1b3c6be0' + '647e86f8c02ed015ec03ce566b912da76620da18fabdd36edaf86f7ad7c759c6' + 'ab51f912efa8ae44847c9c1137f8f9181a8ecc942824d78b328d5afe200a299d') + +prepare() { + cd "${srcdir}/${_pkgname}-${pkgver}" + patch -p1 -i ${srcdir}/msys2.patch + patch -p1 -i ${srcdir}/screenshot.patch +} + +build() { + cd "${srcdir}/${_pkgname}-${pkgver}" + ./update-manpage.sh +} + +package() { + cd "${srcdir}/${_pkgname}-${pkgver}" + install -Dm755 screenfetch-dev "${pkgdir}/usr/bin/screenfetch" + install -Dm644 screenfetch.1 "${pkgdir}/usr/share/man/man1/screenfetch.1" + install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING" + install -Dm644 CHANGELOG "${pkgdir}/usr/share/doc/${pkgname}/CHANGELOG" + install -Dm644 README.mkdn "${pkgdir}/usr/share/doc/${pkgname}/README.mkdn" + install -Dm644 TODO "${pkgdir}/usr/share/doc/${pkgname}/TODO" +} diff --git a/screenfetch/msys2.patch b/screenfetch/msys2.patch new file mode 100644 index 00000000..35e20cac --- /dev/null +++ b/screenfetch/msys2.patch @@ -0,0 +1,268 @@ + - support Msys2 + - show exact release version on Windows 10 + - use modern logo on Windows 8, 10 and their server equivalents + +--- a/screenfetch-dev ++++ b/screenfetch-dev +@@ -190,7 +190,7 @@ + } + + supported_distros="Antergos, Arch Linux (Old and Current Logos), BLAG, CentOS, Chakra, Chapeau, CrunchBang, CRUX, Debian, Deepin, Dragora, elementary OS, Evolve OS, Fedora, Frugalware, Fuduntu, Funtoo, Gentoo, gNewSense, Jiyuu Linux, Kali Linux, KaOS, Korora, LinuxDeepin, Linux Mint, LMDE, Logos, Mageia, Mandriva/Mandrake, Manjaro, NixOS, openSUSE, Parabola GNU/Linux-libre, PeppermintOS, Raspbian, Red Hat Enterprise Linux, Sabayon, Scientific Linux, Slackware, Solus, TinyCore, Trisquel, Ubuntu, Viperr and Void." +-supported_other="Dragonfly/Free/Open/Net BSD, Haiku, Mac OS X and Windows+Cygwin." ++supported_other="Dragonfly/Free/Open/Net BSD, Haiku, Mac OS X, Windows+Cygwin and Windows+Msys." + supported_dms="KDE, Gnome, Unity, Xfce, LXDE, Cinnamon, MATE, CDE and RazorQt." + supported_wms="2bwm, 9wm, Awesome, Beryl, Blackbox, Cinnamon, Compiz, dminiwm, dwm, dtwm, E16, E17, echinus, Emerald, FluxBox, FVWM, herbstluftwm, IceWM, KWin, Metacity, monsterwm, Musca, Gala, Mutter, Muffin, Notion, OpenBox, PekWM, Ratpoison, Sawfish, ScrotWM, SpectrWM, StumpWM, subtle, WindowMaker, WMFS, wmii, Xfwm4, XMonad and i3." + +@@ -519,6 +519,11 @@ + distro="Cygwin" + fake_distro="${distro}" + ;; ++ "Msys") ++ distro="Msys" ++ fake_distro="${distro}" ++ distro_more="$(uname -r | head -c 1)" ++ ;; + "Haiku") + distro="Haiku" + fake_distro="${distro}" +@@ -535,6 +539,12 @@ + ;; + esac + fi ++ if [[ "${distro}" == "Cygwin" || "${distro}" == "Msys" ]]; then ++ # https://msdn.microsoft.com/en-us/library/ms724832%28VS.85%29.aspx ++ if [ "$(wmic os get version | grep -o '^\(6\.[23]\|10\)')" ]; then ++ fake_distro="Windows - Modern" ++ fi ++ fi + if [[ "${distro}" == "Unknown" ]]; then + if [ -f /etc/os-release ]; then + distrib_id=$(/dev/null 2>&1; then + if [[ "$distro" =~ "BSD" ]]; then +@@ -1227,7 +1239,7 @@ + if [[ "$(echo $xResolution | wc -l)" -ge 1 ]]; then + xResolution=$(echo $xResolution | tr "\\n" "," | sed 's/\(.*\),/\1/') + fi +- elif [[ "${distro}" == "Cygwin" ]]; then ++ elif [[ "${distro}" == "Cygwin" || "${distro}" == "Msys" ]]; then + width=($(wmic desktopmonitor get screenwidth | grep -vE '[a-z]+' | tr '\r\n' ' ')) + height=($(wmic desktopmonitor get screenheight | grep -vE '[a-z]+' | tr '\r\n' ' ')) + +@@ -1250,7 +1262,7 @@ + # DE Detection - Begin + detectde () { + DE="Not Present" +- if [[ ${distro} != "Mac OS X" && ${distro} != "Cygwin" ]]; then ++ if [[ ${distro} != "Mac OS X" && ${distro} != "Cygwin" && "${distro}" != "Msys" ]]; then + if [[ -n ${DISPLAY} ]]; then + if type -p xprop >/dev/null 2>&1;then + xprop_root="$(xprop -root 2>/dev/null)" +@@ -1474,11 +1486,13 @@ + if ps -U ${USER} | grep [F]inder >/dev/null 2>&1; then + DE="Aqua" + fi +- elif [[ "${distro}" == "Cygwin" ]]; then +- winver=`wmic os get version | grep -o '^[0-9]'` +- if [ "$winver" == "7" ]; then DE='Aero' +- elif [ "$winver" == "6" ]; then DE='Aero' +- else DE='Luna'; fi ++ elif [[ "${distro}" == "Cygwin" || "${distro}" == "Msys" ]]; then ++ # https://msdn.microsoft.com/en-us/library/ms724832%28VS.85%29.aspx ++ if [ "$(wmic os get version | grep -o '^\(6\|10\)')" ]; then ++ DE='Aero' ++ else ++ DE='Luna' ++ fi + fi + verboseOut "Finding desktop environment...found as '$DE'" + } +@@ -1488,7 +1502,7 @@ + # WM Detection - Begin + detectwm () { + WM="Not Found" +- if [[ ${distro} != "Mac OS X" && ${distro} != "Cygwin" ]]; then ++ if [[ ${distro} != "Mac OS X" && ${distro} != "Cygwin" && "${distro}" != "Msys" ]]; then + if [[ -n ${DISPLAY} ]]; then + for each in "${wmnames[@]}"; do + PID="$(pgrep -U ${UID} "^$each$")" +@@ -1617,7 +1631,7 @@ + if ps -U ${USER} | grep Finder >/dev/null 2>&1; then + WM="Quartz Compositor" + fi +- elif [[ "${distro}" == "Cygwin" ]]; then ++ elif [[ "${distro}" == "Cygwin" || "${distro}" == "Msys" ]]; then + bugn=$(tasklist | grep -o 'bugn' | tr -d '\r \n') + wind=$(tasklist | grep -o 'Windawesome' | tr -d '\r \n') + if [ "$bugn" = "bugn" ]; then WM="bug.n" +@@ -1753,8 +1767,8 @@ + else + Win_theme="Graphite" + fi +- elif [[ "${distro}" == "Cygwin" ]]; then +- themeFile="$(reg query 'HKCU\Software\Microsoft\Windows\CurrentVersion\Themes' /v 'CurrentTheme' | grep -o '[A-Z]:\\.*')" ++ elif [[ "${distro}" == "Cygwin" || "${distro}" == "Msys" ]]; then ++ themeFile="$(reg query 'HKCU\Software\Microsoft\Windows\CurrentVersion\Themes' //v 'CurrentTheme' | grep -o '[A-Z]:\\.*')" + Win_theme=$(echo $themeFile | awk -F"\\" '{print $NF}' | grep -o '[0-9A-z. ]*$' | grep -o '^[0-9A-z ]*') + fi + +@@ -1995,8 +2009,8 @@ + fi + fi + +- if [ "$distro" == "Cygwin" -a "$gtkFont" == "Not Found" ]; then +- if [ -f "$HOME/.minttyrc" ]; then ++ if [[ "${distro}" == "Cygwin" || "${distro}" == "Msys" ]]; then ++ if [[ "$gtkFont" == "Not Found" && -f "$HOME/.minttyrc" ]]; then + gtkFont="$(grep '^Font=.*' "$HOME/.minttyrc" | grep -o '[0-9A-z ]*$')" + fi + fi +@@ -2131,9 +2145,9 @@ + + asciiText () { + # Distro logos and ASCII outputs +- if [[ "$fake_distro" ]]; then distro="${fake_distro}"; fi + if [[ "$asc_distro" ]]; then myascii="${asc_distro}" + elif [[ "$art" ]]; then myascii="custom" ++ elif [[ "$fake_distro" ]]; then myascii="${fake_distro}" + else myascii="${distro}"; fi + case ${myascii} in + "custom") source "$art" ;; +@@ -3207,7 +3221,7 @@ + "${c3} o' %s\n") + ;; + +- "Windows"|"Cygwin") ++ "Windows"|"Cygwin"|"Msys") + if [[ "$no_color" != "1" ]]; then + c1=$(getColor 'light red') # Red + c2=$(getColor 'light green') # Green +@@ -3234,6 +3248,33 @@ + "${c4} \"VEzjt:;;z>*\` %s") + ;; + ++ "Windows - Modern") ++ if [[ "$no_color" != "1" ]]; then ++ c1=$(getColor 'light blue') # Blue ++ fi ++ if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi ++ startline="0" ++ fulloutput=("${c1} .., %s" ++"${c1} ....,,:;+ccllll %s" ++"${c1} ...,,+:; cllllllllllllllllll %s" ++"${c1} ,cclllllllllll lllllllllllllllllll %s" ++"${c1} llllllllllllll lllllllllllllllllll %s" ++"${c1} llllllllllllll lllllllllllllllllll %s" ++"${c1} llllllllllllll lllllllllllllllllll %s" ++"${c1} llllllllllllll lllllllllllllllllll %s" ++"${c1} llllllllllllll lllllllllllllllllll %s" ++"${c1} %s" ++"${c1} llllllllllllll lllllllllllllllllll %s" ++"${c1} llllllllllllll lllllllllllllllllll %s" ++"${c1} llllllllllllll lllllllllllllllllll %s" ++"${c1} llllllllllllll lllllllllllllllllll %s" ++"${c1} llllllllllllll lllllllllllllllllll %s" ++"${c1} \`'ccllllllllll lllllllllllllllllll %s" ++"${c1} \`'\"\"*:: :ccllllllllllllllll %s" ++"${c1} \`\`\`\`''\"*::cll %s" ++"${c1} \`\` %s") ++ ;; ++ + "Haiku") + if [[ "$no_color" != "1" ]]; then + c1=$(getColor 'black_haiku') # Black +@@ -3906,7 +3947,7 @@ + "Arch Linux - Old"|"Fedora"|"Korora"|"Chapeau"|"Mandriva"|"Mandrake"|"Chakra"|"ChromeOS"|"Sabayon"|"Slackware"|"Mac OS X"|"Trisquel"|"Kali Linux"|"Jiyuu Linux"|"Antergos"|"KaOS"|"Logos"|"gNewSense"|"NixOS") labelcolor=$(getColor 'light blue');; + "Arch Linux"|"Frugalware"|"Mageia"|"Deepin"|"CRUX") labelcolor=$(getColor 'light cyan');; + "Mint"|"LMDE"|"openSUSE"|"LinuxDeepin"|"DragonflyBSD"|"Manjaro"|"Manjaro-tree"|"Android"|"Void") labelcolor=$(getColor 'light green');; +- "Ubuntu"|"FreeBSD"|"FreeBSD - Old"|"Debian"|"Raspbian"|"BSD"|"Red Hat Enterprise Linux"|"Peppermint"|"Cygwin"|"Fuduntu"|"NetBSD"|"Scientific Linux"|"DragonFlyBSD"|"BackTrack Linux") labelcolor=$(getColor 'light red');; ++ "Ubuntu"|"FreeBSD"|"FreeBSD - Old"|"Debian"|"Raspbian"|"BSD"|"Red Hat Enterprise Linux"|"Peppermint"|"Cygwin"|"Msys"|"Fuduntu"|"NetBSD"|"Scientific Linux"|"DragonFlyBSD"|"BackTrack Linux") labelcolor=$(getColor 'light red');; + "CrunchBang"|"Solus"|"Viperr"|"elementary"*) labelcolor=$(getColor 'dark grey');; + "Gentoo"|"Parabola GNU/Linux-libre"|"Funtoo"|"Funtoo-text"|"BLAG") labelcolor=$(getColor 'light purple');; + "Haiku") labelcolor=$(getColor 'green');; +@@ -3941,10 +3982,12 @@ + buildVers=`buildVers=$(sw_vers|grep BuildVersion);echo ${buildVers:14}` + if [ -n "$distro_more" ]; then mydistro=$(echo -e "$labelcolor OS:$textcolor $distro_more $sysArch") + else mydistro=$(echo -e "$labelcolor OS:$textcolor $sysArch $distro $prodVers $buildVers"); fi +- elif [[ "$distro" == "Cygwin" ]]; then +- distro=$(wmic os get name | head -2 | tail -1) +- distro=$(expr match "$distro" '\(Microsoft Windows [A-Za-z0-9.]\+\)') +- sysArch=$(wmic os get OSArchitecture | head -2 | tail -1 | tr -d '\r ') ++ elif [[ "${distro}" == "Cygwin" || "${distro}" == "Msys" ]]; then ++ distro="$(wmic os get caption | sed 's/\r//g; s/[ \t]*$//g; 2!d')" ++ if [[ "$(wmic os get version | grep -o '^10\.')" == "10." ]]; then ++ distro="$distro (v$(wmic os get version | grep '^10\.' | tr -d ' '))" ++ fi ++ sysArch=$(wmic os get OSArchitecture | sed 's/\r//g; s/[ \t]*$//g; 2!d') + mydistro=$(echo -e "$labelcolor OS:$textcolor $distro $sysArch") + else + if [ -n "$distro_more" ]; then mydistro=$(echo -e "$labelcolor OS:$textcolor $distro_more") +@@ -4018,7 +4061,7 @@ + # [ "$gtkBackground" ] && mybg=$(echo -e "$labelcolor BG:$textcolor $gtkBackground"); out_array=( "${out_array[@]}" "$mybg" ); ((display_index++)) + fi + fi +- elif [[ "$fake_distro" == "Cygwin" ]]; then ++ elif [[ "${fake_distro}" == "Cygwin" || "${fake_distro}" == "Msys" || "${fake_distro}" == "Windows - Modern" ]]; then + if [[ "${display[@]}" =~ "res" && -n "$xResolution" ]]; then myres=$(echo -e "$labelcolor Resolution:${textcolor} $xResolution"); out_array=( "${out_array[@]}" "$myres" ); ((display_index++)); fi + if [[ "${display[@]}" =~ "de" ]]; then + if [[ "${DE}" != "Not Present" ]]; then +@@ -4034,7 +4077,7 @@ + fi + fi + fi +- [[ "${fake_distro}" != "Cygwin" ]] && if [[ "${display[@]}" =~ "disk" ]]; then mydisk=$(echo -e "$labelcolor Disk:$textcolor $diskusage"); out_array=( "${out_array[@]}" "$mydisk" ); ((display_index++)); fi ++ [[ "${fake_distro}" != "Cygwin" && "${fake_distro}" != "Msys" && "${fake_distro}" != "Windows - Modern" ]] && if [[ "${display[@]}" =~ "disk" ]]; then mydisk=$(echo -e "$labelcolor Disk:$textcolor $diskusage"); out_array=( "${out_array[@]}" "$mydisk" ); ((display_index++)); fi + if [[ "${display[@]}" =~ "cpu" ]]; then mycpu=$(echo -e "$labelcolor CPU:$textcolor $cpu"); out_array=( "${out_array[@]}" "$mycpu" ); ((display_index++)); fi + if [[ "${display[@]}" =~ "gpu" ]] && [[ "$gpu" != "Not Found" ]]; then mygpu=$(echo -e "$labelcolor GPU:$textcolor $gpu"); out_array=( "${out_array[@]}" "$mygpu" ); ((display_index++)); fi + if [[ "${display[@]}" =~ "mem" ]]; then mymem=$(echo -e "$labelcolor RAM:$textcolor $mem"); out_array=( "${out_array[@]}" "$mymem" ); ((display_index++)); fi diff --git a/screenfetch/screenshot.patch b/screenfetch/screenshot.patch new file mode 100644 index 00000000..fb222ac1 --- /dev/null +++ b/screenfetch/screenshot.patch @@ -0,0 +1,73 @@ +Make it possible to upload screenshots when a custom screenshot command was used. +Warn if no custom command was given and scrot is missing. +Warn if uploading was enabled and curl is missing. + +--- a/screenfetch-dev ++++ b/screenfetch-dev +@@ -226,10 +226,10 @@ + printf " ${bold}-N${c0} Strip all color from output.\n" + printf " ${bold}-t${c0} Truncate output based on terminal width (Experimental!).\n" + printf " ${bold}-p${c0} Portrait output.\n" +- printf " ${bold}-s(u)${c0} Using this flag tells the script that you want it\n" ++ printf " ${bold}-s [-u IMGHOST]${c0} Using this flag tells the script that you want it\n" + printf " to take a screenshot. Use the -u flag if you would like\n" + printf " to upload the screenshots to one of the pre-configured\n" +- printf " locations. These include: teknik, pomf, imgur, mediacrush, and hmp.\n" ++ printf " locations. These include: teknik, pomf, imgur, mediacrush and hmp.\n" + printf " ${bold}-c string${c0} You may change the outputted colors with -c. The format is\n" + printf " as follows: [0-9][0-9],[0-9][0-9]. The first argument controls the\n" + printf " ASCII logo colors and the label colors. The second argument\n" +@@ -2053,8 +2053,19 @@ + ####################### + + takeShot () { ++ take_screenshot="yes" + if [[ -z $screenCommand ]]; then ++ screenCommand="scrot -cd3" ++ if ! type -p scrot >/dev/null 2>&1; then ++ errorOut "Cannot take screenshot! \`scrot' not in \$PATH" ++ take_screenshot="no" ++ fi ++ fi ++ if [[ "${take_screenshot}" == "yes" ]]; then + if [[ "${upload}" == "1" ]]; then ++ if ! type -p curl >/dev/null 2>&1; then ++ errorOut "Cannot upload screenshot! \`curl' not in \$PATH" ++ else + shotfiles[1]=${shotfile} + if [ "$distro" == "Mac OS X" ]; then + displays="$(system_profiler SPDisplaysDataType | grep 'Resolution:' | wc -l | tr -d ' ')" +@@ -2063,7 +2074,7 @@ + shotfiles[$i]="$(echo ${shotfile} | sed "s/\(.*\)\./\1_${i}./")" + done + printf "Taking shot in 3.. "; sleep 1; printf "2.. "; sleep 1; printf "1.. "; sleep 1; printf "0.\n"; screencapture -x ${shotfiles[@]} &> /dev/null +- else scrot -cd3 "${shotfile}"; fi ++ else $screenCommand "${shotfile}"; fi + if [ -f "${shotfile}" ]; then + verboseOut "Screenshot saved at '${shotfiles[@]}'" + printf "${bold}==>${c0} Uploading your screenshot now..." +@@ -2120,6 +2131,7 @@ + else + errorOut "ERROR: Problem saving screenshot to ${shotfiles[@]}" + fi ++ fi + else + shotfiles[1]=${shotfile} + if [ "$distro" == "Mac OS X" ]; then +@@ -2129,15 +2141,13 @@ + shotfiles[$i]="$(echo ${shotfile} | sed "s/\(.*\)\./\1_${i}./")" + done + printf "Taking shot in 3.. "; sleep 1; printf "2.. "; sleep 1; printf "1.. "; sleep 1; printf "0.\n"; screencapture -x ${shotfiles[@]} &> /dev/null +- else scrot -cd3 "${shotfile}"; fi ++ else $screenCommand "${shotfile}"; fi + if [ -f "${shotfile}" ]; then + verboseOut "Screenshot saved at '${shotfiles[@]}'" + else + errorOut "ERROR: Problem saving screenshot to ${shotfiles[@]}" + fi + fi +- else +- $screenCommand + fi + } +