diff --git a/.bashrc b/.bashrc index 490a6c2..1569ca6 100644 --- a/.bashrc +++ b/.bashrc @@ -60,7 +60,7 @@ function _myps1() { local __git_status='`parse_git_dirty`' local __ps1end="\[\033[00m\]$> $__space" local __dir="\[\033[38;5;7m\]\w" - PS1="$__name_hostname $__space$__dir$__git_branch $__ps1end" + PS1=" $__dir$__git_branch $__ps1end" } _myps1 @@ -78,33 +78,35 @@ pfetch #extract script from DistroTube's dotfiles repo ex () { - if [ -f $1 ] ; then - case $1 in - *.tar.bz2) tar xjf $1 ;; - *.tar.gz) tar xzf $1 ;; - *.bz2) bunzip2 $1 ;; - *.rar) unrar x $1 ;; - *.gz) gunzip $1 ;; - *.tar) tar xf $1 ;; - *.tbz2) tar xjf $1 ;; - *.tgz) tar xzf $1 ;; - *.zip) unzip $1 ;; - *.Z) uncompress $1;; - *.7z) 7z x $1 ;; - *) echo "'$1' cannot be extracted via ex()" ;; - esac - else - echo "'$1' is not a valid file" - fi + if [ -f $1 ] ; then + case $1 in + *.tar.bz2) tar xjf $1 ;; + *.tar.gz) tar xzf $1 ;; + *.bz2) bunzip2 $1 ;; + *.rar) unrar x $1 ;; + *.gz) gunzip $1 ;; + *.tar) tar xf $1 ;; + *.tbz2) tar xjf $1 ;; + *.tgz) tar xzf $1 ;; + *.zip) unzip $1 ;; + *.Z) uncompress $1;; + *.7z) 7z x $1 ;; + *) echo "'$1' cannot be extracted via ex()" ;; + esac + else + echo "'$1' is not a valid file" + fi } -#Aliases +#Default export EDITOR="nvim" export BROWSER='firefox' export TERMINAL='urxvt' #Askpass export SUDO_ASKPASS=/usr/bin/rofi-askpass + +#XDG export XDG_CACHE_HOME="$HOME/.cache" export XDG_DATA_HOME="$HOME/.local/share" export XDG_CONFIG_HOME="$HOME/.config" @@ -113,12 +115,20 @@ export XDG_CONFIG_HOME="$HOME/.config" export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | source $MYVIMRC' #Aliases +alias nano='nvim' alias vim='nvim' +alias vi='nvim' alias weather='curl wttr.in' alias pac='sudo pacman' alias pacS='sudo pacman -S' +alias pacSy='sudo pacman -Sy' +alias pacSyu='sudo pacman -Syu' +alias pacR='sudo pacman -R' alias aur='yay' alias aurS='yay -S' +alias aurSy='yay -Sy' +alias aurSyu='yay -Syu' +alias aurR='yay -R' alias spotifyrip='spotify-ripper -u palembani@gmail.com' alias xreload='xrdb ~/.Xresources' alias ytv='youtube-viewer' @@ -134,12 +144,14 @@ alias cls='clear' alias classprop='xprop WM_CLASS' alias storagelist='lsblk -f' alias ..='cd ..' +alias ...='cd ../..' alias ls='exa --color=always' alias ll='ls -alF' alias l='ls -CF' alias la='ls -a' alias cfvim='vim $XDG_CONFIG_HOME/vim/vimrc' alias cfbash='vim $HOME/.bashrc' +alias cfzsh='vim $HOME/.zshrc' alias cfbsp='vim $XDG_CONFIG_HOME/bspwm/bspwmrc' alias cfpoly='vim $XDG_CONFIG_HOME/polybar/config' alias cfkeys='vim $XDG_CONFIG_HOME/sxhkd/sxhkdrc' diff --git a/.config/qtile/config.py b/.config/qtile/config.py index 48ad0bc..dadbfb9 100755 --- a/.config/qtile/config.py +++ b/.config/qtile/config.py @@ -22,6 +22,7 @@ import os import re import socket import subprocess +from keys import keys from libqtile.config import Key, Screen, Group, Drag, Click, Match from libqtile.command import lazy from libqtile import layout, bar, widget, hook @@ -44,213 +45,10 @@ def dbus_register(): 'string:' + id]) -##### DEFINING SOME WINDOW FUNCTIONS ##### - -@lazy.function -def window_to_prev_group(qtile): - if qtile.currentWindow is not None: - i = qtile.groups.index(qtile.currentGroup) - qtile.currentWindow.togroup(qtile.groups[i - 1].name) - -@lazy.function -def window_to_next_group(qtile): - if qtile.currentWindow is not None: - i = qtile.groups.index(qtile.currentGroup) - qtile.currentWindow.togroup(qtile.groups[i + 1].name) - -##### LAUNCH APPS IN SPECIFIED GROUPS ##### - -def app_or_group(group, app): - def f(qtile): - if qtile.groupMap[group].windows: - qtile.groupMap[group].cmd_toscreen() - else: - qtile.groupMap[group].cmd_toscreen() - qtile.cmd_spawn(app) - return f - ##### KEYBINDINGS ##### def init_keys(): - keys = [ - Key( - [mod, 'control'], 'q', - lazy.spawn('sh /home/ziro/.scripts/prompt') - ), - Key( - [mod], "Return", - lazy.spawn(myTerm) # Open terminal - ), - Key( - [mod], "Tab", - lazy.next_layout() # Toggle through layouts - ), - Key( - [mod], "q", - lazy.window.kill() # Kill active window - ), - Key( - [mod, "shift"], "r", - lazy.restart() # Restart Qtile - ), - Key( - [mod, "shift"], "q", - lazy.shutdown() # Shutdown Qtile - ), - Key([mod], "w", - lazy.to_screen(0) # Keyboard focus screen(0) - ), - Key([mod], "e", - lazy.to_screen(1) # Keyboard focus screen(1) - ), - Key([mod], "r", - lazy.to_screen(2) # Keyboard focus screen(2) - ), -# Key([mod, "control"], "k", -# lazy.layout.section_up() # Move up a section in treetab -# ), -# Key([mod, "control"], "j", -# lazy.layout.section_down() # Move down a section in treetab -# ), - ### Window controls - Key( - [mod], "k", - lazy.layout.down() # Switch between windows in current stack pane - ), - Key( - [mod], "i", - lazy.layout.up() # Switch between windows in current stack pane - ), - Key( - [mod], "j", - lazy.layout.left() # Switch between windows in current stack pane - ), - Key( - [mod], "l", - lazy.layout.right() # Switch between windows in current stack pane - ), - Key( - [mod, "shift"], "k", - lazy.layout.shuffle_down() # Move windows down in current stack - ), - Key( - [mod, "shift"], "i", - lazy.layout.shuffle_up() # Move windows up in current stack - ), - Key( - [mod, "shift"], "j", - lazy.layout.shuffle_left() # Move windows down in current stack - ), - Key( - [mod, "shift"], "l", - lazy.layout.shuffle_right() # Move windows up in current stack - ), - Key( - [mod, "shift"], "period", - lazy.layout.grow(), # Grow size of current window (XmonadTall) - lazy.layout.increase_nmaster(), # Increase number in master pane (Tile) - ), - Key( - [mod, "shift"], "comma", - lazy.layout.shrink(), # Shrink size of current window (XmonadTall) - lazy.layout.decrease_nmaster(), # Decrease number in master pane (Tile) - ), - Key( - [mod, "shift"], "Left", # Move window to workspace to the left - window_to_prev_group - ), - Key( - [mod, "shift"], "Right", - window_to_next_group - ), - Key( - [mod], "n", - lazy.layout.normalize() - ), - Key( - [mod], "m", - lazy.layout.maximize() - ), - Key( - [mod, "shift"], "p", - lazy.window.toggle_floating() - ), - Key( - [mod, "shift"], "space", - lazy.layout.rotate(), - lazy.layout.flip() - ), - ### Stack controls - Key( - ["mod1"], "space", - lazy.layout.next() - ), - Key( - [mod, "control"], "Return", - lazy.layout.toggle_split() - ), - - ### Dmenu Run Launcher - Key( - ["mod4"], "space", - lazy.spawn("dmenu_run -fn 'Google Sans:size=8' -nb '#282a36' -nf '#ffffff' -sb '#00a8ff' -sf '#282a36' -p 'dmenu:'") - ), - - ### Application Launch Shortcuts - Key( - [mod, "mod1"], "k", - lazy.spawn("passmenu") - ), - Key( - [mod, "mod1"], "Print", - lazy.spawn("gnome-screenshot") - ), - Key( - [mod, "mod1"], "p", - lazy.spawn("sh /home/ziro/.scripts/play.sh") - ), - Key( - [mod, "mod1"], "m", - lazy.spawn("sh /home/ziro/.scripts/musicplayer.sh") - ), - Key( - [mod, "mod1"], "v", - lazy.spawn("sh /home/ziro/.scripts/video.sh") - ), - Key( - [mod, "mod1"], "c", - lazy.spawn(myTerm+" -e calcurse") - ), - Key( - [mod, "mod1"], "u", - lazy.spawn("sh /home/ziro/.scripts/dmenumount") - ), - Key( - [mod, "mod1"], "y", - lazy.spawn(myTerm+" -e youtube-viewer") - ), - Key( - [mod, "mod1"], "b", - lazy.spawn("firefox") - ), - Key( - [mod, "mod1"], "g", - lazy.spawn("/home/ziro/my\ Files/Gravit/GravitDesigner.AppImage") - ), - Key( - [mod, "mod1"], "o", - lazy.spawn("obs") - ), - #myCustom Stuff - Key( - [mod], "leftarrow", - lazy.screen.next_group() - ), - Key( - [mod], "rightarrow", - lazy.screen.prev_group() - ), - ] + keys return keys ##### BAR COLORS ##### diff --git a/.config/qtile/keys.py b/.config/qtile/keys.py new file mode 100755 index 0000000..c52f696 --- /dev/null +++ b/.config/qtile/keys.py @@ -0,0 +1,208 @@ +from libqtile.config import key, screen, group, drag, click, match +from libqtile.command import lazy + +mod = 'mod4' +mod = "mod4" # Sets mod key to SUPER/WINDOWS +myTerm = "urxvt" # My terminal of choice +myConfig = "/home/ziro/.config/qtile/config.py" # Qtile config file location + +def app_or_group(group, app): + def f(qtile): + if qtile.groupMap[group].windows: + qtile.groupMap[group].cmd_toscreen() + else: + qtile.groupMap[group].cmd_toscreen() + qtile.cmd_spawn(app) + return f + +@lazy.function +def window_to_prev_group(qtile): + if qtile.currentWindow is not None: + i = qtile.groups.index(qtile.currentGroup) + qtile.currentWindow.togroup(qtile.groups[i - 1].name) + +@lazy.function +def window_to_next_group(qtile): + if qtile.currentWindow is not None: + i = qtile.groups.index(qtile.currentGroup) + qtile.currentWindow.togroup(qtile.groups[i + 1].name) + +keys = [ + Key( + [mod, 'control'], 'q', + lazy.spawn('sh /home/ziro/.scripts/prompt') + ), + Key( + [mod], "Return", + lazy.spawn(myTerm) # Opn terminal + ), + Key( + [mod], "Tab", + lazy.next_layout() # Toggle through layouts + ), + Key( + [mod], "q", + lazy.window.kill() # Kill active window + ), + Key( + [mod, "shift"], "r", + lazy.restart() # Restart Qtile + ), + Key( + [mod, "shift"], "q", + lazy.shutdown() # Shutdown Qtile + ), + Key([mod], "w", + lazy.to_screen(0) # Keyboard focus screen(0) + ), + Key([mod], "e", + lazy.to_screen(1) # Keyboard focus screen(1) + ), + Key([mod], "r", + lazy.to_screen(2) # Keyboard focus screen(2) + ), +# Key([mod, "control"], "k", +# lazy.layout.section_up() # Move up a section in treetab +# ), +# Key([mod, "control"], "j", +# lazy.layout.section_down() # Move down a section in treetab +# ), + ### Window controls + Key( + [mod], "k", + lazy.layout.down() # Switch between windows in current stack pane + ), + Key( + [mod], "i", + lazy.layout.up() # Switch between windows in current stack pane + ), + Key( + [mod], "j", + lazy.layout.left() # Switch between windows in current stack pane + ), + Key( + [mod], "l", + lazy.layout.right() # Switch between windows in current stack pane + ), + Key( + [mod, "shift"], "k", + lazy.layout.shuffle_down() # Move windows down in current stack + ), + Key( + [mod, "shift"], "i", + lazy.layout.shuffle_up() # Move windows up in current stack + ), + Key( + [mod, "shift"], "j", + lazy.layout.shuffle_left() # Move windows down in current stack + ), + Key( + [mod, "shift"], "l", + lazy.layout.shuffle_right() # Move windows up in current stack + ), + Key( + [mod, "shift"], "period", + lazy.layout.grow(), # Grow size of current window (XmonadTall) + lazy.layout.increase_nmaster(), # Increase number in master pane (Tile) + ), + Key( + [mod, "shift"], "comma", + lazy.layout.shrink(), # Shrink size of current window (XmonadTall) + lazy.layout.decrease_nmaster(), # Decrease number in master pane (Tile) + ), + Key( + [mod, "shift"], "Left", # Move window to workspace to the left + window_to_prev_group + ), + Key( + [mod, "shift"], "Right", + window_to_next_group + ), + Key( + [mod], "n", + lazy.layout.normalize() + ), + Key( + [mod], "m", + lazy.layout.maximize() + ), + Key( + [mod, "shift"], "p", + lazy.window.toggle_floating() + ), + Key( + [mod, "shift"], "space", + lazy.layout.rotate(), + lazy.layout.flip() + ), + ### Stack controls + Key( + ["mod1"], "space", + lazy.layout.next() + ), + Key( + [mod, "control"], "Return", + lazy.layout.toggle_split() + ), + + ### Dmenu Run Launcher + Key( + ["mod4"], "space", + lazy.spawn("dmenu_run -fn 'Google Sans:size=8' -nb '#282a36' -nf '#ffffff' -sb '#00a8ff' -sf '#282a36' -p 'dmenu:'") + ), + + ### Application Launch Shortcuts + Key( + [mod, "mod1"], "k", + lazy.spawn("passmenu") + ), + Key( + [mod, "mod1"], "Print", + lazy.spawn("gnome-screenshot") + ), + Key( + [mod, "mod1"], "p", + lazy.spawn("sh /home/ziro/.scripts/play.sh") + ), + Key( + [mod, "mod1"], "m", + lazy.spawn("sh /home/ziro/.scripts/musicplayer.sh") + ), + Key( + [mod, "mod1"], "v", + lazy.spawn("sh /home/ziro/.scripts/video.sh") + ), + Key( + [mod, "mod1"], "c", + lazy.spawn(myTerm+" -e calcurse") + ), + Key( + [mod, "mod1"], "u", + lazy.spawn("sh /home/ziro/.scripts/dmenumount") + ), + Key( + [mod, "mod1"], "y", + lazy.spawn(myTerm+" -e youtube-viewer") + ), + Key( + [mod, "mod1"], "b", + lazy.spawn("firefox") + ), + Key( + [mod, "mod1"], "g", + lazy.spawn("/home/ziro/my\ Files/Gravit/GravitDesigner.AppImage") + ), + Key( + [mod, "mod1"], "o", + lazy.spawn("obs") + ), + #myCustom Stuff + Key( + [mod], "leftarrow", + lazy.screen.next_group() + ), + Key( + [mod], "rightarrow", + lazy.screen.prev_group() + ), + ] diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 91ee586..c955fda 100755 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -7,23 +7,29 @@ set viminfo+='1000,n$XDG_DATA_HOME/vim/viminfo set runtimepath=$XDG_CONFIG_HOME/vim,$VIMRUNTIME,$XDG_CONFIG_HOME/vim/after let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" +" +set encoding=UTF-8 +" + " - Mapping + Settings noremap "*y noremap "*p noremap "+y noremap "+p -noremap NERDCommenterToggle +noremap :NERDCommenterToggle :set mouse=a -autocmd FileType python map :w:exec '!clear; python3' shellescape(@%, 1) -autocmd FileType python imap :w:exec '!clear; python3' shellescape(@%, 1) +autocmd FileType python map :w:!clear; python3 % +autocmd FileType python imap :w:exec '!clear; python3 %' set number autocmd FileType plaintex command! -nargs=0 Lw w !pdflatex % > /dev/null autocmd FileType tex command! -nargs=0 Lw w !pdflatex % > /dev/null set ignorecase set smartcase +map :NERDTreeToggle " Sw (sudo w) to save as root command! -nargs=0 W w !sudo tee % > /dev/null +cmap w!! w !sudo tee > /dev/null % " - Auto refresh vimrc augroup myvimrc @@ -53,19 +59,22 @@ Plug 'autozimu/LanguageClient-neovim', { \ } Plug 'SirVer/ultisnips' Plug 'honza/vim-snippets' -if has('nvim') - Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } -else - Plug 'Shougo/deoplete.nvim' - Plug 'roxma/nvim-yarp' - Plug 'roxma/vim-hug-neovim-rpc' -endif +"if has('nvim') +" Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } +"else +" Plug 'Shougo/deoplete.nvim' +" Plug 'roxma/nvim-yarp' +" Plug 'roxma/vim-hug-neovim-rpc' +"endif Plug 'preservim/nerdcommenter' +Plug 'ycm-core/YouCompleteMe' +Plug 'preservim/nerdtree' +Plug 'ryanoasis/vim-devicons' call plug#end() -" - deoplete -let g:deoplete#enable_at_startup = 1 +" - YouCompleteMe +let g:ycm_autoclose_preview_window_after_completion = 1 " - Powerline Integraton let g:airline_powerline_fonts = 1 @@ -75,7 +84,7 @@ let g:airline_theme='onedark' " - Snippet -let g:UltiSnipsExpandTrigger="" -let g:UltiSnipsJumpForwardTrigger="" +let g:UltiSnipsExpandTrigger="" +let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" let g:UltiSnipsEditSplit="vertical" diff --git a/.config/zsh/aliases b/.config/zsh/aliases index f860341..749cdf6 100644 --- a/.config/zsh/aliases +++ b/.config/zsh/aliases @@ -1,5 +1,8 @@ #!/usr/bin/env bash +#sudo +alias sudo='sudo ' + #vim alias nano='nvim' alias vim='nvim' @@ -39,6 +42,7 @@ alias classprop='xprop WM_CLASS' alias storagelist='lsblk -f' alias ..='cd ..' alias ...='cd ../..' +alias q='exit' alias ls='exa --color=always' alias ll='ls -alF' alias l='ls -CF' @@ -56,6 +60,9 @@ alias htop='htop -t' alias rm='rm -i' alias mv='mv -i' alias cp='cp -i' +alias mntfd='sudo mount -o gid=users,fmask=113,dmask=002' +alias umntfd='sudo umount' +alias cmatrix='unimatrix -n -s 96 -l 'o'' #Git Aliases alias gs='git status' diff --git a/.zshrc b/.zshrc index 88a3a3b..b86066d 100644 --- a/.zshrc +++ b/.zshrc @@ -1,7 +1,9 @@ # If you come from bash you might have to change your $PATH. # export PATH=$HOME/bin:/usr/local/bin:$PATH +# colors +autoload -U colors && colors -#XDG +# XDG export XDG_CACHE_HOME="$HOME/.cache" export XDG_DATA_HOME="$HOME/.local/share" export XDG_CONFIG_HOME="$HOME/.config" @@ -14,7 +16,8 @@ PATH="$HOME/.local/bin${PATH:+:${PATH}}" # Path to your oh-my-zsh installation. export ZSH="$XDG_DATA_HOME/oh-my-zsh" -export ZSH_CUSTOM="$ZSH" +export ZSH_CUSTOM="$ZSH/custom" +export PLUGINS="$XDG_DATA_HOME/zsh/plugins" # History in cache directory HISTFILE=~/.cache/zsh/zsh_history @@ -22,14 +25,15 @@ HISTSIZE=1000 SAVEHIST=1000 # Theme -ZSH_THEME="spaceship" +ZSH_THEME="zi" -# Plugins -plugins=( -git -) - -source $ZSH/oh-my-zsh.sh +# Completion (from Luke Smith) +# Basic auto/tab complete: +autoload -U compinit +zstyle ':completion:*' menu select +zmodload zsh/complist +compinit +_comp_options+=(globdots) # Include hidden files. # Default if [[ -n $SSH_CONNECTION ]]; then @@ -46,5 +50,16 @@ export SUDO_ASKPASS=/usr/bin/rofi-askpass #vim export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | source $MYVIMRC' +#binding/alias [ -f ~/.config/zsh/aliases ] && source ~/.config/zsh/aliases +# vi mode +#bindkey -v +#export KEYTIMEOUT=1 + +# Plugins +plugins=( +git +zsh-syntax-highlighting +) +source $ZSH/oh-my-zsh.sh