This commit is contained in:
David Aizenberg
2020-11-10 01:46:56 +04:00
parent f1eb8ff64e
commit cafc9f3ff1
17 changed files with 163 additions and 383 deletions

View File

@@ -124,3 +124,5 @@ function tf() {
export PATH="$PATH:$HOME/.rvm/bin" export PATH="$PATH:$HOME/.rvm/bin"
alias moc='mocp --theme=transparent-background' alias moc='mocp --theme=transparent-background'
source /home/david/.config/broot/launcher/bash/br

View File

@@ -9,7 +9,6 @@
#Exports #Exports
EDITOR=vim EDITOR=vim
#Thanks to http://bashrcgenerator.com/ #Thanks to http://bashrcgenerator.com/
export PS1="\[\e[00;32m\]\u\[\e[0m\]\[\e[00;37m\]@\h:\[\e[0m\]\[\e[00;36m\][\[\e[0m\]\[\e[00;32m\]\w\[\e[0m\]\[\e[00;36m\]]\[\e[0m\]\[\e[00;37m\]\\$ \[\e[0m\]" export PS1="\[\e[00;32m\]\u\[\e[0m\]\[\e[00;37m\]@\h:\[\e[0m\]\[\e[00;36m\][\[\e[0m\]\[\e[00;32m\]\w\[\e[0m\]\[\e[00;36m\]]\[\e[0m\]\[\e[00;37m\]\\$ \[\e[0m\]"
@@ -97,7 +96,7 @@ export NVM_DIR="$HOME/.nvm"
# Yavide alias # Yavide alias
alias yavide="gvim --servername yavide -f -N -u /opt/yavide/.vimrc" alias yavide="gvim --servername yavide -f -N -u /opt/yavide/.vimrc"
alias t="clear; python ~/t/t.py --task-dir ~/Dropbox --list tasks" alias t="clear; python ~/t/t.py --task-dir ~/b2_sync/t --list tasks"
alias tw="t | grep 'verify'" alias tw="t | grep 'verify'"
function ta() { function ta() {
@@ -124,3 +123,7 @@ export PATH="$PATH:$HOME/.rvm/bin"
eval "$(starship init bash)" eval "$(starship init bash)"
[[ -s "/etc/profile.d/grc.bashrc" ]] && source /etc/profile.d/grc.bashrc [[ -s "/etc/profile.d/grc.bashrc" ]] && source /etc/profile.d/grc.bashrc
source /home/david/.config/broot/launcher/bash/br
alias repl="NODE_PATH=$(npm root -g) node"

11
.vimrc
View File

@@ -13,20 +13,16 @@ set nocompatible | filetype indent plugin on | syn on
set runtimepath^=~/.vim/bundle/ctrlp.vim set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard'] let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
set rtp+=~/.vim/bundle/Vundle.vim set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin() call vundle#begin()
" let Vundle manage Vundle, required " let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim' Plugin 'VundleVim/Vundle.vim'
Plugin 'preservim/nerdtree' Plugin 'preservim/nerdtree'
Plugin 'pangloss/vim-javascript'
Plugin 'nathanaelkane/vim-indent-guides' Plugin 'nathanaelkane/vim-indent-guides'
Plugin 'jelera/vim-javascript-syntax'
Plugin 'Xuyuanp/nerdtree-git-plugin' Plugin 'Xuyuanp/nerdtree-git-plugin'
Plugin 'ryanoasis/vim-devicons' Plugin 'ryanoasis/vim-devicons'
Plugin 'Raimondi/delimitMate' Plugin 'Raimondi/delimitMate'
Plugin 'scrooloose/syntastic'
Plugin 'marijnh/tern_for_vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'digitaltoad/vim-pug' Plugin 'digitaltoad/vim-pug'
Plugin 'ekalinin/Dockerfile.vim' Plugin 'ekalinin/Dockerfile.vim'
Plugin 'godlygeek/tabular' Plugin 'godlygeek/tabular'
@@ -155,6 +151,9 @@ autocmd FileType php setlocal expandtab shiftwidth=4 tabstop=4 softtabstop=4
" X?HTML & XML " X?HTML & XML
autocmd FileType html,xhtml,xml setlocal expandtab shiftwidth=2 tabstop=2 softtabstop=2 autocmd FileType html,xhtml,xml setlocal expandtab shiftwidth=2 tabstop=2 softtabstop=2
" JS
autocmd FileType javascript setlocal equalprg=js-beautify\ --stdin
" CSS " CSS
autocmd FileType css setlocal expandtab shiftwidth=4 tabstop=4 softtabstop=4 autocmd FileType css setlocal expandtab shiftwidth=4 tabstop=4 softtabstop=4
@@ -168,8 +167,6 @@ autocmd FileType javascript setlocal expandtab shiftwidth=4 tabstop=4 softtabsto
let python_highlight_all = 1 let python_highlight_all = 1
let javascript_enable_domhtmlcss=1 let javascript_enable_domhtmlcss=1
let g:javascript_plugin_jsdoc = 1
let g:javascript_plugin_ngdoc = 1
filetype plugin indent on filetype plugin indent on

View File

@@ -1,32 +0,0 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR __fish_init_2_39_8:\x1d
SETUVAR __fish_init_2_3_0:\x1d
SETUVAR fish_color_autosuggestion:9C9C9C
SETUVAR fish_color_cancel:\x2dr
SETUVAR fish_color_command:F4F4F4
SETUVAR fish_color_comment:B0B0B0
SETUVAR fish_color_cwd:green
SETUVAR fish_color_cwd_root:red
SETUVAR fish_color_end:969696
SETUVAR fish_color_error:FFA779
SETUVAR fish_color_escape:00a6b2
SETUVAR fish_color_history_current:\x2d\x2dbold
SETUVAR fish_color_host:normal
SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue
SETUVAR fish_color_normal:normal
SETUVAR fish_color_operator:00a6b2
SETUVAR fish_color_param:A0A0F0
SETUVAR fish_color_quote:666A80
SETUVAR fish_color_redirection:FAFAFA
SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_status:red
SETUVAR fish_color_user:brgreen
SETUVAR fish_color_valid_path:\x2d\x2dunderline
SETUVAR fish_greeting:Welcome\x20to\x20fish\x2c\x20the\x20friendly\x20interactive\x20shell
SETUVAR fish_key_bindings:fish_default_key_bindings
SETUVAR fish_pager_color_completion:normal
SETUVAR fish_pager_color_description:B3A06D\x1eyellow
SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan

View File

@@ -1,31 +0,0 @@
# This file is automatically generated by the fish.
# Do NOT edit it directly, your changes will be overwritten.
SET __fish_init_2_39_8:\x1d
SET __fish_init_2_3_0:\x1d
SET fish_color_autosuggestion:555\x1ebrblack
SET fish_color_cancel:\x2dr
SET fish_color_command:\x2d\x2dbold
SET fish_color_comment:red
SET fish_color_cwd:green
SET fish_color_cwd_root:red
SET fish_color_end:brmagenta
SET fish_color_error:brred
SET fish_color_escape:bryellow\x1e\x2d\x2dbold
SET fish_color_history_current:\x2d\x2dbold
SET fish_color_host:normal
SET fish_color_match:\x2d\x2dbackground\x3dbrblue
SET fish_color_normal:normal
SET fish_color_operator:bryellow
SET fish_color_param:cyan
SET fish_color_quote:yellow
SET fish_color_redirection:brblue
SET fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
SET fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
SET fish_color_user:brgreen
SET fish_color_valid_path:\x2d\x2dunderline
SET fish_greeting:Welcome\x20to\x20fish\x2c\x20the\x20friendly\x20interactive\x20shell
SET fish_key_bindings:fish_default_key_bindings
SET fish_pager_color_completion:\x1d
SET fish_pager_color_description:B3A06D\x1eyellow
SET fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SET fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan

View File

@@ -1,26 +0,0 @@
function fish_prompt
if not set -q VIRTUAL_ENV_DISABLE_PROMPT
set -g VIRTUAL_ENV_DISABLE_PROMPT true
end
set_color yellow
printf '%s' (whoami)
set_color normal
printf ' at '
set_color magenta
echo -n (prompt_hostname)
set_color normal
printf ' in '
set_color $fish_color_cwd
printf '%s' (prompt_pwd)
set_color normal
# Line 2
echo
if test $VIRTUAL_ENV
printf "(%s) " (set_color blue)(basename $VIRTUAL_ENV)(set_color normal)
end
printf '↪ '
set_color normal
end

View File

@@ -20,6 +20,7 @@ font pango:monospace 8
exec feh --bg-fill /home/david/Pictures/wall.jpg exec feh --bg-fill /home/david/Pictures/wall.jpg
exec setxkbmap -layout gb,ru -variant ,winkeys -option grp:caps_toggle,grp_led:scroll,terminate:ctrl_alt_bksp,compose:ralt exec setxkbmap -layout gb,ru -variant ,winkeys -option grp:caps_toggle,grp_led:scroll,terminate:ctrl_alt_bksp,compose:ralt
exec dunst exec dunst
exec pasystray
# This font is widely installed, provides lots of unicode glyphs, right-to-left # This font is widely installed, provides lots of unicode glyphs, right-to-left
@@ -41,6 +42,10 @@ bindsym XF86AudioRaiseVolume exec pactl set-sink-volume 0 +5% #increase sound vo
bindsym XF86AudioLowerVolume exec pactl set-sink-volume 0 -5% #decrease sound volume bindsym XF86AudioLowerVolume exec pactl set-sink-volume 0 -5% #decrease sound volume
bindsym XF86AudioMute exec pactl set-sink-mute 0 toggle # mute sound bindsym XF86AudioMute exec pactl set-sink-mute 0 toggle # mute sound
bindsym $super+bracketright exec pactl set-sink-volume 0 +5% #increase sound volume
bindsym $super+bracketleft exec pactl set-sink-volume 0 -5% #decrease sound volume
bindsym $super+p exec pactl set-sink-mute 0 toggle # mute sound
bindsym XF86MonBrightnessUp exec xbacklight -inc 10 # increase screen brightness bindsym XF86MonBrightnessUp exec xbacklight -inc 10 # increase screen brightness
bindsym XF86MonBrightnessDown exec xbacklight -dec 10 # decrease screen brightness bindsym XF86MonBrightnessDown exec xbacklight -dec 10 # decrease screen brightness
@@ -53,6 +58,7 @@ bindsym $mod+Shift+q kill
# start dmenu (a program launcher) # start dmenu (a program launcher)
#bindsym $mod+d exec dmenu_run #bindsym $mod+d exec dmenu_run
bindsym $mod+d exec rofi -show run -modi run -theme Arc-Dark bindsym $mod+d exec rofi -show run -modi run -theme Arc-Dark
bindsym $mod+Shift+d exec rofi -show drun -modi run -show-icons -theme Arc-Dark
bindsym F3 exec rofi -modi ssh -show ssh -theme Arc-Dark bindsym F3 exec rofi -modi ssh -show ssh -theme Arc-Dark
bindsym F2 exec rofi -modi window -show window -theme Arc-Dark bindsym F2 exec rofi -modi window -show window -theme Arc-Dark
@@ -99,7 +105,7 @@ bindsym $mod+f fullscreen toggle
for_window [title="^scratchpad$"] border 1pixel, floating enable, move scratchpad for_window [title="^scratchpad$"] border 1pixel, floating enable, move scratchpad
bindsym F1 [instance="scratchpad"] scratchpad show; sticky enable bindsym F1 [instance="scratchpad"] scratchpad show; sticky enable
exec urxvt -name scratchpad -geometry 120x80 exec urxvt -name scratchpad -geometry 200x50
# change container layout (stacked, tabbed, toggle split) # change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking bindsym $mod+s layout stacking
@@ -146,7 +152,7 @@ bindsym $mod+Shift+0 move container to workspace 10
bindsym $mod+Shift+c move container to workspace tg bindsym $mod+Shift+c move container to workspace tg
bindsym $mod+Shift+x move container to workspace media bindsym $mod+Shift+x move container to workspace media
bindsym --release Print exec scrot -s '/tmp/%F_%T_$wx$h.png' -e 'xclip -selection clipboard -target image/png -i $f' bindsym --release Print exec scrot --freeze -s '/tmp/%F_%T_$wx$h.png' -e 'xclip -selection clipboard -target image/png -i $f'
# mocp # mocp
#bindsym $mod+Shift+j exec "/usr/bin/mocp -G" #bindsym $mod+Shift+j exec "/usr/bin/mocp -G"

View File

@@ -1,16 +1,16 @@
[docker] [docker]
command= sh ~/Scripts/docker.sh command= sh ~/dotfiles/scripts/docker.sh
color=#0db7ed color=#0db7ed
interval=10 interval=10
[memory] [memory]
command= sh ~/Scripts/memory.sh command= sh ~/dotfiles/scripts/memory.sh
label=MEM label=MEM
interval=30 interval=30
[disk] [disk]
command= sh ~/Scripts/disk.sh command= sh ~/dotfiles/scripts/disk.sh
label=HOME: label=HOME:
interval=30 interval=30
@@ -21,7 +21,7 @@ interval=3600
color=#A4C2F4 color=#A4C2F4
[covid] [covid]
command= sh ~/Scripts/corona.sh command= sh ~/dotfiles/scripts/corona.sh
color=#ffffff color=#ffffff
interval=240 interval=240

View File

@@ -1,196 +0,0 @@
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod1
set $super Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:monospace 10
#exec feh --bg-fill /home/david/Pictures/Wallpapers/ellie_full.jpg
exec feh --bg-fill /home/david/Pictures/wall.png
exec setxkbmap -layout gb,ru -variant ,winkeys -option grp:caps_toggle,grp_led:scroll,terminate:ctrl_alt_bksp,compose:ralt
bindsym --release Print exec scrot -s '/tmp/%F_%T_$wx$h.png' -e 'xclip -selection clipboard -target image/png -i $f'
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesnt scale on retina/hidpi displays.
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume 0 +5% #increase sound volume
bindsym XF86AudioLowerVolume exec pactl set-sink-volume 0 -5% #decrease sound volume
bindsym XF86AudioMute exec pactl set-sink-mute 0 toggle # mute sound
bindsym XF86MonBrightnessUp exec xbacklight -inc 10 # increase screen brightness
bindsym XF86MonBrightnessDown exec xbacklight -dec 10 # decrease screen brightness
# start a terminal
bindsym $mod+Return exec i3-sensible-terminal
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec dmenu_run
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $mod+Shif+j focus left
bindsym $mod+Shift+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
# alternatively, you can use the cursor keys:
#bindsym $mod+Left focus left
#bindsym $mod+Down focus down
#bindsym $mod+Up focus up
#bindsym $mod+Right focus right
# move focused window
#bindsym $mod+Shift+j move left
#bindsym $mod+Shift+k move down
#bindsym $mod+Shift+l move up
#bindsym $mod+Shift+semicolon move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# switch to workspace
bindsym $mod+1 workspace firefox
bindsym $mod+2 workspace local
bindsym $mod+3 workspace remote
bindsym $mod+4 workspace ide
bindsym $mod+5 workspace debug
bindsym $mod+6 workspace fs
bindsym $mod+7 workspace archive
bindsym $mod+8 workspace junk
bindsym $mod+9 workspace track
bindsym $mod+0 workspace 10
bindsym $mod+c workspace tg
bindsym $mod+x workspace media
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace firefox
bindsym $mod+Shift+2 move container to workspace local
bindsym $mod+Shift+3 move container to workspace remote
bindsym $mod+Shift+4 move container to workspace ide
bindsym $mod+Shift+5 move container to workspace debug
bindsym $mod+Shift+6 move container to workspace fs
bindsym $mod+Shift+7 move container to workspace archive
bindsym $mod+Shift+8 move container to workspace junk
bindsym $mod+Shift+9 move container to workspace track
bindsym $mod+Shift+0 move container to workspace 10
bindsym $mod+Shift+c move container to workspace tg
bindsym $mod+Shift+x move container to workspace media
# mocp
#bindsym $mod+Shift+j exec "/usr/bin/mocp -G"
bindsym $mod+p exec "/usr/bin/mocp -G"
bindsym $mod+k exec "/usr/bin/mocp -f"
bindsym $mod+j exec "/usr/bin/mocp -r"
bindsym $super+l exec i3lock -i /home/david/Pictures/wall.png
# reload the configuration file
bindsym $mod+Shift+t reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
bar {
status_command i3blocks -c /home/david/.config/i3blocks.conf </dev/null
colors {
separator #928374
background #000000
statusline #FFFFFF
focused_workspace #282828 #282828 #FFFFFF #FFFFFF
active_workspace #1d2021 #1d2021 #928374 #aea79f
inactive_workspace #000000 #000000 #AAAAAA #AAAAAA
urgent_workspace #cc241d #cc241d #ebdbb2 #ffffff
}
}
client.focused #000000 #000000 #FFFFFF #000000
client.focused_inactive #333333 #333333 #FFFFFF #000000
client.unfocused #333333 #333333 #FFFFFF #333333
client.urgent #cc241d #cc241d #ebdbb2 #282828

View File

@@ -1,69 +0,0 @@
general {
colors = true
interval = 5
}
order += "wireless wlp58s0"
order += "ethernet enp0s31f6"
order += "path_exists VPN"
order += "load"
order += "tztime local"
order += "tztime berlin"
order += "battery all"
wireless wlp58s0 {
format_up = "%essid"
format_down = "wlan"
}
ethernet enp0s31f6 {
# if you use %speed, i3status requires the cap_net_admin capability
format_up = "eth: %ip (%speed)"
format_down = "eth"
}
battery all {
format = "%status %percentage %remaining %consumption"
format_down = "No battery"
last_full_capacity = true
status_chr = "⚡ CHR"
status_bat = "🔋 BAT"
status_unk = "? UNK"
status_full = "☻ FULL"
path = "/sys/class/power_supply/BAT%d/uevent"
low_threshold = 20
}
run_watch DHCP {
pidfile = "/var/run/dhclient*.pid"
}
run_watch VPNC {
# file containing the PID of a vpnc process
pidfile = "/var/run/vpnc/pid"
}
path_exists VPN {
# path exists when a VPN tunnel launched by nmcli/nm-applet is active
path = "/proc/sys/net/ipv4/conf/tun0"
}
tztime local {
format = "Day: %d Local: %H:%M"
}
tztime berlin {
format = "HH: %H:%M"
timezone = "Europe/Berlin"
}
load {
format = "%5min"
}
disk "/" {
format = "%free"
}

6
scripts/corona.sh Executable file
View File

@@ -0,0 +1,6 @@
#/bin/bash
#stat=$(curl -s "https://corona-stats.online/LT?minimal=true" | head -n 2 | tail -n 1 | awk '{print "SARS-CoV-2: Lithuania Total: " $6 " New: " $8 $9 " Active: " $17}' | sed 's/\x1b\[[0-9;]*m//g' )
stat=$(curl -s "https://corona-stats.online/LT?format=json" | jq '.data[0]' | jq '.cases, .todayCases, .active' | tr '\r\n' ' ' | awk '{print "🤧:" $2}')
echo "$stat"

49
scripts/disk.sh Executable file
View File

@@ -0,0 +1,49 @@
#!/bin/sh
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
DIR="${DIR:-$BLOCK_INSTANCE}"
DIR="${DIR:-$HOME}"
ALERT_LOW="${ALERT_LOW:-$1}"
ALERT_LOW="${ALERT_LOW:-10}" # color will turn red under this value (default: 10%)
LOCAL_FLAG="-l"
if [ "$1" = "-n" ] || [ "$2" = "-n" ]; then
LOCAL_FLAG=""
fi
df -h -P $LOCAL_FLAG "$DIR" | awk -v label="$LABEL" -v alert_low=$ALERT_LOW '
/\/.*/ {
# full text
print label $4
# short text
print label $4
use=$5
# no need to continue parsing
exit 0
}
END {
gsub(/%$/,"",use)
if (100 - use < alert_low) {
# color
print "#FF0000"
}
}
'

12
scripts/docker.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
# Number of docker containers running
count=$(docker ps -q | wc -l | sed -r 's/^0$//g')
if [ "$count" = '' ]; then
count=0
fi
echo "🐳: $count"

70
scripts/memory.sh Executable file
View File

@@ -0,0 +1,70 @@
#!/bin/sh
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TYPE="${BLOCK_INSTANCE:-mem}"
awk -v type=$TYPE '
/^MemTotal:/ {
mem_total=$2
}
/^MemFree:/ {
mem_free=$2
}
/^Buffers:/ {
mem_free+=$2
}
/^Cached:/ {
mem_free+=$2
}
/^SwapTotal:/ {
swap_total=$2
}
/^SwapFree:/ {
swap_free=$2
}
END {
if (type == "swap") {
free=swap_free/1024/1024
used=(swap_total-swap_free)/1024/1024
total=swap_total/1024/1024
} else {
free=mem_free/1024/1024
used=(mem_total-mem_free)/1024/1024
total=mem_total/1024/1024
}
pct=0
if (total > 0) {
pct=used/total*100
}
# full text
printf("%.1fG/%.1fG (%.f%%)\n", used, total, pct)
# short text
printf("%.f%%\n", pct)
# color
if (pct > 90) {
print("#FF0000")
} else if (pct > 80) {
print("#FFAE00")
} else if (pct > 70) {
print("#FFF600")
}
}
' /proc/meminfo

View File

@@ -17,24 +17,13 @@ then
echo -e "${GREEN} Wiping old backups ${RESET}" echo -e "${GREEN} Wiping old backups ${RESET}"
rm -rf ~/.config/i3status~ rm -rf ~/.config/i3status~
rm -rf ~/.config/i3~ rm -rf ~/.config/i3~
rm -rf ~/.vim~ rm -rf ~/.vim~
rm -f ~/.vimrc~ rm -f ~/.vimrc~
rm -f ~/.bashrc~ rm -f ~/.bashrc~
rm -f ~/.zshrc~ rm -f ~/.zshrc~
echo -e "${GREEN} Deleted old backups ${RESET}" echo -e "${GREEN} Deleted old backups ${RESET}"
fi fi
read -n 1 -p "Is this desktop or laptop? (d/l/q) " ans;
case $ans in
d|D)
PLATFORM='desktop';;
l|L)
PLATFORM='laptop';;
*)
exit;;
esac
echo -e "${GREEN} Backing Up and moving configs ${RESET}" echo -e "${GREEN} Backing Up and moving configs ${RESET}"
mv ~/.config/i3status ~/.config/i3status~ mv ~/.config/i3status ~/.config/i3status~
@@ -62,8 +51,8 @@ mkdir tmp/
# obsolette for now # obsolette for now
# ln -rsf wmfsrc ~/.config/wmfs/wmfsrc # ln -rsf wmfsrc ~/.config/wmfs/wmfsrc
ln -rsf ${PLATFORM}/i3/config ~/.config/i3/config ln -rsf i3/config ~/.config/i3/config
ln -rsf ${PLATFORM}/i3status/config ~/.config/i3status/config ln -rsf i3status/config ~/.config/i3status/config
ln -rsf .zshrc ~/.zshrc ln -rsf .zshrc ~/.zshrc
ln -rsf .bashrc ~/.bashrc ln -rsf .bashrc ~/.bashrc