diff --git a/.bash_env b/.bash_env new file mode 100644 index 0000000..4a2ddf4 --- /dev/null +++ b/.bash_env @@ -0,0 +1,26 @@ +#!/bin/sh + +# Environment exports +export MOZ_ENABLE_WAYLAND=1 +export XDG_CONFIG_HOME=~/.config +export XDG_CACHE_HOME=~/.cache +export XDG_DATA_HOME=~/.local/share +export BROWSER=/usr/bin/brave-browser +export VISUAL=vim +export EDITOR=vim +export QT_QPA_PLATFORMTHEME=qt5ct +export DESKTOP_SESSION=sway +export GOPATH="$HOME"/go + +# Scripts Path +PATH=$PATH:~/.local/bin +PATH=$PATH:~/bin +PATH=$PATH:/usr/local/go/bin +PATH=$PATH:$HOME/go/bin + +# Doom Path +PATH=$PATH:~/.config/emacs/bin/ + +# Flatpak path +PATH=$PATH:/var/lib/flatpak/exports/bin +PATH=$PATH:/var/lib/flatpak/app diff --git a/.bash_profile b/.bash_profile index b0ac9ae..c590679 100644 --- a/.bash_profile +++ b/.bash_profile @@ -1,12 +1,7 @@ #!/usr/bin/env bash -export MOZ_ENABLE_WAYLAND=1 -export XDG_CONFIG_HOME=~/.config -export XDG_CACHE_HOME=~/.cache -export XDG_DATA_HOME=~/.local/share -export BROWSER=/usr/bin/brave-browser -export VISUAL=vim -export EDITOR=vim -export QT_QPA_PLATFORMTHEME=qt5ct -export DESKTOP_SESSION=sway +if [ -f ~/.bash_env ]; then + . "$HOME"/.bash_env +fi + [ "$(tty)" = "/dev/tty1" ] && exec sway diff --git a/.bashrc b/.bashrc index aaefdc1..54cc098 100755 --- a/.bashrc +++ b/.bashrc @@ -1,4 +1,7 @@ -#!/bin/bash +#!/bin/sh + +# If not running interactively, don't do anything +[ -z "$PS1" ] && return #Source global definitions if [ -f /etc/bashrc ]; then @@ -8,10 +11,11 @@ fi #Enable bash programmable completion features in interactive shells if [ -f /usr/share/bash-completion/bash_completion ]; then . /usr/share/bash-completion/bash_completion -elif [ -f /etc/bash_completion ]; then - . /etc/bash_completion fi +if [ -f ~/.bash_env ]; then + . "$HOME"/.bash_env +fi ####################################################### # EXPORTS @@ -29,20 +33,13 @@ shopt -s checkwinsize # Causes bash to append to history instead of overwriting it so if you start a new terminal, you have old session history shopt -s histappend -PROMPT_COMMAND='history -a' # Allow ctrl-S for history navigation (with ctrl-R) stty -ixon -# Set the default editor -export EDITOR=vim -export VISUAL=vim - # To have colors for ls and all grep commands such as grep, egrep and zgrep export CLICOLOR=1 export LS_COLORS='no=00:fi=00:di=00;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:*.xml=00;31:' -alias grep="/usr/bin/grep $GREP_OPTIONS" -unset GREP_OPTIONS # Color for manpages in less makes manpages a little easier to read export LESS_TERMCAP_mb=$'\E[01;31m' @@ -53,21 +50,6 @@ export LESS_TERMCAP_so=$'\E[01;44;33m' export LESS_TERMCAP_ue=$'\E[0m' export LESS_TERMCAP_us=$'\E[01;32m' -export LC_WHO=rorlando - -# Scripts Path -PATH=$PATH:~/.local/bin -PATH=$PATH:~/bin -PATH=$PATH:/usr/local/go/bin - -# Doom Path -PATH=$PATH:~/.config/emacs/bin/ - -# Flatpak path -PATH=$PATH:/var/lib/flatpak/exports/bin -PATH=$PATH:/var/lib/flatpak/app - - ####################################################### # GOPASS ####################################################### @@ -94,7 +76,7 @@ alias vim='nvim' alias vi='nvim' # DNF -alias dnf='sudo dnf5' +alias dnf='dnf5' alias din='sudo dnf5 install' alias dre='sudo dnf5 remove' alias dup='sudo dnf5 update' @@ -134,9 +116,6 @@ alias h="history | grep " # Search files in the current folder alias f="find . | grep " -# Show current network connections to the server -alias ipview="netstat -anpl | grep :80 | awk {'print \$5'} | cut -d\":\" -f1 | sort | uniq -c | sort -n | sed -e 's/^ *//' -e 's/ *\$//'" - # Alias's to show disk space and space used in a folder alias diskspace="du -S | sort -n -r |more" alias folders='du -h --max-depth=1' @@ -168,11 +147,6 @@ alias tbr='trans :pt-BR' alias wgup='sudo wg-quick up /etc/wireguard/wg0.conf' alias wgdown='sudo wg-quick down /etc/wireguard/wg0.conf' -# SSH -alias stork='ssh stork' -alias mail='ssh mail' -alias eel='ssh eel' - # Keychain alias keys='eval $(keychain --eval --quiet ry_ecdsa) && eval $(keychain --eval --quiet id_rsa)' @@ -183,8 +157,8 @@ alias keys='eval $(keychain --eval --quiet ry_ecdsa) && eval $(keychain --eval - # Create and go to the directory mkdirg() { - mkdir -p $1 - cd $1 + mkdir -p "$1" + cd "$1" || exit } @@ -192,69 +166,22 @@ mkdirg() { # Prompt ####################################################### -function __setprompt { - - # Define colors - local LIGHTGRAY="\033[0;37m" - local WHITE="\033[1;37m" - local BLACK="\033[0;30m" - local DARKGRAY="\033[1;30m" - local RED="\033[0;31m" - local LIGHTRED="\033[1;31m" - local GREEN="\033[0;32m" - local LIGHTGREEN="\033[1;32m" - local BROWN="\033[0;33m" - local YELLOW="\033[1;33m" - local BLUE="\033[0;34m" - local LIGHTBLUE="\033[1;34m" - local MAGENTA="\033[0;35m" - local LIGHTMAGENTA="\033[1;35m" - local CYAN="\033[0;36m" - local LIGHTCYAN="\033[1;36m" - local NOCOLOR="\033[0m" - local PURPLE="\033[1;34m" - - PS1="" - # User and server - local SSH_IP=$(echo $SSH_CLIENT | awk '{ print $1 }') - local SSH2_IP=$(echo $SSH2_CLIENT | awk '{ print $1 }') - if [ $SSH2_IP ] || [ $SSH_IP ]; then - PS1+="(\[${PURPLE}\]\u@\h" - else - PS1+="(\[${PURPLE}\]\u" - fi - - # Current directory - PS1+="\[${LIGHTGRAY}\]:\[${BROWN}\]\w\[${LIGHTGRAY}\])-" - - # Total size of files in current directory - PS1+="(\[${GREEN}\]$(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed 's/total //')\[${LIGHTGRAY}\]:" - - # Number of files - PS1+="\[${GREEN}\]\$(/bin/ls -A -1 | /usr/bin/wc -l)\[${LIGHTGRAY}\])-" - - # git branch - PS1+="(\[${LIGHTGRAY}\]\$(git branch --show-current 2>/dev/null)\[${LIGHTGRAY}\])" - - # Skip to the next line - PS1+="\n" - - if [[ $EUID -ne 0 ]]; then - PS1+="\[${GREEN}\] >\[${NOCOLOR}\] " # Normal user - else - PS1+="\[${RED}\]>\[${NOCOLOR}\] " # Root user - fi - - # PS2 is used to continue a command using the \ character - PS2="\[${LIGHTGRAY}\]>\[${NOCOLOR}\] " - - # PS3 is used to enter a number choice in a script - PS3='Please enter a number from above list: ' - - # PS4 is used for tracing a script in debug mode - PS4='\[${LIGHTGRAY}\]+\[${NOCOLOR}\] ' +# Function to get the current Git branch +function parse_git_branch { + git branch 2>/dev/null | grep -e '^*' | sed 's/^* \(.*\)/ (\1)/' } -PROMPT_COMMAND='__setprompt' + +# Define colors +export RED='\[\033[0;31m\]' +export BLUE='\[\033[0;34m\]' +GREEN='\[\033[0;32m\]' +YELLOW='\[\033[0;33m\]' +CYAN='\[\033[0;36m\]' +WHITE='\[\033[0;37m\]' +RESET='\[\033[0m\]' + +# Custom prompt +PS1="${CYAN}[\u@\h ${YELLOW}\w${GREEN}\$(parse_git_branch)${CYAN}]${WHITE}${RESET}\n\$ " ####################################################### diff --git a/.config/doom/config.el b/.config/doom/config.el index d62fd31..896ebb5 100644 --- a/.config/doom/config.el +++ b/.config/doom/config.el @@ -179,3 +179,11 @@ (setq elfeed-search-filter "@1-month-ago +unread")) (setq create-lockfiles nil) + +(use-package! python-black + :demand t + :after python + :config + (add-hook! 'python-mode-hook #'python-black-on-save-mode)) + +(setq flycheck-python-pylint-executable "pylint") diff --git a/.config/doom/init.el b/.config/doom/init.el index 1ea5ef1..df73b25 100644 --- a/.config/doom/init.el +++ b/.config/doom/init.el @@ -125,7 +125,7 @@ ;;fsharp ; ML stands for Microsoft's Language ;;fstar ; (dependent) types and (monadic) effects and Z3 ;;gdscript ; the language you waited for - ;;(go +lsp) ; the hipster dialect + (go +lsp) ; the hipster dialect ;;(haskell +lsp) ; a language that's lazier than I am ;;hy ; readability of scheme w/ speed of python ;;idris ; a language you can depend on @@ -146,7 +146,7 @@ ;;php ; perl's insecure younger brother ;;plantuml ; diagrams for confusing people more ;;purescript ; javascript, but functional - (python +lsp) ; beautiful is better than ugly + (python +lsp +pyright) ; beautiful is better than ugly ;;qt ; the 'cutest' gui framework ever ;;racket ; a DSL for DSLs ;;raku ; the artist formerly known as perl6 diff --git a/.config/doom/packages.el b/.config/doom/packages.el index 953ba24..cf83a3f 100644 --- a/.config/doom/packages.el +++ b/.config/doom/packages.el @@ -3,3 +3,4 @@ (package! org-make-toc) (package! modus-themes) (package! ef-themes) +(package! python-black) diff --git a/.config/sway/config b/.config/sway/config index b0ef968..f95e01e 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -1,8 +1,6 @@ -exec_always { - gsettings set org.gnome.desktop.interface gtk-theme 'Arc-Darker' - gsettings set org.gnome.desktop.interface icon-theme 'Papirus-Dark' -} - +####################### +# VARIABLES +####################### # Directional Keys set $left h set $down j @@ -19,6 +17,10 @@ set $term alacritty #set $menu bemenu-run -p Run: -l 10 -c -M 500 --fn 'Hack 16' --tf '#ff4e00' --ff '#dbc077' --hf '#ff4e00' set $menu rofi -show +####################### +# GENERAL KEYBINDS +####################### + # Start a terminal bindsym $mod+Return exec $term @@ -165,15 +167,22 @@ bindsym $mod+Ctrl+g exec grimshot save window # Turn the system off bindsym $mod+Shift+e exec wlogout -p layer-shell -# Enable/disable trackpad -bindsym $mod+t exec swaymsg input "1739:52824:SYNA8008:00_06CB:CE58_Touchpad" events disabled -bindsym $mod+Shift+t exec swaymsg input "1739:52824:SYNA8008:00_06CB:CE58_Touchpad" events enabled - # Bookmarks bindsym $mod+Insert exec wtype $(grep -v '^#' ~/.local/share/bookmarks/bookmarks | bemenu -p Bookmark: -l 50 -c -M 500 --fn 'Hack 16' --tf '#ff4e00' --ff '#dbc077' --hf '#ff4e00' | cut -d ' ' -f1) bindsym $mod+Shift+Insert exec ~/.local/bin/bookmark_insert + +####################### +# EXECS +####################### +# Set GTK/icon theme +exec_always { + gsettings set org.gnome.desktop.interface gtk-theme 'Arc-Darker' + gsettings set org.gnome.desktop.interface icon-theme 'Papirus-Dark' +} + + # Notifications exec_always dunst @@ -189,9 +198,6 @@ exec_always /usr/bin/nm-applet # Bluetooth manager tray applet exec /usr/bin/blueman-applet -# Clamshell Mode Script -#exec_always ~/.config/sway/clamshell.sh - # KDE polkit exec /usr/lib/x86_64-linux-gnu/libexec/polkit-kde-authentication-agent-1 @@ -199,6 +205,18 @@ exec /usr/lib/x86_64-linux-gnu/libexec/polkit-kde-authentication-agent-1 exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK exec hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK +# Idle configuration +exec swayidle -w \ + timeout 3200 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaylock -f' +# timeout 15 'if pgrep -x swaylock; then swaymsg "output * dpms off"; fi' \ + + +####################### +# DECORATIONS +####################### + # Window Borders default_border pixel 3 default_floating_border none @@ -217,26 +235,10 @@ smart_gaps on gaps inner 5 gaps outer 2 -# Idle configuration -exec swayidle -w \ - timeout 3200 'swaymsg "output * dpms off"' \ - resume 'swaymsg "output * dpms on"' \ - before-sleep 'swaylock -f' -# timeout 15 'if pgrep -x swaylock; then swaymsg "output * dpms off"; fi' \ +####################### +# INPUTS +####################### -### Input configuration -# -# Example configuration: -# -# input "2:14:SynPS/2_Synaptics_TouchPad" { -# dwt enabled -# tap enabled -# natural_scroll enabled -# middle_emulation enabled -# } -# -# You can get the names of your inputs by running: swaymsg -t get_inputs -# Read `man 5 sway-input` for more information about this section. input type:keyboard { # Capslock key should work as escape key # See /usr/share/X11/xkb/rules/xorg.lst for options @@ -252,30 +254,49 @@ input type:keyboard { # events disable #} -# Set trackpoint sensitivity +# Set trackpoint sensitivity on Laptop input "2:10:TPPS/2_Elan_TrackPoint" { pointer_accel 1.0 accel_profile "flat" } +# Set trackpoint sensitivity on Tex Shinobi USB +input "1241:1031:USB-HID_Keyboard_Mouse" { + pointer_accel 0.3 + accel_profile "flat" +} # Hide mouse cursor after inactivity seat * hide_cursor 10000 +# Enable/disable trackpad +bindsym $mod+t exec swaymsg input "1739:52824:SYNA8008:00_06CB:CE58_Touchpad" events disabled +bindsym $mod+Shift+t exec swaymsg input "1739:52824:SYNA8008:00_06CB:CE58_Touchpad" events enabled + +####################### +# OUTPUTS +####################### + +# Lid stuff set $laptop eDP-1 bindswitch --reload --locked lid:on output $laptop disable bindswitch --reload --locked lid:off output $laptop enable # Monitors -# You can get the names of your outputs by running: swaymsg -t get_outputs output HDMI-A-1 scale 2.0 # Wallpaper output * bg ~/.config/wallpapers/exterminator.png fill +# Enable/Disable extra HDMI screens bindsym $mod+Shift+m output "HDMI-A-1" enable bindsym $mod+Shift+n output "HDMI-A-1" disable + +####################### +# WORKSPACES +####################### + # Assign workspaces to numbers set $ws1 number "1" set $ws2 number "2" @@ -303,6 +324,11 @@ bindsym $mod+Shift+5 move container to workspace $ws5 bindsym $mod+Shift+6 move container to workspace $ws6 bindsym $mod+Shift+0 move container to workspace $ws7 + +####################### +# BAR +####################### + # Status Bar: bar { swaybar_command waybar