From dacca74639e150698333d4bd7b7bc3837326a5f0 Mon Sep 17 00:00:00 2001 From: Kumar Damani Date: Thu, 5 Nov 2020 13:29:18 -0500 Subject: fixed bspwm workspace bug --- Scripts/.config/Scripts/configs | 12 --- Scripts/.config/Scripts/folders | 6 -- Scripts/.config/Scripts/get_email.sh | 7 -- Scripts/.config/Scripts/shortcuts.py | 23 ----- Scripts/.config/Scripts/startdwm | 21 ---- Scripts/.config/Scripts/tmux_connect.sh | 9 -- Scripts/.config/Scripts/vimrc | 175 -------------------------------- Scripts/.config/Scripts/zerohosts | 105 ------------------- bspwm/.config/bspwm/bspwmrc | 5 +- 9 files changed, 2 insertions(+), 361 deletions(-) delete mode 100755 Scripts/.config/Scripts/configs delete mode 100755 Scripts/.config/Scripts/folders delete mode 100755 Scripts/.config/Scripts/get_email.sh delete mode 100755 Scripts/.config/Scripts/shortcuts.py delete mode 100755 Scripts/.config/Scripts/startdwm delete mode 100755 Scripts/.config/Scripts/tmux_connect.sh delete mode 100755 Scripts/.config/Scripts/vimrc delete mode 100755 Scripts/.config/Scripts/zerohosts diff --git a/Scripts/.config/Scripts/configs b/Scripts/.config/Scripts/configs deleted file mode 100755 index 7455ba0..0000000 --- a/Scripts/.config/Scripts/configs +++ /dev/null @@ -1,12 +0,0 @@ -cfb ~/.bashrc -cfv ~/.config/Scripts/vimrc -cfr ~/.config/vifm/vifmrc -cfi ~/.config/i3/config -cfm ~/.config/mutt/muttrc -cff ~/.config/Scripts/folders -cfc ~/.config/Scripts/configs -cfT ~/.config/Scripts/tmux.conf -cfa ~/.config/mutt/aliases -cfp ~/.config/polybar/mybar -cfs ~/.config/sxhkd/sxhkdrc -cfB ~/.config/bspwm/bspwmrc diff --git a/Scripts/.config/Scripts/folders b/Scripts/.config/Scripts/folders deleted file mode 100755 index 4452f45..0000000 --- a/Scripts/.config/Scripts/folders +++ /dev/null @@ -1,6 +0,0 @@ -h ~ -d ~/Documents -D ~/Downloads -s ~/.config/Scripts -c ~/Dropbox/winter2019 -w ~/Downloads/wallpapers diff --git a/Scripts/.config/Scripts/get_email.sh b/Scripts/.config/Scripts/get_email.sh deleted file mode 100755 index 6c28c68..0000000 --- a/Scripts/.config/Scripts/get_email.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# notify -notify-send "📧" - -#log -(echo "============`date`============`offlineimap -o`") >> ~/.offlineimap/email.log 2>&1 diff --git a/Scripts/.config/Scripts/shortcuts.py b/Scripts/.config/Scripts/shortcuts.py deleted file mode 100755 index 24d6592..0000000 --- a/Scripts/.config/Scripts/shortcuts.py +++ /dev/null @@ -1,23 +0,0 @@ -import csv - -bash = "" - -with open("/home/kdam0/.bashrc") as bsh: - bash+=bsh.read() - -#First we open the list of folder shortcuts and go down each line adding each in the required syntax to each of the three configs: - -with open("/home/kdam0/.config/Scripts/folders") as fold: - for line in csv.reader(fold, dialect="excel-tab"): - #Adds the bash shortcuts: - bash+=("alias "+line[0]+"=\"cd "+line[1]+" && ls -a\"\n") - -#Goes thru the config file file and adds the shortcuts to both bash and ranger. - -with open("/home/kdam0/.config/Scripts/configs") as conf: - for line in csv.reader(conf, dialect="excel-tab"): - bash+=("alias "+line[0]+"=\"vim "+line[1]+"\"\n") - - -with open("/home/kdam0/.bashrc","w") as outbash: - outbash.write(bash) diff --git a/Scripts/.config/Scripts/startdwm b/Scripts/.config/Scripts/startdwm deleted file mode 100755 index 1db7aeb..0000000 --- a/Scripts/.config/Scripts/startdwm +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -while true; do - disk_used=$(df -hl --total / | awk '{print $5}' | sed -n 2p) - xsetroot -name "/: ${disk_used} || 🗓 $(date)" - sleep 1m -done & - -#while true; do - # Log stderror to a file - # dwm 2> ~/.dwm.log - # No error logging - #dwm >/dev/null 2>&1 -#done - -#dwm && $HOME/.config/Scripts/autostart.sh && sxhkd -c $HOME/.config/sxhkd/sxhkdrc_dwm & - -sxhkd & -$HOME/.config/Scripts/autostart.sh & -dwm >/dev/null 2>&1 - diff --git a/Scripts/.config/Scripts/tmux_connect.sh b/Scripts/.config/Scripts/tmux_connect.sh deleted file mode 100755 index d524c57..0000000 --- a/Scripts/.config/Scripts/tmux_connect.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -# list existing tmux session in rofi -sel=$(tmux ls -F '#S' | rofi -dmenu -p "pick a session") - -# if sel is empty, create new session - -# if sel not empty, attach to this session -tmux attach -t $sel diff --git a/Scripts/.config/Scripts/vimrc b/Scripts/.config/Scripts/vimrc deleted file mode 100755 index 0a4c4cd..0000000 --- a/Scripts/.config/Scripts/vimrc +++ /dev/null @@ -1,175 +0,0 @@ -call plug#begin('~/.vim/plugged') - Plug 'junegunn/goyo.vim' - Plug '/usr/bin/fzf' - Plug 'junegunn/fzf.vim' - Plug 'itchyny/lightline.vim' - Plug 'dylanaraps/wal.vim' - Plug 'PotatoesMaster/i3-vim-syntax' - Plug 'LukeSmithxyz/vimling' - Plug 'vimwiki/vimwiki' - Plug 'scrooloose/nerdtree' - Plug 'digitaltoad/vim-pug' - Plug 'airblade/vim-gitgutter' - Plug 'ap/vim-css-color' - Plug 'mileszs/ack.vim' - Plug 'raimondi/delimitmate' - Plug 'rstacruz/sparkup' -call plug#end() - -" Some basics: - set nocompatible - filetype plugin on - syntax on - "colorscheme koehler - colorscheme wal - set encoding=utf-8 - set number - set relativenumber - set cursorline - let mapleader = "," - -" For saving view folds: - au BufWinLeave * mkview - " au BufWinEnter * silent loadview - -let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'} "Interpret .md files, etc. as .markdown - -" Spell-check set to F6: - map :setlocal spell! spelllang=en_ca - - -" Goyo plugin makes text more readable when writing prose: - map :Goyo - inoremap :Goyoa - - -" Enable Goyo by default for mutt writting - autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=72 - autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo - " Goyo's width will be the line limit in mutt. - -" Enable autocompletion: - set wildmode=longest,list,full - set wildmenu - -" Automatically deletes all tralling whitespace on save. - autocmd BufWritePre * %s/\s\+$//e - -" When shortcut files are updated, renew bash and ranger configs with new -" material: - autocmd BufWritePost ~/.config/Scripts/folders,~/.config/Scripts/configs !python ~/.config/Scripts/shortcuts.py - -" Runs a script that cleans out tex build files whenever I close out of a .tex file. - autocmd VimLeave *.tex !texclear - -"Copy selected text to system clipboard (requires gvim installed): - vnoremap "+y - -" Disables automatic commenting on newline: - autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o - -" C-T for new tab - nnoremap :tabnew - -" For normal mode when in terminals (in X I have caps mapped to esc, this replaces it when I don't have X) - inoremap jk - -"Shortcutting split navigation, saving a keypress: - map h - map j - map k - map l - -" Splits open at the bottom and right, which is non-retarded, unlike vim defaults. - set splitbelow splitright - -"Replace all is aliased to S. Visual mode shortcut doesn't work yet for some -"reason... - nnoremap S :%s//g - vnoremap S noop - vnoremap S :s//g - - vnoremap K xkP`[V`] - vnoremap J xp`[V`] - vnoremap L >gv - vnoremap H n :bp - nnoremap m :bn - nnoremap w :bd - - nmap , :w - set pastetoggle=v - - map gn :bn - map gp :bp - map gd :bd - -" toggle line chars view - "set listchars=eol:¬,tab:>,trail:~,extends:>,precedes:<,space:␣ - "set listchars=tab:│\ ,trail:·,extends:→ - "set listchars=tab:»\ ,extends:›,precedes:‹,nbsp:·,trail:· - set listchars=tab:→\ ,eol:↲,nbsp:␣,trail:•,extends:⟩,precedes:⟨ - noremap l :set list! - set list - -" fzf hotkey - map p :Files - -" lightline config - set noshowmode - set laststatus=2 - -" colorscheme nord - let g:lightline = { - \ 'active': { - \ 'left': [['mode', 'paste' ], ['readonly', 'filename', 'modified']], - \ 'right': [['lineinfo'], ['percent'], ['fileformat', 'fileencoding']] - \ }, - \ 'colorscheme': 'srcery_drk' - \ } - -" url from file - map u :wsilent !urlscan - -" compile groff or tex docs - " map c :! groff -ms -etpR % -Tps \| ps2pdf - %:r.pdf - map c :w! \| !compiler % - -" open pdfs html - map o :!opout % - -" open and edit the bib in a vsplit - map b :vsp~/Dropbox/Latex/references.bib - map B :vsp~/Dropbox/Latex/references.refer - " map r :vsp$REFER - -" Navigating with guides - inoremap /<++>"_c4l - vnoremap /<++>"_c4l - map /<++>"_c4l - -" Nerd tree - map :NERDTreeToggle - autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif - -" Git-gutter - set updatetime=100 - -" Silver searcher - if executable('ag') - let g:ackprg = 'ag --vimgrep' - endif - -" Tab settings - set tabstop=4 - set noexpandtab - autocmd Filetype css setlocal tabstop=2 - - -" Snippets - autocmd FileType bib inoremap ,a @article{author={<++>},year={<++>},title={<++>},journal={<++>},volume={<++>},pages={<++>},}<++>8kA,i - autocmd FileType bib inoremap ,b @book{author={<++>},year={<++>},title={<++>},publisher={<++>},}<++>6kA,i - autocmd FileType bib inoremap ,c @incollection{author={<++>},title={<++>},booktitle={<++>},editor={<++>},year={<++>},publisher={<++>},}<++>8kA,i - autocmd FileType bib inoremap ,o @online{title={<++>},url={<++>},year={<++>}}<++>5kA,i - diff --git a/Scripts/.config/Scripts/zerohosts b/Scripts/.config/Scripts/zerohosts deleted file mode 100755 index 63a2e56..0000000 --- a/Scripts/.config/Scripts/zerohosts +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/sh -# thuban -- thuban@yeuxdelibad.net. -# Idea from https://sebsauvage.net/wiki/doku.php?id=dns-blocklist -# Licence: MIT -# Script to generate a /etc/hosts file to blacklist ads -# Add yours in $MYHOSTS in a file passed as argument -# zerohosts file.txt - -set -e - -# DOWNLOADER (to standard output) -#D="wget -O-" # mosts linux -#D="curl -L" # with curl -D="ftp -o-" # OpenBSD - - -# Number of days befor updating the list -DAYS=7 - -# Run only if older than $DAYS -test -z "$(find /etc/hosts -mtime +${DAYS} )" && exit - -if [ -f "${1}" ]; then - MYHOSTS=$(cat "${1}") -else - MYHOSTS="" -fi - -HOSTSSRC=" -https://adaway.org/hosts.txt -https://someonewhocares.org/hosts/zero/hosts -https://hosts-file.net/ad_servers.txt -https://www.malwaredomainlist.com/hostslist/hosts.txt -http://winhelp2002.mvps.org/hosts.txt -https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext -" - -DOMAINSSRC=" -https://mirror.cedia.org.ec/malwaredomains/justdomains -https://mirror.cedia.org.ec/malwaredomains/immortal_domains.txt -https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt -https://feodotracker.abuse.ch/blocklist/?download=domainblocklist -https://zeustracker.abuse.ch/blocklist.php?download=baddomains -" - - -echo "" -echo "[zerohosts]: running" - -TMP=$(mktemp) - -echo "[zerohosts]: download lists" -for URL in ${HOSTSSRC}; do - echo "$URL" - ${D} "${URL}" >> "$TMP" -done - -for URL in ${DOMAINSSRC}; do - echo "$URL" - ${D} "${URL}" | \ - awk '{print "0.0.0.0 " $1}' >> "$TMP" -done - -# The following call sed several times. It is necessary because the -# filter must be applied in order. - -echo "[zerohosts]: filter lists" -sed -i -e 's/#.*$//g' $TMP -# Remove ^M -sed -i -e 's/ -//g' $TMP -# Remove empty lines -sed -i -e '/^[[:space:]]*$/d' $TMP - -# remove localhosts and ip6 -sed -i -e '/^.*:.*$/d' \ - -e '/^127\.0\.0\.1[[:space:]]*localhost.*$/d' \ - -e '/^255.*$/d' $TMP - -# 127.0.0.1 to 0.0.0.0 -sed -i -e 's/127.0.0.1/0.0.0.0/g' $TMP - -# remove lines with only one field, somes lists have this. -sed -i -e '/^0\.0\.0\.0[[:space:]]*$/d' $TMP - -echo "[zerohosts]: write /etc/hosts" -cat << EOF > /etc/hosts -$(date '+# %Y-%m-%d %H:%M:%S') -127.0.0.1 localhost -::1 localhost -0.0.0.0 0.0.0.0 -${MYHOSTS} - -$(tr -s '[:blank:]' < $TMP | sort -u) -EOF - -chmod 0644 /etc/hosts - -echo "[zerohosts]: delete tmp file $TMP" -rm $TMP - -echo "[zerohosts]: Bye :)" -exit 0 - - diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc index c2c9194..2612e23 100755 --- a/bspwm/.config/bspwm/bspwmrc +++ b/bspwm/.config/bspwm/bspwmrc @@ -3,9 +3,8 @@ pkill sxhkd sxhkd -c $HOME/.config/sxhkd/sxhkdrc & sxhkd -c $HOME/.config/sxhkd/sxhkdrc_bspwm & -MONS="$(xrandr --query | grep -w 'connected' | cut -d ' ' -f1)" -MON_COUNT=$(echo "$MONS" | wc -l) -PRIMARY=$(echo "$MONS" | head -n 1) +PRIMARY=$(xrandr --query | grep -w 'connected' | cut -d ' ' -f1 | head -n 1) +MON_COUNT=$(xrandr --listactivemonitors | sed '1d' | wc -l) if [ "$MON_COUNT" = 2 ] then -- cgit v1.2.3