Basic vim settings, plugins
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
#!/bin/bash
|
||||
## Author: Shaun Reed | Contact: shaunrd0@gmail.com | URL: www.shaunreed.com ##
|
||||
## ##
|
||||
## A script to find and return the CPU package temp sensor ##
|
||||
###############################################################################
|
||||
# bash.sh
|
||||
|
||||
for i in /sys/class/hwmon/hwmon*/temp*_input; do
|
||||
sensors+=("$(<$(dirname $i)/name): $(cat ${i%_*}_label 2>/dev/null || echo $(basename ${i%_*})) $(readlink -f $i)");
|
||||
done
|
||||
|
||||
for i in "${sensors[@]}"
|
||||
do
|
||||
if [[ $i =~ ^coretemp:.Package.* ]]
|
||||
then
|
||||
export CPU_SENSOR=${i#*0}
|
||||
fi
|
||||
done
|
||||
|
||||
echo "scale=2;((9/5) * $(cat $CPU_SENSOR)/1000) + 32"|bc
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
#!/bin/env python3
|
||||
import sys
|
||||
import re
|
||||
import json
|
||||
from subprocess import run, PIPE
|
||||
import argparse
|
||||
|
||||
|
||||
def get_ws():
|
||||
return json.loads(run('i3-msg -t get_workspaces'.split(), stdout=PIPE).stdout)
|
||||
|
||||
|
||||
def to_empty(current=None, strict=False, right=True, move=False, wrap=True, min_num=1):
|
||||
"""Move to nearest empty numbered workspace"""
|
||||
if current is None:
|
||||
current = [w for w in get_ws() if w['focused']][0]
|
||||
|
||||
numbered = re.compile('^\d+$' if strict else '^\d+|(\d+:.*)$')
|
||||
|
||||
ns = {w['num'] for w in get_ws() if numbered.match(w['name']) != None and
|
||||
(not strict or w['name'] == str(w['num']))}
|
||||
|
||||
if numbered.match(current['name']) is None:
|
||||
# If current workspace is unnumbered, pick rightmost or leftmost
|
||||
if len(ns) == 0:
|
||||
new_ix = min_num
|
||||
else:
|
||||
new_ix = min(ns) - 1 if right else max(ns) + 1
|
||||
else:
|
||||
# Find numbered workspace nearest to current
|
||||
new_ix = current['num']
|
||||
|
||||
while new_ix in ns:
|
||||
new_ix += 1 if right else -1
|
||||
|
||||
# Wrap around
|
||||
if new_ix < min_num:
|
||||
if wrap:
|
||||
new_ix = max(ns) + 1
|
||||
else:
|
||||
return
|
||||
|
||||
if move:
|
||||
s = 'i3-msg move container to workspace {0}; workspace {0}'.format(new_ix)
|
||||
else:
|
||||
s = 'i3-msg workspace ' + str(new_ix)
|
||||
print(s)
|
||||
run(s.split())
|
||||
|
||||
|
||||
def to_empty_near(num, relative=False, **kwargs):
|
||||
"""Move to empty numbered workspace nearest to workspace 'num'"""
|
||||
if relative:
|
||||
if 0 <= num < len(get_ws()):
|
||||
current = get_ws()[num]
|
||||
else:
|
||||
return
|
||||
else:
|
||||
ns = [w for w in get_ws() if w['num'] == num]
|
||||
current = ns[0] if len(ns) > 0 else {'num': num, 'name': str(num)}
|
||||
to_empty(current, **kwargs)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description='Switch to an empty numbered workspace.')
|
||||
parser.add_argument('direction', type=str, nargs='?', default='next',
|
||||
help='either next (default) or prev')
|
||||
parser.add_argument('number', type=int, nargs='?',
|
||||
help='workspace to start searching from (default: current)')
|
||||
parser.add_argument('-r', '--relative', dest='rel', action='store_true',
|
||||
help='use workspace indices, not numbers (default: no)')
|
||||
parser.add_argument('-w', '--nowrap', dest='wrap', action='store_false',
|
||||
help='if at edge, wrap around to other edge (default: yes)')
|
||||
parser.add_argument('-s', '--nostrict', dest='strict', action='store_false',
|
||||
help='numbered workspaces have a numeric name (default: yes)')
|
||||
parser.add_argument('-m', '--move', dest='move', action='store_true',
|
||||
help='move container to new workspace (default: no)')
|
||||
|
||||
args = parser.parse_args()
|
||||
kwargs = {'right': args.direction.lower().strip() == 'next',
|
||||
'wrap': args.wrap, 'strict': args.strict, 'move': args.move}
|
||||
|
||||
if type(args.number) is int:
|
||||
to_empty_near(args.number, relative=args.rel, **kwargs)
|
||||
else:
|
||||
to_empty(**kwargs)
|
||||
@@ -1,63 +0,0 @@
|
||||
#!/bin/sh
|
||||
# shellcheck disable=SC2016,SC2059
|
||||
|
||||
KEYBOARD_ID="Corsair Corsair STRAFE Gaming Keyboard"
|
||||
|
||||
# cpm: characters per minute
|
||||
# wpm: words per minute (1 word = 5 characters)
|
||||
METRIC=wpm
|
||||
FORMAT=" %d $METRIC"
|
||||
|
||||
INTERVAL=2
|
||||
|
||||
# If you have a keyboard layout that is not listed here yet, create a condition
|
||||
# yourself. $3 is the key index. Use `xinput test "AT Translated Set 2 keyboard"`
|
||||
# to see key codes in real time. Be sure to open a pull request for your
|
||||
# layout's condition!
|
||||
LAYOUT=qwerty
|
||||
|
||||
case "$LAYOUT" in
|
||||
qwerty) CONDITION='($3 >= 10 && $3 <= 19) || ($3 >= 24 && $3 <= 33) || ($3 >= 37 && $3 <= 53) || ($3 >= 52 && $3 <= 58)'; ;;
|
||||
azerty) CONDITION='($3 >= 10 && $3 <= 19) || ($3 >= 24 && $3 <= 33) || ($3 >= 37 && $3 <= 54) || ($3 >= 52 && $3 <= 57)'; ;;
|
||||
qwertz) CONDITION='($3 >= 10 && $3 <= 20) || ($3 >= 24 && $3 <= 34) || ($3 == 36) || ($3 >= 38 && $3 <= 48) || ($3 >= 52 && $3 <= 58)'; ;;
|
||||
dontcare) CONDITION='1'; ;; # Just register all key presses, not only letters and numbers
|
||||
*) echo "Unsupported layout \"$LAYOUT\""; exit 1; ;;
|
||||
esac
|
||||
|
||||
# We have to account for the fact we're not listening a whole minute
|
||||
multiply_by=60
|
||||
divide_by=$INTERVAL
|
||||
|
||||
case "$METRIC" in
|
||||
wpm) divide_by=$((divide_by * 5)); ;;
|
||||
cpm) ;;
|
||||
*) echo "Unsupported metric \"$METRIC\""; exit 1; ;;
|
||||
esac
|
||||
|
||||
hackspeed_cache="$(mktemp -p '' hackspeed_cache.XXXXX)"
|
||||
trap 'rm "$hackspeed_cache"' EXIT
|
||||
|
||||
# Write a dot to our cache for each key press
|
||||
printf '' > "$hackspeed_cache"
|
||||
xinput test "$KEYBOARD_ID" | \
|
||||
stdbuf -o0 awk '$1 == "key" && $2 == "press" && ('"$CONDITION"') {printf "."}' >> "$hackspeed_cache" &
|
||||
|
||||
while true; do
|
||||
# Ask the kernel how big the file is with the command `stat`. The number we
|
||||
# get is the file size in bytes, which equals the amount of dots the file
|
||||
# contains, and hence how much keys were pressed since the file was last
|
||||
# cleared.
|
||||
lines=$(stat --format %s "$hackspeed_cache")
|
||||
|
||||
# Truncate the cache file so that in the next iteration, we count only new
|
||||
# keypresses
|
||||
printf '' > "$hackspeed_cache"
|
||||
|
||||
# The shell only does integer operations, so make sure to first multiply and
|
||||
# then divide
|
||||
value=$((lines * multiply_by / divide_by))
|
||||
|
||||
printf "$FORMAT\\n" "$value"
|
||||
|
||||
sleep $INTERVAL
|
||||
done
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/bin/bash
|
||||
## Author: Shaun Reed | Contact: shaunrd0@gmail.com | URL: www.shaunreed.com ##
|
||||
## ##
|
||||
## A script to track system idle time within a polybar menu ##
|
||||
###############################################################################
|
||||
# info-idle.sh
|
||||
|
||||
|
||||
METRIC=sec
|
||||
FORMAT=" %d $METRIC"
|
||||
INTERVAL=2
|
||||
|
||||
case "$METRIC" in
|
||||
min) DIVIDE_BY=$((1000 * 60)); ;;
|
||||
sec) DIVIDE_BY=1000; ;;
|
||||
msec) DIVIDE_BY=1 ;;
|
||||
*) echo "Unsupported metric \"$METRIC\""; exit 1; ;;
|
||||
esac
|
||||
|
||||
while true; do
|
||||
VALUE=$(($(xprintidle)/ DIVIDE_BY))
|
||||
printf "$FORMAT\\n" "$VALUE"
|
||||
sleep $INTERVAL
|
||||
done
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
BAR_HEIGHT=22 # polybar height
|
||||
BORDER_SIZE=1 # border size from your wm settings
|
||||
YAD_WIDTH=222 # 222 is minimum possible value
|
||||
YAD_HEIGHT=193 # 193 is minimum possible value
|
||||
DATE="$(TZ=UTC date +"%a %d %H:%M")"
|
||||
|
||||
case "$1" in
|
||||
--popup)
|
||||
if [ "$(xdotool getwindowfocus getwindowname)" = "yad-calendar" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
eval "$(xdotool getmouselocation --shell)"
|
||||
eval "$(xdotool getdisplaygeometry --shell)"
|
||||
|
||||
# X
|
||||
if [ "$((X + YAD_WIDTH / 2 + BORDER_SIZE))" -gt "$WIDTH" ]; then #Right side
|
||||
: $((pos_x = WIDTH - YAD_WIDTH - BORDER_SIZE))
|
||||
elif [ "$((X - YAD_WIDTH / 2 - BORDER_SIZE))" -lt 0 ]; then #Left side
|
||||
: $((pos_x = BORDER_SIZE))
|
||||
else #Center
|
||||
: $((pos_x = X - YAD_WIDTH / 2))
|
||||
fi
|
||||
|
||||
# Y
|
||||
if [ "$Y" -gt "$((HEIGHT / 2))" ]; then #Bottom
|
||||
: $((pos_y = HEIGHT - YAD_HEIGHT - BAR_HEIGHT - BORDER_SIZE))
|
||||
else #Top
|
||||
: $((pos_y = BAR_HEIGHT + BORDER_SIZE))
|
||||
fi
|
||||
|
||||
yad --calendar --undecorated --fixed --close-on-unfocus --no-buttons \
|
||||
--width=$YAD_WIDTH --height=$YAD_HEIGHT --posx=$pos_x --posy=$pos_y \
|
||||
--title="yad-calendar" --borders=0 >/dev/null &
|
||||
;;
|
||||
*)
|
||||
echo "$DATE"
|
||||
;;
|
||||
esac
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
#start-htop.sh
|
||||
#
|
||||
|
||||
|
||||
#i3 move to workspace number $ws95;i3 floating enable;i3 resize set height 700;i3 resize set width 1000;i3 move position center && i3-sensible-terminal -e htop;
|
||||
|
||||
|
||||
(urxvt -hold -e htop && i3 move to workspace number $ws95 && i3 floating enable && i3 resize set height 700 && i3 resize set width 1000 && i3 move position center)
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
conky -c $HOME/.config/conky/shortcuts_green &&
|
||||
conky -c $HOME/.config/conky/sysinfo_green &&
|
||||
|
||||
exit 0
|
||||
@@ -1,96 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
get_icon() {
|
||||
case $1 in
|
||||
01d) icon="滛";; # Sun clear
|
||||
01n) icon="";; # Moon clear
|
||||
02d) icon="";; # Sun cloudy
|
||||
02n) icon="";; # Moon cloudy
|
||||
03*) icon="";; # Cloud
|
||||
04*) icon="";; # Clouds
|
||||
09d) icon="";; # Day, cloud, rain, wind
|
||||
09n) icon="";; # Night, cloud, rain, wind
|
||||
10d) icon="";; # Day rain
|
||||
10n) icon="";; # Night rain
|
||||
11d) icon="";; # Day, rain, lightning
|
||||
11n) icon="";; # Night, rain, lightning
|
||||
13d) icon="";; # Day, snow
|
||||
13n) icon="";; # Night, snow
|
||||
50d) icon="";; # Day, fog
|
||||
50n) icon="";; # Night, fog
|
||||
*) icon=""; # Sun clear, default icon
|
||||
esac
|
||||
|
||||
echo $icon
|
||||
}
|
||||
|
||||
get_duration() {
|
||||
|
||||
osname=$(uname -s)
|
||||
|
||||
case $osname in
|
||||
*BSD) date -r "$1" -u +%H:%M;;
|
||||
*) date --date="@$1" -u +%H:%M;;
|
||||
esac
|
||||
|
||||
}
|
||||
|
||||
KEY="3fbb0282dfd1ba8295bcb93b329fd152"
|
||||
CITY="5149222"
|
||||
UNITS="imperial"
|
||||
SYMBOL="°"
|
||||
|
||||
API="https://api.openweathermap.org/data/2.5"
|
||||
|
||||
if [ -n "$CITY" ]; then
|
||||
if [ "$CITY" -eq "$CITY" ] 2>/dev/null; then
|
||||
CITY_PARAM="id=$CITY"
|
||||
else
|
||||
CITY_PARAM="q=$CITY"
|
||||
fi
|
||||
|
||||
current=$(curl -sf "$API/weather?appid=$KEY&$CITY_PARAM&units=$UNITS")
|
||||
forecast=$(curl -sf "$API/forecast?appid=$KEY&$CITY_PARAM&units=$UNITS&cnt=1")
|
||||
else
|
||||
location=$(curl -sf https://location.services.mozilla.com/v1/geolocate?key=geoclue)
|
||||
|
||||
if [ -n "$location" ]; then
|
||||
location_lat="$(echo "$location" | jq '.location.lat')"
|
||||
location_lon="$(echo "$location" | jq '.location.lng')"
|
||||
|
||||
current=$(curl -sf "$API/weather?appid=$KEY&lat=$location_lat&lon=$location_lon&units=$UNITS")
|
||||
forecast=$(curl -sf "$API/forecast?appid=$KEY&lat=$location_lat&lon=$location_lon&units=$UNITS&cnt=1")
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$current" ] && [ -n "$forecast" ]; then
|
||||
current_temp=$(echo "$current" | jq ".main.temp" | cut -d "." -f 1)
|
||||
current_icon=$(echo "$current" | jq -r ".weather[0].icon")
|
||||
|
||||
forecast_temp=$(echo "$forecast" | jq ".list[].main.temp" | cut -d "." -f 1)
|
||||
forecast_icon=$(echo "$forecast" | jq -r ".list[].weather[0].icon")
|
||||
|
||||
|
||||
if [ "$current_temp" -gt "$forecast_temp" ]; then
|
||||
trend="" # Arrow, down-right slant
|
||||
elif [ "$forecast_temp" -gt "$current_temp" ]; then
|
||||
trend="" # Arrow, up-right slant
|
||||
else
|
||||
trend="" # Arrow, left-to-right
|
||||
fi
|
||||
|
||||
|
||||
sun_rise=$(echo "$current" | jq ".sys.sunrise")
|
||||
sun_set=$(echo "$current" | jq ".sys.sunset")
|
||||
now=$(date +%s)
|
||||
|
||||
if [ "$sun_rise" -gt "$now" ]; then
|
||||
daytime=" $(get_duration "$((sun_rise-now))")" # Sun rise
|
||||
elif [ "$sun_set" -gt "$now" ]; then
|
||||
daytime=" $(get_duration "$((sun_set-now))")" # Sun set
|
||||
else
|
||||
daytime=" $(get_duration "$((sun_rise-now))")" # Unknown
|
||||
fi
|
||||
|
||||
echo "$(get_icon "$current_icon") $current_temp$SYMBOL $trend $(get_icon "$forecast_icon") $forecast_temp$SYMBOL $daytime"
|
||||
fi
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/bin/bash
|
||||
## Author: Shaun Reed | Contact: shaunrd0@gmail.com | URL: www.shaunreed.com ##
|
||||
## ##
|
||||
## A script to toggle and notify xautolock via polybar menus ##
|
||||
###############################################################################
|
||||
# xoffee.sh
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Incorrect number of arguments provided"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$1" = "enable" ]; then
|
||||
xautolock -disable
|
||||
notify-send "Caffeine enabled"
|
||||
elif [ "$1" = "disable" ]; then
|
||||
xautolock -enable
|
||||
notify-send "Caffeine disabled"
|
||||
else
|
||||
notify-send "Error: Incorrect arg for xoffee script"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Generated by JetBrains Toolbox 1.16.6207 at Sun Jan 19 03:37:29 2020
|
||||
|
||||
"/home/kapper/.local/share/JetBrains/Toolbox/apps/PyCharm-C/ch-0/193.5662.61/bin/pycharm.sh" "$@"
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
4afb8389-b9cd-44af-bf06-2c0b267584b6
|
||||
@@ -1 +0,0 @@
|
||||
e7d96d16-43f1-4386-a004-45530dcd9334
|
||||
@@ -1 +0,0 @@
|
||||
21aeff4f-e794-4f9b-b9f0-efcc9a956f72
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,46 +0,0 @@
|
||||
# Inconsolata
|
||||
|
||||
|
||||
## Which font?
|
||||
|
||||
### TL;DR
|
||||
|
||||
* Pick your font family and then select from the `'complete'` directory.
|
||||
* If you are on Windows pick a font with the `'Windows Compatible'` suffix.
|
||||
* This includes specific tweaks to ensure the font works on Windows, in particular monospace identification and font name length limitations
|
||||
* If you are limited to monospaced fonts (because of your terminal, etc) then pick a font with the `'Mono'` suffix.
|
||||
* This denotes that the Nerd Font glyphs will be monospaced not necessarily that the entire font will be monospaced
|
||||
|
||||
### Ligatures
|
||||
|
||||
By the *Nerd Font* policy, the variant with the `'Mono'` suffix is not supposed to have any ligatures.
|
||||
Use the non-*Mono* variants to have ligatures.
|
||||
|
||||
### Explanation
|
||||
|
||||
Once you narrow down your font choice of family (`Droid Sans`, `Inconsolata`, etc) and style (`bold`, `italic`, etc) you have 2 main choices:
|
||||
|
||||
#### `Option 1: Download already patched font`
|
||||
|
||||
* download an already patched font from the `complete` folder
|
||||
* This is most likely the one you want. It includes **all** of the glyphs from all of the glyph sets. Only caution here is that some fonts have glyphs in the _same_ code point so to include everything some had to be moved to alternate code points.
|
||||
|
||||
#### `Option 2: Patch your own font`
|
||||
|
||||
* patch your own variations with the various options provided by the font patcher (see each font's readme for full list of combinations available)
|
||||
* This is the option you want if the font you use is _not_ already included or you want maximum control of what's included
|
||||
* This contains a list of _all permutations_ of the various glyphs. E.g. You want the font with only [Octicons][octicons] or you want the font with just [Font Awesome][font-awesome] and [Devicons][vorillaz-devicons]. The goal is to provide every combination possible in this folder.
|
||||
|
||||
|
||||
For more information see: [The FAQ](https://github.com/ryanoasis/nerd-fonts/wiki/FAQ-and-Troubleshooting#which-font)
|
||||
|
||||
|
||||
[vim-devicons]:https://github.com/ryanoasis/vim-devicons
|
||||
[vorillaz-devicons]:https://vorillaz.github.io/devicons/
|
||||
[font-awesome]:https://github.com/FortAwesome/Font-Awesome
|
||||
[octicons]:https://github.com/primer/octicons
|
||||
[gabrielelana-pomicons]:https://github.com/gabrielelana/pomicons
|
||||
[Seti-UI]:https://atom.io/themes/seti-ui
|
||||
[ryanoasis-powerline-extra-symbols]:https://github.com/ryanoasis/powerline-extra-symbols
|
||||
[SIL-RFN]:http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web_fonts_and_RFNs#14cbfd4a
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +0,0 @@
|
||||
[Appearance]
|
||||
ColorScheme=GreenOnBlack
|
||||
Font=Inconsolata Nerd Font Mono [PfEd],9,-1,5,57,0,0,0,0,0,Medium
|
||||
|
||||
[General]
|
||||
Icon=yakuake
|
||||
Name=Default Powerline
|
||||
Parent=FALLBACK/
|
||||
Reference in New Issue
Block a user