mirror of https://github.com/ericonr/dotfiles.git
Initial commit.
This commit is contained in:
parent
475f5c45c1
commit
52a3d7cc18
|
@ -0,0 +1,2 @@
|
|||
alias arduino-uno='arduino-cli compile --fqbn arduino:avr:uno'
|
||||
alias arduino-leonardo='arduino-cli compile --fqbn arduino:avr:leonardo'
|
|
@ -0,0 +1,17 @@
|
|||
function openocdfast -a interface target
|
||||
openocd -f interface/$interface.cfg -f target/$target.cfg
|
||||
end
|
||||
|
||||
function openocdstlink -a target
|
||||
openocdfast stlink $target
|
||||
end
|
||||
|
||||
function openocdcmsis -a target
|
||||
openocdfast cmsis-dap $target
|
||||
end
|
||||
|
||||
alias arm-ugdb='ugdb --gdb arm-none-eabi-gdb'
|
||||
|
||||
function arm-ugdb-tmux
|
||||
tmux new-window -n ugdb-arm ugdb --gdb arm-none-eabi-gdb $argv
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
alias set-can='sudo ip link set up can0 type can bitrate 500000'
|
||||
alias can0dump='candump can0'
|
||||
|
||||
function can0filt
|
||||
candump can0,$0:7ff
|
||||
end
|
|
@ -0,0 +1,58 @@
|
|||
alias jpnb='jupyter-notebook'
|
||||
|
||||
alias cformat='clang-format -i -style=webkit'
|
||||
|
||||
function statusgit --argument show
|
||||
if test -z $show
|
||||
set show_status false
|
||||
else
|
||||
set show_status true
|
||||
end
|
||||
|
||||
set_color -o
|
||||
printf "Checking git status: "
|
||||
if $show_status
|
||||
printf "showing all status!"
|
||||
end
|
||||
printf "\n\n"
|
||||
set_color normal
|
||||
|
||||
for dir in ./*/
|
||||
cd "$dir"
|
||||
|
||||
if git_is_repo
|
||||
set final 0
|
||||
|
||||
set_color -o
|
||||
printf "$dir is:\n"
|
||||
set_color normal
|
||||
|
||||
if git_is_dirty
|
||||
printf " dirty\n"
|
||||
set final 1
|
||||
end
|
||||
if git_is_staged
|
||||
printf " staged\n"
|
||||
set final 1
|
||||
end
|
||||
if git_is_touched
|
||||
printf " touched\n"
|
||||
set final 1
|
||||
end
|
||||
|
||||
if test $final = 0
|
||||
printf " clean\n"
|
||||
if $show_status
|
||||
git status
|
||||
end
|
||||
printf "\n"
|
||||
else
|
||||
git status
|
||||
printf "\n"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
cd -
|
||||
end
|
||||
end
|
|
@ -0,0 +1,19 @@
|
|||
function list-display --description 'List available display interfaces from xrandr.'
|
||||
xrandr | sed -n '/connected/p'
|
||||
end
|
||||
|
||||
function conf-display --argument-names width height interface
|
||||
set MODELINE (cvt $width $height | sed -e '/Modeline*/!d' -e 's/Modeline //')
|
||||
set RESOL_REFRESH (echo $MODELINE | awk -F'"' '{print $2}')
|
||||
|
||||
eval xrandr --newmode $MODELINE
|
||||
eval xrandr --addmode $interface $RESOL_REFRESH
|
||||
eval xrandr --output $interface --mode $RESOL_REFRESH
|
||||
|
||||
if $status
|
||||
echo "Succesfully configured $interface for displaying $width x $height video!"
|
||||
else
|
||||
echo "There was an error!"
|
||||
end
|
||||
|
||||
end
|
|
@ -0,0 +1,9 @@
|
|||
alias clem='emacsclient -n'
|
||||
alias sudoclem='sudo emacsclient -n'
|
||||
|
||||
alias temacs="emacs -nw"
|
||||
alias stemacs="sudo emacs -nw"
|
||||
|
||||
function pcmark
|
||||
pulldown-cmark < $argv > $argv.html
|
||||
end
|
|
@ -0,0 +1,26 @@
|
|||
alias lk='ls -1'
|
||||
alias kl='ls -1'
|
||||
|
||||
alias weather='curl wttr.in/'
|
||||
|
||||
function pdfunlock
|
||||
# command taken from https://mandrivausers.org/index.php?/topic/79354-saving-pdf-file-without-password-solved/
|
||||
echo "Password: $argv[1]"
|
||||
|
||||
mkdir -p unlocked
|
||||
for file in *.pdf
|
||||
rm -f "unlocked/$file"
|
||||
pdftk "$file" input_pw "$argv[1]" output "unlocked/$file"
|
||||
if test $status = 0
|
||||
echo "Unlocked: $file!"
|
||||
else
|
||||
echo "Problem unlocking: $file."
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function starttmux
|
||||
emacs --daemon
|
||||
tmux
|
||||
end
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
set -x PATH $PATH ~/.local/bin
|
||||
set -x VISUAL zile
|
||||
set -x fish_term256 1
|
|
@ -0,0 +1,31 @@
|
|||
# This file contains fish universal variable definitions.
|
||||
# VERSION: 3.0
|
||||
SETUVAR __fish_init_2_3_0:\x1d
|
||||
SETUVAR fish_color_autosuggestion:50A0A0
|
||||
SETUVAR fish_color_cancel:\x2dr
|
||||
SETUVAR fish_color_command:cyan\x1e\x2d\x2dbold
|
||||
SETUVAR fish_color_comment:5C9933
|
||||
SETUVAR fish_color_cwd:green
|
||||
SETUVAR fish_color_cwd_root:red
|
||||
SETUVAR fish_color_end:8EEB00
|
||||
SETUVAR fish_color_error:brred
|
||||
SETUVAR fish_color_escape:00a6b2
|
||||
SETUVAR fish_color_history_current:\x2d\x2dbold
|
||||
SETUVAR fish_color_host:normal
|
||||
SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue
|
||||
SETUVAR fish_color_normal:normal
|
||||
SETUVAR fish_color_operator:00a6b2
|
||||
SETUVAR fish_color_param:brcyan
|
||||
SETUVAR fish_color_quote:bryellow
|
||||
SETUVAR fish_color_redirection:7CB02C
|
||||
SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
|
||||
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
|
||||
SETUVAR fish_color_status:red
|
||||
SETUVAR fish_color_user:brgreen
|
||||
SETUVAR fish_color_valid_path:cyan
|
||||
SETUVAR fish_greeting:Welcome\x20to\x20fish\x2c\x20the\x20friendly\x20interactive\x20shell
|
||||
SETUVAR fish_key_bindings:fish_default_key_bindings
|
||||
SETUVAR fish_pager_color_completion:normal
|
||||
SETUVAR fish_pager_color_description:B3A06D\x1eyellow
|
||||
SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
|
||||
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
|
|
@ -0,0 +1,132 @@
|
|||
(custom-set-variables
|
||||
;; custom-set-variables was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(c-basic-offset 4)
|
||||
'(cursor-type (quote (bar . 2)))
|
||||
'(custom-enabled-themes (quote (misterioso)))
|
||||
'(mediawiki-site-alist
|
||||
(quote
|
||||
(("ERacing" "http://unicamperacing.com.br/wiki" "Ericonr" "" nil "Main Page")
|
||||
("Wikipedia" "https://en.wikipedia.org/w/" "username" "password" nil "Main Page"))))
|
||||
'(mediawiki-site-default "ERacing")
|
||||
'(package-selected-packages
|
||||
(quote
|
||||
(xclip multiple-cursors ws-butler company-jedi company-irony company auto-complete fish-mode mediawiki markdown-mode rust-mode))))
|
||||
(custom-set-faces
|
||||
;; custom-set-faces was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(company-preview ((t (:foreground "darkgray" :underline t))))
|
||||
'(company-preview-common ((t (:inherit company-preview))))
|
||||
'(company-tooltip ((t (:background "lightgray" :foreground "black"))))
|
||||
'(company-tooltip-common ((((type x)) (:inherit company-tooltip :weight bold)) (t (:inherit company-tooltip))))
|
||||
'(company-tooltip-common-selection ((((type x)) (:inherit company-tooltip-selection :weight bold)) (t (:inherit company-tooltip-selection))))
|
||||
'(company-tooltip-selection ((t (:background "steelblue" :foreground "white")))))
|
||||
|
||||
(require 'package)
|
||||
(add-to-list 'package-archives
|
||||
'("melpa-stable" . "https://stable.melpa.org/packages/"))
|
||||
(package-initialize)
|
||||
|
||||
;; Overwrite selected text
|
||||
(delete-selection-mode t)
|
||||
|
||||
;; Enable deleting trailing whitespace on all programming modes
|
||||
(require 'ws-butler)
|
||||
(add-hook 'prog-mode-hook #'ws-butler-mode)
|
||||
|
||||
;; Multiple cursors
|
||||
(require 'multiple-cursors)
|
||||
(global-set-key (kbd "C-c m") 'mc/mark-all-like-this)
|
||||
|
||||
;; Auto init AC
|
||||
(add-hook 'after-init-hook 'auto-complete-mode)
|
||||
(ac-config-default)
|
||||
|
||||
;; Language specific info
|
||||
(setq rust-format-on-save t)
|
||||
|
||||
;; User agent
|
||||
(setq url-user-agent "FOO")
|
||||
|
||||
;; Reload file
|
||||
(global-set-key (kbd "C-x r") 'revert-buffer)
|
||||
|
||||
;; C-w delete previous word
|
||||
(defadvice kill-region (before unix-werase activate compile)
|
||||
"When called interactively with no active region, delete a single word
|
||||
backwards instead."
|
||||
(interactive
|
||||
(if mark-active (list (region-beginning) (region-end))
|
||||
(list (save-excursion (backward-word 1) (point)) (point)))))
|
||||
|
||||
;; Cycle in the reverse direction of the kill-ring with M-Y
|
||||
(defun yank-pop-forwards (arg)
|
||||
(interactive "p")
|
||||
(yank-pop (- arg)))
|
||||
(global-set-key "\M-Y" 'yank-pop-forwards)
|
||||
|
||||
;; Turn on xclip
|
||||
(xclip-mode 1)
|
||||
|
||||
;; Control ispell
|
||||
(with-eval-after-load "ispell"
|
||||
(setq ispell-program-name "hunspell")
|
||||
(setq ispell-dictionary "pt_BR,en_US-large")
|
||||
;; ispell-set-spellchecker-params has to be called
|
||||
;; before ispell-hunspell-add-multi-dic will work
|
||||
(ispell-set-spellchecker-params)
|
||||
(ispell-hunspell-add-multi-dic "pt_BR,en_US-large"))
|
||||
(ispell-minor-mode 1)
|
||||
|
||||
;; Font for GTK
|
||||
(set-frame-font "Monospace-11" nil t)
|
||||
|
||||
;; Enables company and company-irony
|
||||
;; (eval-after-load 'company
|
||||
;; '(add-to-list 'company-backends 'company-irony))
|
||||
;; (add-hook 'after-init-hook 'global-company-mode)
|
||||
|
||||
;; Enables company-jedi
|
||||
;; (defun my/python-mode-hook ()
|
||||
;; (add-to-list 'company-backends 'company-jedi))
|
||||
;; (add-hook 'python-mode-hook 'my/python-mode-hook)
|
||||
|
||||
;; Set colors https://github.com/albert4git/aTest/blob/master/dotFiles/el-king18/my18company-ac-ispell-yas-eldoc-elisp.el
|
||||
;; (require 'color)
|
||||
;; (let ((bg (face-attribute 'default :background)))
|
||||
;; (custom-set-faces
|
||||
;; `(company-tooltip-common
|
||||
;; ((t :foreground "cyan"
|
||||
;; :background "black"
|
||||
;; :underline t)))
|
||||
;; `(company-template-field
|
||||
;; ((t :inherit company-tooltip
|
||||
;; :foreground "cyan")))
|
||||
;; `(company-tooltip-selection
|
||||
;; ((t :background "gray40"
|
||||
;; :foreground "cyan")))
|
||||
;; `(company-tooltip-common-selection
|
||||
;; ((t :foreground "cyan"
|
||||
;; :background "gray40"
|
||||
;; :underline t)))
|
||||
;; `(company-scrollbar-fg
|
||||
;; ((t :background "cyan2")))
|
||||
;; `(company-tooltip-annotation
|
||||
;; ((t :inherit company-tooltip
|
||||
;; :foreground "cyan")))))
|
||||
|
||||
;; Set colors https://github.com/company-mode/company-mode/wiki/Switching-from-AC
|
||||
|
||||
;; Similarities to AC
|
||||
;; (eval-after-load 'company
|
||||
;; '(progn
|
||||
;; (define-key company-active-map (kbd "TAB") 'company-complete-common-or-cycle)
|
||||
;; (define-key company-active-map (kbd "<tab>") 'company-complete-common-or-cycle)))
|
||||
;; (eval-after-load 'company
|
||||
;; '(progn
|
||||
;; (define-key company-active-map (kbd "S-TAB") 'company-select-previous)
|
||||
;; (define-key company-active-map (kbd "<backtab>") 'company-select-previous)))
|
|
@ -0,0 +1,22 @@
|
|||
# funcoes para facilitar o uso do arm-none-eabi-gdb
|
||||
|
||||
# sequencia inicial
|
||||
def rst
|
||||
monitor reset halt
|
||||
tb main
|
||||
continue
|
||||
end
|
||||
|
||||
# essa eh necessaria com a STM32F4 para programar
|
||||
def mrh
|
||||
monitor reset halt
|
||||
end
|
||||
|
||||
# para conectar ao microcontrolador
|
||||
def loco
|
||||
target remote localhost:3333
|
||||
end
|
||||
|
||||
def semihosting
|
||||
monitor arm semihosting enable
|
||||
end
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
xset b off
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
export KDEWM=/usr/bin/i3
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
sudo mv /usr/share/sddm/themes/breath/components/artwork/background.png /usr/share/sddm/themes/breath/components/artwork/background.png.back
|
||||
|
||||
sudo convert /home/ericonr/Pictures/Wallpaper/wallpaper_login.* /usr/share/sddm/themes/breath/components/artwork/background.png
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# based on: https://bbs.archlinux.org/viewtopic.php?id=215899
|
||||
# and: https://git.reviewboard.kde.org/r/125648/
|
||||
# and: https://github.com/chubin/wttr.in
|
||||
|
||||
WALLPATH=/home/ericonr/Pictures/Wallpaper
|
||||
|
||||
# download png
|
||||
curl wttr.in/Campinas_tqp0.png --output $WALLPATH/weather.png --silent
|
||||
convert $WALLPATH/weather.png -resize 130% $WALLPATH/weather.png
|
||||
echo DOWNLOADED
|
||||
|
||||
# create the background image
|
||||
convert $WALLPATH/wallpaper_default.jpg $WALLPATH/weather.png -geometry '+50+50' -composite $WALLPATH/wallpaper_weather.jpg
|
||||
|
||||
# run script that changes the wallpaper - convoluted mess
|
||||
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript \
|
||||
'var allDesktops = desktops();
|
||||
print (allDesktops);
|
||||
|
||||
wallpath = "file:///home/ericonr/Pictures/Wallpaper/";
|
||||
|
||||
// allDesktops.lentgh not used, changing only the main background
|
||||
|
||||
for (i=0; i < 1; i++) {
|
||||
d = allDesktops[i];
|
||||
d.wallpaperPlugin = "org.kde.image";
|
||||
d.currentConfigGroup = Array("Wallpaper", "org.kde.image", "General");
|
||||
d.writeConfig("Image", wallpath + "wallpaper_default.jpg")
|
||||
d.writeConfig("Image", wallpath + "wallpaper_weather.jpg")
|
||||
}'
|
||||
echo CHANGED_BACKGROUND
|
|
@ -0,0 +1,34 @@
|
|||
new-session -A -s standard
|
||||
kill-session -tstandard -a
|
||||
|
||||
new-window -tstandard -n text-editor emacsclient -c -nw
|
||||
split-window -h -p 35 -P
|
||||
split-window -v -P
|
||||
|
||||
new-window -tstandard -n browser links duckduckgo.com
|
||||
|
||||
new-window -tstandard -n dual-text emacsclient -c -nw
|
||||
split-window -h emacsclient -c -nw
|
||||
split-window -v -p 20 -P
|
||||
|
||||
new-window -tstandard -n multishell
|
||||
split-window -h htop
|
||||
split-window -v cmus
|
||||
select-pane -tstandard:multishell.0
|
||||
split-window -v
|
||||
|
||||
select-pane -tstandard:text-editor.0
|
||||
|
||||
unbind-key C-b
|
||||
set -g prefix "C-a"
|
||||
bind-key C-a send-prefix
|
||||
#set -g prefix2 C-`
|
||||
#bind-key C-` send-prefix -2
|
||||
|
||||
unbind-key l
|
||||
bind-key h select-pane -L
|
||||
bind-key j select-pane -D
|
||||
bind-key k select-pane -U
|
||||
bind-key l select-pane -R
|
||||
|
||||
set -sg escape-time 0
|
Loading…
Reference in New Issue