From 688dd5fc7a250f9f49df0242a259c926e4fd1b1c Mon Sep 17 00:00:00 2001 From: Kevin Mok Date: Mon, 3 Dec 2018 15:35:18 -0500 Subject: [PATCH] Closes #66 --- aliases/zsh_aliases | 6 ++-- bash-colors.txt | 2 -- configs/i3blocks-scripts/cpu_usage | 4 +-- dotfiles/Xmodmap | 4 +++ dotfiles/imwheelrc | 3 ++ dotfiles/set-dotfiles.sh | 4 ++- dotfiles/xinitrc | 4 +++ x/marble-mouse/10-evdev.conf | 53 ++++++++++++++++++++++++++++++ x/marble-mouse/set-config.sh | 13 ++++++++ {xkb => x/xkb}/NZXT-pc | 0 {xkb => x/xkb}/X1-Carbon-pc | 0 {xkb => x/xkb}/set-layouts.sh | 0 12 files changed, 85 insertions(+), 8 deletions(-) delete mode 100644 bash-colors.txt create mode 100644 dotfiles/Xmodmap create mode 100644 dotfiles/imwheelrc create mode 100644 dotfiles/xinitrc create mode 100644 x/marble-mouse/10-evdev.conf create mode 100755 x/marble-mouse/set-config.sh rename {xkb => x/xkb}/NZXT-pc (100%) rename {xkb => x/xkb}/X1-Carbon-pc (100%) rename {xkb => x/xkb}/set-layouts.sh (100%) diff --git a/aliases/zsh_aliases b/aliases/zsh_aliases index adb125f..9ae6333 100644 --- a/aliases/zsh_aliases +++ b/aliases/zsh_aliases @@ -1,7 +1,7 @@ # system {{{ # HISTFILE=~/.histfile -HISTSIZE=1000 -SAVEHIST=1000 +HISTSIZE=10000 +SAVEHIST=10000 setopt appendhistory autocd extendedglob nomatch notify # vim mode {{{ # @@ -202,7 +202,7 @@ alias gchom="git checkout master" alias gchnw="git checkout -b wip" alias gchw="git checkout wip" alias gheadm1="git reset --hard HEAD~1" -alias glstf="git ls-tree -r HEAD --name-only" +alias gls="git ls-tree -r HEAD --name-only" # push {{{ # alias egc="nvim -c \"set syn=gitcommit\" -c \"set tw=72\" commit-msg.txt" diff --git a/bash-colors.txt b/bash-colors.txt deleted file mode 100644 index a23a129..0000000 --- a/bash-colors.txt +++ /dev/null @@ -1,2 +0,0 @@ -#0077ff - lab text -#174af0 - lab text (bold) diff --git a/configs/i3blocks-scripts/cpu_usage b/configs/i3blocks-scripts/cpu_usage index 3625a93..a70a323 100755 --- a/configs/i3blocks-scripts/cpu_usage +++ b/configs/i3blocks-scripts/cpu_usage @@ -41,8 +41,8 @@ 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; +printf "%.0f%%\n", $cpu_usage; +printf "%.0f%%\n", $cpu_usage; # Print color, if needed if ($cpu_usage >= $t_crit) { diff --git a/dotfiles/Xmodmap b/dotfiles/Xmodmap new file mode 100644 index 0000000..2efaa1c --- /dev/null +++ b/dotfiles/Xmodmap @@ -0,0 +1,4 @@ +clear Lock + +keycode 22 = Caps_Lock +keycode 66 = BackSpace diff --git a/dotfiles/imwheelrc b/dotfiles/imwheelrc new file mode 100644 index 0000000..3a005ba --- /dev/null +++ b/dotfiles/imwheelrc @@ -0,0 +1,3 @@ +".*" +None, Up, Button4, 5 +None, Down, Button5, 5 diff --git a/dotfiles/set-dotfiles.sh b/dotfiles/set-dotfiles.sh index 77ff1af..0f18215 100755 --- a/dotfiles/set-dotfiles.sh +++ b/dotfiles/set-dotfiles.sh @@ -1,7 +1,9 @@ +#!/bin/zsh + # Get directory variables from script. . ../dirs.sh # List of dotfiles I want to link to system. -dotfiles=(bashrc gitconfig inputrc vimrc Xresources zshrc) +dotfiles=(bashrc gitconfig inputrc imwheelrc vimrc xinitrc Xmodmap Xresources zshrc) # cd $dot_dir for dotfile in $dotfiles; do # Remove system dotfile. diff --git a/dotfiles/xinitrc b/dotfiles/xinitrc new file mode 100644 index 0000000..3a7ea3d --- /dev/null +++ b/dotfiles/xinitrc @@ -0,0 +1,4 @@ +#xrandr --setprovideroutputsource modesetting NVIDIA-0 +[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources +xrandr --auto +exec i3 diff --git a/x/marble-mouse/10-evdev.conf b/x/marble-mouse/10-evdev.conf new file mode 100644 index 0000000..ecb8106 --- /dev/null +++ b/x/marble-mouse/10-evdev.conf @@ -0,0 +1,53 @@ +# - - - Logitech Marble Mouse Settings - - - +# +# The Logitech Marble Mouse buttons are mapped [A-D] from left to right: +# A (large); B (small) | C (small); D (large). +# +# Preferred options for right-handed usage: +# A = normal click [1] +# B = middle-click [2] +# C = middle-click [2] +# D = right-click [3] +# Hold button B while rolling trackball to emulate wheel-scrolling. +# +# Preferred options for left-handed usage: +# A = right-click [3] +# B = middle-click [2] +# C = middle-click [2] +# D = normal click [1] +# Hold button C while rolling trackball to emulate wheel-scrolling. +# Pressing both large buttons simultaneously (b) produces a "back" action. + +Section "InputClass" + Identifier "Marble Mouse" + MatchProduct "Logitech USB Trackball" + MatchIsPointer "on" + MatchDevicePath "/dev/input/event*" + Driver "evdev" + +# Physical button #s: A b D - - - - B C +# Option "ButtonMapping" "1 8 3 4 5 6 7 2 2" right-hand placement +# Option "ButtonMapping" "3 8 1 4 5 6 7 2 2" left-hand placement +# b = A & D + #Option "ButtonMapping" "1 8 3 4 5 6 7 2 2" + Option "ButtonMapping" "3 8 1 4 5 6 7 2 2" + +# EmulateWheel: Use Marble Mouse trackball as mouse wheel +# Factory Default: 8; Use 9 for right side small button + Option "EmulateWheel" "true" + Option "EmulateWheelButton" "8" + +# EmulateWheelInertia: How far (in pixels) the pointer must move to +# generate button press/release events in wheel emulation mode. +# Factory Default: 50 + Option "EmulateWheelInertia" "10" + +# Axis Mapping: Enable vertical [ZAxis] and horizontal [XAxis] scrolling + Option "ZAxisMapping" "4 5" +# Option "XAxisMapping" "6 7" + +# Emulate3Buttons: Required to interpret simultaneous press of two large +# buttons, A & D, as a seperate command, b. +# Factory Default: true + Option "Emulate3Buttons" "true" +EndSection diff --git a/x/marble-mouse/set-config.sh b/x/marble-mouse/set-config.sh new file mode 100755 index 0000000..9131665 --- /dev/null +++ b/x/marble-mouse/set-config.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Get directory variables from script. +sh ../../dirs.sh + +config_file_name="10-evdev.conf" +sys_layout_file="/etc/X11/xorg.conf.d/$config_file_name" +config_dir="$linux_config_dir/x/marble-mouse" + +# Remove system file. +sudo rm -rf "$sys_layout_file" +# Link config file in repository to system config location. +sudo ln -s "$config_dir"/"$config_file_name" "$sys_layout_file" diff --git a/xkb/NZXT-pc b/x/xkb/NZXT-pc similarity index 100% rename from xkb/NZXT-pc rename to x/xkb/NZXT-pc diff --git a/xkb/X1-Carbon-pc b/x/xkb/X1-Carbon-pc similarity index 100% rename from xkb/X1-Carbon-pc rename to x/xkb/X1-Carbon-pc diff --git a/xkb/set-layouts.sh b/x/xkb/set-layouts.sh similarity index 100% rename from xkb/set-layouts.sh rename to x/xkb/set-layouts.sh