From c87546e75cf98622601846394ac5b7f6ed617196 Mon Sep 17 00:00:00 2001 From: Kevin Mok Date: Thu, 8 Mar 2018 06:37:28 -0500 Subject: [PATCH] Copied i3blocks scripts from orig dir Some were modified from original but can't be bothered to check which. 'backlight' is custom. Changed both PC/laptop i3blocks config to reference new i3blocks-scripts location. system: Fixed keyboard repeat rate for PC/laptop. Git: Added amending commit and forcing push aliases. i3: Changed '$mod+F[1-3]' mappings to just 'F[1-3]'. --- .gitignore | 1 + aliases/zsh_aliases | 7 ++- configs/NZXT/i3blocks/i3blocks.conf | 3 +- configs/X1-Carbon/i3/config | 13 ++-- configs/X1-Carbon/i3blocks/i3blocks.conf | 50 ++++++++++++---- configs/i3blocks-scripts/backlight | 9 +++ configs/i3blocks-scripts/battery | 76 ++++++++++++++++++++++++ configs/i3blocks-scripts/cpu_usage | 55 +++++++++++++++++ configs/i3blocks-scripts/load_average | 34 +++++++++++ configs/i3blocks-scripts/memory | 49 +++++++++++++++ configs/i3blocks-scripts/name | 1 + configs/i3blocks-scripts/spotify.py | 15 +++++ configs/i3blocks-scripts/temperature | 69 +++++++++++++++++++++ configs/i3blocks-scripts/volume | 70 ++++++++++++++++++++++ configs/i3blocks-scripts/wifi | 46 ++++++++++++++ dotfiles/Xresources | 2 +- dotfiles/vimrc | 8 ++- dotfiles/zshrc | 7 ++- 18 files changed, 488 insertions(+), 27 deletions(-) create mode 100755 configs/i3blocks-scripts/backlight create mode 100755 configs/i3blocks-scripts/battery create mode 100755 configs/i3blocks-scripts/cpu_usage create mode 100755 configs/i3blocks-scripts/load_average create mode 100755 configs/i3blocks-scripts/memory create mode 100755 configs/i3blocks-scripts/name create mode 100644 configs/i3blocks-scripts/spotify.py create mode 100755 configs/i3blocks-scripts/temperature create mode 100755 configs/i3blocks-scripts/volume create mode 100755 configs/i3blocks-scripts/wifi diff --git a/.gitignore b/.gitignore index 41a49e4..787b684 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ temp.sh konsole.shortcuts commit-msg.txt core +ideas.md diff --git a/aliases/zsh_aliases b/aliases/zsh_aliases index 3c2e329..035909f 100644 --- a/aliases/zsh_aliases +++ b/aliases/zsh_aliases @@ -71,7 +71,7 @@ alias vr="ni ~/.config/ranger/rc.conf" # i3 {{{ # alias v3="ni ~/.config/i3/config" alias v3b="ni ~/.config/i3blocks/i3blocks.conf" -alias i3b="f /usr/share/i3blocks" +alias i3b="f ~/i3blocks" alias pipes="pipes.sh -t 2" alias bgs="nemo ~/Pictures/Backgrounds" @@ -91,6 +91,7 @@ alias rg="ranger" function ok() { okular $1 ; } function chr() { google-chrome $1 ; } function ni() { nvim $1 ; } + alias nisw="f ~/.local/share/nvim/swap" # function mrk() { pandoc -o ${1%.*}.html $1 && chr ${1%.*}.html ; } function mrk() { pandoc -o ${1%.*}.html $1 ; } @@ -202,7 +203,7 @@ if [[ "$(hostname)" = "X1-Carbon" ]]; then # }}} key swaps # alias gbl="xbacklight -get" - function sbl() { xbacklight -set $(echo "scale=2;$1*10" | bc) ; } + function bl() { xbacklight -set $(echo "scale=2;$1*10" | bc) ; } alias thn="thunar ." @@ -242,10 +243,12 @@ alias gst="git stash" alias gstp="git stash pop" alias gc="git commit" +alias gcam="git commit --amend" # todo: fix function gcm(){ echo git commit -m \""$1"\" ; } alias gps="git push" +alias gpsfrc="git push --force" alias gdwip="git push -d origin wip && git branch -d wip" alias gclear="git stash clear" # }}} push # diff --git a/configs/NZXT/i3blocks/i3blocks.conf b/configs/NZXT/i3blocks/i3blocks.conf index c7abe46..2cfb604 100644 --- a/configs/NZXT/i3blocks/i3blocks.conf +++ b/configs/NZXT/i3blocks/i3blocks.conf @@ -26,7 +26,8 @@ # The top properties below are applied to every block, but can be overridden. # Each block command defaults to the script name to avoid boilerplate. align=center -command=/usr/share/i3blocks/$BLOCK_NAME +# command=/usr/share/i3blocks/$BLOCK_NAME +command=~/linux-config/configs/i3blocks-scripts/$BLOCK_NAME separator=true separator_block_width=25 markup=pango diff --git a/configs/X1-Carbon/i3/config b/configs/X1-Carbon/i3/config index a0ba593..8fbf80a 100644 --- a/configs/X1-Carbon/i3/config +++ b/configs/X1-Carbon/i3/config @@ -1,14 +1,16 @@ # applications {{{ # + # startup {{{ # exec redshift -O 4000 -# exec_always /home/kevin/.local/bin/wal -i "/home/kevin/Pictures/Backgrounds/" -exec_always /home/kevin/.local/bin/wal -i "/home/kevin/Pictures/Backgrounds/japan-street.jpg" +exec_always /home/kevin/.local/bin/wal -i "/home/kevin/Pictures/Backgrounds/" +# exec_always /home/kevin/.local/bin/wal -i "/home/kevin/Pictures/Backgrounds/japan-street.jpg" exec imwheel # enable horizontal scrolling exec --no-startup-id synclient HorizTwoFingerScroll=1 # disable touchscreen exec xinput disable 12 exec $def_term +reload # }}} startup # set $def_term "rxvt-unicode" @@ -100,18 +102,19 @@ bindsym $mod+a focus parent # workspace {{{ # # ws names {{{ # set $ws1 "1 " -bindsym $mod+F1 workspace $ws1; exec $def_term +bindsym F1 workspace $ws1; exec $def_term set $ws2 "2 " -bindsym $mod+F2 workspace $ws2; exec $def_term +bindsym F2 workspace $ws2; exec $def_term set $ws3 "3 🌐" -bindsym $mod+F3 workspace $ws3; exec $run_chrome +bindsym F3 workspace $ws3; exec $run_chrome set $ws4 "4 🖹" set $ws5 "5 " set $ws6 "6 🗪" bindsym Mod4+d workspace $ws6; exec discord +bindsym Mod4+l workspace $ws6; exec slack set $ws7 "7 ↥" set $ws8 "8 𝅘𝅥𝅮" diff --git a/configs/X1-Carbon/i3blocks/i3blocks.conf b/configs/X1-Carbon/i3blocks/i3blocks.conf index f95a834..f2a295a 100644 --- a/configs/X1-Carbon/i3blocks/i3blocks.conf +++ b/configs/X1-Carbon/i3blocks/i3blocks.conf @@ -1,4 +1,4 @@ -#j properties {{{ # +# properties {{{ # # i3blocks config file # # Please see man i3blocks for a complete reference! @@ -26,41 +26,65 @@ # The top properties below are applied to every block, but can be overridden. # Each block command defaults to the script name to avoid boilerplate. align=center -command=/usr/share/i3blocks/$BLOCK_NAME +command=~/linux-config/configs/i3blocks-scripts/$BLOCK_NAME separator=true separator_block_width=25 markup=pango # }}} Global properties # -[time] -command=date '+%H:%M.%a-%m-%d' -interval=60 -color=#999999 +# blocks {{{ # +# spotify {{{ # [spotify] command=python /usr/share/i3blocks/spotify.py label= # label= color=#388E8E interval=10 +# }}} spotify # -[load_average] -label=🗠 -interval=5 -color=#990000 +# backlight {{{ # +[backlight] +command=. /usr/share/i3blocks/backlight +label=🔆 +color=#EEAD0E +interval=10 +# }}} backlight # +# battery {{{ # [battery] label=⚡ interval=60 +# }}} battery # +# wifi {{{ # [wifi] label=🖧 instance=wlp3s0 interval=10 +# }}} wifi # +# time {{{ # +[time] +command=date '+%H:%M.%a-%m-%d' +interval=60 +color=#999999 +# }}} time # + +# load {{{ # +[load_average] +label=🗠 +interval=5 +color=#990000 +# }}} load # + +# name {{{ # [name] color=#cc5490 interval=6000 +# }}} name # + +# blocks }}} # # unused blocks {{{ # # [memory] @@ -135,9 +159,9 @@ interval=6000 # Support multiple chips, though lm-sensors. # The script may be called with -w and -c switches to specify thresholds, # see the script for details. -#[temperature] -#label=TEMP -#interval=10 +# [temperature] +# label=TEMP +# interval=10 # Key indicators # diff --git a/configs/i3blocks-scripts/backlight b/configs/i3blocks-scripts/backlight new file mode 100755 index 0000000..6dc7dfc --- /dev/null +++ b/configs/i3blocks-scripts/backlight @@ -0,0 +1,9 @@ +#!/bin/sh +# https://askubuntu.com/a/179949/794515 +round() +{ +echo $(printf %.$2f $(echo "scale=$2;(((10^$2)*$1)+0.5)/(10^$2)" | bc)) +}; + +cur_bl=$(xbacklight -get) +echo "$(round "$cur_bl" 0)%" diff --git a/configs/i3blocks-scripts/battery b/configs/i3blocks-scripts/battery new file mode 100755 index 0000000..d27fa53 --- /dev/null +++ b/configs/i3blocks-scripts/battery @@ -0,0 +1,76 @@ +#!/usr/bin/perl +# +# Copyright 2014 Pierre Mavro +# Copyright 2014 Vivien Didelot +# +# Licensed under the terms of the GNU GPL v3, or any later version. +# +# This script is meant to use with i3blocks. It parses the output of the "acpi" +# command (often provided by a package of the same name) to read the status of +# the battery, and eventually its remaining time (to full charge or discharge). +# +# The color will gradually change for a percentage below 85%, and the urgency +# (exit code 33) is set if there is less that 5% remaining. + +use strict; +use warnings; +use utf8; + +my $acpi; +my $status; +my $percent; +my $full_text; +my $short_text; +my $bat_number = $ENV{BLOCK_INSTANCE} || 0; + +# read the first line of the "acpi" command output +open (ACPI, "acpi -b | grep 'Battery $bat_number' |") or die; +$acpi = ; +close(ACPI); + +# fail on unexpected output +if ($acpi !~ /: (\w+), (\d+)%/) { + die "$acpi\n"; +} + +$status = $1; +$percent = $2; +$full_text = "$percent%"; + +if ($status eq 'Discharging') { + $full_text .= ' DIS'; +} elsif ($status eq 'Charging') { + $full_text .= ' CHR'; +} + +$short_text = $full_text; + +if ($acpi =~ /(\d\d:\d\d):/) { + $full_text .= " ($1)"; +} + +# print text +print "$full_text\n"; +print "$short_text\n"; + +# consider color and urgent flag only on discharge +if ($status eq 'Discharging') { + + if ($percent < 20) { + print "#FF0000\n"; + } elsif ($percent < 40) { + print "#FFAE00\n"; + } elsif ($percent < 60) { + print "#FFF600\n"; + } elsif ($percent < 85) { + print "#A8FF00\n"; + } + + if ($percent < 5) { + exit(33); + } +} else { + print "#2c9332\n"; +} + +exit(0); diff --git a/configs/i3blocks-scripts/cpu_usage b/configs/i3blocks-scripts/cpu_usage new file mode 100755 index 0000000..8c3c1f5 --- /dev/null +++ b/configs/i3blocks-scripts/cpu_usage @@ -0,0 +1,55 @@ +#!/usr/bin/perl +# +# Copyright 2014 Pierre Mavro +# Copyright 2014 Vivien Didelot +# Copyright 2014 Andreas Guldstrand +# +# Licensed under the terms of the GNU GPL v3, or any later version. + +use strict; +use warnings; +use utf8; +use Getopt::Long; + +# default values +my $t_warn = 50; +my $t_crit = 80; +my $cpu_usage = -1; + +sub help { + print "Usage: cpu_usage [-w ] [-c ]\n"; + print "-w : warning threshold to become yellow\n"; + print "-c : critical threshold to become red\n"; + exit 0; +} + +GetOptions("help|h" => \&help, + "w=i" => \$t_warn, + "c=i" => \$t_crit); + +# Get CPU usage +$ENV{LC_ALL}="en_US"; # if mpstat is not run under en_US locale, things may break, so make sure it is +open (MPSTAT, 'mpstat 1 1 |') or die; +while () { + if (/^.*\s+(\d+\.\d+)\s+$/) { + $cpu_usage = 100 - $1; # 100% - %idle + last; + } +} +close(MPSTAT); + +$cpu_usage eq -1 and die 'Can\'t find CPU information'; + +# Print short_text, full_text +printf "%.2f%%\n", $cpu_usage; +printf "%.2f%%\n", $cpu_usage; + +# Print color, if needed +if ($cpu_usage >= $t_crit) { + print "#FF0000\n"; + exit 33; +} elsif ($cpu_usage >= $t_warn) { + print "#FFFC00\n"; +} + +exit 0; diff --git a/configs/i3blocks-scripts/load_average b/configs/i3blocks-scripts/load_average new file mode 100755 index 0000000..37a5c71 --- /dev/null +++ b/configs/i3blocks-scripts/load_average @@ -0,0 +1,34 @@ +#!/bin/sh +# Copyright (C) 2014 Julien Bonjean + +# 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 . + +load="$(cut -d ' ' -f1 /proc/loadavg)" +cpus="$(nproc)" + +# full text +echo "$load" + +# short text +echo "$load" + +# color if load is too high +awk -v cpus=$cpus -v cpuload=$load ' + BEGIN { + if (cpus <= cpuload) { + print "#FF0000"; + exit 33; + } + } +' diff --git a/configs/i3blocks-scripts/memory b/configs/i3blocks-scripts/memory new file mode 100755 index 0000000..e28af4e --- /dev/null +++ b/configs/i3blocks-scripts/memory @@ -0,0 +1,49 @@ +#!/bin/sh +# Copyright (C) 2014 Julien Bonjean + +# 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 . + +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 { + # full text + if (type == "swap") + printf("%.1fG\n", (swap_total-swap_free)/1024/1024) + else + printf("%.1fG\n", mem_free/1024/1024) + + # TODO: short text + + # TODO: color (if less than X%) +} +' /proc/meminfo diff --git a/configs/i3blocks-scripts/name b/configs/i3blocks-scripts/name new file mode 100755 index 0000000..38a9977 --- /dev/null +++ b/configs/i3blocks-scripts/name @@ -0,0 +1 @@ +echo "Kevin 🚀" diff --git a/configs/i3blocks-scripts/spotify.py b/configs/i3blocks-scripts/spotify.py new file mode 100644 index 0000000..7d1d18e --- /dev/null +++ b/configs/i3blocks-scripts/spotify.py @@ -0,0 +1,15 @@ +#!/usr/bin/python + +import dbus +try: + bus = dbus.SessionBus() + spotify = bus.get_object("org.mpris.MediaPlayer2.spotify", "/org/mpris/MediaPlayer2") + spotify_iface = dbus.Interface(spotify, 'org.freedesktop.DBus.Properties') + props = spotify_iface.Get('org.mpris.MediaPlayer2.Player', 'Metadata') + print(str(props['xesam:artist'][0]) + " - " + str(props['xesam:title'])) + exit +except dbus.exceptions.DBusException: + exit + + + diff --git a/configs/i3blocks-scripts/temperature b/configs/i3blocks-scripts/temperature new file mode 100755 index 0000000..ad745c3 --- /dev/null +++ b/configs/i3blocks-scripts/temperature @@ -0,0 +1,69 @@ +#!/usr/bin/perl +# Copyright 2014 Pierre Mavro +# Copyright 2014 Vivien Didelot +# Copyright 2014 Andreas Guldstrand +# Copyright 2014 Benjamin Chretien + +# 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 . + +use strict; +use warnings; +use utf8; +use Getopt::Long; + +binmode(STDOUT, ":utf8"); + +# default values +my $t_warn = 70; +my $t_crit = 90; +my $chip = ""; +my $temperature = -9999; + +sub help { + print "Usage: temperature [-w ] [-c ] [--chip ]\n"; + print "-w : warning threshold to become yellow\n"; + print "-c : critical threshold to become red\n"; + print "--chip : sensor chip\n"; + exit 0; +} + +GetOptions("help|h" => \&help, + "w=i" => \$t_warn, + "c=i" => \$t_crit, + "chip=s" => \$chip); + +# Get chip temperature +open (SENSORS, "sensors -u $chip |") or die; +while () { + if (/^\s+temp1_input:\s+[\+]*([\-]*\d+\.\d)/) { + $temperature = $1; + last; + } +} +close(SENSORS); + +$temperature eq -9999 and die 'Cannot find temperature'; + +# Print short_text, full_text +print "$temperature°C\n" x2; + +# Print color, if needed +if ($temperature >= $t_crit) { + print "#FF0000\n"; + exit 33; +} elsif ($temperature >= $t_warn) { + print "#FFFC00\n"; +} + +exit 0; diff --git a/configs/i3blocks-scripts/volume b/configs/i3blocks-scripts/volume new file mode 100755 index 0000000..a55db88 --- /dev/null +++ b/configs/i3blocks-scripts/volume @@ -0,0 +1,70 @@ +#!/bin/bash +# Copyright (C) 2014 Julien Bonjean +# Copyright (C) 2014 Alexander Keller + +# 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 . + +#------------------------------------------------------------------------ + +# The second parameter overrides the mixer selection +# For PulseAudio users, use "pulse" +# For Jack/Jack2 users, use "jackplug" +# For ALSA users, you may use "default" for your primary card +# or you may use hw:# where # is the number of the card desired +MIXER="default" +[ -n "$(lsmod | grep pulse)" ] && MIXER="pulse" +[ -n "$(lsmod | grep jack)" ] && MIXER="jackplug" +MIXER="${2:-$MIXER}" + +# The instance option sets the control to report and configure +# This defaults to the first control of your selected mixer +# For a list of the available, use `amixer -D $Your_Mixer scontrols` +SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols | + sed -n "s/Simple mixer control '\([A-Za-z ]*\)',0/\1/p" | + head -n1 + )}" + +# The first parameter sets the step to change the volume by (and units to display) +# This may be in in % or dB (eg. 5% or 3dB) +STEP="${1:-5%}" + +#------------------------------------------------------------------------ + +capability() { # Return "Capture" if the device is a capture device + amixer -D $MIXER get $SCONTROL | + sed -n "s/ Capabilities:.*cvolume.*/Capture/p" +} + +volume() { + amixer -D $MIXER get $SCONTROL $(capability) +} + +format() { + perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)' + perl_filter+='{CORE::say $4 eq "off" ? "MUTE" : "' + # If dB was selected, print that instead + perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1') + perl_filter+='"; exit}' + perl -ne "$perl_filter" +} + +#------------------------------------------------------------------------ + +case $BLOCK_BUTTON in + 3) amixer -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute + 4) amixer -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;; # scroll up, increase + 5) amixer -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;; # scroll down, decrease +esac + +volume | format diff --git a/configs/i3blocks-scripts/wifi b/configs/i3blocks-scripts/wifi new file mode 100755 index 0000000..ffaccab --- /dev/null +++ b/configs/i3blocks-scripts/wifi @@ -0,0 +1,46 @@ +#!/bin/bash +# Copyright (C) 2014 Alexander Keller + +# 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 . + +#------------------------------------------------------------------------ + +INTERFACE="${BLOCK_INSTANCE:-wlan0}" + +#------------------------------------------------------------------------ + +# As per #36 -- It is transparent: e.g. if the machine has no battery or wireless +# connection (think desktop), the corresponding block should not be displayed. +[[ ! -d /sys/class/net/${INTERFACE}/wireless ]] || + [[ "$(cat /sys/class/net/$INTERFACE/operstate)" = 'down' ]] && exit + +#------------------------------------------------------------------------ + +QUALITY=$(grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70) }') + +#------------------------------------------------------------------------ + +echo $QUALITY% # full text +echo $QUALITY% # short text + +# color +if [[ $QUALITY -ge 80 ]]; then + echo "#00FF00" +elif [[ $QUALITY -lt 80 ]]; then + echo "#FFF600" +elif [[ $QUALITY -lt 60 ]]; then + echo "#FFAE00" +elif [[ $QUALITY -lt 40 ]]; then + echo "#FF0000" +fi diff --git a/dotfiles/Xresources b/dotfiles/Xresources index cda2503..02769b4 100644 --- a/dotfiles/Xresources +++ b/dotfiles/Xresources @@ -4,7 +4,7 @@ URxvt.font: xft:hack:size=12 URxvt*inheritPixmap: true URxvt*transparent: true ! URxvt*shading: 0 to 99 darkens, 101 to 200 lightens -URxvt*shading: 30 +URxvt*shading: 40 /* }}} transparency */ URxvt.scrollBar: false diff --git a/dotfiles/vimrc b/dotfiles/vimrc index 5a57897..995267b 100644 --- a/dotfiles/vimrc +++ b/dotfiles/vimrc @@ -117,7 +117,7 @@ colorscheme wal " Mappings {{{ " " function keys {{{ " -map :wa +" map :wa map :wqa map :qa! map :make -C ~/Documents/resume cv @@ -171,8 +171,6 @@ nnoremap rv :source $MYVIMRC nnoremap R q:i%s///g2F/i " set syntax to shell (for dotfiles) nnoremap s :set syn=sh -" replace bars/underscores in URL -nnoremap url :.s/\([-_]\)/\\\1/g " format current line nnoremap w Vgq " format this and next line @@ -181,6 +179,7 @@ nnoremap ww Vjgq nnoremap z za " copy next thing to system clipboard nnoremap y "+ +nnoremap Y "+Y " }}} leader mappings " @@ -193,6 +192,7 @@ autocmd Filetype c inoremap s struct pixel " tex {{{ " autocmd Filetype tex inoremap D \Delta autocmd Filetype tex inoremap e \exists +autocmd Filetype tex inoremap ep \epsilon autocmd Filetype tex inoremap fa \forall autocmd Filetype tex inoremap g \geq autocmd Filetype tex inoremap i \in @@ -204,6 +204,8 @@ autocmd Filetype tex inoremap R \Rightarrow autocmd Filetype tex inoremap st such that autocmd Filetype tex inoremap t \times autocmd Filetype tex inoremap T $T$ +" replace bars/underscores in URL +autocmd Filetype tex inoremap url :.s/\([-_]\)/\\\1/g autocmd Filetype tex inoremap v \vee autocmd Filetype tex inoremap w \wedge autocmd Filetype tex inoremap x $x$-axis diff --git a/dotfiles/zshrc b/dotfiles/zshrc index bc6312f..cebd334 100644 --- a/dotfiles/zshrc +++ b/dotfiles/zshrc @@ -95,8 +95,6 @@ source ~/linux-config/aliases/zsh_aliases # alias ohmyzsh="mate ~/.oh-my-zsh" if [ "$(whoami)" = "kevin" ]; then - gsettings set org.gnome.desktop.peripherals.keyboard delay 25 - gsettings set org.gnome.desktop.peripherals.keyboard repeat-interval 200 export PATH="${PATH}:${HOME}/.local/bin/" (cat ~/.cache/wal/sequences &) fi @@ -106,6 +104,11 @@ then xmodmap -e "clear Lock" xmodmap -e "keycode 22 = Caps_Lock" xmodmap -e "keycode 66 = BackSpace" + + # keyboard repeat rate + gsettings set org.gnome.desktop.peripherals.keyboard delay 25 + gsettings set org.gnome.desktop.peripherals.keyboard repeat-interval 200 else xrandr --dpi 150 + xset r rate 200 60 fi