Browse Source

neofetch faster

main
Yiğit Çolakoğlu 4 years ago
parent
commit
85af7cb294
20 changed files with 107 additions and 73 deletions
  1. +3
    -0
      .gitmodules
  2. +1
    -1
      misc/profile
  3. BIN
      misc/ranger/colorschemes/__pycache__/__init__.cpython-39.opt-1.pyc
  4. BIN
      misc/ranger/colorschemes/__pycache__/material-ocean.cpython-39.opt-1.pyc
  5. +12
    -14
      misc/ranger/colorschemes/material-ocean.py
  6. +0
    -37
      misc/ranger/commands.py
  7. +1
    -1
      misc/ranger/plugins/compress.py
  8. +0
    -0
      misc/ranger/plugins/devicons
  9. +9
    -2
      misc/ranger/rc.conf
  10. +10
    -0
      scripts/fastfetch
  11. +1
    -1
      scripts/nextcloud-sync
  12. +57
    -5
      scripts/status-bar/weather
  13. +1
    -1
      suckless/build.sh
  14. +1
    -1
      suckless/st/config.h
  15. +2
    -1
      xorg/xinitrc
  16. +1
    -1
      zsh/aliases
  17. +1
    -1
      zsh/antibody/p10k.zsh
  18. +1
    -1
      zsh/antibody/zsh_plugins.txt
  19. +2
    -2
      zsh/cmds
  20. +4
    -4
      zsh/zshrc

+ 3
- 0
.gitmodules View File

@ -7,3 +7,6 @@
[submodule "misc/ranger/plugins/devicons2"] [submodule "misc/ranger/plugins/devicons2"]
path = misc/ranger/plugins/devicons2 path = misc/ranger/plugins/devicons2
url = https://github.com/cdump/ranger-devicons2.git url = https://github.com/cdump/ranger-devicons2.git
[submodule "misc/ranger/plugins/devicons"]
path = misc/ranger/plugins/devicons
url = https://github.com/cdump/ranger-devicons2

+ 1
- 1
misc/profile View File

@ -5,7 +5,6 @@ export _JAVA_AWT_WM_NONREPARENTING=1
export AWT_TOOLKIT=MToolkit export AWT_TOOLKIT=MToolkit
export SHELL=/bin/zsh export SHELL=/bin/zsh
export TERMINAL=/usr/local/bin/st export TERMINAL=/usr/local/bin/st
export TERM=st
export ANDROID_HOME=~/Android/Sdk export ANDROID_HOME=~/Android/Sdk
export FLUTTER_HOME=~/flutter export FLUTTER_HOME=~/flutter
export TMUX_PLUGIN_MANAGER_PATH=~/.tmux/plugins export TMUX_PLUGIN_MANAGER_PATH=~/.tmux/plugins
@ -20,5 +19,6 @@ export CM_SYNC_PRIMARY_TO_CLIPBOARD=1
export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$FLUTTER_HOME/bin export PATH=$PATH:$FLUTTER_HOME/bin
export DEFAULT_RECIPIENT="yigitcolakoglu@hotmail.com"
export PATH="$PATH:/home/yigit/.scripts:/home/yigit/.local/bin:/home/yigit/.gem/ruby/2.7.0/bin:$GOPATH/bin:$GOPATH/binexport:/home/yigit/.local/bin" export PATH="$PATH:/home/yigit/.scripts:/home/yigit/.local/bin:/home/yigit/.gem/ruby/2.7.0/bin:$GOPATH/bin:$GOPATH/binexport:/home/yigit/.local/bin"
export CPATH=/usr/include/opencv4 export CPATH=/usr/include/opencv4

BIN
misc/ranger/colorschemes/__pycache__/__init__.cpython-39.opt-1.pyc View File


BIN
misc/ranger/colorschemes/__pycache__/material-ocean.cpython-39.opt-1.pyc View File


+ 12
- 14
misc/ranger/colorschemes/material-ocean.py View File

@ -5,17 +5,24 @@ from __future__ import (absolute_import, division, print_function)
from ranger.gui.colorscheme import ColorScheme from ranger.gui.colorscheme import ColorScheme
from ranger.gui.color import ( from ranger.gui.color import (
black, blue, cyan, green, magenta, red, white, yellow, default,
normal, bold, reverse, dim, BRIGHT,
default_colors,
default, normal, bold, reverse, dim, BRIGHT, default_colors,
) )
black = 16
blue = 32
cyan = 50
green = 47
magenta = 141
red = 9
white = 255
yellow =227
class Default(ColorScheme): class Default(ColorScheme):
progress_bar_color = blue
progress_bar_color = 87
def use(self, context): # pylint: disable=too-many-branches,too-many-statements def use(self, context): # pylint: disable=too-many-branches,too-many-statements
fg, bg, attr = default_colors
fg, bg, attr = 231, black, bold
if context.reset: if context.reset:
return default_colors return default_colors
@ -39,22 +46,18 @@ class Default(ColorScheme):
if context.directory: if context.directory:
attr |= bold attr |= bold
fg = blue fg = blue
fg += BRIGHT
elif context.executable and not \ elif context.executable and not \
any((context.media, context.container, any((context.media, context.container,
context.fifo, context.socket)): context.fifo, context.socket)):
attr |= bold attr |= bold
fg = green fg = green
fg += BRIGHT
if context.socket: if context.socket:
attr |= bold attr |= bold
fg = magenta fg = magenta
fg += BRIGHT
if context.fifo or context.device: if context.fifo or context.device:
fg = yellow fg = yellow
if context.device: if context.device:
attr |= bold attr |= bold
fg += BRIGHT
if context.link: if context.link:
fg = cyan if context.good else magenta fg = cyan if context.good else magenta
if context.tag_marker and not context.selected: if context.tag_marker and not context.selected:
@ -63,11 +66,9 @@ class Default(ColorScheme):
fg = white fg = white
else: else:
fg = red fg = red
fg += BRIGHT
if not context.selected and (context.cut or context.copied): if not context.selected and (context.cut or context.copied):
attr |= bold attr |= bold
fg = black fg = black
fg += BRIGHT
# If the terminal doesn't support bright colors, use dim white # If the terminal doesn't support bright colors, use dim white
# instead of black. # instead of black.
if BRIGHT == 0: if BRIGHT == 0:
@ -111,16 +112,13 @@ class Default(ColorScheme):
if context.marked: if context.marked:
attr |= bold | reverse attr |= bold | reverse
fg = yellow fg = yellow
fg += BRIGHT
if context.frozen: if context.frozen:
attr |= bold | reverse attr |= bold | reverse
fg = cyan fg = cyan
fg += BRIGHT
if context.message: if context.message:
if context.bad: if context.bad:
attr |= bold attr |= bold
fg = red fg = red
fg += BRIGHT
if context.loaded: if context.loaded:
bg = self.progress_bar_color bg = self.progress_bar_color
if context.vcsinfo: if context.vcsinfo:


+ 0
- 37
misc/ranger/commands.py View File

@ -109,43 +109,6 @@ class fzf_select(Command):
else: else:
self.fm.select_file(selected) self.fm.select_file(selected)
class fzf_rga_documents_search(Command):
"""
:fzf_rga_search_documents
Search in PDFs, E-Books and Office documents in current directory.
Allowed extensions: .epub, .odt, .docx, .fb2, .ipynb, .pdf.
Usage: fzf_rga_search_documents <search string>
"""
def execute(self):
if self.arg(1):
search_string = self.rest(1)
else:
self.fm.notify("Usage: fzf_rga_search_documents <search string>", bad=True)
return
import subprocess
import os.path
from ranger.container.file import File
command="rga '%s' . --rga-adapters=pandoc,poppler | fzf +m | awk -F':' '{print $1}'" % search_string
fzf = self.fm.execute_command(command, universal_newlines=True, stdout=subprocess.PIPE)
stdout, stderr = fzf.communicate()
if fzf.returncode == 0:
fzf_file = os.path.abspath(stdout.rstrip('\n'))
self.fm.execute_file(File(fzf_file))
class tmsu_tag(Command):
""":tmsu_tag
Tags the current file with tmsu
"""
def execute(self):
cf = self.fm.thisfile
self.fm.run("tmsu tag \"{0}\" {1}".format(cf.basename, self.rest(1)))
class YankContent(Command): class YankContent(Command):
""" """
Copy the content of image file and text file with xclip Copy the content of image file and text file with xclip


+ 1
- 1
misc/ranger/plugins/compress.py View File

@ -22,7 +22,7 @@ class compress(Command):
if len(parts) > 1: if len(parts) > 1:
au_flags = [' '.join(parts[1:])] au_flags = [' '.join(parts[1:])]
else: else:
au_flags = [os.path.basename(self.fm.thisdir.path) + '.zip']
au_flags = [os.path.basename(self.fm.thisdir.path) + '.tar.gz']
# Making description line # Making description line
files_num = len(marked_files) files_num = len(marked_files)


misc/ranger/plugins/devicons2 → misc/ranger/plugins/devicons View File


+ 9
- 2
misc/ranger/rc.conf View File

@ -286,8 +286,14 @@ map gR eval fm.cd(ranger.RANGERDIR)
map g/ cd / map g/ cd /
map g? cd /usr/share/doc/ranger map g? cd /usr/share/doc/ranger
# Encryption and Compression
map eE encrypt
map eD decrypt
map X extract
map C compress
# External Programs # External Programs
map E edit
map e edit
map du shell -p du --max-depth=1 -h --apparent-size map du shell -p du --max-depth=1 -h --apparent-size
map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
map yp shell -f echo -n %d/%f | xsel -i; xsel -o | xsel -i -b map yp shell -f echo -n %d/%f | xsel -i; xsel -o | xsel -i -b
@ -311,7 +317,7 @@ map pL paste_symlink relative=True
map phl paste_hardlink map phl paste_hardlink
map pht paste_hardlinked_subtree map pht paste_hardlinked_subtree
map dD console delete
map D delete
map dd cut map dd cut
map ud uncut map ud uncut
@ -320,6 +326,7 @@ map dr cut mode=remove
map dt cut mode=toggle map dt cut mode=toggle
map yy copy map yy copy
map Y YankContent
map uy uncut map uy uncut
map ya copy mode=add map ya copy mode=add
map yr copy mode=remove map yr copy mode=remove


+ 10
- 0
scripts/fastfetch View File

@ -0,0 +1,10 @@
#!/bin/bash
if [ ! -f "$HOME/.cache/neofetch" ]; then
mkdir -p "$HOME/.cache"
touch "$HOME/.cache/neofetch"
neofetch --ascii ~/.config/neofetch/ascii.txt > "$HOME/.cache/neofetch"
fi
cat "$HOME/.cache/neofetch"

+ 1
- 1
scripts/nextcloud-sync View File

@ -11,7 +11,7 @@ for i in "${!mappings[@]}"; do
"${mappings[$i]}" "$i" >> /tmp/nextcloud.out 2>> /tmp/nextcloud.err "${mappings[$i]}" "$i" >> /tmp/nextcloud.out 2>> /tmp/nextcloud.err
done done
echo $(date '+%R') >> $HOME/.cache/nextcloud-track
echo $(date '+%R') > $HOME/.cache/nextcloud-track
kill -59 $(pidof dwmblocks) kill -59 $(pidof dwmblocks)

+ 57
- 5
scripts/status-bar/weather View File

@ -5,6 +5,57 @@ source ~/.config.env
weatherreport="${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" weatherreport="${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport"
weatherreportjson="${XDG_DATA_HOME:-$HOME/.local/share}/weatherreportjson" weatherreportjson="${XDG_DATA_HOME:-$HOME/.local/share}/weatherreportjson"
WCODES=(
["113"]="^c#ebcb8b^"
["116"]="^c#ebcb8b^杖"
["119"]="摒"
["122"]=""
["143"]=""
["176"]="^c#81a1c1^"
["179"]="^c#81a1c1^"
["182"]="^c#81a1c1^"
["185"]="^c#81a1c1^"
["200"]=""
["227"]=""
["230"]=""
["248"]=""
["260"]=""
["263"]="^c#81a1c1^"
["266"]="^c#81a1c1^"
["281"]="^c#81a1c1^"
["284"]="^c#81a1c1^"
["293"]="^c#81a1c1^"
["296"]="^c#81a1c1^"
["299"]="^c#81a1c1^"
["302"]="^c#81a1c1^"
["305"]="^c#81a1c1^"
["308"]="^c#81a1c1^"
["311"]="^c#81a1c1^"
["314"]="^c#81a1c1^"
["317"]="^c#81a1c1^"
["320"]=""
["323"]="^c#81a1c1^"
["326"]="^c#81a1c1^"
["329"]=""
["332"]=""
["335"]="^c#81a1c1^"
["338"]=""
["350"]="^c#81a1c1^"
["353"]="^c#81a1c1^"
["356"]="^c#81a1c1^"
["359"]="^c#81a1c1^"
["362"]="^c#81a1c1^"
["365"]="^c#81a1c1^"
["368"]="^c#81a1c1^"
["371"]="^c#81a1c1^"
["374"]="^c#81a1c1^"
["377"]="^c#81a1c1^"
["386"]="^c#81a1c1^"
["389"]="^c#81a1c1^"
["392"]="^c#81a1c1^"
["395"]="^c#81a1c1^"
)
getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;} getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;}
getforecastjson() { curl -sf "wttr.in/$LOCATION?format=j1" > "$weatherreportjson" || exit 1 ;} getforecastjson() { curl -sf "wttr.in/$LOCATION?format=j1" > "$weatherreportjson" || exit 1 ;}
@ -12,14 +63,15 @@ getforecastjson() { curl -sf "wttr.in/$LOCATION?format=j1" > "$weatherreportjson
# precipitation chance and the daily high and low from the downloaded file and # precipitation chance and the daily high and low from the downloaded file and
# display them with coresponding emojis. # display them with coresponding emojis.
showweather() { showweather() {
jq -r ".weather|.[0]|.hourly|.[$(expr $(date '+%H') / 4)]|.FeelsLikeC,.chanceofrain,.chanceofsnow,.WindGustKmph" "$weatherreportjson" |sed ':a;N;$!ba;s/\n/ /g' \
| awk -F' ' '{
data=$(jq -r ".weather|.[0]|.hourly|.[$(expr $(date '+%H') / 4)]|.FeelsLikeC,.chanceofrain,.chanceofsnow,.WindGustKmph,.weatherCode" "$weatherreportjson")
data=$(echo -ne $(echo $data | cut -d' ' -f 1-4)" ${WCODES[$(echo $data | cut -d' ' -f 5)]}")
echo $data | awk -F' ' '{
if ($4 > 30) if ($4 > 30)
print "^c#ffffff^ ^d^" $4 "kph ^c#ebcb8b^ 盛 ^d^ " $1 "°"
print "^c#ffffff^ ^d^" $4 "kh "$5 " ^d^ " $1 "°"
else if ($2 < $3) else if ($2 < $3)
print "^c#ffffff^ ^d^" $3 "% ^c#ebcb8b^ 盛 ^d^ " $1 "°"
print "^c#ffffff^ ^d^" $3 "% "$5 " ^d^ " $1 "°"
else else
print "^c#81a1c1^ ^d^" $2 "% ^c#ebcb8b^ 盛 ^d^ " $1 "°"}'
print "^c#81a1c1^ ^d^" $2 "% " $5 " ^d^ " $1 "°"}'
} }
case $BLOCK_BUTTON in case $BLOCK_BUTTON in


+ 1
- 1
suckless/build.sh View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
for d in */ ; do for d in */ ; do
echo "Building in $d..."
echo "Building in $d"
cd $d cd $d
sudo make install sudo make install
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then


+ 1
- 1
suckless/st/config.h View File

@ -7,7 +7,7 @@
*/ */
static char *font = "CaskaydiaCove Nerd Font Mono:pixelsize=16:antialias=true:autohint=true"; static char *font = "CaskaydiaCove Nerd Font Mono:pixelsize=16:antialias=true:autohint=true";
static char *font2[] = { static char *font2[] = {
"Symbola:pixelsize=12:antialias=true:autohint=true",
"Symbola:pixelsize=16:antialias=true:autohint=true",
}; };
static int borderpx = 2; static int borderpx = 2;


+ 2
- 1
xorg/xinitrc View File

@ -30,6 +30,7 @@ if [ "$ACTIVITYWATCHER" = true ] ; then
aw-watcher-window & aw-watcher-window &
aw-watcher-afk & aw-watcher-afk &
fi fi
touch ~/.cache/nextcloud-track
xss-lock -- /home/yigit/.scripts/lock & xss-lock -- /home/yigit/.scripts/lock &
echo "on" > ~/.cache/dunst echo "on" > ~/.cache/dunst
echo "on" > ~/.cache/screensaver echo "on" > ~/.cache/screensaver
@ -44,7 +45,7 @@ pactl upload-sample /usr/share/sounds/freedesktop/stereo/bell.oga x11-bell
pactl load-module module-x11-bell sample=x11-bell display=$DISPLAY pactl load-module module-x11-bell sample=x11-bell display=$DISPLAY
xset b 100 xset b 100
xset dpms 600 600 600 xset dpms 600 600 600
~/.keyboard
~/.keyboard > /tmp/keyboard.out 2> /tmp/keyboard.err
dunst & dunst &


+ 1
- 1
zsh/aliases View File

@ -2,7 +2,7 @@
alias feh="feh --scale-down --auto-zoom" alias feh="feh --scale-down --auto-zoom"
alias cclear="$(which clear)" alias cclear="$(which clear)"
alias clear="clear && neofetch --ascii ~/.config/neofetch/ascii.txt"
alias clear="clear && fastfetch"
alias neofetch="neofetch --ascii ~/.config/neofetch/ascii.txt" alias neofetch="neofetch --ascii ~/.config/neofetch/ascii.txt"
alias idea="/home/yigit/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/201.7223.91/bin/idea.sh" alias idea="/home/yigit/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/201.7223.91/bin/idea.sh"
alias open=xdg-open alias open=xdg-open


+ 1
- 1
zsh/antibody/p10k.zsh View File

@ -84,7 +84,7 @@
# Red prompt symbol if the last command failed. # Red prompt symbol if the last command failed.
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS}_FOREGROUND=$red typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS}_FOREGROUND=$red
# Default prompt symbol. # Default prompt symbol.
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION="$MODE λ"
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION="$MODE"λ
# Prompt symbol in command vi mode. # Prompt symbol in command vi mode.
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION="$MODE❮λ❯" typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION="$MODE❮λ❯"
# Prompt symbol in visual vi mode is the same as in command mode. # Prompt symbol in visual vi mode is the same as in command mode.


+ 1
- 1
zsh/antibody/zsh_plugins.txt View File

@ -8,6 +8,6 @@ zsh-users/zsh-syntax-highlighting
zsh-users/zsh-history-substring-search zsh-users/zsh-history-substring-search
zsh-users/zsh-autosuggestions zsh-users/zsh-autosuggestions
le0me55i/zsh-extract le0me55i/zsh-extract
hcgraf/zsh-sudo
Aloxaf/fzf-tab
rupa/z rupa/z

+ 2
- 2
zsh/cmds View File

@ -29,14 +29,14 @@ colors() {
fi fi
echo -en "$color:$space\\033[38;5;${color}myeet\\033[48;5;${color}mworld\\033[0m" echo -en "$color:$space\\033[38;5;${color}myeet\\033[48;5;${color}mworld\\033[0m"
echo -n " " echo -n " "
if [[ $count == 10 ]]
if [[ $count == 7 ]]
then then
echo -en "\n"; echo -en "\n";
count=-1 count=-1
fi fi
((color++)); ((color++));
((count++)) ((count++))
done
done
echo "" echo ""
} }


+ 4
- 4
zsh/zshrc View File

@ -1,5 +1,5 @@
eval "$(direnv hook zsh)" >> /tmp/direnv eval "$(direnv hook zsh)" >> /tmp/direnv
neofetch --ascii ~/.config/neofetch/ascii.txt
fastfetch
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi fi
@ -9,8 +9,8 @@ source ~/.profile
source <(antibody init) source <(antibody init)
HISTFILE=~/.zsh_history HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
HISTSIZE=100000
SAVEHIST=100000
setopt appendhistory setopt appendhistory
#Autocompletion #Autocompletion
@ -39,7 +39,7 @@ source ~/.cmds
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=241'
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=241,bold'
export KEYTIMEOUT=5 export KEYTIMEOUT=5
# added by travis gem # added by travis gem


Loading…
Cancel
Save