Modify several files

This commit is contained in:
Oystein Kristoffer Tveit 2021-10-24 02:44:58 +02:00
parent 621b02a10a
commit 470384ac20
7 changed files with 267 additions and 170 deletions

View File

@ -3,14 +3,16 @@
# When using zsh, see also # When using zsh, see also
# $HOME/.oh-my-zsh/lib # $HOME/.oh-my-zsh/lib
export SCREENSHOT_DIR='$HOME/pictures/screenshots' export SCREENSHOT_DIR="$HOME/pictures/screenshots"
# ░█▀▀░█░█░▀█▀░░░█▀▀░█▀█░█▀▀░▀█▀░█░█░█▀█░█▀▄░█▀▀ # ░█▀▀░█░█░▀█▀░░░█▀▀░█▀█░█▀▀░▀█▀░█░█░█▀█░█▀▄░█▀▀
# ░█▀▀░▄▀▄░░█░░░░▀▀█░█░█░█▀▀░░█░░█▄█░█▀█░█▀▄░█▀▀ # ░█▀▀░▄▀▄░░█░░░░▀▀█░█░█░█▀▀░░█░░█▄█░█▀█░█▀▄░█▀▀
# ░▀▀▀░▀░▀░░▀░░░░▀▀▀░▀▀▀░▀░░░░▀░░▀░▀░▀░▀░▀░▀░▀▀▀ # ░▀▀▀░▀░▀░░▀░░░░▀▀▀░▀▀▀░▀░░░░▀░░▀░▀░▀░▀░▀░▀░▀▀▀
# Music player
alias m="ncmpcpp" alias m="ncmpcpp"
# Text editor
if command -v nvim &> /dev/null; then if command -v nvim &> /dev/null; then
alias vim="nvim" alias vim="nvim"
alias vi="nvim" alias vi="nvim"
@ -24,16 +26,21 @@ else
echo -e "\033[31m[ERROR] No vim program found on the system! Couldn't bind aliases!\033[0m" echo -e "\033[31m[ERROR] No vim program found on the system! Couldn't bind aliases!\033[0m"
fi fi
alias openfile='$HOME/.scripts/rofi/config-selector.py | xargs nvim'
# IPython
if command -v ipython &> /dev/null; then if command -v ipython &> /dev/null; then
alias p="ipython" alias p="ipython"
fi fi
# YouTube-dl
if command -v youtube-dl &> /dev/null; then if command -v youtube-dl &> /dev/null; then
alias youtube-dl-list='youtube-dl -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio" -o "%(playlist_index)s-%(title)s.%(ext)s"' alias youtube-dl-list='youtube-dl -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio" -o "%(playlist_index)s-%(title)s.%(ext)s"'
alias music-dl='youtube-dl --extract-audio -f "bestaudio[ext=m4a]/best"' alias music-dl='youtube-dl --extract-audio -f "bestaudio[ext=m4a]/best"'
alias music-dl-list='youtube-dl --extract-audio -f "bestaudio[ext=m4a]/best" -o "%(playlist_index)s-%(title)s.%(ext)s"' alias music-dl-list='youtube-dl --extract-audio -f "bestaudio[ext=m4a]/best" -o "%(playlist_index)s-%(title)s.%(ext)s"'
fi fi
# Screenshots
if command -v maim &> /dev/null; then if command -v maim &> /dev/null; then
alias skusho='maim --hidecursor --nokeyboard $(echo $SCREENSHOT_DIR)/$(date +%s).png' alias skusho='maim --hidecursor --nokeyboard $(echo $SCREENSHOT_DIR)/$(date +%s).png'
@ -42,37 +49,108 @@ if command -v maim &> /dev/null; then
fi fi
fi fi
if command -v rsync &> /dev/null; then # Scan listening ports
alias ccp='/usr/bin/cp'
alias cp='rsync --progress --human-readable'
alias cpr='rsync --progress --human-readable --recursive'
fi
if command -v bat &> /dev/null; then
alias ccat='/usr/bin/cat'
alias cat='bat'
fi
if command -v netstat &> /dev/null; then if command -v netstat &> /dev/null; then
alias ports='sudo netstat -tulpn | grep LISTEN' alias ports='sudo netstat -tulpn | grep LISTEN'
fi fi
# Latex Make
if command -v latexmk &> /dev/null; then if command -v latexmk &> /dev/null; then
alias view-latex='latexmk -pdf -pvc main.tex' alias view-latex='latexmk -pdf -pvc main.tex'
fi fi
# alias tangle-doom-emacs='cd $HOME/.doom.d && $HOME/.emacs.d/bin/org-tangle config.org && cd -' # Tmux reload
if command -v tmux &> /dev/null; then
alias reload-tmux='tmux source $HOME/.config/tmux/tmux.conf'
fi
# Ag replacement
if command -v rg &> /dev/null; then
alias ag='rg'
fi
# Xmonad recompilation
if command -v xmonad &> /dev/null; then if command -v xmonad &> /dev/null; then
alias xr='xmonad --recompile' alias xr='xmonad --recompile'
alias xmr='paru -S xmobar-git --noconfirm' alias xmr='paru -S xmobar-git --noconfirm'
alias xxmr='xr; xmr' alias xxmr='xr; xmr'
fi fi
if [[ -f $HOME/.scripts/dropbox.py ]]; then if [[ -f $HOME/.scripts/dropbox.py ]]; then
alias dp="python $HOME/.scripts/dropbox.py" alias dp="python $HOME/.scripts/dropbox.py"
alias openfile='$HOME/.scripts/rofi/config-selector.py | xargs nvim' fi
# ------------------------ System tools ------------------------ #
# cp
if command -v z &> /dev/null; then
alias cd='z'
fi
# cp
if command -v rsync &> /dev/null; then
alias ccp='/usr/bin/cp'
alias cp='rsync --progress --human-readable'
alias cpr='rsync --progress --human-readable --recursive'
fi
# cat
if command -v bat &> /dev/null; then
alias ccat='/usr/bin/cat'
# TODO: use mdcat if the file is a markdown file
alias cat='bat'
fi
# htop
if command -v bottom &> /dev/null; then
alias htop='bottom'
fi
# ps
if command -v procs &> /dev/null; then
alias ps='procs'
fi
# find
if command -v fd &> /dev/null; then
# At the current time, fd does not support the -m flag, which I have
# experienced that some software rely on. Therefore, it's gonna be aliased
# to fin
alias fin='fd'
fi
# xxd
if command -v hex &> /dev/null; then
alias xxd='hex'
fi
# uniq
if command -v runiq &> /dev/null; then
alias uniq='runiq'
fi
# cut
if command -v hck &> /dev/null; then
alias cut='hck'
fi
# ------------------------ Reminders ------------------------ #
# compression decompression
if command -v ouch &> /dev/null; then
alias zip='echo "Consider using ouch instead\n"; zip'
alias unzip='echo "Consider using ouch instead\n"; unzip'
alias tar='echo "Consider using ouch instead\n"; tar'
fi
# Make tool
if command -v just &> /dev/null; then
alias make='echo "Consider using just instead\n"; make'
fi
# Disk usage viewer
if command -v diskonaut &> /dev/null; then
alias ncdu='echo "Consider using diskonaut instead\n"; ncdu'
fi fi
# ░█▀▀░█▀█░█░░░█▀█░█▀▄ # ░█▀▀░█▀█░█░░░█▀█░█▀▄

View File

@ -128,37 +128,55 @@ draw_bold_text_with_bright_colors: false
colors: colors:
# Default colours # Default colours
primary: primary:
# MONOKAI
background: '0x272822' background: '0x272822'
foreground: '0xf8f8f2' foreground: '0xf8f8f2'
# PAPER
# background: '0xf2e3bd'
# foreground: '0x2f343f'
# Colors that should be used to draw the terminal cursor. If these are unset, # Colors that should be used to draw the terminal cursor. If these are unset,
# the cursor colour will be the inverse of the cell colour. # the cursor colour will be the inverse of the cell colour.
# cursor: # cursor:
# text: '0x2e2e2d' # text: '0x2e2e2d'
# # text: '0x000000' # text: '0x000000'
# cursor: '0xffffff' # cursor: '#20fccf'
# Normal colors # Normal colors
normal: normal:
black: '0x272822' # MONOKAI
red: '0xf92672' black: '#272822'
green: '0xa6e22e' red: '#f92672'
yellow: '0xf4bf75' green: '#a6e22e'
blue: '0x66d9ef' yellow: '#f4bf75'
magenta: '0xae81ff' blue: '#66d9ef'
cyan: '0xa1efe4' magenta: '#ae81ff'
white: '0xf8f8f2' cyan: '#a1efe4'
white: '#f8f8f2'
# PAPER
# black: '#222222'
# red: '#C30771'
# green: '#10A778'
# yellow: '#A89C14'
# blue: '#008ec4'
# magenta: '#523C79'
# cyan: '#20A5BA'
# white: '#f7f3ee'
# Bright colors # Bright colors
bright: # bright:
black: '0x75715e' # black: '#303030'
red: '0xf92672' # red: '#E32791'
green: '0xa6e22e' # green: '#5FD7A7'
yellow: '0xf4bf75' # yellow: '#F3E430'
blue: '0x66d9ef' # blue: '#B6D6FD'
magenta: '0xae81ff' # magenta: '#6855DE'
cyan: '0xa1efe4' # cyan: '#4FB8CC'
white: '0xf8f8f5' # white: '#f7f3ee'
# Dim colors (Optional) # Dim colors (Optional)
# dim: # dim:
@ -211,7 +229,7 @@ colors:
# indexed_colors: [] # indexed_colors: []
# Visual Bell # Visual Bell
#
# Any time the BEL code is received, Alacritty "rings" the visual bell. Once # Any time the BEL code is received, Alacritty "rings" the visual bell. Once
# rung, the terminal background will be set to white and transition back to the # rung, the terminal background will be set to white and transition back to the
# default background color. You can control the rate of this transition by # default background color. You can control the rate of this transition by
@ -463,6 +481,7 @@ cursor:
# - _ Underline # - _ Underline
# - | Beam # - | Beam
style: Block style: Block
blinking: On
# If this is `true`, the cursor will be rendered as a hollow box when the # If this is `true`, the cursor will be rendered as a hollow box when the
# window is not focused. # window is not focused.

View File

@ -2,29 +2,9 @@
name = h7x4 name = h7x4
email = h7x4abk3g@protonmail.com email = h7x4abk3g@protonmail.com
[init]
defaultBranch = main
[alias]
aliases = !git config --get-regexp alias | sed -re 's/alias\\.(\\S*)\\s(.*)$/\\1 = \\2/g'
uncommit = "reset --soft HEAD^"
rev = "checkout HEAD -- "
revall = "checkout ."
unadd = "rm --cached "
delete-merged = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
mkbr = "checkout -b"
mvbr = "branch -m"
rmbr = "branch -d"
rrmbr = "push origin --delete"
graph = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"
graphv = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"
g = !"git graph"
[core] [core]
excludesfile = ~/.gitignore excludesfile = ~/.config/git/ignore
attributesfile = ~/.gitattributes attributesfile = ~/.config/git/attributes
# Treat spaces before tabs and all kinds of trailing whitespace as an error. # Treat spaces before tabs and all kinds of trailing whitespace as an error.
# [default] trailing-space: looks for spaces at the end of a line # [default] trailing-space: looks for spaces at the end of a line
@ -37,29 +17,60 @@
editor = nvim editor = nvim
pager = less pager = less
[alias]
aliases = !git config --get-regexp alias | sed -re 's/alias\\.(\\S*)\\s(.*)$/\\1 = \\2/g'
uncommit = "reset --soft HEAD^"
rev = "checkout HEAD -- "
revall = "checkout ."
; unstage = "rm --cached "
unstage = "restore --staged "
delete-merged = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
mkbr = "checkout -b"
mvbr = "branch -m"
rmbr = "branch -d"
rrmbr = "push origin --delete"
graph = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"
graphv = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"
g = !"git graph"
# Colors
[color "branch"]
upstream = cyan
[color] [color]
ui = auto ui = auto
[github] # Commands
user = h7x4abk3g
[filter "lfs"] [init]
required = true defaultBranch = main
smudge = git-lfs smudge -- %f
process = git-lfs filter-process [fetch]
clean = git-lfs clean -- %f prune = true
[pull]
rebase = true
[push]
default = current
[merge]
tool = nvimdiff
conflictstyle = diff3
colorMoved = zebra
[mergetool]
keepBackup = false
[mergetool "nvimdiff"]
cmd = "nvim -d $BASE $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'"
[diff] [diff]
mnemonicPrefix = true mnemonicPrefix = true
renames=true renames=true
tool = nvimdiff tool = nvimdiff
[merge]
tool = nvimdiff
conflictstyle = diff3
[mergetool]
keepBackup = false
[mergetool "nvimdiff"]
cmd = "nvim -d $BASE $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'"
[grep] [grep]
break = true break = true
@ -67,7 +78,14 @@
lineNumber = true lineNumber = true
extendedRegexp = true extendedRegexp = true
# URL Stuff [instaweb]
local = true
port = 9876
# Upstream
[github]
user = h7x4abk3g
[url "git@github.com:"] [url "git@github.com:"]
insteadOf = "gh:" insteadOf = "gh:"
@ -95,6 +113,12 @@
pushInsteadOf = "ntnu:" pushInsteadOf = "ntnu:"
pushInsteadOf = "git://gitlab.stud.idi.ntnu.no/" pushInsteadOf = "git://gitlab.stud.idi.ntnu.no/"
# Colors # Misc
[color "branch"] [web]
upstream = cyan browser = google-chrome-stable
[filter "lfs"]
required = true
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
clean = git-lfs clean -- %f

View File

@ -48,10 +48,10 @@ XF86MonBrightnessDown
light -U 5 light -U 5
@Print @Print
skushoclip maim --hidecursor --nokeyboard --select | xclip -selection clipboard -target image/png -in
shift + @Print shift + @Print
skusho maim --hidecursor --nokeyboard $SCREENSHOT_DIR/$(date +%s).png
super + @Print super + @Print
boomer boomer

View File

@ -1,58 +1,8 @@
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Split panes using gh
bind h split-window -h -c "#{pane_current_path}"
bind g split-window -v -c "#{pane_current_path}"
unbind '"' # Unbind default vertical split
unbind % # Unbind default horizontal split
# Reload config
unbind r
bind r \
source-file $XDG_CONFIG_HOME/tmux/tmux.conf\;\
display-message 'Reloaded tmux.conf'
# Switch panes using Alt-hjkl without prefix
bind -n C-h select-pane -L
bind -n C-j select-pane -D
bind -n C-k select-pane -U
bind -n C-l select-pane -R
# Resize pane
bind -n M-H resize-pane -L 5
bind -n M-J resize-pane -D 5
bind -n M-K resize-pane -U 5
bind -n M-L resize-pane -R 5
# Fullscreen current pane
unbind z
bind M-z resize-pane -Z
unbind &
bind BSpace killp
# Swap clock-mode and new-window
unbind c
unbind t
bind c clock-mode
bind t new-window
# Setup 'y' to yank (copy)
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi 'V' send -X select-line
bind-key -T copy-mode-vi 'r' send -X rectangle-toggle
# OTHER SETTINGS
# Don't rename windows automatically after rename with ',' # Don't rename windows automatically after rename with ','
set-option -g allow-rename off set-option -g allow-rename off
set -g mouse on set -g mouse on
set -q -g status-utf8 on
setw -q -g utf8 on setw -q -g utf8 on
# setw -g mode-keys vi # setw -g mode-keys vi
set-option -g default-terminal screen-256color set-option -g default-terminal screen-256color
@ -68,6 +18,60 @@ set -g status-right-length 150
set -g base-index 1 set -g base-index 1
set -g pane-base-index 0 set -g pane-base-index 0
######################
######## KEYS ########
######################
# Remap prefix from 'C-b' to 'C-a'
# Comments will use '$P' as prefix
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Split panes using $P-[gh]
bind h split-window -h -c "#{pane_current_path}"
bind g split-window -v -c "#{pane_current_path}"
unbind '"' # Unbind default vertical split
unbind % # Unbind default horizontal split
# Reload config using $P-r
unbind r
bind r \
source-file $XDG_CONFIG_HOME/tmux/tmux.conf\;\
display-message 'Reloaded tmux.conf'
# Switch panes using Alt-[hjkl]
bind -n C-h select-pane -L
bind -n C-j select-pane -D
bind -n C-k select-pane -U
bind -n C-l select-pane -R
# Resize pane using Alt-Shift-[hjkl]
bind -n M-H resize-pane -L 5
bind -n M-J resize-pane -D 5
bind -n M-K resize-pane -U 5
bind -n M-L resize-pane -R 5
# Fullscreen current pane using $P-Alt-z
unbind z
bind M-z resize-pane -Z
# Kill pane using $P-Backspace
unbind &
bind BSpace killp
# Swap clock-mode and new-window
# New tab: $P-t
# Clock mode: $P-c
unbind c
unbind t
bind c clock-mode
bind t new-window
# Setup 'y' to yank (copy)
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi 'V' send -X select-line
bind-key -T copy-mode-vi 'r' send -X rectangle-toggle
###################### ######################
### DESIGN CHANGES ### ### DESIGN CHANGES ###
@ -79,8 +83,6 @@ set-window-option -g window-status-current-style fg=magenta
set-option -g status-style 'bg=black fg=default' set-option -g status-style 'bg=black fg=default'
set-option -g default-shell '/bin/zsh' set-option -g default-shell '/bin/zsh'
#OTHER DESIGN CHANGES
set -g status-position bottom set -g status-position bottom
set -g status-interval 4 set -g status-interval 4
set -g status-justify centre # center align window list set -g status-justify centre # center align window list
@ -89,39 +91,11 @@ setw -g status-bg default
setw -g window-status-format '#[bg=#888888]#[fg=black,bold] #I #[bg=default] #[fg=#888888]#W ' setw -g window-status-format '#[bg=#888888]#[fg=black,bold] #I #[bg=default] #[fg=#888888]#W '
setw -g window-status-current-format '#[fg=black,bold]#[bg=cyan] #I #[fg=cyan]#[bg=default] #W ' setw -g window-status-current-format '#[fg=black,bold]#[bg=cyan] #I #[fg=cyan]#[bg=default] #W '
# # loud or quiet? #######################
# set -g visual-activity off ####### PLUGINS #######
# set -g visual-bell off #######################
# set -g visual-silence off
# setw -g monitor-activity off
# set -g bell-action none
# # modes # tmux-thumbs - rewrite of tmux-fingers, copy pasting using hints
# setw -g clock-mode-colour colour5 run-shell $HOME/.config/tmux/plugins/tmux-thumbs/tmux-thumbs.tmux
# setw -g mode-style 'fg=colour1 bg=colour18 bold'
# # panes
# set -g pane-border-style 'fg=colour8 bg=colour0'
# set -g pane-active-border-style 'bg=colour0 fg=colour2'
# # statusbar
# set -g status-position bottom
# set -g status-justify left
# set -g status-style 'bg=color2 fg=colour2 dim'
# set -g status-left ''
# set -g status-right '#[fg=colour233,bg=colour19] %d/%m #[fg=colour233,bg=colour8] %H:%M:%S '
# set -g status-right-length 50
# set -g status-left-length 20
# setw -g window-status-current-style 'fg=colour2 bg=colourbackground bold'
# setw -g window-status-current-format ' #I#[fg=colour2]:#[fg=colour2]#W#[fg=colour2]#F '
# setw -g window-status-style 'fg=colour8 bg=colour18'
# setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
# setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold'
# # messages
# set -g message-style 'fg=colour232 bg=colour16 bold'
# vim: filetype=.tmux.conf: # vim: filetype=.tmux.conf:

View File

@ -4,10 +4,12 @@
# alias disable-touch="xinput set-prop 16 'Device Enabled' 0" # alias disable-touch="xinput set-prop 16 'Device Enabled' 0"
# alias enable-touch ="xinput set-prop 16 'Device Enabled' 1" # alias enable-touch ="xinput set-prop 16 'Device Enabled' 1"
alias turnOffScreenHDMI="xrandr --output DP-3 --off" alias updateWallpaper="feh --bg-fill $HOME/Dropbox/bilder/Wallpapers/pixiv/80242900_p0.jpg"
alias doubleScreenHDMI="xrandr --output DP-3 --mode 1920x1080"
alias extendScreenHDMI="xrandr --output DP-3 --mode 1920x1080 --right-of eDP-1"
alias turnOffScreenUSBC="xrandr --output DP-1 --off" alias turnOffScreenHDMI="xrandr --output DP-3 --off && updateWallpaper"
alias doubleScreenUSBC="xrandr --output DP-1 --mode 1920x1080" alias doubleScreenHDMI="xrandr --output DP-3 --mode 1920x1080 && updateWallpaper"
alias extendScreenUSBC="xrandr --output DP-1 --mode 1920x1080 --right-of eDP-1" alias extendScreenHDMI="xrandr --output DP-3 --mode 1920x1080 --right-of eDP-1 && updateWallpaper"
alias turnOffScreenUSBC="xrandr --output DP-1 --off && updateWallpaper"
alias doubleScreenUSBC="xrandr --output DP-1 --mode 1920x1080 && updateWallpaper"
alias extendScreenUSBC="xrandr --output DP-1 --mode 1920x1080 --right-of eDP-1 && updateWallpaper"

View File

@ -44,7 +44,7 @@ Config {
Run Memory ["-t","<usedratio>%"] 10, Run Memory ["-t","<usedratio>%"] 10,
Run Swap ["-t", "<usedratio>%"] 100, Run Swap ["-t", "<usedratio>%"] 100,
Run Date "%a %_d %b %H:%M" "date" 10, Run Date "%a %_d %b - %H:%M - W%W" "date" 10,
Run Com "/home/h7x4/.config/xmobar/scripts/mpd_status.sh" [] "mpc" 10, Run Com "/home/h7x4/.config/xmobar/scripts/mpd_status.sh" [] "mpc" 10,
-- Run Com "/home/h7x4/.config/xmobar/scripts/wireless.sh" [] "wi" 100, -- Run Com "/home/h7x4/.config/xmobar/scripts/wireless.sh" [] "wi" 100,
Run Com "/home/h7x4/.config/xmobar/scripts/volume.py" [] "vol" 10, Run Com "/home/h7x4/.config/xmobar/scripts/volume.py" [] "vol" 10,