diff options
| author | Raghuram Subramani <raghus2247@gmail.com> | 2024-01-27 12:45:54 +0530 |
|---|---|---|
| committer | Raghuram Subramani <raghus2247@gmail.com> | 2024-01-27 12:45:54 +0530 |
| commit | 05f9bc5afd5ac5f671f1dcd3d20774b0987545ec (patch) | |
| tree | aa1a9fbe816b5217f6827ae2a41481f762c6c7f4 /config | |
| parent | cc5a352e65e533cc84358a546c9ee6f1d5a47908 (diff) | |
refactor dotfiles, and use nix
Diffstat (limited to 'config')
| -rw-r--r-- | config/alacritty/alacritty.toml | 11 | ||||
| -rw-r--r-- | config/dunst/dunstrc | 63 | ||||
| -rw-r--r-- | config/fuzzel/fuzzel.ini | 16 | ||||
| -rw-r--r-- | config/hypr/hyprland.conf | 108 | ||||
| -rw-r--r-- | config/hypr/hyprpaper.conf | 3 | ||||
| -rw-r--r-- | config/nvim/init.lua | 197 | ||||
| -rw-r--r-- | config/nvim/lua/compile.lua | 38 | ||||
| -rw-r--r-- | config/waybar/config | 58 | ||||
| -rw-r--r-- | config/waybar/style.css | 108 |
9 files changed, 602 insertions, 0 deletions
diff --git a/config/alacritty/alacritty.toml b/config/alacritty/alacritty.toml new file mode 100644 index 0000000..3c39090 --- /dev/null +++ b/config/alacritty/alacritty.toml @@ -0,0 +1,11 @@ +[window] +dynamic_title = true + +[font] +normal = { family = "UbuntuMono Nerd Font Mono", style = "Regular" } +bold = { family = "UbuntuMono Nerd Font Mono", style = "Bold" } +italic = { family = "UbuntuMono Nerd Font Mono", style = "Italic" } +bold_italic = { family = "UbuntuMono Nerd Font Mono", style = "Bold Italic" } + +[cursor] +style = { shape = "Beam" } diff --git a/config/dunst/dunstrc b/config/dunst/dunstrc new file mode 100644 index 0000000..902ba1c --- /dev/null +++ b/config/dunst/dunstrc @@ -0,0 +1,63 @@ +[global] + monitor = 1 + follow = none + indicate_hidden = yes + shrink = no + transparency = 0 + separator_height = 2 + padding = 8 + horizontal_padding = 8 + frame_width = 3 + frame_color = "#aaaaaa" + separator_color = frame + sort = yes + idle_threshold = 120 + font = Monospace 8 + line_height = 0 + markup = full + format = "<b>%s</b>\n%b" + alignment = left + vertical_alignment = center + show_age_threshold = 60 + word_wrap = yes + ellipsize = middle + ignore_newline = no + stack_duplicates = true + hide_duplicate_count = false + show_indicators = yes + icon_position = left + min_icon_size = 0 + max_icon_size = 32 + icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/ + sticky_history = yes + history_length = 20 + dmenu = /usr/bin/dmenu -p dunst: + browser = /usr/bin/sensible-browser + always_run_script = true + title = Dunst + class = Dunst + corner_radius = 0 + ignore_dbusclose = false + force_xinerama = false + mouse_left_click = close_current + mouse_middle_click = do_action, close_current + mouse_right_click = close_all +[experimental] + per_monitor_dpi = false + +[urgency_low] + background = "#131417" + foreground = "#ffffff" + timeout = 10 + +[urgency_normal] + background = "#131417" + foreground = "#ffffff" + timeout = 10 + +[urgency_critical] + background = "#131417" + foreground = "#ffffff" + timeout = 0 + +# vim: ft=cfg diff --git a/config/fuzzel/fuzzel.ini b/config/fuzzel/fuzzel.ini new file mode 100644 index 0000000..42f47df --- /dev/null +++ b/config/fuzzel/fuzzel.ini @@ -0,0 +1,16 @@ +width=50 +font=UbuntuMono Nerd Font:size=8 +terminal=alacritty -e +prompt="> " +layer=overlay +line-height=16 +icons-enabled=no + +[colors] +background=272727ff +selection-text=272727ff +selection-match=272727ff +selection=f2f0faff +text=f2f0faff +match=f2f0faff +border=f2f0faff diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf new file mode 100644 index 0000000..075dbec --- /dev/null +++ b/config/hypr/hyprland.conf @@ -0,0 +1,108 @@ +monitor=eDP-1,1920x1080@60,0x0,1 +monitor=HDMI-A-1,2560x1440@60,-2560x-350,1 + +exec-once = waybar & hyprpaper & dunst & /nix/store/$(ls -la /nix/store | grep 'polkit-gnome' | grep 4096 | awk '{print $9}' | sed -n '$p')/libexec/polkit-gnome-authentication-agent-1 & blueman-applet & nm-applet + +xwayland { + force_zero_scaling = true +} + +input { + kb_layout = us + follow_mouse = 1 + touchpad { + natural_scroll = yes + } + sensitivity = 0 +} + +general { + gaps_in = 4 + gaps_out = 8 + border_size = 2 + col.active_border = rgba(f2f0faff) + col.inactive_border = rgba(272727ff) + + layout = master +} + +decoration { + rounding = 10 + + blur { + enabled = true + size = 3 + passes = 1 + } + + drop_shadow = yes + shadow_range = 4 + shadow_render_power = 3 + col.shadow = rgba(1a1a1aee) +} + +animations { + enabled = yes + + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + + animation = windows, 1, 4, myBezier + animation = windowsOut, 1, 4, default, popin 80% + animation = fade, 1, 4, default + animation = workspaces, 1, 4, default +} + +master { + new_is_master = false +} + +gestures { + workspace_swipe = true +} + +bind = SUPER SHIFT, RETURN, exec, alacritty +bind = SUPER SHIFT, Q, killactive +bind = SUPER SHIFT, B, exit +bind = SUPER, E, exec, dolphin +bind = SUPER SHIFT, F, togglefloating +bind = SUPER, F, fullscreen, 1 +bind = SUPER, SPACE, exec, pkill fuzzel || fuzzel +bind = SUPER, X, exec, waylock + +bind = SUPER, RETURN, layoutmsg, swapwithmaster master +bind = SUPER SHIFT, J, layoutmsg, swapnext +bind = SUPER SHIFT, K, layoutmsg, swapprev + +# Move focus with mainMod + arrow keys +bind = SUPER, L, movefocus, l +bind = SUPER, H, movefocus, r +bind = SUPER, K, movefocus, u +bind = SUPER, J, movefocus, d + +# Switch workspaces with mainMod + [0-9] +bind = SUPER, 1, workspace, 1 +bind = SUPER, 2, workspace, 2 +bind = SUPER, 3, workspace, 3 +bind = SUPER, 4, workspace, 4 +bind = SUPER, 5, workspace, 5 +bind = SUPER, 6, workspace, 6 +bind = SUPER, 7, workspace, 7 +bind = SUPER, 8, workspace, 8 +bind = SUPER, 9, workspace, 9 +bind = SUPER, 0, workspace, 10 + +# Move active window to a workspace with mainMod + SHIFT + [0-9] +bind = SUPER SHIFT, 1, movetoworkspace, 1 +bind = SUPER SHIFT, 2, movetoworkspace, 2 +bind = SUPER SHIFT, 3, movetoworkspace, 3 +bind = SUPER SHIFT, 4, movetoworkspace, 4 +bind = SUPER SHIFT, 5, movetoworkspace, 5 +bind = SUPER SHIFT, 6, movetoworkspace, 6 +bind = SUPER SHIFT, 7, movetoworkspace, 7 +bind = SUPER SHIFT, 8, movetoworkspace, 8 +bind = SUPER SHIFT, 9, movetoworkspace, 9 +bind = SUPER SHIFT, 0, movetoworkspace, 10 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = SUPER, mouse:272, movewindow +bindm = SUPER, mouse:273, resizewindow diff --git a/config/hypr/hyprpaper.conf b/config/hypr/hyprpaper.conf new file mode 100644 index 0000000..8204052 --- /dev/null +++ b/config/hypr/hyprpaper.conf @@ -0,0 +1,3 @@ +preload = /home/compromyse/Pictures/wallpaper.jpg +wallpaper = ,/home/compromyse/Pictures/wallpaper.jpg +splash = false diff --git a/config/nvim/init.lua b/config/nvim/init.lua new file mode 100644 index 0000000..f3873b6 --- /dev/null +++ b/config/nvim/init.lua @@ -0,0 +1,197 @@ +-- General Settings +vim.opt.number = true +vim.opt.mouse = '' +vim.opt.ignorecase = true +vim.opt.smartcase = true +vim.opt.hlsearch = false +vim.opt.wrap = true +vim.opt.breakindent = true +vim.opt.tabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.expandtab = true +vim.opt.termguicolors = true +vim.opt.splitbelow = true +vim.opt.scrolloff = 5 +vim.opt.mouse = 'a' +vim.api.nvim_set_option('clipboard','unnamedplus') +vim.opt.ruler = false +vim.cmd.colorscheme('rasmus') + +-- Reset Cursor On Exit +local au_id = vim.api.nvim_create_augroup('RestoreCursorShapeOnExit', {clear = true}) +vim.api.nvim_create_autocmd('VimLeave',{ + command = 'set guicursor=a:ver20', + group = au_id +}) + +-- Setup Packages +require('packer').startup(function(use) + use 'wbthomason/packer.nvim' + use 'lukas-reineke/indent-blankline.nvim' + use 'windwp/nvim-autopairs' + use 'numToStr/Comment.nvim' + + use 'kvrohit/rasmus.nvim' + + use 'hrsh7th/cmp-nvim-lsp' + use 'hrsh7th/nvim-cmp' + use 'neovim/nvim-lspconfig' + use 'hrsh7th/cmp-nvim-lsp-signature-help' + use { + 'nvim-telescope/telescope.nvim', + requires = { {'nvim-lua/plenary.nvim'} } + } + + use 'stevearc/oil.nvim' + + use 'akinsho/toggleterm.nvim' + use 'christoomey/vim-tmux-navigator' + + if install_plugins then + require('packer').sync() + end +end) + +if install_plugins then + return +end + + +local oil = require('oil') +_G.oil = oil +oil.setup { + default_file_explorer = true, + columns = { + 'icon', + }, + view_options = { + show_hidden = true + } +} + +require('ibl').setup() + +require('Comment').setup { + padding = true, + toggler = { + line = '\\\\' + }, + opleader = { + block = '\\\\' + } +} + +-- CMP Setup +local cmp = require'cmp' +cmp.setup({ + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + ['<C-b>'] = cmp.mapping.scroll_docs(-4), + ['<C-f>'] = cmp.mapping.scroll_docs(4), + ['<C-Space>'] = cmp.mapping.complete(), + ['<TAB>'] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' } + }, { + { name = 'buffer' }, + } + ) +}) +cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'cmp_git' }, + }, { + { name = 'buffer' }, + }) +}) +cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' } + } +}) +cmp.setup.cmdline(':', { + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) +}) + +-- Set Up Lspconfig +local lspconfig = require('lspconfig') +local capabilities = require('cmp_nvim_lsp').default_capabilities() +servers = { 'pyright', 'ccls', 'gopls' } +for _, lsp in pairs(servers) do + lspconfig[lsp].setup { + capabilities = capabilities + } +end + +-- Set Up Telescope +local actions = require('telescope.actions') +local telescope = require('telescope') +telescope.setup({ + pickers = { + find_files = { + hidden = true + } + }, + defaults = { + layout_strategy = 'bottom_pane', + layout_config = { + height = 0.4 + }, + }, +}) + +-- Set Up ToggleTerm +require('toggleterm').setup { + direction = 'horizontal', + size = math.floor(0.8 * vim.api.nvim_win_get_height(0)) +} + +-- Set Up Autopairs +require('nvim-autopairs').setup({ map_cr = true }) + +-- Set Up Compile.lua +require('compile') + +-- Keyboard Shortcuts +vim.keymap.set('n', 'P', '<cmd>pu<cr>', { noremap = true }) + +vim.keymap.set('n', '<space><space>', '<cmd>Telescope find_files<cr>', { noremap = true }) +vim.keymap.set('n', '<space>b', '<cmd>Telescope buffers<cr>', { noremap = true }) +vim.keymap.set('n', '<space>f', '<cmd>Telescope live_grep<cr>', { noremap = true }) + +vim.keymap.set('n', '<A-x>', '<cmd>close<cr>', { noremap = true }) +vim.keymap.set('n', '<A-q>', '<cmd>bdelete!<cr>', { noremap = true }) + +vim.keymap.set('t', '<Esc>', '<C-\\><C-n>', { noremap = true }) + +vim.keymap.set('n', '\\d', vim.lsp.buf.definition, { noremap = true }) +vim.keymap.set('n', '\\f', vim.lsp.buf.declaration, { noremap = true }) + +vim.keymap.set('n', 'K', vim.lsp.buf.hover, { noremap = true }) + +vim.keymap.set('n', '<A-y>', '<cmd>ToggleTerm<cr>', { noremap = true }) +vim.keymap.set('t', '<A-y>', '<cmd>ToggleTerm<cr>', { noremap = true }) +vim.keymap.set('t', '<A-y>', '<cmd>ToggleTerm<cr>', { noremap = true }) + +vim.keymap.set('n', '<A-n>', '<cmd>bnext<cr>', { noremap = true }) +vim.keymap.set('n', '<A-p>', '<cmd>bprev<cr>', { noremap = true }) + +vim.keymap.set('n', '<C-h>', '<cmd>TmuxNavigateLeft<cr>', { noremap = true }) +vim.keymap.set('n', '<C-j>', '<cmd>TmuxNavigateDown<cr>', { noremap = true }) +vim.keymap.set('n', '<C-k>', '<cmd>TmuxNavigateUp<cr>', { noremap = true }) +vim.keymap.set('n', '<C-l>', '<cmd>TmuxNavigateRight<cr>', { noremap = true }) + +vim.keymap.set('n', '<A-a>', '<cmd>lua oil.toggle_float()<cr>', { noremap = true }) + +-- Splitting The Window +vim.api.nvim_set_keymap('n', '<A-\\>', ':vsplit<CR>', { noremap = true }) +vim.api.nvim_set_keymap('n', '<A-->', ':split<CR>', { noremap = true }) diff --git a/config/nvim/lua/compile.lua b/config/nvim/lua/compile.lua new file mode 100644 index 0000000..f529b90 --- /dev/null +++ b/config/nvim/lua/compile.lua @@ -0,0 +1,38 @@ +local openTerminal = function(command) + local Terminal = require('toggleterm.terminal').Terminal + local term = Terminal:new({ + cmd = command, + direction = 'horizontal' + }) + term:toggle() +end + +local path = vim.fn.getcwd() .. '/.compile' + +local run = function() + local file_exists = os.rename(path, path) + + if file_exists then + openTerminal( + 'echo "Directory: $(pwd)"; echo "Compilation started at $(date +"%H:%M:%S")"; echo; ' + .. 'bash ' .. path .. + '; echo; echo "Compilation finished at $(date +"%H:%M:%S")"; read' + ) + return + end + + local file = io.open(path, 'w') + + file:seek('set') + file:write([[#!/bin/sh +set -xe +]] + ) + file:close() + print('Created ' .. path) + return nil +end + +vim.keymap.set('n', 'zz', function() + run() +end) diff --git a/config/waybar/config b/config/waybar/config new file mode 100644 index 0000000..24cb4f0 --- /dev/null +++ b/config/waybar/config @@ -0,0 +1,58 @@ +{ + "layer": "top", + "output": "eDP-1", + "height": 40, + "modules-left": ["custom/launcher", "hyprland/workspaces", "hyprland/window"], + "modules-right": ["tray", "cpu", "backlight", "battery", "clock"], + + // Modules configuration + "custom/launcher": { + "format": "<span font='24'></span>" + }, + "hyprland/workspaces": { + "persistent-workspaces": { + "*": 10 + }, + "disable-scroll": true, + "format": "{icon}", + "on-click": "activate", + "format-icons": { + "urgent": "", + "active": "", + "empty": "", + "default": "", + "sort-by-number": true + }, + }, + "hyprland/window": { + "format": "> {title}", + "separate-outputs": false + }, + "tray": { + "spacing": 10 + }, + "clock": { + "timezone": "Asia/Kolkata", + "format": " {:%a, %Y-%m-%d %H:%M}", + }, + "cpu": { + "format": " {usage}%", + "tooltip": false + }, + "backlight": { + "format": "{icon} {percent}%", + "format-icons": ["", "", "", "", "", "", "", "", ""] + }, + "battery": { + "bat": "BAT1", + "states": { + "warning": 30, + "critical": 15 + }, + "format": "{icon} {capacity}%", + "format-charging": " {capacity}%+", + "format-plugged": " {capacity}%", + "format-icons": ["", "", "", "", ""] + } +} + diff --git a/config/waybar/style.css b/config/waybar/style.css new file mode 100644 index 0000000..a42db21 --- /dev/null +++ b/config/waybar/style.css @@ -0,0 +1,108 @@ +* { + font-family: UbuntuMono Nerd Font Mono; + font-weight: 500; + font-size: 16px; +} + +window#waybar { + background-color: rgba(27, 27, 27, 1); + color: #f2f0fa; + transition-property: background-color; + transition-duration: .5s; +} + +button { + box-shadow: inset 0 -3px transparent; + border: none; + border-radius: 0px; +} + +button:hover { + background: inherit; +} + +#custom-launcher { + margin: 0 10px; + padding: 0 10px; +} + +#workspaces { + border-radius: 10px; + background-color: #f2f0fa; + color: #272727; + padding: 0 10px; +} + +#workspaces button { + padding: 0 10px; + color: #272727; + background-color: #f2f0fa; +} + +#workspaces button.active { + color: #272727; + background-color: #f2f0fa; +} + +#workspaces button.urgent { + color: #272727; + background-color: #f2f0fa; +} + +#clock { + padding: 0 10px; + margin: 0 10px; + color: #f2f0fa; + border-radius: 0px; +} + +#battery, +#cpu, +#backlight, +#tray { + padding: 0 10px; + margin: 0 0px; + background-color: #f2f0fa; + color: #272727; +} + +#battery { + border-radius: 0px 10px 10px 0px; +} + +#cpu { + border-radius: 10px 0px 0px 10px; +} + +#tray { + border-radius: 10px; + margin: 0 10px; +} + +#window, +#workspaces { + margin: 0 4px; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left > widget:first-child > #workspaces { + margin-left: 0; +} + +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; +} + +label:focus { + background-color: #000000; +} + +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} |
