Compare commits

...

2 commits

Author SHA1 Message Date
d386db6bee wayland configs added 2023-09-29 16:16:41 +02:00
e133a98500 do not rely on lsp-zero 2023-09-29 16:15:55 +02:00
8 changed files with 787 additions and 44 deletions

82
.config/kitty/kitty.conf Normal file
View file

@ -0,0 +1,82 @@
font_family Fira Code
# vim:ft=kitty
## name: Catppuccin Kitty Frappe
## author: Catppuccin Org
## license: MIT
## upstream: https://github.com/catppuccin/kitty/blob/main/themes/frappe.conf
## blurb: Soothing pastel theme for the high-spirited!
# The basic colors
foreground #C6D0F5
background #303446
selection_foreground #303446
selection_background #F2D5CF
# Cursor colors
cursor #F2D5CF
cursor_text_color #303446
# URL underline color when hovering with mouse
url_color #F2D5CF
# Kitty window border colors
active_border_color #BABBF1
inactive_border_color #737994
bell_border_color #E5C890
# OS Window titlebar colors
wayland_titlebar_color system
macos_titlebar_color system
# Tab bar colors
active_tab_foreground #232634
active_tab_background #CA9EE6
inactive_tab_foreground #C6D0F5
inactive_tab_background #292C3C
tab_bar_background #232634
# Colors for marks (marked text in the terminal)
mark1_foreground #303446
mark1_background #BABBF1
mark2_foreground #303446
mark2_background #CA9EE6
mark3_foreground #303446
mark3_background #85C1DC
# The 16 terminal colors
# black
color0 #51576D
color8 #626880
# red
color1 #E78284
color9 #E78284
# green
color2 #A6D189
color10 #A6D189
# yellow
color3 #E5C890
color11 #E5C890
# blue
color4 #8CAAEE
color12 #8CAAEE
# magenta
color5 #F4B8E4
color13 #F4B8E4
# cyan
color6 #81C8BE
color14 #81C8BE
# white
color7 #B5BFE2
color15 #A5ADCE

View file

@ -1,61 +1,96 @@
local lspconfig = require('lspconfig')
local lsp_defaults = lspconfig.util.default_config
lsp_defaults.capabilities = vim.tbl_deep_extend(
'force',
lsp_defaults.capabilities,
require('cmp_nvim_lsp').default_capabilities()
)
vim.api.nvim_create_autocmd('LspAttach', {
desc = 'LSP actions',
callback = function(event)
local opts = { buffer = event.buf }
vim.keymap.set('n', '<leader>i', '<cmd>lua vim.lsp.buf.hover()<cr>', opts)
vim.keymap.set('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>', opts)
vim.keymap.set('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>', opts)
vim.keymap.set('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>', opts)
vim.keymap.set('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>', opts)
vim.keymap.set('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>', opts)
vim.keymap.set('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>', opts)
vim.keymap.set('n', '<leader>r', '<cmd>lua vim.lsp.buf.rename()<cr>', opts)
vim.keymap.set('n', '<leader>f', '<cmd>lua vim.lsp.buf.format({async=true})<cr>', opts)
vim.keymap.set('n', '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<cr>', opts)
vim.keymap.set('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>', opts)
vim.keymap.set('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>', opts)
vim.keymap.set('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>', opts)
end
})
local default_setup = function(server)
lspconfig[server].setup({})
end
require('mason').setup({ require('mason').setup({
ui = { ui = {
border = 'rounded' border = 'rounded'
} }
}) })
-- Install language servers -- Install language servers
require('mason-lspconfig').setup { require('mason-lspconfig').setup({
ensure_installed = { ensure_installed = {
'lua_ls', 'clangd', 'pylsp', 'yamlls' 'lua_ls', 'clangd', 'pylsp', 'yamlls'
} },
} handlers = {
local lsp = require('lsp-zero').preset({ default_setup,
manage_nvim_cmp = { pylsp = function()
set_sources = 'lsp', require('lspconfig').pylsp.setup({
set_basic_mappings = true, settings = {
set_extra_mappings = false, pylsp = {
use_luasnip = true, plugins = {
set_format = true, flake8 = { enabled = true },
documentation_window = true, autopep8 = { enabled = false },
} yapf = {
enabled = true,
},
isort = { enabled = true },
}
}
}
})
end
},
}) })
lsp.on_attach(function(client, bufnr)
lsp.default_keymaps({ buffer = bufnr })
end)
-- (Optional) Configure lua language server for neovim
require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())
lsp.setup()
local cmp = require('cmp') local cmp = require('cmp')
local cmp_action = require('lsp-zero').cmp_action()
-- configure auto complete key
cmp.setup({ cmp.setup({
mapping = { sources = {
['<Tab>'] = cmp_action.tab_complete(), { name = 'nvim_lsp' },
['<S-Tab>'] = cmp_action.select_prev_or_fallback(), },
mapping = cmp.mapping.preset.insert({
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end),
['<C-e>'] = cmp.mapping.abort(), ['<C-e>'] = cmp.mapping.abort(),
['<C-space>'] = cmp.mapping.complete(), ['<C-space>'] = cmp.mapping.complete(),
['<C-j>'] = cmp.mapping.scroll_docs(1), ['<C-j>'] = cmp.mapping.scroll_docs(1),
['<C-k>'] = cmp.mapping.scroll_docs(-1), ['<C-k>'] = cmp.mapping.scroll_docs(-1),
['<CR>'] = cmp.mapping.confirm({ select = false }), ['<CR>'] = cmp.mapping.confirm({ select = false }),
}, }),
window = { window = {
completion = cmp.config.window.bordered(), completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(),
}, },
}) })
require('lspconfig').pylsp.setup {
settings = {
pylsp = {
plugins = {
autopep8 = { enabled = false },
yapf = { enabled = true, args = '--style={based_on_style: google column_limit: 80}' },
}
}
}
}

View file

@ -28,14 +28,11 @@ vim.keymap.set('n', '<leader>f', function()
end) end)
-- quickfix navigation -- quickfix navigation
vim.keymap.set('n', '<C-j>', '<cmd>cnext<CR>zz') -- vim.keymap.set('n', '<C-j>', '<cmd>cnext<CR>zz')
vim.keymap.set('n', '<C-k>', '<cmd>cprev<CR>zz') -- vim.keymap.set('n', '<C-k>', '<cmd>cprev<CR>zz')
vim.keymap.set('n', '<leader>j', '<cmd>lnext<CR>zz') vim.keymap.set('n', '<leader>j', '<cmd>lnext<CR>zz')
vim.keymap.set('n', '<leader>k', '<cmd>lprev<CR>zz') vim.keymap.set('n', '<leader>k', '<cmd>lprev<CR>zz')
vim.keymap.set('n', '<leader>i', vim.lsp.buf.hover)
vim.keymap.set('n', '<leader>r', vim.lsp.buf.rename)
vim.keymap.set('n', '<leader>dq', vim.diagnostic.setqflist) vim.keymap.set('n', '<leader>dq', vim.diagnostic.setqflist)
local function quickfix() local function quickfix()
vim.lsp.buf.code_action({ vim.lsp.buf.code_action({

117
.config/sway/config Normal file
View file

@ -0,0 +1,117 @@
set $mod Mod4
set $term kitty
set $menu kickoff
set $lock swaylock
# scale internal display
output eDP-1 scale 1.75
focus_follows_mouse no
default_border pixel 2
default_floating_border pixel 2
gaps inner 10
gaps outer 5
smart_borders on
exec dbus-update-activation-environment --all
exec eval $(gnome-keyring-daemon --start)
exec export SSH_AUTH_SOCK
exec swayidle -w \
timeout 300 '$lock -f' \
timeout 310 'swaymsg "output * power off"'\
resume 'swaymsg "output * power on"' \
before-sleep $lock
bindsym $mod+Shift+Ctrl+l exec $lock
exec swaybg -c#000000 -m solid_color
bindsym $mod+Return exec $term
bindsym $mod+d exec $menu
bindsym $mod+Shift+r restart
bindsym $mod+Shift+c reload
bindsym $mod+Shift+q kill
mode "$mode_exit" {
bindsym l exec --no-startup-id $locker, mode "default"
bindsym o exec --no-startup-id i3-msg exit, mode "default"
bindsym r exec --no-startup-id reboot, mode "default"
bindsym s exec --no-startup-id systemctl poweroff -i, mode "default"
bindsym Escape mode "default"
bindsym Return mode "default"
}
bindsym $mod+Shift+e mode "$mode_exit"
mode "$mode_resize" {
bindsym {
h resize shrink width
j resize grow height
k reisze shrink height
l resize grow width
Escape mode "default"
}
}
bindsym $mod+r mode "$mode_resize"
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
bindsym $mod+Ctrl+h move workspace to output left
bindsym $mod+Ctrl+j move workspace to output down
bindsym $mod+Ctrl+k move workspace to output up
bindsym $mod+Ctrl+l move workspace to output right
bindsym $mod+Space floating toggle
bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl s 10%-
bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl s +10%
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym $mod+v split h
bindsym $mod+s split v
bindsym $mod+a focus parent
bindsym $mod+f fullscreen toggle
bar {
position top
swaybar_command waybar
}
input type:touchpad {
tap enabled
natural_scroll enabled
}

173
.config/waybar/config Normal file
View file

@ -0,0 +1,173 @@
// vim:ft=json
{
// "layer": "top", // Waybar at top layer
// "position": "bottom", // Waybar position (top|bottom|left|right)
"height": 30, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width
"spacing": 4, // Gaps between modules (4px)
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode", "sway/scratchpad", "custom/media"],
"modules-center": ["sway/window"],
"modules-right": ["idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "keyboard-state", "sway/language", "battery", "battery#bat2", "clock", "tray"],
// Modules configuration
// "sway/workspaces": {
// "disable-scroll": true,
// "all-outputs": true,
// "warp-on-scroll": false,
// "format": "{name}: {icon}",
// "format-icons": {
// "1": "",
// "2": "",
// "3": "",
// "4": "",
// "5": "",
// "urgent": "",
// "focused": "",
// "default": ""
// }
// },
"keyboard-state": {
"numlock": true,
"capslock": true,
"format": "{name} {icon}",
"format-icons": {
"locked": "",
"unlocked": ""
}
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"sway/scratchpad": {
"format": "{icon} {count}",
"show-empty": false,
"format-icons": ["", ""],
"tooltip": true,
"tooltip-format": "{app}: {title}"
},
"mpd": {
"format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ",
"format-disconnected": "Disconnected ",
"format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
"unknown-tag": "N/A",
"interval": 2,
"consume-icons": {
"on": " "
},
"random-icons": {
"off": "<span color=\"#f53c3c\"></span> ",
"on": " "
},
"repeat-icons": {
"on": " "
},
"single-icons": {
"on": "1 "
},
"state-icons": {
"paused": "",
"playing": ""
},
"tooltip-format": "MPD (connected)",
"tooltip-format-disconnected": "MPD (disconnected)"
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
// "timezone": "America/New_York",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}"
},
"custom/clock": {
"exec": "echo ' '$(date +'%H:%M')' '",
"format": "<big>{}</big>",
"interval": 5
},
"cpu": {
"format": "{usage}% ",
"tooltip": false
},
"memory": {
"format": "{}% "
},
"temperature": {
"thermal-zone": 7,
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}°C {icon}",
"format": "{temperatureC}°C {icon}",
"format-icons": ["", "", ""]
},
"backlight": {
// "device": "acpi_video1",
"format": "{percent}% {icon}",
"format-icons": [""]
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-charging": "{capacity}% ",
"format-plugged": "{capacity}% ",
"format-alt": "{time} {icon}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""]
},
"battery#bat2": {
"bat": "BAT2"
},
"network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi": "{essid} ({signalStrength}%) ",
"format-ethernet": "{ipaddr}/{cidr} ",
"tooltip-format": "{ifname} via {gwaddr} ",
"format-linked": "{ifname} (No IP) ",
"format-disconnected": "Disconnected ⚠",
"format-alt": "{ifname}: {ipaddr}/{cidr}"
},
"pulseaudio": {
// "scroll-step": 1, // %, can be a float
"format": "{volume}% {icon} {format_source}",
"format-bluetooth": "{volume}% {icon} {format_source}",
"format-bluetooth-muted": " {icon} {format_source}",
"format-muted": " {format_source}",
"format-source": "{volume}% ",
"format-source-muted": "",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", "", ""]
},
"on-click": "pavucontrol"
},
"custom/media": {
"format": "{icon} {}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"spotify": "",
"default": "🎜"
},
"escape": true,
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
}
}

37
.config/waybar/frappe.css Normal file
View file

@ -0,0 +1,37 @@
/*
*
* Catppuccin Frappe palette
* Maintainer: rubyowo
*
*/
@define-color base #303446;
@define-color mantle #292c3c;
@define-color crust #232634;
@define-color text #c6d0f5;
@define-color subtext0 #a5adce;
@define-color subtext1 #b5bfe2;
@define-color surface0 #414559;
@define-color surface1 #51576d;
@define-color surface2 #626880;
@define-color overlay0 #737994;
@define-color overlay1 #838ba7;
@define-color overlay2 #949cbb;
@define-color blue #8caaee;
@define-color lavender #babbf1;
@define-color sapphire #85c1dc;
@define-color sky #99d1db;
@define-color teal #81c8be;
@define-color green #a6d189;
@define-color yellow #e5c890;
@define-color peach #ef9f76;
@define-color maroon #ea999c;
@define-color red #e78284;
@define-color mauve #ca9ee6;
@define-color pink #f4b8e4;
@define-color flamingo #eebebe;
@define-color rosewater #f2d5cf;

301
.config/waybar/style.css Normal file
View file

@ -0,0 +1,301 @@
@import "frappe.css";
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: FontAwesome, Roboto, Helvetica, Arial, sans-serif;
font-size: 16px;
}
window#waybar {
background-color: @base;
color: @text;
transition-property: background-color;
transition-duration: .5s;
}
window#waybar.hidden {
opacity: 0.2;
}
/*
window#waybar.empty {
background-color: transparent;
}
window#waybar.solo {
background-color: #FFFFFF;
}
*/
window#waybar.termite {
background-color: #3F3F3F;
}
window#waybar.chromium {
background-color: #000000;
border: none;
}
button {
/* Use box-shadow instead of border so the text isn't offset */
box-shadow: inset 0 -3px transparent;
/* Avoid rounded borders under each button name */
border: none;
border-radius: 0;
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
button:hover {
background: inherit;
box-shadow: inset 0 -3px #ffffff;
}
#workspaces {
background: @crust;
border-radius: 5px;
}
#workspaces button:first-child {
border-radius: 5px 0px 0px 5px;
}
#workspaces button:last-child {
border-radius: 0 5px 5px 0;
}
#workspaces button {
padding: 0 10px;
background-color: transparent;
color: @blue;
}
#workspaces button:hover {
background: rgba(0, 0, 0, 0.2);
}
#workspaces button.focused {
background: alpha(@lavender, 0.1);
color: @green;
box-shadow: inset 0 -3px @mauve;
}
#workspaces button.urgent {
background-color: @red;
}
#mode {
background-color: @crust;
border-bottom: 3px solid @mauve;
}
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#backlight,
#network,
#pulseaudio,
#wireplumber,
#custom-media,
#tray,
#mode,
#idle_inhibitor,
#scratchpad,
#mpd {
padding: 0 10px;
color: #ffffff;
}
#window,
#workspaces {
margin: 0 4px;
}
/* If workspaces is the leftmost module, omit left margin */
.modules-left > widget:first-child > #workspaces {
margin-left: 0;
}
/* If workspaces is the rightmost module, omit right margin */
.modules-right > widget:last-child > #workspaces {
margin-right: 0;
}
#clock {
background-color: @crust;
color: @text;
}
#battery {
background-color: @crust;
color: @yellow;
}
#battery.charging, #battery.plugged {
color: @blue;
background-color: @crust;
}
@keyframes blink {
to {
background-color: #ffffff;
color: #000000;
}
}
#battery.critical:not(.charging) {
background-color: @yellow;
color: @blue;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
label:focus {
background-color: @crust;
}
#cpu {
background-color: @crust;
color: @mauve;
}
#memory {
background-color: @crust;
color: @mauve;
}
#disk {
background-color: @crust;
color: @mauve;
}
#backlight {
background-color: @crust;
color: @mauve;
}
#network {
background-color: @crust;
color: @mauve;
}
#network.disconnected {
background-color: @base;
color: @text;
}
#pulseaudio {
background-color: @crust;
color: @mauve;
}
#pulseaudio.muted {
background-color: @crust;
color: @maroon;
}
#wireplumber {
background-color: @crust;
color: @mauve;
}
#wireplumber.muted {
background-color: @crust;
color: @maroon;
}
#custom-media {
background-color: #66cc99;
color: #2a5c45;
min-width: 100px;
}
#custom-media.custom-spotify {
background-color: #66cc99;
}
#custom-media.custom-vlc {
background-color: #ffa000;
}
#temperature {
background-color: @crust;
color: @mauve;
}
#temperature.critical {
background-color: #eb4d4b;
}
#tray {
background-color: @base;
}
#tray > .passive {
-gtk-icon-effect: dim;
}
#tray > .needs-attention {
-gtk-icon-effect: highlight;
background-color: @crust;
}
#idle_inhibitor {
background-color: @crust;
color: @mauve;
}
#idle_inhibitor.activated {
background-color: @crust;
color: @maroon;
}
#mpd {
background-color: #66cc99;
color: #2a5c45;
}
#mpd.disconnected {
background-color: #f53c3c;
}
#mpd.stopped {
background-color: #90b1b1;
}
#mpd.paused {
background-color: #51a37a;
}
#language {
background: @crust;
color: @mauve;
padding: 0 5px;
min-width: 16px;
}
#keyboard-state {
background: @crust;
color: @mauve;
padding: 0 0px;
min-width: 16px;
}
#keyboard-state > label {
padding: 0 5px;
}
#keyboard-state > label.locked {
background: rgba(0, 0, 0, 0.2);
}
#scratchpad {
background: rgba(0, 0, 0, 0.2);
}
#scratchpad.empty {
background-color: transparent;
}

View file

@ -86,7 +86,7 @@ source $ZSH/oh-my-zsh.sh
if [[ -n $SSH_CONNECTION ]]; then if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim' export EDITOR='vim'
else else
export EDITOR='vim' export EDITOR='nvim'
fi fi
alias reboot-windows="systemctl reboot --boot-loader-entry=windows.conf" alias reboot-windows="systemctl reboot --boot-loader-entry=windows.conf"
@ -99,3 +99,4 @@ alias mount-lehre='kinit -kt "$HOME/keytabs/cta1233.keytab" cta1233@KERBEROS.TU-
alias rosterm='docker exec -it ros2-vim zsh' alias rosterm='docker exec -it ros2-vim zsh'
alias git-delete-merged="git branch --merged main | grep -v '^[ *]*main$' | xargs git branch -d" alias git-delete-merged="git branch --merged main | grep -v '^[ *]*main$' | xargs git branch -d"
export MOZ_ENABLE_WAYLAND=1