diff --git a/.config/Code/User/settings.json b/.config/Code/User/settings.json new file mode 100644 index 0000000..0c54b2a --- /dev/null +++ b/.config/Code/User/settings.json @@ -0,0 +1,80 @@ +{ + // Editor settings + "editor.fontFamily": "Source Code Pro", + "editor.fontWeight": 600, + "editor.fontLigatures": false, + "editor.fontSize": 14, + "editor.lineHeight": 20, + "editor.tabSize": 2, + "editor.detectIndentation": false, + "editor.minimap.enabled": false, + "editor.suggestSelection": "first", + "editor.formatOnPaste": true, + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true + }, + "editor.cursorStyle": "line", + "editor.lineNumbers": "on", + "editor.wordSeparators": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-", + "editor.wordWrap": "on", + "window.menuBarVisibility": "toggle", + // Emmet + "emmet.includeLanguages": { + "javascript": "javascriptreact" + }, + "emmet.showExpandedAbbreviation": "never", + "emmet.triggerExpansionOnTab": true, + // ESLint + "eslint.packageManager": "yarn", + // Theme + "workbench.colorTheme": "Material Theme Darker High Contrast", + "workbench.iconTheme": "material-icon-theme", + // Explorer + "explorer.confirmDelete": false, + "explorer.compactFolders": false, + "explorer.confirmDragAndDrop": false, + // Keyboard + "keyboard.dispatch": "keyCode", + // Language extensions + "javascript.validate.enable": true, + "javascript.updateImportsOnFileMove.enabled": "always", + "typescript.validate.enable": true, + "typescript.updateImportsOnFileMove.enabled": "always", + "typescript.preferences.importModuleSpecifier": "relative", + "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", + // Helpers + "rust-analyzer.cargo.allFeatures": true, + "prettier.useTabs": true, + // Terminal profiles + "terminal.integrated.profiles.linux": { + "fish": { + "path": "fish" + } + }, + // Default formatters + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[javascriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[typescriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[jsonc]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[yaml]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[html]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + } +} diff --git a/.config/fish/conf.d/fish-ssh-agent.fish b/.config/fish/conf.d/fish-ssh-agent.fish deleted file mode 100644 index 8315237..0000000 --- a/.config/fish/conf.d/fish-ssh-agent.fish +++ /dev/null @@ -1,8 +0,0 @@ -# From https://github.com/danhper/fish-ssh-agent -if test -z "$SSH_ENV" - set -xg SSH_ENV $HOME/.ssh/environment -end - -if not __ssh_agent_is_started - __ssh_agent_start -end diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 5df45a5..df99b7b 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -2,21 +2,51 @@ set -x PATH $PATH $HOME/.cargo/bin $HOME/go/bin (yarn global bin) set -x GPG_TTY (tty) -alias yay paru +alias y paru alias j z -abbr --add gst git status -abbr --add gaa git add --all -abbr --add gds git diff --staged -abbr --add gdh git diff HEAD -abbr --add gl git log --oneline --graph -abbr --add gcm git commit -m +alias gst "git status" +alias gaa "git add --all" +alias ga. "git add ." +alias gds "git diff --staged" +function gdh --argument-names 'reach' + if count $argv > /dev/null + git diff HEAD~$reach + else + git diff HEAD + end +end +funcsave gdh +alias gl "git log --oneline --graph" +alias gcm "git commit -m" -abbr --add ls exa -abbr --add la exa -al -abbr --add l exa -l +alias ls exa +alias l "exa -al" +alias ll "exa -l" -abbr --add cat bat +alias cat bat + +alias sa "ssh-add -t 3600" +alias sat "ssh-add -t " +alias sad "ssh-add -d" + +function forbat --argument-names 'lang' + switch $lang + case json + prettier --parser json | bat --language json --pager "less -RF" + case js + prettier --parser babel | bat --language babel --pager "less -RF" + case '*' + echo I don\'t know $lang + end +end +funcsave forbat + +function bluehead + bluetoothctl power on + bluetoothctl connect 94:DB:56:8E:74:D9 +end +funcsave bluehead zoxide init fish | source starship init fish | source diff --git a/.config/fish/functions/__ssh_agent_is_started.fish b/.config/fish/functions/__ssh_agent_is_started.fish deleted file mode 100644 index 70c7aed..0000000 --- a/.config/fish/functions/__ssh_agent_is_started.fish +++ /dev/null @@ -1,15 +0,0 @@ -# From https://github.com/danhper/fish-ssh-agent -function __ssh_agent_is_started -d "check if ssh agent is already started" - if begin; test -f $SSH_ENV; and test -z "$SSH_AGENT_PID"; end - source $SSH_ENV > /dev/null - end - - if begin; test -z "$SSH_AGENT_PID"; and test -z "$SSH_CONNECTION"; end - return 1 - end - - ssh-add -l > /dev/null 2>&1 - if test $status -eq 2 - return 1 - end -end diff --git a/.config/fish/functions/__ssh_agent_start.fish b/.config/fish/functions/__ssh_agent_start.fish deleted file mode 100644 index 33c46d7..0000000 --- a/.config/fish/functions/__ssh_agent_start.fish +++ /dev/null @@ -1,6 +0,0 @@ -# From https://github.com/danhper/fish-ssh-agent -function __ssh_agent_start -d "start a new ssh agent" - ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV - chmod 600 $SSH_ENV - source $SSH_ENV > /dev/null -end diff --git a/.config/i3/config b/.config/i3/config index f72386a..e048b1f 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -117,29 +117,34 @@ bindsym $mod+Tab exec --no-startup-id rofi -show window -sorting fzf -matching f # keyboard config exec_always "setxkbmap -model pc105 -layout us,se -variant , -option altwin:swap_lalt_lwin -option caps:swapescape -option grp:win_space_toggle" -# start composite manager -exec picom - focus_follows_mouse no - default_border pixel 3 default_floating_border none -hide_edge_borders none +mouse_warping none +title_align center # switch to workspace with urgent window automatically for_window [urgent=latest] focus -smart_borders on -# class border backgr. text indicator child_border -client.focused #000000 #285577 #ffffff #2e9ef4 #b3f3f3 -client.focused_inactive #000000 #5f676a #ffffff #484e50 #0c4443 -client.unfocused #000000 #222222 #888888 #292d2e #0c4443 -client.urgent #000000 #900000 #ffffff #900000 #ff0000 -client.placeholder #000000 #0c0c0c #ffffff #000000 #000000 -client.background #ffffff +set $active_color "#47a7a6" +set $inactive_color "#0c4443" + +# class border background text indicator child_border +client.focused #000000 #285577 #ffffff $active_color $active_color +client.focused_inactive #000000 #5f676a #ffffff $inactive_color $inactive_color +client.unfocused #000000 #222222 #888888 $inactive_color #0c4443 +client.urgent #000000 #900000 #ffffff $inactive_color #ff0000 +client.placeholder #000000 #0c0c0c #ffffff $inactive_color #000000 +client.background #ffffff bindsym $mod+Shift+s exec flameshot gui +for_window [class="code"] move container to workspace $ws2 +for_window [class="discord"] move container to workspace $ws9 +for_window [class="slack"] move container to workspace $ws9 +for_window [class="signal"] move container to workspace $ws9 +for_window [class="spotify"] move container to workspace $ws10 + # screen brightness controls bindsym XF86MonBrightnessUp exec light -A 5 # increase screen brightness bindsym XF86MonBrightnessDown exec light -U 5 # decrease screen brightness @@ -150,37 +155,27 @@ bindsym XF86AudioNext exec playerctl next bindsym XF86AudioPrev exec playerctl previous # volume controls -bindsym XF86AudioRaiseVolume exec --no-startup-id pamixer -i 4 -bindsym XF86AudioLowerVolume exec --no-startup-id pamixer -d 4 -bindsym XF86AudioMute exec --no-startup-id pamixer -t +bindsym XF86AudioRaiseVolume exec pamixer -i 4 +bindsym XF86AudioLowerVolume exec pamixer -d 4 +bindsym XF86AudioMute exec pamixer -t bar { id main font pango:Source Code Pro SemiBold, FontAwesome 10 position top - status_command .cargo/bin/i3status-simple + # status_command .cargo/bin/i3status-simple + status_command i3status tray_output none colors { - separator #666666 - background #222222 - statusline #dddddd - focused_workspace #0088CC #0088CC #ffffff - active_workspace #333333 #333333 #ffffff - inactive_workspace #333333 #333333 #888888 - urgent_workspace #2f343a #900000 #ffffff - } -} -bindsym $mod+t bar mode toggle tray -bar { - id tray - mode hide - modifier none - position bottom - tray_output primary - workspace_buttons no - colors { - background #222222 + # class border background text + focused_workspace $active_color $active_color #ffffff + active_workspace #333333 #333333 #ffffff + inactive_workspace #333333 #333333 #888888 + urgent_workspace #ef4444 #ef4444 #ffffff + separator #666666 + background #222222 + statusline #dddddd } } @@ -188,8 +183,16 @@ bar { exec --no-startup-id feh --bg-scale $HOME/.wallpapers/simplistic-mountain.jpg # Update lock screen bg cache -exec --no-startup-id betterlockscreen -u $HOME/wallpapers/blue-whale.png +exec --no-startup-id betterlockscreen -u $HOME/.wallpapers/blue-whale.png # Lock after 5 minutes exec --no-startup-id xset s 300 600 -exec --no-startup-id xss-lock --transfer-sleep-lock $HOME/.config/i3/scripts/lock.sh +exec --no-startup-id xss-lock $HOME/.config/i3/scripts/lock.sh + +# Start applications +exec --no-startup-id firefox +exec --no-startup-id code +exec --no-startup-id discord +exec --no-startup-id slack +exec --no-startup-id signal +exec --no-startup-id spotify diff --git a/.config/i3/scripts/lock.sh b/.config/i3/scripts/lock.sh index eec6471..5f3ec1f 100755 --- a/.config/i3/scripts/lock.sh +++ b/.config/i3/scripts/lock.sh @@ -4,6 +4,6 @@ revert() { } trap revert HUP INT TERM -xset +dpms dpms 15 15 15 +xset +dpms dpms 600 600 600 betterlockscreen -l -- -n -e revert diff --git a/.gitconfig b/.gitconfig index 1df3aef..7643509 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,7 +1,7 @@ [user] name = Rasmus Rosengren email = rasmus.rosengren@protonmail.com - signingkey = A5EE9B6829E20E3E + signingkey = C3BED1500C477BED [commit] gpgsign = true