From 62ad4bece814bc7b53cf6d57c453d9986492ccff Mon Sep 17 00:00:00 2001 From: Rahul Sandhu Date: Fri, 15 Sep 2023 23:32:18 +0100 Subject: [PATCH] add dots --- alacritty/alacritty.yml | 55 +++++++ alacritty/alacritty.yml.bak | 52 ++++++ kanshi/config | 8 + mako/config | 28 ++++ nvim/init.lua | 202 +++++++++++++++++++++++ nvim/lua/plugins.lua | 86 ++++++++++ nvim/plugin/packer_compiled.lua | 249 +++++++++++++++++++++++++++++ rofi/bin/launcher | 15 ++ rofi/bin/powermenu | 89 +++++++++++ rofi/bin/rofi-network-manager.conf | 23 +++ rofi/bin/screenshot.sh | 158 ++++++++++++++++++ rofi/bin/wifimenu | 240 +++++++++++++++++++++++++++ rofi/colors/adapta.rasi | 16 ++ rofi/colors/arc.rasi | 16 ++ rofi/colors/black.rasi | 16 ++ rofi/colors/catppuccin.rasi | 16 ++ rofi/colors/cyberpunk.rasi | 16 ++ rofi/colors/dracula.rasi | 16 ++ rofi/colors/everforest.rasi | 16 ++ rofi/colors/gruvbox.rasi | 16 ++ rofi/colors/lovelace.rasi | 16 ++ rofi/colors/navy.rasi | 16 ++ rofi/colors/nord.rasi | 16 ++ rofi/colors/onedark.rasi | 16 ++ rofi/colors/paper.rasi | 16 ++ rofi/colors/solarized.rasi | 16 ++ rofi/colors/tokyonight.rasi | 16 ++ rofi/colors/yousai.rasi | 16 ++ rofi/shared/colors.rasi | 18 +++ rofi/shared/fonts.rasi | 12 ++ rofi/shared/theme.bash | 4 + rofi/themes/colors.rasi | 18 +++ rofi/themes/default.rasi | 163 +++++++++++++++++++ rofi/themes/fonts.rasi | 12 ++ rofi/themes/powermenu.rasi | 137 ++++++++++++++++ rofi/themes/powermenu/colors.rasi | 1 + rofi/themes/powermenu/fonts.rasi | 3 + rofi/themes/powermenu/onedark.rasi | 8 + rofi/themes/wifi.rasi | 134 ++++++++++++++++ sway/config | 172 ++++++++++++++++++++ tmux/tmux.conf | 22 +++ waybar/config | 72 +++++++++ waybar/scripts/updates.sh | 2 + waybar/style.css | 120 ++++++++++++++ 44 files changed, 2359 insertions(+) create mode 100644 alacritty/alacritty.yml create mode 100644 alacritty/alacritty.yml.bak create mode 100644 kanshi/config create mode 100644 mako/config create mode 100644 nvim/init.lua create mode 100644 nvim/lua/plugins.lua create mode 100644 nvim/plugin/packer_compiled.lua create mode 100644 rofi/bin/launcher create mode 100644 rofi/bin/powermenu create mode 100644 rofi/bin/rofi-network-manager.conf create mode 100755 rofi/bin/screenshot.sh create mode 100644 rofi/bin/wifimenu create mode 100644 rofi/colors/adapta.rasi create mode 100644 rofi/colors/arc.rasi create mode 100644 rofi/colors/black.rasi create mode 100644 rofi/colors/catppuccin.rasi create mode 100644 rofi/colors/cyberpunk.rasi create mode 100644 rofi/colors/dracula.rasi create mode 100644 rofi/colors/everforest.rasi create mode 100644 rofi/colors/gruvbox.rasi create mode 100644 rofi/colors/lovelace.rasi create mode 100644 rofi/colors/navy.rasi create mode 100644 rofi/colors/nord.rasi create mode 100644 rofi/colors/onedark.rasi create mode 100644 rofi/colors/paper.rasi create mode 100644 rofi/colors/solarized.rasi create mode 100644 rofi/colors/tokyonight.rasi create mode 100644 rofi/colors/yousai.rasi create mode 100644 rofi/shared/colors.rasi create mode 100644 rofi/shared/fonts.rasi create mode 100755 rofi/shared/theme.bash create mode 100644 rofi/themes/colors.rasi create mode 100644 rofi/themes/default.rasi create mode 100644 rofi/themes/fonts.rasi create mode 100644 rofi/themes/powermenu.rasi create mode 100644 rofi/themes/powermenu/colors.rasi create mode 100644 rofi/themes/powermenu/fonts.rasi create mode 100644 rofi/themes/powermenu/onedark.rasi create mode 100644 rofi/themes/wifi.rasi create mode 100644 sway/config create mode 100644 tmux/tmux.conf create mode 100644 waybar/config create mode 100644 waybar/scripts/updates.sh create mode 100644 waybar/style.css diff --git a/alacritty/alacritty.yml b/alacritty/alacritty.yml new file mode 100644 index 0000000..739b1e7 --- /dev/null +++ b/alacritty/alacritty.yml @@ -0,0 +1,55 @@ +# Configuration for Alacritty, the GPU enhanced terminal emulator. + +env: + # TERM: tmux-256color + TERM: xterm-256color + +window: + decorations: none + opacity: 1.0 + dynamic_title: true + padding: + x: 15 + y: 15 + +scrolling: + history: 100000 + +font: + normal: + family: JetBrainsMono Nerd Font + +colors: + primary: + background: '#101419' + foreground: '#b6beca' + cursor: + text: CellForeground + cursor: '#f5f5f5' + bright: + black: '#384148' + red: '#fc7b81' + green: '#94f7c5' + yellow: '#ffeba6' + blue: '#8cc1ff' + magenta: '#e2a6ff' + cyan: '#90daff' + white: '#fafdff' + normal: + black: '#1c252c' + red: '#e05f65' + green: '#78dba9' + yellow: '#f1cf8a' + blue: '#70a5eb' + magenta: '#c68aee' + cyan: '#74bee9' + white: '#dee1e6' + +# shell: +# program: /usr/bin/tmux + +cursor: + style: + shape: Block + +live_config_reload: true diff --git a/alacritty/alacritty.yml.bak b/alacritty/alacritty.yml.bak new file mode 100644 index 0000000..7fb9d80 --- /dev/null +++ b/alacritty/alacritty.yml.bak @@ -0,0 +1,52 @@ +# Configuration for Alacritty, the GPU enhanced terminal emulator. + +env: + # TERM: tmux-256color + TERM: xterm-256color + +window: + decorations: none + opacity: 1.0 + dynamic_title: true + padding: + x: 15 + y: 15 + +scrolling: + history: 100000 + +font: + normal: + family: JetBrainsMono Nerd Font + +colors: + primary: + background: '#1A1B1F' + foreground: '#DFE0EA' + normal: + black: '#16181D' + red: '#E85A84' + green: '#94DD8E' + yellow: '#E9D26C' + blue: '#7EB7E6' + magenta: '#D895C7' + cyan: '#89BEB7' + white: '#CFD0D7' + bright: + black: '#818181' + red: '#E85A84' + green: '#94DD8E' + yellow: '#E9D26C' + blue: '#7EB7E6' + magenta: '#D895C7' + cyan: '#89BEB7' + white: '#d2d2d2' + +# shell: +# program: /usr/bin/tmux + +cursor: + style: + shape: Block + +live_config_reload: true diff --git a/kanshi/config b/kanshi/config new file mode 100644 index 0000000..14e3c14 --- /dev/null +++ b/kanshi/config @@ -0,0 +1,8 @@ +profile { + output eDP-1 disable + output "Philips Consumer Electronics Company PHL 258B6QU UHB1623076065" mode 2560x1440 position 2560,0 + output "Ancor Communications Inc ASUS PB298 D8LMTF079748" mode 2560x1080 position 0,210 +} +profile { + output eDP-1 enable scale 1.75 +} diff --git a/mako/config b/mako/config new file mode 100644 index 0000000..d7bef8a --- /dev/null +++ b/mako/config @@ -0,0 +1,28 @@ +sort=-time +layer=overlay +background-color=#2e3440 +width=300 +height=110 +border-size=2 +border-color=#88c0d0 +border-radius=20 +icons=0 +max-icon-size=32 +default-timeout=5000 +ignore-timeout=1 +font=monospace 12 + +[urgency=low] +border-color=#cccccc + +[urgency=normal] +border-color=#d08770 + +[urgency=high] +border-color=#bf616a +default-timeout=0 + +[category=mpd] +default-timeout=2000 +group-by=category + diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..feacd8d --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,202 @@ +require("plugins") + +local builtin = require('telescope.builtin') +local mark = require("harpoon.mark") +local ui = require("harpoon.ui") + +local api = vim.api +local g = vim.g +local opt = vim.opt +local keymap = vim.api.nvim_set_keymap + +require('lualine').setup { + options = { + icons_enabled = true, + theme= 'palenight', + + component_separators = { left = '|', right = '|'}, + section_separators = { left = '', right = ''}, + + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + }, +} + +require'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "rust", "cpp" }, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + + -- List of parsers to ignore installing (for "all") + ignore_install = { "javascript" }, + + highlight = { + enable = true, + + additional_vim_regex_highlighting = false, + }, +} + +vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) + +local cmp = require("cmp") +cmp.setup { + window = { + completion = cmp.config.window.bordered() + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.confirm{ select = false }, + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end, {"i", "s"}), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end) + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "path" } + }, { + { name = "buffer" }, + }) +} + +cmp.setup.cmdline({"/"}, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = "buffer" } + } +}) + +cmp.setup.cmdline(":", { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = "path" } + }, { + { name = "cmdline" } + }) +}) + +require('formatter').setup({ + filetype = { + cpp = { + function() + return { + exe = "clang-format", + stdin = true + } + end + }, + } +}) + +require("mason").setup { + ensure_installed = { + "clangd", "clang-format", + } +} + +local lspconfig = require('lspconfig') +lspconfig.clangd.setup { + on_attach = function(client, bufnr) + client.server_capabilities.signatureHelpProvider = false + on_attach(client,bufnr) + end, + capabilities = capabilities, +} + +lspconfig.pyright.setup {} +lspconfig.rust_analyzer.setup {} + +require("luasnip.loaders.from_vscode").lazy_load() + + +require('gitsigns').setup { + signs = { + add = { hl = 'GitGutterAdd', text = '|' }, + change = { hl = 'GitGutterChange', text = '|' }, + delete = { hl = 'GitGutterDelete', text = '_' }, + topdelete = { hl = 'GitGutterDelete', text = '‾' }, + changedelete = { hl = 'GitGutterChange', text = '~' }, + }, +} + +require('Comment').setup() + +require("nightfox").setup({ + palettes = { + terafox = { + bg1 = "#1A1B1F", + }, + }, +}) + +-- vim.cmd("colorscheme terafox") + +require('decay').setup({ + style = 'dark', + italics = { + code = true, + comments = false -- to disable italic comments, replace to true to enable + }, + nvim_tree = { + contrast = true + } +}) + +-- require('decay').setup({ +-- style = 'dark', +-- nvim_tree = { +-- contrast = true -- or false to disable tree contrast, +-- }, +-- }) + +-- vim.cmd("colorscheme decay") + +opt.number = true +opt.tabstop = 4 +opt.shiftwidth = 4 +opt.relativenumber = true +opt.mouse = "a" +opt.ignorecase = true +opt.termguicolors = true +-- opt.showtabline = 2 +opt.list = true +g.loaded_netrw = 1 +g.loaded_netrwPlugin = 1 +g.mapleader = " " +g.vimtex_view_method = "zathura" +g.vimtex_compiler_method = "latexmk" + +keymap("n", "f", ":NvimTreeToggle", {silent = true} ) +keymap("n", "t", ":ToggleTerm", {silent = true} ) +keymap('n', 'y', '"+y', {silent = true}) +keymap('n', 'd', '"+d', {silent = true}) +keymap('n', 'pp', '"+p', {silent = true}) +keymap('n', 'l', ":!zathura = expand('%:r').pdf &", {silent = true}) +keymap('n', '', ":BufferLineCyclePrev", {silent = true}) +keymap('n', '', ":BufferLineCycleNext", {silent = true}) +vim.keymap.set('n', 'pf', builtin.find_files, {}) +vim.keymap.set('n', 'pg', builtin.git_files, {}) +vim.keymap.set('n', 'ps', function() + builtin.grep_string({ search = vim.fn.input("Grep > ") }) +end) +vim.keymap.set("n", "a", mark.add_file) +vim.keymap.set("n", "e", ui.toggle_quick_menu) +vim.cmd [[autocmd BufWritePre lua vim.lsp.buf.format()]] diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua new file mode 100644 index 0000000..5d5ef2e --- /dev/null +++ b/nvim/lua/plugins.lua @@ -0,0 +1,86 @@ +return require('packer').startup(function(use) + -- Packer + use 'wbthomason/packer.nvim' + + -- Lualine + use { + 'nvim-lualine/lualine.nvim', + requires = { 'kyazdani42/nvim-web-devicons', opt = true } + } + + -- Neovim dev icons + requires = { + 'nvim-tree/nvim-web-devicons', + }, + + -- Bufferline + use {'akinsho/bufferline.nvim', tag = "v3.*", requires = 'nvim-tree/nvim-web-devicons'} + + -- Nvim tree + use { + 'nvim-tree/nvim-tree.lua', + requires = { + 'nvim-tree/nvim-web-devicons', + }, + tag = 'nightly' + } + + use "kyazdani42/nvim-web-devicons" + + -- Git signs + use { + 'lewis6991/gitsigns.nvim', + } + + -- Nvim telescope + use { + 'nvim-telescope/telescope.nvim', tag = '0.1.0', + requires = { {'nvim-lua/plenary.nvim'} } + } + + -- Nightfox + use {'EdenEast/nightfox.nvim'} + + -- Treesitter + use {'nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' } } + + -- Harpoon + use('theprimeagen/harpoon') + + -- Undo tree + use('mbbill/undotree') + + -- Comment + use { + 'numToStr/Comment.nvim', + config = function() + require('Comment').setup() + end + } + + -- Indent blankline + use "lukas-reineke/indent-blankline.nvim" + + -- Alpha nvim + use { + 'goolord/alpha-nvim', + config = function () + require'alpha'.setup(require'alpha.themes.dashboard'.config) + end + } + + use {'neovim/nvim-lspconfig'} + use {'hrsh7th/cmp-nvim-lsp'} + use {'hrsh7th/cmp-buffer'} + use {'hrsh7th/cmp-path'} + use {'hrsh7th/cmp-cmdline'} + use {'hrsh7th/nvim-cmp'} + use {'L3MON4D3/LuaSnip'} + use {'saadparwaiz1/cmp_luasnip'} + use {'rafamadriz/friendly-snippets'} + use {'jayden-chan/base46.nvim'} + use {'lervag/vimtex'} + use {'williamboman/mason.nvim'} + use {'mhartington/formatter.nvim'} + use {'decaycs/decay.nvim', as = 'decay'} +end) diff --git a/nvim/plugin/packer_compiled.lua b/nvim/plugin/packer_compiled.lua new file mode 100644 index 0000000..e43f8ae --- /dev/null +++ b/nvim/plugin/packer_compiled.lua @@ -0,0 +1,249 @@ +-- Automatically generated packer.nvim plugin loader code + +if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then + vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') + return +end + +vim.api.nvim_command('packadd packer.nvim') + +local no_errors, error_msg = pcall(function() + +_G._packer = _G._packer or {} +_G._packer.inside_compile = true + +local time +local profile_info +local should_profile = false +if should_profile then + local hrtime = vim.loop.hrtime + profile_info = {} + time = function(chunk, start) + if start then + profile_info[chunk] = hrtime() + else + profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 + end + end +else + time = function(chunk, start) end +end + +local function save_profiles(threshold) + local sorted_times = {} + for chunk_name, time_taken in pairs(profile_info) do + sorted_times[#sorted_times + 1] = {chunk_name, time_taken} + end + table.sort(sorted_times, function(a, b) return a[2] > b[2] end) + local results = {} + for i, elem in ipairs(sorted_times) do + if not threshold or threshold and elem[2] > threshold then + results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' + end + end + if threshold then + table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)') + end + + _G._packer.profile_output = results +end + +time([[Luarocks path setup]], true) +local package_path_str = "/home/rahulsandhu/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/rahulsandhu/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/rahulsandhu/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/rahulsandhu/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" +local install_cpath_pattern = "/home/rahulsandhu/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" +if not string.find(package.path, package_path_str, 1, true) then + package.path = package.path .. ';' .. package_path_str +end + +if not string.find(package.cpath, install_cpath_pattern, 1, true) then + package.cpath = package.cpath .. ';' .. install_cpath_pattern +end + +time([[Luarocks path setup]], false) +time([[try_loadstring definition]], true) +local function try_loadstring(s, component, name) + local success, result = pcall(loadstring(s), name, _G.packer_plugins[name]) + if not success then + vim.schedule(function() + vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) + end) + end + return result +end + +time([[try_loadstring definition]], false) +time([[Defining packer_plugins]], true) +_G.packer_plugins = { + ["Comment.nvim"] = { + config = { "\27LJ\2\n5\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\fComment\frequire\0" }, + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/Comment.nvim", + url = "https://github.com/numToStr/Comment.nvim" + }, + LuaSnip = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/LuaSnip", + url = "https://github.com/L3MON4D3/LuaSnip" + }, + ["alpha-nvim"] = { + config = { "\27LJ\2\na\0\0\5\0\5\0\n6\0\0\0'\2\1\0B\0\2\0029\0\2\0006\2\0\0'\4\3\0B\2\2\0029\2\4\2B\0\2\1K\0\1\0\vconfig\27alpha.themes.dashboard\nsetup\nalpha\frequire\0" }, + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/alpha-nvim", + url = "https://github.com/goolord/alpha-nvim" + }, + ["base46.nvim"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/base46.nvim", + url = "https://github.com/jayden-chan/base46.nvim" + }, + ["bufferline.nvim"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/bufferline.nvim", + url = "https://github.com/akinsho/bufferline.nvim" + }, + ["cmp-buffer"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/cmp-buffer", + url = "https://github.com/hrsh7th/cmp-buffer" + }, + ["cmp-cmdline"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/cmp-cmdline", + url = "https://github.com/hrsh7th/cmp-cmdline" + }, + ["cmp-nvim-lsp"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp", + url = "https://github.com/hrsh7th/cmp-nvim-lsp" + }, + ["cmp-path"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/cmp-path", + url = "https://github.com/hrsh7th/cmp-path" + }, + cmp_luasnip = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/cmp_luasnip", + url = "https://github.com/saadparwaiz1/cmp_luasnip" + }, + decay = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/decay", + url = "https://github.com/decaycs/decay.nvim" + }, + ["formatter.nvim"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/formatter.nvim", + url = "https://github.com/mhartington/formatter.nvim" + }, + ["friendly-snippets"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/friendly-snippets", + url = "https://github.com/rafamadriz/friendly-snippets" + }, + ["gitsigns.nvim"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/gitsigns.nvim", + url = "https://github.com/lewis6991/gitsigns.nvim" + }, + harpoon = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/harpoon", + url = "https://github.com/theprimeagen/harpoon" + }, + ["indent-blankline.nvim"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim", + url = "https://github.com/lukas-reineke/indent-blankline.nvim" + }, + ["lualine.nvim"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/lualine.nvim", + url = "https://github.com/nvim-lualine/lualine.nvim" + }, + ["mason.nvim"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/mason.nvim", + url = "https://github.com/williamboman/mason.nvim" + }, + ["nightfox.nvim"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/nightfox.nvim", + url = "https://github.com/EdenEast/nightfox.nvim" + }, + ["nvim-cmp"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/nvim-cmp", + url = "https://github.com/hrsh7th/nvim-cmp" + }, + ["nvim-lspconfig"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", + url = "https://github.com/neovim/nvim-lspconfig" + }, + ["nvim-tree.lua"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/nvim-tree.lua", + url = "https://github.com/nvim-tree/nvim-tree.lua" + }, + ["nvim-treesitter"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/nvim-treesitter", + url = "https://github.com/nvim-treesitter/nvim-treesitter" + }, + ["nvim-web-devicons"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/nvim-web-devicons", + url = "https://github.com/kyazdani42/nvim-web-devicons" + }, + ["packer.nvim"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/packer.nvim", + url = "https://github.com/wbthomason/packer.nvim" + }, + ["plenary.nvim"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/plenary.nvim", + url = "https://github.com/nvim-lua/plenary.nvim" + }, + ["telescope.nvim"] = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/telescope.nvim", + url = "https://github.com/nvim-telescope/telescope.nvim" + }, + undotree = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/undotree", + url = "https://github.com/mbbill/undotree" + }, + vimtex = { + loaded = true, + path = "/home/rahulsandhu/.local/share/nvim/site/pack/packer/start/vimtex", + url = "https://github.com/lervag/vimtex" + } +} + +time([[Defining packer_plugins]], false) +-- Config for: alpha-nvim +time([[Config for alpha-nvim]], true) +try_loadstring("\27LJ\2\na\0\0\5\0\5\0\n6\0\0\0'\2\1\0B\0\2\0029\0\2\0006\2\0\0'\4\3\0B\2\2\0029\2\4\2B\0\2\1K\0\1\0\vconfig\27alpha.themes.dashboard\nsetup\nalpha\frequire\0", "config", "alpha-nvim") +time([[Config for alpha-nvim]], false) +-- Config for: Comment.nvim +time([[Config for Comment.nvim]], true) +try_loadstring("\27LJ\2\n5\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\fComment\frequire\0", "config", "Comment.nvim") +time([[Config for Comment.nvim]], false) + +_G._packer.inside_compile = false +if _G._packer.needs_bufread == true then + vim.cmd("doautocmd BufRead") +end +_G._packer.needs_bufread = false + +if should_profile then save_profiles() end + +end) + +if not no_errors then + error_msg = error_msg:gsub('"', '\\"') + vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') +end diff --git a/rofi/bin/launcher b/rofi/bin/launcher new file mode 100644 index 0000000..fda1c84 --- /dev/null +++ b/rofi/bin/launcher @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +DIR="$HOME/.config" + +rofi \ + -show drun \ + -modi run,drun \ + -no-lazy-grab \ + -scroll-method 0 \ + -drun-match-fields all \ + -drun-display-format "{name}" \ + -no-drun-show-actions \ + -terminal st \ + -theme "$DIR"/rofi/themes/default.rasi + -kb-cancel Alt-F1 \ diff --git a/rofi/bin/powermenu b/rofi/bin/powermenu new file mode 100644 index 0000000..b074791 --- /dev/null +++ b/rofi/bin/powermenu @@ -0,0 +1,89 @@ +#!/usr/bin/env bash + +dir="$HOME/.config/rofi/themes/" +theme='powermenu' + +# CMDs +uptime="`uptime -p | sed -e 's/up //g'`" +host=`hostnamectl hostname` +user=`whoami` +# Options +shutdown=' Shutdown' +reboot=' Reboot' +lock=' Lock' +suspend=' Suspend' +logout=' Logout' +yes=' Yes' +no=' No' + +# Rofi CMD +rofi_cmd() { + rofi -theme-str 'window {location: center; anchor: center; fullscreen: false; height: 350px;}' \ + -dmenu \ + -p "$user@$host" \ + -mesg "Uptime: $uptime" \ + -theme ${dir}/${theme}.rasi +} + +# Confirmation CMD +confirm_cmd() { + rofi -theme-str 'window {location: center; anchor: center; fullscreen: false; width: 250px;}' \ + -theme-str 'mainbox {children: [ "message", "listview" ];}' \ + -theme-str 'listview {columns: 2; lines: 1;}' \ + -theme-str 'element-text {horizontal-align: 0.5;}' \ + -theme-str 'textbox {horizontal-align: 0.5;}' \ + -dmenu \ + -p 'Confirmation' \ + -mesg 'Are you Sure?' \ + -theme ${dir}/${theme}.rasi +} + +# Ask for confirmation +confirm_exit() { + echo -e "$yes\n$no" | confirm_cmd +} + +# Pass variables to rofi dmenu +run_rofi() { + echo -e "$lock\n$suspend\n$logout\n$reboot\n$shutdown" | rofi_cmd +} + +# Execute Command +run_cmd() { + selected="$(confirm_exit)" + if [[ "$selected" == "$yes" ]]; then + if [[ $1 == '--shutdown' ]]; then + systemctl poweroff + elif [[ $1 == '--reboot' ]]; then + systemctl reboot + elif [[ $1 == '--suspend' ]]; then + mpc -q pause + amixer set Master mute + systemctl suspend + elif [[ $1 == '--logout' ]]; then + swaymsg exit + fi + else + exit 0 + fi +} + +# Actions +chosen="$(run_rofi)" +case ${chosen} in + $shutdown) + run_cmd --shutdown + ;; + $reboot) + run_cmd --reboot + ;; + $lock) + swaylock -i /home/rahulsandhu/.config/sway/wallpaper.jpg -k --font JetBrainsMonoNerdFont --clock --indicator + ;; + $suspend) + run_cmd --suspend + ;; + $logout) + run_cmd --logout + ;; +esac diff --git a/rofi/bin/rofi-network-manager.conf b/rofi/bin/rofi-network-manager.conf new file mode 100644 index 0000000..a89630c --- /dev/null +++ b/rofi/bin/rofi-network-manager.conf @@ -0,0 +1,23 @@ +# Location +#This sets the anchor point: +# +---------- + +# | 1 | 2 | 3 | +# | 8 | 0 | 4 | +# | 7 | 6 | 5 | +# +-----------+ +#If you want the window to be in the upper right corner, set location to 3. +LOCATION=0 +QRCODE_LOCATION=$LOCATION +#X, Y Offset +Y_AXIS=0 +X_AXIS=0 +#Use notifications or not +# Values on / off +NOTIFICATIONS_INIT="off" +#Location of qrcode wifi image +QRCODE_DIR="/tmp/" +#WIDTH_FIX_MAIN/WIDTH_FIX_STATUS needs to be increased or decreased , if the text +#doesn't fit or it has too much space at the end when you launch rofi-network-manager. +#It depends on the font type and size. +WIDTH_FIX_MAIN=8 +WIDTH_FIX_STATUS=10 diff --git a/rofi/bin/screenshot.sh b/rofi/bin/screenshot.sh new file mode 100755 index 0000000..7a535da --- /dev/null +++ b/rofi/bin/screenshot.sh @@ -0,0 +1,158 @@ +# Import Current Theme +source "$HOME"/.config/rofi/applets/shared/theme.bash +theme="$type/$style" + +# Theme Elements +prompt='Screenshot' +mesg="DIR: `xdg-user-dir PICTURES`/Screenshots" + +if [[ "$theme" == *'type-1'* ]]; then + list_col='1' + list_row='5' + win_width='400px' +elif [[ "$theme" == *'type-3'* ]]; then + list_col='1' + list_row='5' + win_width='120px' +elif [[ "$theme" == *'type-5'* ]]; then + list_col='1' + list_row='5' + win_width='520px' +elif [[ ( "$theme" == *'type-2'* ) || ( "$theme" == *'type-4'* ) ]]; then + list_col='5' + list_row='1' + win_width='670px' +fi + +# Options +layout=`cat ${theme} | grep 'USE_ICON' | cut -d'=' -f2` +if [[ "$layout" == 'NO' ]]; then + option_1=" Capture Desktop" + option_2=" Capture Area" + option_3=" Capture Window" + option_4=" Capture in 5s" + option_5=" Capture in 10s" +else + option_1="" + option_2="" + option_3="" + option_4="" + option_5="" +fi + +# Rofi CMD +rofi_cmd() { + rofi -theme-str "window {width: $win_width;}" \ + -theme-str "listview {columns: $list_col; lines: $list_row;}" \ + -theme-str 'textbox-prompt-colon {str: "";}' \ + -dmenu \ + -p "$prompt" \ + -mesg "$mesg" \ + -markup-rows \ + -theme ${theme} +} + +# Pass variables to rofi dmenu +run_rofi() { + echo -e "$option_1\n$option_2\n$option_3\n$option_4\n$option_5" | rofi_cmd +} + +# Screenshot +time=`date +%Y-%m-%d-%H-%M-%S` +geometry=`xrandr | grep 'current' | head -n1 | cut -d',' -f2 | tr -d '[:blank:],current'` +dir="`xdg-user-dir PICTURES`/Screenshots" +file="Screenshot_${time}_${geometry}.png" + +if [[ ! -d "$dir" ]]; then + mkdir -p "$dir" +fi + +# notify and view screenshot +notify_view() { + notify_cmd_shot='dunstify -u low --replace=699' + ${notify_cmd_shot} "Copied to clipboard." + viewnior ${dir}/"$file" + if [[ -e "$dir/$file" ]]; then + ${notify_cmd_shot} "Screenshot Saved." + else + ${notify_cmd_shot} "Screenshot Deleted." + fi +} + +# Copy screenshot to clipboard +copy_shot () { + tee "$file" | xclip -selection clipboard -t image/png +} + +# countdown +countdown () { + for sec in `seq $1 -1 1`; do + dunstify -t 1000 --replace=699 "Taking shot in : $sec" + sleep 1 + done +} + +# take shots +shotnow () { + cd ${dir} && sleep 0.5 && maim -u -f png | copy_shot + notify_view +} + +shot5 () { + countdown '5' + sleep 1 && cd ${dir} && maim -u -f png | copy_shot + notify_view +} + +shot10 () { + countdown '10' + sleep 1 && cd ${dir} && maim -u -f png | copy_shot + notify_view +} + +shotwin () { + cd ${dir} && maim -u -f png -i `xdotool getactivewindow` | copy_shot + notify_view +} + +shotarea () { + cd ${dir} && maim -u -f png -s -b 2 -c 0.35,0.55,0.85,0.25 -l | copy_shot + notify_view +} + +# Execute Command +run_cmd() { + if [[ "$1" == '--opt1' ]]; then + shotnow + elif [[ "$1" == '--opt2' ]]; then + shotarea + elif [[ "$1" == '--opt3' ]]; then + shotwin + elif [[ "$1" == '--opt4' ]]; then + shot5 + elif [[ "$1" == '--opt5' ]]; then + shot10 + fi +} + +# Actions +chosen="$(run_rofi)" +case ${chosen} in + $option_1) + run_cmd --opt1 + ;; + $option_2) + run_cmd --opt2 + ;; + $option_3) + run_cmd --opt3 + ;; + $option_4) + run_cmd --opt4 + ;; + $option_5) + run_cmd --opt5 + ;; +esac + + diff --git a/rofi/bin/wifimenu b/rofi/bin/wifimenu new file mode 100644 index 0000000..eee1462 --- /dev/null +++ b/rofi/bin/wifimenu @@ -0,0 +1,240 @@ +#!/bin/bash +# Default Values +LOCATION=0 +QRCODE_LOCATION=$LOCATION +Y_AXIS=0 +X_AXIS=0 +NOTIFICATIONS_INIT="off" +QRCODE_DIR="/tmp/" +WIDTH_FIX_MAIN=1 +WIDTH_FIX_STATUS=10 +DIR="$HOME/.config/rofi" +PASSWORD_ENTER="if connection is stored,hit enter/esc." +WIRELESS_INTERFACES=($(nmcli device | awk '$2=="wifi" {print $1}')) +WIRELESS_INTERFACES_PRODUCT=() +WLAN_INT=0 +WIRED_INTERFACES=($(nmcli device | awk '$2=="ethernet" {print $1}')) +WIRED_INTERFACES_PRODUCT=() +function initialization() { + source "$DIR/bin/rofi-network-manager.conf" || source "${XDG_CONFIG_HOME:-$HOME/.config}/rofi/bin/rofi-network-manager.conf" + { [[ -f "$DIR/themes/wifi.rasi" ]] && RASI_DIR="$DIR/themes/wifi.rasi"; } || { [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/rofi/themes/wifi.rasi" ]] && RASI_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/rofi/themes/wifi.rasi"; } || exit + for i in "${WIRELESS_INTERFACES[@]}"; do WIRELESS_INTERFACES_PRODUCT+=("$(nmcli -f general.product device show "$i" | awk '{print $2}')"); done + for i in "${WIRED_INTERFACES[@]}"; do WIRED_INTERFACES_PRODUCT+=("$(nmcli -f general.product device show "$i" | awk '{print $2}')"); done + wireless_interface_state && ethernet_interface_state +} +function notification() { + [[ "$NOTIFICATIONS_INIT" == "on" && -x "$(command -v notify-send)" ]] && notify-send -r "5" -u "normal" $1 "$2" +} +function wireless_interface_state() { + ACTIVE_SSID=$(nmcli device status | grep "^${WIRELESS_INTERFACES[WLAN_INT]}." | awk '{print $4}') + WIFI_CON_STATE=$(nmcli device status | grep "^${WIRELESS_INTERFACES[WLAN_INT]}." | awk '{print $3}') + { [[ "$WIFI_CON_STATE" == "unavailable" ]] && WIFI_LIST="***Wi-Fi Disabled***" && WIFI_SWITCH="~Wi-Fi On" && OPTIONS="${WIFI_LIST}\n${WIFI_SWITCH}\n~Scan"; } || { [[ "$WIFI_CON_STATE" =~ "connected" ]] && { + PROMPT=${WIRELESS_INTERFACES_PRODUCT[WLAN_INT]}[${WIRELESS_INTERFACES[WLAN_INT]}] + WIFI_LIST=$(nmcli --fields IN-USE,SSID,SECURITY,BARS device wifi list ifname "${WIRELESS_INTERFACES[WLAN_INT]}" | awk -F' +' '{ if (!seen[$2]++) print}' | sed "s/^IN-USE\s//g" | sed "/*/d" | sed "s/^ *//" | awk '$1!="--" {print}') + [[ "$ACTIVE_SSID" == "--" ]] && WIFI_SWITCH="~Scan\n~Manual/Hidden\n~Wi-Fi Off" || WIFI_SWITCH="~Scan\n~Disconnect\n~Manual/Hidden\n~Wi-Fi Off" + OPTIONS="${WIFI_LIST}\n${WIFI_SWITCH}" + }; } +} +function ethernet_interface_state() { + WIRED_CON_STATE=$(nmcli device status | grep "ethernet" | head -1 | awk '{print $3}') + { [[ "$WIRED_CON_STATE" == "disconnected" ]] && WIRED_SWITCH="~Eth On"; } || { [[ "$WIRED_CON_STATE" == "connected" ]] && WIRED_SWITCH="~Eth Off"; } || { [[ "$WIRED_CON_STATE" == "unavailable" ]] && WIRED_SWITCH="***Wired Unavailable***"; } || { [[ "$WIRED_CON_STATE" == "connecting" ]] && WIRED_SWITCH="***Wired Initializing***"; } + OPTIONS="${OPTIONS}\n${WIRED_SWITCH}" +} +function rofi_menu() { + { [[ ${#WIRELESS_INTERFACES[@]} -ne "1" ]] && OPTIONS="${OPTIONS}\n~Change Wifi Interface\n~More Options"; } || { OPTIONS="${OPTIONS}\n~More Options"; } + { [[ "$WIRED_CON_STATE" == "connected" ]] && PROMPT="${WIRED_INTERFACES_PRODUCT}[$WIRED_INTERFACES]"; } || PROMPT="${WIRELESS_INTERFACES_PRODUCT[WLAN_INT]}[${WIRELESS_INTERFACES[WLAN_INT]}]" + SELECTION=$(echo -e "$OPTIONS" | rofi_cmd "$OPTIONS" $WIDTH_FIX_MAIN "-a 0") + SSID=$(echo "$SELECTION" | sed "s/\s\{2,\}/\|/g" | awk -F "|" '{print $1}') + selection_action +} +function dimensions() { + { [[ "${1}" != "" ]] && WIDTH=$(echo -e "$1" | awk '{print length}' | sort -n | tail -1) && ((WIDTH += $2)) && LINES=$(echo -e "$1" | wc -l); } || { WIDTH=$2 && LINES=0; } +} +function rofi_cmd() { + dimensions "$1" $2 + rofi -dmenu -i -location "$LOCATION" -yoffset "$Y_AXIS" -xoffset "$X_AXIS" $3 \ + -theme "$RASI_DIR" -theme-str ' + window{width: '"$((WIDTH / 2))"'em;} + listview{lines: '"$LINES"';} + textbox-prompt-colon{str:"'"$PROMPT"':";} + '"$4"'' +} +function change_wireless_interface() { + { [[ ${#WIRELESS_INTERFACES[@]} -eq "2" ]] && { [[ $WLAN_INT -eq "0" ]] && WLAN_INT=1 || WLAN_INT=0; }; } || { + LIST_WLAN_INT="" + for i in "${!WIRELESS_INTERFACES[@]}"; do LIST_WLAN_INT=("${LIST_WLAN_INT[@]}${WIRELESS_INTERFACES_PRODUCT[$i]}[${WIRELESS_INTERFACES[$i]}]\n"); done + LIST_WLAN_INT[-1]=${LIST_WLAN_INT[-1]::-2} + CHANGE_WLAN_INT=$(echo -e "${LIST_WLAN_INT[@]}" | rofi_cmd "${LIST_WLAN_INT[@]}" $WIDTH_FIX_STATUS) + for i in "${!WIRELESS_INTERFACES[@]}"; do [[ $CHANGE_WLAN_INT == "${WIRELESS_INTERFACES_PRODUCT[$i]}[${WIRELESS_INTERFACES[$i]}]" ]] && WLAN_INT=$i && break; done + } + wireless_interface_state && ethernet_interface_state + rofi_menu +} +function scan() { + [[ "$WIFI_CON_STATE" =~ "unavailable" ]] && change_wifi_state "Wi-Fi" "Enabling Wi-Fi connection" "on" && sleep 2 + notification "-t 0 Wifi" "Please Wait Scanning" + WIFI_LIST=$(nmcli --fields IN-USE,SSID,SECURITY,BARS device wifi list ifname "${WIRELESS_INTERFACES[WLAN_INT]}" --rescan yes | awk -F' +' '{ if (!seen[$2]++) print}' | sed "s/^IN-USE\s//g" | sed "/*/d" | sed "s/^ *//" | awk '$1!="--" {print}') + wireless_interface_state && ethernet_interface_state + notification "-t 1 Wifi" "Please Wait Scanning" + rofi_menu +} +function change_wifi_state() { + notification "$1" "$2" + nmcli radio wifi "$3" +} +function change_wired_state() { + notification "$1" "$2" + nmcli device "$3" "$4" +} +function net_restart() { + notification "$1" "$2" + nmcli networking off && sleep 3 && nmcli networking on +} +function disconnect() { + ACTIVE_SSID=$(nmcli -t -f GENERAL.CONNECTION dev show "${WIRELESS_INTERFACES[WLAN_INT]}" | cut -d ':' -f2) + notification "$1" "You're now disconnected from Wi-Fi network '$ACTIVE_SSID'" + nmcli con down id "$ACTIVE_SSID" +} +function check_wifi_connected() { + [[ "$(nmcli device status | grep "^${WIRELESS_INTERFACES[WLAN_INT]}." | awk '{print $3}')" == "connected" ]] && disconnect "Connection_Terminated" +} +function connect() { + check_wifi_connected + notification "-t 0 Wi-Fi" "Connecting to $1" + { [[ $(nmcli dev wifi con "$1" password "$2" ifname "${WIRELESS_INTERFACES[WLAN_INT]}" | grep -c "successfully activated") -eq "1" ]] && notification "Connection_Established" "You're now connected to Wi-Fi network '$1'"; } || notification "Connection_Error" "Connection can not be established" +} +function enter_passwword() { + PROMPT="Enter_Password" && PASS=$(echo "$PASSWORD_ENTER" | rofi_cmd "$PASSWORD_ENTER" 4 "-password") +} +function enter_ssid() { + PROMPT="Enter_SSID" && SSID=$(rofi_cmd "" 40) +} +function stored_connection() { + check_wifi_connected + notification "-t 0 Wi-Fi" "Connecting to $1" + { [[ $(nmcli dev wifi con "$1" ifname "${WIRELESS_INTERFACES[WLAN_INT]}" | grep -c "successfully activated") -eq "1" ]] && notification "Connection_Established" "You're now connected to Wi-Fi network '$1'"; } || notification "Connection_Error" "Connection can not be established" +} +function ssid_manual() { + enter_ssid + [[ -n $SSID ]] && { + enter_passwword + { [[ -n "$PASS" ]] && [[ "$PASS" != "$PASSWORD_ENTER" ]] && connect "$SSID" "$PASS"; } || stored_connection "$SSID" + } +} +function ssid_hidden() { + enter_ssid + [[ -n $SSID ]] && { + enter_passwword && check_wifi_connected + [[ -n "$PASS" ]] && [[ "$PASS" != "$PASSWORD_ENTER" ]] && { + nmcli con add type wifi con-name "$SSID" ssid "$SSID" ifname "${WIRELESS_INTERFACES[WLAN_INT]}" + nmcli con modify "$SSID" wifi-sec.key-mgmt wpa-psk + nmcli con modify "$SSID" wifi-sec.psk "$PASS" + } || [[ $(nmcli -g NAME con show | grep -c "$SSID") -eq "0" ]] && nmcli con add type wifi con-name "$SSID" ssid "$SSID" ifname "${WIRELESS_INTERFACES[WLAN_INT]}" + notification "-t 0 Wifi" "Connecting to $SSID" + { [[ $(nmcli con up id "$SSID" | grep -c "successfully activated") -eq "1" ]] && notification "Connection_Established" "You're now connected to Wi-Fi network '$SSID'"; } || notification "Connection_Error" "Connection can not be established" + } +} +function interface_status() { + local -n INTERFACES=$1 && local -n INTERFACES_PRODUCT=$2 + for i in "${!INTERFACES[@]}"; do + CON_STATE=$(nmcli device status | grep "^${INTERFACES[$i]}." | awk '{print $3}') + INT_NAME=${INTERFACES_PRODUCT[$i]}[${INTERFACES[$i]}] + [[ "$CON_STATE" == "connected" ]] && STATUS="$INT_NAME:\n\t$(nmcli -t -f GENERAL.CONNECTION dev show "${INTERFACES[$i]}" | awk -F '[:]' '{print $2}') ~ $(nmcli -t -f IP4.ADDRESS dev show "${INTERFACES[$i]}" | awk -F '[:/]' '{print $2}')" || STATUS="$INT_NAME: ${CON_STATE^}" + echo -e "${STATUS}" + done +} +function status() { + WLAN_STATUS="$(interface_status WIRELESS_INTERFACES WIRELESS_INTERFACES_PRODUCT)" + ETH_STATUS="$(interface_status WIRED_INTERFACES WIRED_INTERFACES_PRODUCT)" + OPTIONS="${ETH_STATUS}\n${WLAN_STATUS}" + ACTIVE_VPN=$(nmcli -g NAME,TYPE con show --active | awk '/:vpn/' | sed 's/:vpn.*//g') + [[ -n $ACTIVE_VPN ]] && OPTIONS="${OPTIONS}\n${ACTIVE_VPN}[VPN]: $(nmcli -g ip4.address con show "${ACTIVE_VPN}" | awk -F '[:/]' '{print $1}')" + echo -e "$OPTIONS" | rofi_cmd "$OPTIONS" $WIDTH_FIX_STATUS "" "mainbox {children:[listview];}" +} +function share_pass() { + SSID=$(nmcli dev wifi show-password | grep -oP '(?<=SSID: ).*' | head -1) + PASSWORD=$(nmcli dev wifi show-password | grep -oP '(?<=Password: ).*' | head -1) + OPTIONS="SSID: ${SSID}\nPassword: ${PASSWORD}" + [[ -x "$(command -v qrencode)" ]] && OPTIONS="${OPTIONS}\n~QrCode" + SELECTION=$(echo -e "$OPTIONS" | rofi_cmd "$OPTIONS" $WIDTH_FIX_STATUS "-a "$((LINES - 1))"" "mainbox {children:[listview];}") + selection_action +} +function gen_qrcode() { + qrencode -t png -o /tmp/wifi_qr.png -s 10 -m 2 "WIFI:S:""$SSID"";T:""$(nmcli dev wifi show-password | grep -oP '(?<=Security: ).*' | head -1)"";P:""$PASSWORD"";;" + rofi -dmenu -location "$QRCODE_LOCATION" \ + -theme-str ' + * { + background-color: transparent; + text-color: transparent;} + window { + border-radius: 6px; + padding: 1em; + background-color: transparent; + background-image: url("'$QRCODE_DIR'wifi_qr.png",width); + width: 20em;} + textbox-prompt-colon { + expand: false; + margin: 0; + str:"";} + listview { lines: 15;} + entry { enabled: false;}' +} +function manual_hidden() { + OPTIONS="~Manual\n~Hidden" && SELECTION=$(echo -e "$OPTIONS" | rofi_cmd "$OPTIONS" $WIDTH_FIX_STATUS "" "mainbox {children:[listview];}") + selection_action +} +function vpn() { + ACTIVE_VPN=$(nmcli -g NAME,TYPE con show --active | awk '/:vpn/' | sed 's/:vpn.*//g') + [[ $ACTIVE_VPN ]] && OPTIONS="~Deactive $ACTIVE_VPN" || OPTIONS="$(nmcli -g NAME,TYPE connection | awk '/:vpn/' | sed 's/:vpn.*//g')" + VPN_ACTION=$(echo -e "$OPTIONS" | rofi_cmd "$OPTIONS" "$WIDTH_FIX_STATUS" "" "mainbox {children:[listview];}") + [[ -n "$VPN_ACTION" ]] && { { [[ "$VPN_ACTION" =~ "~Deactive" ]] && nmcli connection down "$ACTIVE_VPN" && notification "VPN_Deactivated" "$ACTIVE_VPN"; } || { + notification "-t 0 Activating_VPN" "$VPN_ACTION" && VPN_OUTPUT=$(nmcli connection up "$VPN_ACTION" 2>/dev/null) + { [[ $(echo "$VPN_OUTPUT" | grep -c "Connection successfully activated") -eq "1" ]] && notification "VPN_Successfully_Activated" "$VPN_ACTION"; } || notification "Error_Activating_VPN" "Check your configuration for $VPN_ACTION" + }; } +} +function more_options() { + OPTIONS="" + [[ "$WIFI_CON_STATE" == "connected" ]] && OPTIONS="~Share Wifi Password\n" + OPTIONS="${OPTIONS}~Status\n~Restart Network" + [[ $(nmcli -g NAME,TYPE connection | awk '/:vpn/' | sed 's/:vpn.*//g') ]] && OPTIONS="${OPTIONS}\n~VPN" + [[ -x "$(command -v nm-connection-editor)" ]] && OPTIONS="${OPTIONS}\n~Open Connection Editor" + SELECTION=$(echo -e "$OPTIONS" | rofi_cmd "$OPTIONS" "$WIDTH_FIX_STATUS" "" "mainbox {children:[listview];}") + selection_action +} +function selection_action() { + case "$SELECTION" in + "~Disconnect") disconnect "Connection_Terminated" ;; + "~Scan") scan ;; + "~Status") status ;; + "~Share Wifi Password") share_pass ;; + "~Manual/Hidden") manual_hidden ;; + "~Manual") ssid_manual ;; + "~Hidden") ssid_hidden ;; + "~Wi-Fi On") change_wifi_state "Wi-Fi" "Enabling Wi-Fi connection" "on" ;; + "~Wi-Fi Off") change_wifi_state "Wi-Fi" "Disabling Wi-Fi connection" "off" ;; + "~Eth Off") change_wired_state "Ethernet" "Disabling Wired connection" "disconnect" "${WIRED_INTERFACES}" ;; + "~Eth On") change_wired_state "Ethernet" "Enabling Wired connection" "connect" "${WIRED_INTERFACES}" ;; + "***Wi-Fi Disabled***") ;; + "***Wired Unavailable***") ;; + "***Wired Initializing***") ;; + "~Change Wifi Interface") change_wireless_interface ;; + "~Restart Network") net_restart "Network" "Restarting Network" ;; + "~QrCode") gen_qrcode ;; + "~More Options") more_options ;; + "~Open Connection Editor") nm-connection-editor ;; + "~VPN") vpn ;; + *) + [[ -n "$SELECTION" ]] && [[ "$WIFI_LIST" =~ .*"$SELECTION".* ]] && { + [[ "$SSID" == "*" ]] && SSID=$(echo "$SELECTION" | sed "s/\s\{2,\}/\|/g " | awk -F "|" '{print $3}') + { [[ "$ACTIVE_SSID" == "$SSID" ]] && nmcli con up "$SSID" ifname "${WIRELESS_INTERFACES[WLAN_INT]}"; } || { + [[ "$SELECTION" =~ "WPA2" ]] || [[ "$SELECTION" =~ "WEP" ]] && enter_passwword + { [[ -n "$PASS" ]] && [[ "$PASS" != "$PASSWORD_ENTER" ]] && connect "$SSID" "$PASS"; } || stored_connection "$SSID" + } + } + ;; + esac +} +function main() { + initialization && rofi_menu +} +main diff --git a/rofi/colors/adapta.rasi b/rofi/colors/adapta.rasi new file mode 100644 index 0000000..dcde9e5 --- /dev/null +++ b/rofi/colors/adapta.rasi @@ -0,0 +1,16 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + **/ + +* { + background: #222D32FF; + background-alt: #29353BFF; + foreground: #B8C2C6FF; + selected: #00BCD4FF; + active: #21FF90FF; + urgent: #FF4B60FF; +} diff --git a/rofi/colors/arc.rasi b/rofi/colors/arc.rasi new file mode 100644 index 0000000..0dfb773 --- /dev/null +++ b/rofi/colors/arc.rasi @@ -0,0 +1,16 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + **/ + +* { + background: #2F343FFF; + background-alt: #383C4AFF; + foreground: #BAC5D0FF; + selected: #5294E2FF; + active: #98C379FF; + urgent: #E06B74FF; +} diff --git a/rofi/colors/black.rasi b/rofi/colors/black.rasi new file mode 100644 index 0000000..fa7b76f --- /dev/null +++ b/rofi/colors/black.rasi @@ -0,0 +1,16 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + **/ + +* { + background: #000000FF; + background-alt: #101010FF; + foreground: #FFFFFFFF; + selected: #62AEEFFF; + active: #98C379FF; + urgent: #E06B74FF; +} diff --git a/rofi/colors/catppuccin.rasi b/rofi/colors/catppuccin.rasi new file mode 100644 index 0000000..62c5945 --- /dev/null +++ b/rofi/colors/catppuccin.rasi @@ -0,0 +1,16 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + **/ + +* { + background: #1E1D2FFF; + background-alt: #282839FF; + foreground: #D9E0EEFF; + selected: #7AA2F7FF; + active: #ABE9B3FF; + urgent: #F28FADFF; +} diff --git a/rofi/colors/cyberpunk.rasi b/rofi/colors/cyberpunk.rasi new file mode 100644 index 0000000..f5fa0e7 --- /dev/null +++ b/rofi/colors/cyberpunk.rasi @@ -0,0 +1,16 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + **/ + +* { + background: #000B1EFF; + background-alt: #0A1528FF; + foreground: #0ABDC6FF; + selected: #0ABDC6FF; + active: #00FF00FF; + urgent: #FF0000FF; +} diff --git a/rofi/colors/dracula.rasi b/rofi/colors/dracula.rasi new file mode 100644 index 0000000..7ae606d --- /dev/null +++ b/rofi/colors/dracula.rasi @@ -0,0 +1,16 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + **/ + +* { + background: #1E1F29FF; + background-alt: #282A36FF; + foreground: #FFFFFFFF; + selected: #BD93F9FF; + active: #50FA7BFF; + urgent: #FF5555FF; +} diff --git a/rofi/colors/everforest.rasi b/rofi/colors/everforest.rasi new file mode 100644 index 0000000..83d4f71 --- /dev/null +++ b/rofi/colors/everforest.rasi @@ -0,0 +1,16 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + **/ + +* { + background: #323D43FF; + background-alt: #3C474DFF; + foreground: #DAD1BEFF; + selected: #7FBBB3FF; + active: #A7C080FF; + urgent: #E67E80FF; +} diff --git a/rofi/colors/gruvbox.rasi b/rofi/colors/gruvbox.rasi new file mode 100644 index 0000000..2ee85d0 --- /dev/null +++ b/rofi/colors/gruvbox.rasi @@ -0,0 +1,16 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + **/ + +* { + background: #282828FF; + background-alt: #353535FF; + foreground: #EBDBB2FF; + selected: #83A598FF; + active: #B8BB26FF; + urgent: #FB4934FF; +} diff --git a/rofi/colors/lovelace.rasi b/rofi/colors/lovelace.rasi new file mode 100644 index 0000000..80140ee --- /dev/null +++ b/rofi/colors/lovelace.rasi @@ -0,0 +1,16 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + **/ + +* { + background: #1D1F28FF; + background-alt: #282A36FF; + foreground: #FDFDFDFF; + selected: #79E6F3FF; + active: #5ADECDFF; + urgent: #F37F97FF; +} diff --git a/rofi/colors/navy.rasi b/rofi/colors/navy.rasi new file mode 100644 index 0000000..1289f53 --- /dev/null +++ b/rofi/colors/navy.rasi @@ -0,0 +1,16 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + **/ + +* { + background: #021B21FF; + background-alt: #0C252BFF; + foreground: #F2F1B9FF; + selected: #44B5B1FF; + active: #7CBF9EFF; + urgent: #C2454EFF; +} diff --git a/rofi/colors/nord.rasi b/rofi/colors/nord.rasi new file mode 100644 index 0000000..c6bc05d --- /dev/null +++ b/rofi/colors/nord.rasi @@ -0,0 +1,16 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + **/ + +* { + background: #2E3440FF; + background-alt: #383E4AFF; + foreground: #E5E9F0FF; + selected: #81A1C1FF; + active: #A3BE8CFF; + urgent: #BF616AFF; +} diff --git a/rofi/colors/onedark.rasi b/rofi/colors/onedark.rasi new file mode 100644 index 0000000..7c76108 --- /dev/null +++ b/rofi/colors/onedark.rasi @@ -0,0 +1,16 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + **/ + +* { + background: #1E2127FF; + background-alt: #282B31FF; + foreground: #FFFFFFFF; + selected: #61AFEFFF; + active: #98C379FF; + urgent: #E06C75FF; +} diff --git a/rofi/colors/paper.rasi b/rofi/colors/paper.rasi new file mode 100644 index 0000000..c3d76e8 --- /dev/null +++ b/rofi/colors/paper.rasi @@ -0,0 +1,16 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + **/ + +* { + background: #F1F1F1FF; + background-alt: #E0E0E0FF; + foreground: #252525FF; + selected: #008EC4FF; + active: #10A778FF; + urgent: #C30771FF; +} diff --git a/rofi/colors/solarized.rasi b/rofi/colors/solarized.rasi new file mode 100644 index 0000000..9051e13 --- /dev/null +++ b/rofi/colors/solarized.rasi @@ -0,0 +1,16 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + **/ + +* { + background: #002B36FF; + background-alt: #073642FF; + foreground: #EEE8D5FF; + selected: #268BD2FF; + active: #859900FF; + urgent: #DC322FFF; +} diff --git a/rofi/colors/tokyonight.rasi b/rofi/colors/tokyonight.rasi new file mode 100644 index 0000000..1145cbd --- /dev/null +++ b/rofi/colors/tokyonight.rasi @@ -0,0 +1,16 @@ +/** + * + * Author : Levi Lacoss (fishyfishfish55) + * Github : @fishyfishfish55 + * + * Colors + **/ + +* { + background: #15161EFF; + background-alt: #1A1B26FF; + foreground: #C0CAF5FF; + selected: #33467CFF; + active: #414868FF; + urgent: #F7768EFF; +} diff --git a/rofi/colors/yousai.rasi b/rofi/colors/yousai.rasi new file mode 100644 index 0000000..757cab3 --- /dev/null +++ b/rofi/colors/yousai.rasi @@ -0,0 +1,16 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + **/ + +* { + background: #F5E7DEFF; + background-alt: #EBDCD2FF; + foreground: #34302DFF; + selected: #D97742FF; + active: #BF8F60FF; + urgent: #B23636FF; +} diff --git a/rofi/shared/colors.rasi b/rofi/shared/colors.rasi new file mode 100644 index 0000000..103ad63 --- /dev/null +++ b/rofi/shared/colors.rasi @@ -0,0 +1,18 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + * + * Available Colors Schemes + * + * adapta catppuccin everforest navy paper + * arc cyberpunk gruvbox nord solarized + * black dracula lovelace onedark yousai + * + **/ + +/* Import color-scheme from `colors` directory */ + +@import "~/.config/rofi/colors/onedark.rasi" diff --git a/rofi/shared/fonts.rasi b/rofi/shared/fonts.rasi new file mode 100644 index 0000000..430c73d --- /dev/null +++ b/rofi/shared/fonts.rasi @@ -0,0 +1,12 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Fonts + * + **/ + +* { + font: "JetBrains Mono Nerd Font 10"; +} diff --git a/rofi/shared/theme.bash b/rofi/shared/theme.bash new file mode 100755 index 0000000..4807020 --- /dev/null +++ b/rofi/shared/theme.bash @@ -0,0 +1,4 @@ +## Current Theme + +type="$HOME/.config/rofi/applets/type-1" +style='style-1.rasi' diff --git a/rofi/themes/colors.rasi b/rofi/themes/colors.rasi new file mode 100644 index 0000000..103ad63 --- /dev/null +++ b/rofi/themes/colors.rasi @@ -0,0 +1,18 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Colors + * + * Available Colors Schemes + * + * adapta catppuccin everforest navy paper + * arc cyberpunk gruvbox nord solarized + * black dracula lovelace onedark yousai + * + **/ + +/* Import color-scheme from `colors` directory */ + +@import "~/.config/rofi/colors/onedark.rasi" diff --git a/rofi/themes/default.rasi b/rofi/themes/default.rasi new file mode 100644 index 0000000..97169df --- /dev/null +++ b/rofi/themes/default.rasi @@ -0,0 +1,163 @@ +/*****----- Configuration -----*****/ +configuration { + modi: "drun"; + show-icons: true; + display-drun: ""; + drun-display-format: "{name}"; +} + +/*****----- Global Properties -----*****/ +@import "colors.rasi" +@import "fonts.rasi" + +/*****----- Main Window -----*****/ +window { + transparency: "real"; + location: center; + anchor: center; + fullscreen: false; + width: 400px; + height: 500px; + x-offset: 0px; + y-offset: 0px; + + enabled: true; + margin: 0px; + padding: 0px; + border: 0px solid; + border-radius: 12px; + border-color: @selected; + background-color: @background; + cursor: "default"; +} + +/*****----- Main Box -----*****/ +mainbox { + enabled: true; + spacing: 0px; + margin: 0px; + padding: 0px; + border: 0px solid; + border-radius: 0px 0px 0px 0px; + border-color: @selected; + background-color: transparent; + children: [ "inputbar", "listview" ]; +} + +/*****----- Inputbar -----*****/ +inputbar { + enabled: true; + spacing: 10px; + margin: 0px; + padding: 15px; + border: 0px solid; + border-radius: 0px; + border-color: @selected; + background-color: @selected; + text-color: @background; + children: [ "prompt", "entry" ]; +} + +prompt { + enabled: true; + background-color: inherit; + text-color: inherit; +} +textbox-prompt-colon { + enabled: true; + expand: false; + str: "::"; + background-color: inherit; + text-color: inherit; +} +entry { + enabled: true; + background-color: inherit; + text-color: inherit; + cursor: text; + placeholder: "Search..."; + placeholder-color: inherit; +} + +/*****----- Listview -----*****/ +listview { + enabled: true; + columns: 1; + lines: 6; + cycle: true; + dynamic: true; + scrollbar: false; + layout: vertical; + reverse: false; + fixed-height: true; + fixed-columns: true; + + spacing: 5px; + margin: 0px; + padding: 0px; + border: 0px solid; + border-radius: 0px; + border-color: @selected; + background-color: transparent; + text-color: @foreground; + cursor: "default"; +} +scrollbar { + handle-width: 5px ; + handle-color: @selected; + border-radius: 0px; + background-color: @background-alt; +} + +/*****----- Elements -----*****/ +element { + enabled: true; + spacing: 10px; + margin: 0px; + padding: 8px; + border: 0px solid; + border-radius: 0px; + border-color: @selected; + background-color: transparent; + text-color: @foreground; + cursor: pointer; +} +element normal.normal { + background-color: @background; + text-color: @foreground; +} +element selected.normal { + background-color: @background-alt; + text-color: @foreground; +} +element-icon { + background-color: transparent; + text-color: inherit; + size: 32px; + cursor: inherit; +} +element-text { + background-color: transparent; + text-color: inherit; + highlight: inherit; + cursor: inherit; + vertical-align: 0.5; + horizontal-align: 0.0; +} + +/*****----- Message -----*****/ +error-message { + padding: 15px; + border: 2px solid; + border-radius: 12px; + border-color: @selected; + background-color: @background; + text-color: @foreground; +} +textbox { + background-color: @background; + text-color: @foreground; + vertical-align: 0.5; + horizontal-align: 0.0; + highlight: none; +} diff --git a/rofi/themes/fonts.rasi b/rofi/themes/fonts.rasi new file mode 100644 index 0000000..430c73d --- /dev/null +++ b/rofi/themes/fonts.rasi @@ -0,0 +1,12 @@ +/** + * + * Author : Aditya Shakya (adi1090x) + * Github : @adi1090x + * + * Fonts + * + **/ + +* { + font: "JetBrains Mono Nerd Font 10"; +} diff --git a/rofi/themes/powermenu.rasi b/rofi/themes/powermenu.rasi new file mode 100644 index 0000000..558ddc8 --- /dev/null +++ b/rofi/themes/powermenu.rasi @@ -0,0 +1,137 @@ +/*****----- Configuration -----*****/ +configuration { + show-icons: false; +} + +/*****----- Global Properties -----*****/ +@import "../shared/colors.rasi" +@import "../shared/fonts.rasi" + +/* +USE_ICON=NO +*/ + +/*****----- Main Window -----*****/ +window { + transparency: "real"; + location: center; + anchor: center; + fullscreen: false; + width: 400px; + x-offset: 0px; + y-offset: 0px; + margin: 0px; + padding: 0px; + border: 1px solid; + border-radius: 30px; + border-color: @selected; + cursor: "default"; + background-color: @background; +} + +/*****----- Main Box -----*****/ +mainbox { + enabled: true; + spacing: 10px; + margin: 0px; + padding: 20px; + background-color: transparent; + children: [ "inputbar", "message", "listview" ]; +} + +/*****----- Inputbar -----*****/ +inputbar { + enabled: true; + spacing: 10px; + padding: 0px; + border: 0px; + border-radius: 0px; + border-color: @selected; + background-color: transparent; + text-color: @foreground; + children: [ "textbox-prompt-colon", "prompt"]; +} + +textbox-prompt-colon { + enabled: false; +} +prompt { + enabled: true; + padding: 10px; + border-radius: 100%; + background-color: @active; + text-color: @background; +} + +/*****----- Message -----*****/ +message { + enabled: true; + margin: 0px; + padding: 10px; + border: 0px solid; + border-radius: 100%; + border-color: @selected; + background-color: @background-alt; + text-color: @foreground; +} +textbox { + background-color: inherit; + text-color: inherit; + vertical-align: 0.5; + horizontal-align: 0.0; +} + +/*****----- Listview -----*****/ +listview { + enabled: true; + columns: 1; + lines: 6; + cycle: true; + scrollbar: false; + layout: vertical; + + spacing: 5px; + background-color: transparent; + cursor: "default"; +} + +/*****----- Elements -----*****/ +element { + enabled: true; + padding: 10px; + border: 0px solid; + border-radius: 100%; + border-color: @selected; + background-color: transparent; + text-color: @foreground; + cursor: pointer; +} +element-text { + background-color: transparent; + text-color: inherit; + cursor: inherit; + vertical-align: 0.5; + horizontal-align: 0.0; +} + +element normal.normal, +element alternate.normal { + background-color: var(background); + text-color: var(foreground); +} +element normal.urgent, +element alternate.urgent, +element selected.active { + background-color: var(urgent); + text-color: var(background); +} +element normal.active, +element alternate.active, +element selected.urgent { + background-color: var(active); + text-color: var(background); +} +element selected.normal { + background-color: var(selected); + text-color: var(background); +} diff --git a/rofi/themes/powermenu/colors.rasi b/rofi/themes/powermenu/colors.rasi new file mode 100644 index 0000000..416115b --- /dev/null +++ b/rofi/themes/powermenu/colors.rasi @@ -0,0 +1 @@ +@import "onedark.rasi" diff --git a/rofi/themes/powermenu/fonts.rasi b/rofi/themes/powermenu/fonts.rasi new file mode 100644 index 0000000..cf15150 --- /dev/null +++ b/rofi/themes/powermenu/fonts.rasi @@ -0,0 +1,3 @@ +* { + font: "JetBrains Mono Nerd Font 10"; +} diff --git a/rofi/themes/powermenu/onedark.rasi b/rofi/themes/powermenu/onedark.rasi new file mode 100644 index 0000000..e509fa9 --- /dev/null +++ b/rofi/themes/powermenu/onedark.rasi @@ -0,0 +1,8 @@ +* { + background: #1E2127FF; + background-alt: #282B31FF; + foreground: #FFFFFFFF; + selected: #61AFEFFF; + active: #98C379FF; + urgent: #E06C75FF; +} diff --git a/rofi/themes/wifi.rasi b/rofi/themes/wifi.rasi new file mode 100644 index 0000000..54739eb --- /dev/null +++ b/rofi/themes/wifi.rasi @@ -0,0 +1,134 @@ +@import "colors.rasi" + +configuration { + show-icons: false; + sidebar-mode: false; + hover-select: true; + me-select-entry: ""; + me-accept-entry: [MousePrimary]; +} +*{ + font: "Product Sans Medium 11"; + //Colors + foreground:#f8f8f2; //Text + accent: @selected; //Highlight + foreground-selection:@foreground; //Selection_fg + background-selection: @selected; //Selection_bg + + transparent: #ffffff00; + background-color: @transparent; + text-color: @foreground; + selected-normal-foreground: @foreground-selection; + normal-foreground: @foreground; + alternate-normal-background: @transparent; + selected-urgent-foreground: @foreground; + urgent-foreground: @foreground; + alternate-urgent-background: @background; + active-foreground: @accent; + selected-active-foreground: @background-selection; + alternate-normal-foreground: @foreground; + alternate-active-background: @background; + bordercolor: @background; + normal-background: @transparent; + selected-normal-background: @background-selection; + separatorcolor: @accent; + urgent-background: @accent; + alternate-urgent-foreground: @foreground; + selected-urgent-background: @accent; + alternate-active-foreground: @foreground; + selected-active-background: @transparent; + active-background: @transparent; +} +window { + width: 400px; + text-color: @foreground; + background-color: @background; + border-radius: 20px; + padding: 18; +} +mainbox { + border: 0; + padding: 0; +} +textbox { + text-color: @foreground; +} +listview { + columns: 1; + lines: 15; + spacing: 4px; + cycle: true; + dynamic: true; + layout: vertical; + text-color: @separatorcolor; +} +element { + border: 0; + padding: 18px 18px; + border-radius: 100%; +} +element-text { + padding: 0; + background-color: none; + text-color: inherit; +} +element.normal.normal { + text-color: @normal-foreground; + background-color: @normal-background; +} +element.normal.urgent { + text-color: @urgent-foreground; + background-color: @urgent-background; +} +element.normal.active { + text-color: @active-foreground; + background-color: @backgroundAdditional; +} +element.selected.normal { + text-color: @selected-normal-foreground; + background-color: @selected-normal-background; +} +element.selected.urgent { + text-color: @selected-urgent-foreground; + background-color: @selected-urgent-background; +} +element.selected.active { + text-color: @foreground; + background-color: @accent; +} +element.alternate.normal { + text-color: @alternate-normal-foreground; + background-color: @alternate-normal-background; +} +element.alternate.urgent { + text-color: @alternate-urgent-foreground; + background-color: @alternate-urgent-background; +} +element.alternate.active { + text-color: @alternate-active-foreground; + background-color: @alternate-active-background; +} +mode-switcher { + border: 0; +} +button selected { + text-color: @selected-normal-foreground; + background-color: @selected-normal-background; +} +button normal { + text-color: @foreground; +} + +inputbar { + children: [textbox-prompt-colon,entry]; +} + +textbox-prompt-colon{ + expand: false; + margin: 0 0 20px 0; + str: ":"; +} + +entry { + placeholder: ""; +} diff --git a/sway/config b/sway/config new file mode 100644 index 0000000..b0e2c74 --- /dev/null +++ b/sway/config @@ -0,0 +1,172 @@ +exec { + eval `keychain --eval --agents ssh id_rsa` + dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK + systemctl --user import-environment && gnome-keyring-daemon --components=ssh\,secrets\,pkcs11 --start + dbus-update-activation-environment --all + gnome-keyring-daemon --start --components=secrets + mako + export SSH_AUTH_SOCK + /usr/libexec/polkit-gnome-authentication-agent-1 + /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 +} + +exec_always "pkill kanshi; kanshi" + +set { + $mod Mod4 + $left h + $down j + $up k + $right l + $term alacritty + $menu /bin/bash $HOME/.config/rofi/bin/launcher + $filemanager alacritty -e 'thunar' +} + +output { + "Philips Consumer Electronics Company PHL 258B6QU UHB1623076065" pos 2560 0 + "Ancor Communications Inc ASUS PB298 0x00003784" pos 0 210 +} + +default_border pixel 2 +smart_borders on + +for_window { + [app_id="zoom" title="^zoom$"] border none, floating enable + [app_id="zoom" title="^(Zoom|About)$"] border pixel, floating enable + [app_id="zoom" title="Settings"] floating enable, floating_minimum_size 960 x 700 + [app_id="zoom" title="Zoom - Free Account"] border none, floating enable + [app_id="zoom" title="Zoom Cloud Meetings"] border none, floating enable + [app_id="zoom" title="Zoom Meeting(.*)?"] workspace next_on_output --create, move container to workspace current, floating disable, inhibit_idle open + [app_id="zoom" title="Choose ONE of the audio conference options"] border none, floating enable + [app_id="zoom" title="Zoom Meeting"] border none, floating enable + [app_id="pavucontrol"] border none, floating enable + [app_id="librewolf" title="LibreWolf - Sharing Indicator"] border none, floating enable +} + +bindsym { + XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle + XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% + XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% + XF86AudioMicMute exec pactl set-source-mute 0 toggle + XF86MonBrightnessUp exec brightnessctl set +10% + XF86MonBrightnessDown exec brightnessctl set 10%- + ctrl+alt+q exec swaylock -i /home/rahulsandhu/.local/share/wallpapers/wallpaper0.jpg -k --font JetBrainsMonoNerdFont --clock --indicator + ctrl+alt+e exec /bin/bash $HOME/.config/rofi/bin/powermenu + $mod+shift+f exec $filemanager + $mod+Shift+d exec grim -g "$(slurp -p)" -t ppm - | convert - -format '%[pixel:p{0,0}]' txt:- | tail -n 1 | cut -d ' ' -f 4 | wl-copy +} + +set $screenshot 1 selected, 2 whole, 3 selected clipboard, 4 whole clipboard, 5 swappy +mode "$screenshot" { + bindsym { + 1 exec 'grim -g "$(slurp)" ~/Pictures/screenshots/screenshot_$(date +"%Y%m%d%H%M%S").png', mode "default" + 2 exec 'grim ~/Pictures/screenshots/screenshot_$(date +"%Y%m%d%H%M%S").png', mode "default" + 3 exec 'grim -g "$(slurp)" - | wl-copy', mode "default" + 4 exec 'grim - | wl-copy', mode "default" + + Return mode "default" + Escape mode "default" + Print mode "default" + } +} + +bindsym Print mode "$screenshot" + +input "type:keyboard" { + xkb_layout gb +} + +input "1267:12602:ELAN0721:00_04F3:313A" { + accel_profile adaptive + click_method button_areas + dwt disabled + natural_scroll enabled + scroll_method two_finger + tap enabled +} + +output * bg ~/.local/share/wallpapers/wallpaper0.jpg fill + +floating_modifier $mod normal + +bindsym { + $mod+Return exec $term + $mod+Shift+q kill + Mod1+space exec $menu + $mod+Shift+c reload + $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit' + $mod+$left focus left + $mod+$down focus down + $mod+$up focus up + $mod+$right focus right + $mod+Left focus left + $mod+Down focus down + $mod+Up focus up + $mod+Right focus right + $mod+Shift+$left move left + $mod+Shift+$down move down + $mod+Shift+$up move up + $mod+Shift+$right move right + $mod+Shift+Left move left + $mod+Shift+Down move down + $mod+Shift+Up move up + $mod+Shift+Right move right + $mod+1 workspace number 1 + $mod+2 workspace number 2 + Lock workspace number 2 + $mod+3 workspace number 3 + $mod+4 workspace number 4 + $mod+5 workspace number 5 + $mod+6 workspace number 6 + $mod+7 workspace number 7 + $mod+8 workspace number 8 + $mod+9 workspace number 9 + $mod+0 workspace number 10 + $mod+Shift+1 move container to workspace number 1 + $mod+Shift+2 move container to workspace number 2 + $mod+Shift+3 move container to workspace number 3 + $mod+Shift+4 move container to workspace number 4 + $mod+Shift+5 move container to workspace number 5 + $mod+Shift+6 move container to workspace number 6 + $mod+Shift+7 move container to workspace number 7 + $mod+Shift+8 move container to workspace number 8 + $mod+Shift+9 move container to workspace number 9 + $mod+Shift+0 move container to workspace number 10 + $mod+b splith + $mod+v splitv + $mod+s layout stacking + $mod+w layout tabbed + $mod+e layout toggle split + $mod+f fullscreen + $mod+Shift+space floating toggle + $mod+space focus mode_toggle + $mod+a focus parent + $mod+Shift+minus move scratchpad + $mod+minus scratchpad show + $mod+Tab split toggle +} + +mode "resize" { + bindsym { + $left resize shrink width 10px + $down resize grow height 10px + $up resize shrink height 10px + $right resize grow width 10px + + Left resize shrink width 10px + Down resize grow height 10px + Up resize shrink height 10px + Right resize grow width 10px + Return mode "default" + Escape mode "default" + } +} + +bindsym $mod+r mode "resize" + +bar { + swaybar_command waybar +} + +include @sysconfdir@/sway/config.d/* diff --git a/tmux/tmux.conf b/tmux/tmux.conf new file mode 100644 index 0000000..f007107 --- /dev/null +++ b/tmux/tmux.conf @@ -0,0 +1,22 @@ +set-option -g prefix C-b + +bind-key r source-file ~/.config/tmux/tmux.conf # Reload config on prefix-r +set -g mouse on # Enable mouse +set -g default-terminal "screen-256color" # Enable 256 colors +set -sg escape-time 0 # Fix ESC delay + +# Vim movement +bind-key -r h select-pane -L +bind-key -r j select-pane -D +bind-key -r l select-pane -R +bind-key -r k select-pane -U + +# Looks +set -g default-terminal "tmux-256color" +set -ag terminal-overrides ",xterm-256color:RGB" +set -g status-position bottom +set -g status-justify left +set-option -g status-style bg=default +set -g status-fg colour10 +set -g status-left ' ' +set -g status-right '#{=20:pane_title} %b %d' diff --git a/waybar/config b/waybar/config new file mode 100644 index 0000000..fe7041a --- /dev/null +++ b/waybar/config @@ -0,0 +1,72 @@ +{ + "height": 30, + "spacing": 4, + "modules-left": ["sway/workspaces"], + "modules-center": ["sway/window"], + "modules-right": ["wireplumber", "network", "cpu", "memory", "disk", "battery", "clock"], + "sway/workspaces": { + "all-outputs": true, + "disable-scroll": true, + "format": "{name}", + "persistent_workspaces": { + "1":[], + "2":[], + "3":[] + }, + }, + "clock": { + "timezone": "Europe/London", + "format": "{:%b %d %H:%M} ", + "tooltip-format": "{:%Y %B}\n{calendar}", + "format-alt": "{:%A, %B %d, %Y} " + }, + "cpu": { + "format": "{usage}% ﬙", + "tooltip": false + }, + "memory": { + "format": "{}% " + }, + "disk": { + "format": "{}% " + }, + "battery": { + "states": { + "warning": 30, + "critical": 15 + }, + "format": "{capacity}% {icon}", + "format-charging": "{capacity}% ", + "format-plugged": "{capacity}% ", + "format-alt": "{time} {icon}", + "format-icons": ["", "", "", "", ""] + }, + "network": { + "format-wifi": " {essid}", + "format-ethernet": " {ipaddr}/{cidr}", + "tooltip-format": " {ifname} via {gwaddr}", + "format-linked": " {ifname} (No IP)", + "format-disconnected": " Disconnected", + "on-click": "exec /bin/bash $HOME/.config/rofi/bin/wifimenu" + }, + "bluetooth": { + "format": " {status}", + "format-connected": " {device_alias}", + "format-connected-battery": " {device_alias} {device_battery_percentage}%", + "tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected", + "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}", + "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", + "tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%", + "on-click": "exec blueberry" + }, + "wireplumber": { + "scroll-step": 1, + "format": "{volume}% {icon}", + "format-muted": "婢 {format_source}", + "format-icons": ["", "", ""], + "on-scroll-down": "pactl set-sink-volume @DEFAULT_SINK@ -1%", + "on-scroll-up": "pactl set-sink-volume @DEFAULT_SINK@ +1%", + "on-click": "killall pavucontrol; pavucontrol" + }, +} + diff --git a/waybar/scripts/updates.sh b/waybar/scripts/updates.sh new file mode 100644 index 0000000..61f2829 --- /dev/null +++ b/waybar/scripts/updates.sh @@ -0,0 +1,2 @@ +#!/bin/sh +checkupdates | wc -l diff --git a/waybar/style.css b/waybar/style.css new file mode 100644 index 0000000..2e0a434 --- /dev/null +++ b/waybar/style.css @@ -0,0 +1,120 @@ +* { + color: #eceff4; + border: 0; + border-radius: 0; + padding: 0 0; + font-family:JetBrainsMonoNerdFont; + font-size: 15px; + margin-right: 2px; + margin-left: 2px; + padding-top: 2.75px; + padding-bottom:2.75px; + } + +window#waybar { + background-color: #101419; + transition-property: background-color; + transition-duration: .5s; +} + +#workspaces, #workspaces button, #clock, #battery, #cpu, #memory, #disk, #backlight, #network, #pulseaudio, #wireplumber, #window { + margin: 2px 2px 2px 2px; + padding: 2px 14px; +} + +#custom-flag { + font-size: 20px; +} + +#workspaces, #workspaces button { + padding: 0 0px; + min-width: 20px; + color: #7aa2f7; +} + +#workspaces button:hover { + background-color: rgba(0, 0, 0, 0.2) +} + +#workspaces button.focused { + color: #c678dd; +} + +#workspaces button.urgent { + color: #e06c75; +} +#clock { + color:#a3be8c; +} + +#backlight { + color: #ebcb8b; +} + +#battery { + color: #d8dee9; + padding-right: 22px; +} + +#battery.charging { + color: #81a1c1; +} + +@keyframes blink { + to { + color: #4c566a; + background-color: #eceff4; + } +} + +#battery.critical:not(.charging) { + background: #bf616a; + color: #eceff4; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +#cpu { + color:#8CBCBE; +} + +#memory { + color: #d3869b; + padding-right: 20px; +} +#disk { + color: #BE8E8C; +} +#network.disabled { + color:#bf616a; +} + +#network{ + color:#a3be8c; +} + +#network.disconnected { + color: #bf616a; +} + +#pulseaudio { + color: #b48ead; +} + +#pulseaudio.muted { + color: #3b4252; +} +#wireplumber { + color: #b48ead; +} + +#wireplumber.muted { + color: #3b4252; +} +#window{ + border-style: hidden; + margin-top:1px; +}