Add old dotfiles

This commit is contained in:
venomade committed 2025-02-27 17:06:42 +00:00
commit 1cace80e48
192 files changed
+13538

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
+3
View File
@@ -0,0 +1,3 @@
NIXOS DOTFILES
Dotfiles for my personal NixOS
+18
View File
@@ -0,0 +1,18 @@
{
"suggest.noselect": true,
"clangd.semanticHighlighting": true,
"coc.preferences.semanticTokensHighlights": false,
"languageserver": {
"haskell": {
"command": "haskell-language-server-wrapper",
"args": ["--lsp"],
"rootPatterns": ["*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml"],
"filetypes": ["haskell", "lhaskell"]
},
"nix": {
"command": "nil",
"filetypes": ["nix"],
"rootPatterns": ["flake.nix"]
}
}
}
+19
View File
@@ -0,0 +1,19 @@
--- dmenu-5.2/config.def.h 2022-10-04 18:36:58.000000000 +0100
+++ dmenu/config.h 2024-01-06 00:56:33.000000000 +0000
@@ -4,13 +4,13 @@
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
/* -fn option overrides fonts[0]; default X11 font or font set */
static const char *fonts[] = {
- "monospace:size=10"
+ "FantasqueSansM Nerd Font:size=12"
};
static const char *prompt = NULL; /* -p option; prompt to the left of input field */
static const char *colors[SchemeLast][2] = {
/* fg bg */
- [SchemeNorm] = { "#bbbbbb", "#222222" },
- [SchemeSel] = { "#eeeeee", "#005577" },
+ [SchemeNorm] = { "#cdd6f4", "#1e1e2e" },
+ [SchemeSel] = { "#cdd6f4", "#907F9B" },
[SchemeOut] = { "#000000", "#00ffff" },
};
/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
+261
View File
@@ -0,0 +1,261 @@
#!/usr/bin/env bash
# shellcheck disable=SC2034
# This issue is ignored because it is part of a larger file that calls upon all variables listed
# To edit this file copy it to `${HOME}/.config/dmscripts/config`
# `cp /etc/dmscripts/config ${HOME}/.config/dmscripts/config`
# Defined variables, modify anything in quotes to your prefered software
# IMPORTANT! Keep the '-p' flag at the end of the DMENU and RMENU variables.
# Also, keep the '--prompt' flag at the end of the FMENU variable.
# These are needed as we use prompts in the scripts.
DMENU="dmenu -i -l 20 -p"
RMENU="rofi -dmenu -p"
# the bind must stay, why is this not the default? idk
FMENU="fzf --bind=enter:replace-query+print-query --border=rounded --margin=5% --color=dark --height 100% --reverse --header=$(basename "$0") --info=hidden --header-first --prompt"
PDF_VIEWER="zathura"
DMBROWSER="firefox"
# DMBROWSER="qutebrowser"
# DMTERM="st -e"
DMTERM="kitty -e"
# DMEDITOR="emacsclient -c -a emacs"
DMEDITOR="${DMTERM} vim"
# TODO: Rename this variable to something more traditional
logout_locker='slock'
# logout_locker='dm-tool lock'
# dmscripts will notify you if your configuration is outdated, to shut it up uncomment this.
# comment it back out if you want dmscripts to nag at you
# DM_SHUTUP="something" # NOTICE: This is currently experimental and will not work in (most) programs
# set this variable up to a real file if you want dmscripts to provide a log of when and what has changed
# in your config (this can be an alternative to the notifications)
DM_CONFIG_DIFF_LOGFILE="/dev/stderr" # NOTICE: experimental
# This case statement lets you change what the DMENU variable is for different scripts, so if you
# want a unique variable for each script you can
# syntax is as follows:
# "<ending-of-script>") DMENU="your variable here"
# *) should be left blank, global variables are defined above
# include -p in standard dmenu as we use prompts by default
case "${0##*-}" in
# "colpick") DMENU="dmenu -i -p";;
# "confedit") DMENU="dmenu -i -l 30 -p";;
# "youtube") DMBROWSER="firefox";;
*);;
esac
# "${0##*-}" means grab the 0th argument (which is always the path to the program) starting from the
# last dash. This gives us the word after the - which is what we are searching for in the case
# statement. ie dm-man -> man
# An awk equivalent is:
# awk -F"-" '{print $NF}'
# Sadly cut has no easy equivalent
# TODO: Move almost all of these variables into the case statement
# TODO: Make some of the more useful ones general variables
# IE a pictures directory, an audio directory, config locations, etc
# dm-bookman
bookman_show_source=1
# dm-sounds
sounds_dir="${HOME}/.config/dmscripts/dmsounds"
# dm-setbg
setbg_dir="${HOME}/Pictures/Papes"
# Set this to 1 if you want to use imv and wayland, 0 if you want to use sxiv
# Note that sxiv is X11 only, you need to mark the image you want to use.
use_imv=0
# dm-maim
maim_dir="${HOME}/Screenshots"
maim_file_prefix="maim"
# dm-note
note_dir="${HOME}/.config/dmscripts/dmnote"
# dm-confedit
# no means it will use only static entries
confedit_isdynamic="yes"
# a list of directories to exclude in conf edit
# as an example: to exclude anything from the folder .config/foo and .config/bar, put "foo|bar"
# It takes any regexp and is case insensitive
confedit_exclude_dirs="BraveSoftware"
# If this variable is blank or is defined as "find", then it uses find
# Examples:
# locate: locate
# fd: fd .
# find: find
# etc
# Note that there is no need to include any arguments excluding directories, that is handled autmatically
confedit_find_prog="find"
# We must declare all lists with the -g option
# a list of static config files that may not be in the expected places
declare -Ag confedit_list
confedit_list[confedit]="$HOME/.config/dmscripts/config"
confedit_list[alacritty]="$HOME/.config/alacritty/alacritty.yml"
confedit_list[awesome]="$HOME/.config/awesome/rc.lua"
confedit_list[bash]="$HOME/.bashrc"
confedit_list[broot]="$HOME/.config/broot/conf.toml"
confedit_list[bspwm]="$HOME/.config/bspwm/bspwmrc"
confedit_list[doom emacs config.el]="$HOME/.config/doom/config.el"
confedit_list[doom emacs config.org]="$HOME/.config/doom/config.org"
confedit_list[doom emacs init.el]="$HOME/.config/doom/init.el"
confedit_list[doom emacs packages.el]="$HOME/.config/doom/packages.el"
confedit_list[dunst]="$HOME/.config/dunst/dunstrc"
confedit_list[dwm]="$HOME/dwm-distrotube/config.def.h"
confedit_list[dwmblocks]="$HOME/dwmblocks-distrotube/blocks.def.h"
confedit_list[fish]="$HOME/.config/fish/config.fish"
confedit_list[herbstluftwm]="$HOME/.config/herbstluftwm/autostart"
confedit_list[i3]="$HOME/.config/i3/config"
confedit_list[ncmpcpp]="$HOME/.config/ncmpcpp/config"
confedit_list[neovim init.vim]="$HOME/.config/nvim/init.vim"
confedit_list[neovim init.lua]="$HOME/.config/nvim/init.lua"
confedit_list[picom]="$HOME/.config/picom/picom.conf"
confedit_list[polybar]="$HOME/.config/polybar/config"
confedit_list[qtile]="$HOME/.config/qtile/config.py"
confedit_list[qutebrowser bookmarks]="$HOME/.config/qutebrowser/bookmarks/urls"
confedit_list[qutebrowser quickmarks]="$HOME/.config/qutebrowser/quickmarks"
confedit_list[qutebrowser config.py]="$HOME/.config/qutebrowser/config.py"
confedit_list[spectrwm]="$HOME/.spectrwm.conf"
confedit_list[ssh]="$HOME/.ssh/config"
confedit_list[st]="$HOME/st-distrotube/config.def.h"
confedit_list[stumpwm]="$HOME/.config/stumpwm/config"
confedit_list[surf]="$HOME/surf-distrotube/config.def.h"
confedit_list[sxhkd]="$HOME/.config/sxhkd/sxhkdrc"
confedit_list[tabbed]="$HOME/tabbed-distrotube/config.def.h"
confedit_list[vifm]="$HOME/.config/vifm/vifmrc"
confedit_list[vim]="$HOME/.vimrc"
confedit_list[xmonad]="$HOME/.xmonad/README.org"
confedit_list[xinitrc]="$HOME/.xinitrc"
confedit_list[xresources]="$HOME/.Xresources"
confedit_list[zsh]="$HOME/.zshrc"
# dm-reddit config
declare -ag reddit_list=(
"r/thedeprogram"
"r/linuxmasterrace"
)
# Search engine config
declare -Ag websearch
# Syntax:
# websearch[name]="https://www.example.com/search?q="
# Search Engines
websearch[brave]="https://search.brave.com/search?q="
websearch[duckduckgo]="https://duckduckgo.com/?q="
websearch[google]="https://www.google.com/search?q="
websearch[yandex]="https://yandex.com/search/?text="
# Information/News
websearch[wikipedia]="https://en.wikipedia.org/w/index.php?search="
# Social Media
websearch[reddit]="https://www.reddit.com/search/?q="
websearch[odysee]="https://odysee.com/$/search?q="
websearch[youtube]="https://www.youtube.com/results?search_query="
# Online Shopping
websearch[amazon]="https://www.amazon.com/s?k="
websearch[ebay]="https://www.ebay.com/sch/i.html?&_nkw="
# Linux
websearch[archwiki]="https://wiki.archlinux.org/index.php?search="
websearch[debian_pkgs]="https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords="
websearch[flathub]="https://flathub.org/search/public?channel=stable&query="
websearch[fedora_pkgs]="https://packages.fedoraproject.org/search?query="
# NixOS
websearch[nix_pkgs]="https://search.nixos.org/packages?query="
websearch[nix_opts]="https://search.nixos.org/options?query="
websearch[nix_hm_opts]="https://mipmip.github.io/home-manager-option-search/?query="
# Development
websearch[github]="https://github.com/search?q="
websearch[gitlab]="https://gitlab.com/search?search="
websearch[stackoverflow]="https://stackoverflow.com/search?q="
websearch[hoogle]="https://hoogle.haskell.org/?hoogle="
# Misc
websearch[books]="https://ravebooksearch.com/#gsc.tab=0&gsc.sort=&gsc.q="
# dm-youtube config
# Think of these as your "subscribed channels", name the channel in the square brackets then put the channel URL in the quotation marks
# Syntax: youtube_channels[name]="https://www.youtube.com/link/to/channel"
declare -Ag youtube_channels
youtube_channels[distrotube]="https://www.youtube.com/@DistroTube/videos"
youtube_channels[alexchristoforou]="https://www.youtube.com/@AlexChristoforou/videos"
youtube_channels[alexandermercouris]="https://www.youtube.com/@AlexMercouris/videos"
youtube_channels[duran]="https://www.youtube.com/@TheDuran/videos"
youtube_channels[isorrowproductions]="https://www.youtube.com/@iSorrowproductions/videos"
youtube_channels[geopoliticaleconomyreport]="https://www.youtube.com/@GeopoliticalEconomyReport/videos"
youtube_channels[secondwindgroup]="https://www.youtube.com/@SecondWindGroup/videos"
youtube_channels[videogamedunkey]="https://www.youtube.com/@videogamedunkey/videos"
youtube_channels[yogscast]="https://www.youtube.com/@yogscast/videos"
youtube_channels[thelinuxexperiment]="https://www.youtube.com/@TheLinuxEXP/videos"
# dm-radio config
# Your list of online radio stations for the dm-radio script.
# Syntax: radio_stations[name]="https://www.zeno.fm/radio/your-station"
# dmradio-volume ranges between -1 and 100 (for mplayer) or 0-100 (for mpv)
DMRADIOVOLUME="100"
declare -Ag radio_stations
radio_stations[Oldies Radio 50s-60s]="https://zeno.fm/radio/oldies-radio-50s-60s/"
radio_stations[Oldies Radio 70s]="https://zeno.fm/radio/oldies-radio-70s/"
radio_stations[Unlimited 80s]="https://zeno.fm/radio/unlimited80s/"
radio_stations[80s Hits]="https://zeno.fm/radio/80shits/"
radio_stations[90s Hits]="https://zeno.fm/radio/90s_HITS/"
radio_stations[2000s Pop]="https://zeno.fm/radio/2000s-pop/"
radio_stations[The 2000s]="https://zeno.fm/radio/the-2000s/"
radio_stations[Hits 2010s]="https://zeno.fm/radio/helia-hits-2010/"
radio_stations[Classical Radio]="https://zeno.fm/radio/classical-radio/"
radio_stations[Classical Relaxation]="https://zeno.fm/radio/radio-christmas-non-stop-classical/"
radio_stations[Classic Rock]="https://zeno.fm/radio/classic-rockdnb2sav8qs8uv/"
radio_stations[Gangsta49]="https://zeno.fm/radio/gangsta49/"
radio_stations[HipHop49]="https://zeno.fm/radio/hiphop49/"
radio_stations[Madhouse Country Radio]="https://zeno.fm/radio/madhouse-country-radio/"
radio_stations[PopMusic]="https://zeno.fm/radio/popmusic74vyurvmug0uv/"
radio_stations[PopStars]="https://zeno.fm/radio/popstars/"
radio_stations[RadioMetal]="https://zeno.fm/radio/radio-metal/"
radio_stations[RocknRoll Radio]="https://zeno.fm/radio/rocknroll-radio994c7517qs8uv/"
# dm-colpick config
declare -Ag colpick_list
colpick_list[black]="#282a36"
colpick_list[red]="#ff5555"
colpick_list[green]="#5af78e"
colpick_list[yellow]="#f1fa8c"
colpick_list[blue]="#57c7ff"
colpick_list[magenta]="#ff6ac1"
colpick_list[cyan]="#8be9fd"
colpick_list[white]="#f1f1f0"
colpick_list[orange]="#ffb86c"
colpick_list[purple]="#bd9cf9"
# dm-weather config
# Example: set the default search parameters to Texas, Paris and Moscow
# weather_locations="Texas, United States
# Paris, France
# Moscow, Russia"
weather_locations="Haverhill, United Kingdom"
# use the weather_opts variable to set additional flags:
# weather_opts="flag1&flag2&flag3=somevalue"
# for full details see: https://github.com/chubin/wttr.in
# current revision (do not touch unless you know what you're doing)
_revision=26
+1
View File
@@ -0,0 +1 @@
:set prompt "λ "
File diff suppressed because it is too large. Load diff
+2
View File
@@ -0,0 +1,2 @@
require("venomade")
require("plugins")
@@ -0,0 +1,3 @@
require('nvim-autopairs').setup({
disable_filetype = { "TelescopePrompt" , "vim" },
})
@@ -0,0 +1,29 @@
require("catppuccin").setup({
flavour = "mocha",
transparent_background = true,
term_colors = true,
dim_inactive = {
enabled = true,
shade = "dark",
percentage = 0.15,
},
styles = {
comments = { "italic" },
conditionals = { "italic" },
loops = {},
functions = {},
keywords = {},
strings = {},
variables = {},
numbers = {},
booleans = { "bold" },
properties = {},
types = {},
operators = {},
},
integrations = {
treesitter = true,
},
})
vim.cmd.colorscheme "catppuccin"
@@ -0,0 +1 @@
require("codeium").setup({})
@@ -0,0 +1 @@
require('colorizer').setup()
@@ -0,0 +1,58 @@
local alpha = require('alpha')
local dashboard = require('alpha.themes.dashboard')
local header = {
type = 'text',
val = 'Neovim',
opts = {
position = 'center',
}
}
local buttons = {
type = 'group',
val = {
{
type = 'text',
val = 'Quick actions',
opts = { position = 'center' }
},
{
type = 'padding',
val = 1,
},
dashboard.button('<leader>n', ' New File',
':enew | NvimTreeFocus<CR>',
{ desc = 'New file' }),
dashboard.button('<leader>o', ' Old Files',
':Telescope oldfiles<CR>',
{ desc = 'Old files' }),
dashboard.button('<leader>ff', ' Find File',
':Telescope find_files<CR>'),
dashboard.button('<leader>fg', ' Find in files')
}
}
alpha.setup {
layout = {
{
type = 'padding',
val = 2,
},
header,
{
type = 'padding',
val = 2,
},
buttons,
{
type = 'padding',
val = 2,
},
},
}
-- vim.api.nvim_create_autocmd("User", {
-- pattern = "AlphaReady",
-- command = "set showtabline=0 | set laststatus=0",
-- })
@@ -0,0 +1,10 @@
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")
vim.keymap.set("n", "<leader>a", mark.add_file)
vim.keymap.set("n", "<C-h>", ui.toggle_quick_menu)
vim.keymap.set("n", "<C-n>", function() ui.nav_file(1) end)
vim.keymap.set("n", "<C-e>", function() ui.nav_file(2) end)
vim.keymap.set("n", "<C-i>", function() ui.nav_file(3) end)
vim.keymap.set("n", "<C-o>", function() ui.nav_file(4) end)
+11
View File
@@ -0,0 +1,11 @@
require("plugins.lsp")
require("plugins.catppuccin")
require("plugins.treesitter")
require("plugins.telescope")
require("plugins.harpoon")
require("plugins.dashboard")
require("plugins.codeium")
require("plugins.lualine")
require("plugins.autopairs")
require("plugins.colorizer")
require("plugins.lastplace")
@@ -0,0 +1 @@
require('nvim-lastplace').setup()
+40
View File
@@ -0,0 +1,40 @@
local lsp_zero = require("lsp-zero")
lsp_zero.on_attach(function(client,buffer)
lsp_zero.default_keymaps({buffer = bufnr})
lsp_zero.buffer_autoformat()
end)
require'lspconfig'.clangd.setup{}
require'lspconfig'.hls.setup{}
require'lspconfig'.nil_ls.setup{}
require'lspconfig'.rust_analyzer.setup{}
local lspkind = require('lspkind')
local cmp = require('cmp')
local cmp_action = require('lsp-zero').cmp_action()
cmp.setup({
preselect = 'none',
completion = {
completeopt = 'menu,menuone,noinsert,noselect'
},
formatting = {
format = lspkind.cmp_format({
mode = 'symbol',
maxwidth = 50,
ellipsis_char = '...',
symbol_map = { Codeium = '' },
})
},
mapping = cmp.mapping.preset.insert({
['<CR>'] = cmp.mapping.confirm({select = false}),
['<Tab>'] = cmp_action.tab_complete(),
['<S-Tab>'] = cmp_action.select_prev_or_fallback(),
['<C-Space>'] = cmp.mapping.complete(),
}),
sources = {
{ name = "nvim_lsp" },
{ name = "codeium" }
}
})
@@ -0,0 +1,13 @@
require('lualine').setup{
options = {
theme = 'palenight',
},
tabline = {
lualine_a = {'buffers'},
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
}
@@ -0,0 +1,7 @@
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
vim.keymap.set('n', '<leader>fg', function()
builtin.grep_string({ search = vim.fn.input("Grep > ") });
end)
@@ -0,0 +1,17 @@
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", "go", "rust", "haskell" },
-- 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,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
}
@@ -0,0 +1,14 @@
vim.cmd('set clipboard+=unnamedplus')
function CopyToClipboard()
local selected_text = vim.fn.getline("'<,'>")
vim.fn.setreg("+", selected_text)
end
function PasteFromClipboard()
local clipboard_text = vim.fn.getreg("+")
vim.fn.setline('.', clipboard_text)
end
vim.api.nvim_set_keymap('x', '<Leader>y', [[:lua CopyToClipboard()<CR>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<Leader>p', [[:lua PasteFromClipboard()<CR>]], { noremap = true, silent = true })
@@ -0,0 +1,41 @@
vim.opt.nu = true
vim.opt.rnu = true
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.autoindent = true
vim.opt.smartindent = true
vim.opt.wrap = false
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
vim.opt.undofile = true
vim.opt.hlsearch = false
vim.opt.incsearch = true
vim.opt.termguicolors = true
vim.opt.scrolloff = 5
vim.opt.updatetime = 50
vim.opt.splitbelow = true
vim.opt.splitright = true
vim.opt.encoding = "utf-8"
vim.opt.shell = "zsh"
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.incsearch = true
vim.opt.title = true
vim.cmd "set showtabline=0 | set laststatus=0"
@@ -0,0 +1,5 @@
require("venomade.remap")
require("venomade.lazy")
require("venomade.config")
require("venomade.clipboard")
require("venomade.neovide")
+42
View File
@@ -0,0 +1,42 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
-- Telescope Fuzzy Finder
{'nvim-telescope/telescope.nvim', tag = '0.1.3', dependencies = {'nvim-lua/plenary.nvim'}},
-- Catppuccin color scheme
{"catppuccin/nvim", name = "catppuccin", priority = 1000},
-- Treesitter syntax highlighting
{"nvim-treesitter/nvim-treesitter", build = ":TSUpdate"},
-- Harpoon bookmarking
{"theprimeagen/harpoon"},
-- LSP ZERO
{'VonHeikemen/lsp-zero.nvim', branch = 'v3.x'},
{'neovim/nvim-lspconfig', dependencies = {'hrsh7th/cmp-nvim-lsp'}},
{'hrsh7th/nvim-cmp', dependencies = {'L3MON4D3/LuaSnip'}},
-- Codeium AI Completion
{'Exafunction/codeium.nvim', dependencies = {'nvim-lua/plenary.nvim', 'hrsh7th/nvim-cmp'}},
-- Dashboard
{'goolord/alpha-nvim', dependencies = {'nvim-tree/nvim-web-devicons'}},
-- LSP Icons
{'onsails/lspkind.nvim'},
-- Bufferline
{'nvim-lualine/lualine.nvim', dependencies = {'nvim-tree/nvim-web-devicons'}},
-- Autoparis
{'windwp/nvim-autopairs'},
-- Color Highlighting
{'norcalli/nvim-colorizer.lua'},
-- Return to last edit position
{'ethanholz/nvim-lastplace'},
})
@@ -0,0 +1,20 @@
if vim.g.neovide then
vim.opt.guifont = { "FantasqueSansM Nerd Font", ":h12" }
vim.g.neovide_scale_factor = 1.0
--Transparency
-- Helper function for transparency formatting
local alpha = function()
return string.format("%x", math.floor(255 * vim.g.transparency or 0.8))
end
vim.g.neovide_transparency = 0.92
vim.g.transparency = 0.92
-- vim.g.neovide_background_color = "#1e1e2e" .. alpha()
vim.g.neovide_window_blurred = true
vim.g.neovide_floating_blur_amount_x = 2.0
vim.g.neovide_floating_blur_amount_y = 2.0
end
@@ -0,0 +1,7 @@
vim.g.mapleader = " "
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
-- Buffers
vim.keymap.set("n", "<leader>bk", vim.cmd.bdelete)
vim.keymap.set("n", "<leader>bn", vim.cmd.bnext)
vim.keymap.set("n", "<leader>bp", vim.cmd.bprev)
+423
View File
@@ -0,0 +1,423 @@
#################################
# Shadows #
#################################
# Enabled client-side shadows on windows. Note desktop windows
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
# unless explicitly requested using the wintypes option.
#
# shadow = false
shadow = true;
# The blur radius for shadows, in pixels. (defaults to 12)
# shadow-radius = 12
shadow-radius = 7;
# The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
# shadow-opacity = .75
# The left offset for shadows, in pixels. (defaults to -15)
# shadow-offset-x = -15
shadow-offset-x = -7;
# The top offset for shadows, in pixels. (defaults to -15)
# shadow-offset-y = -15
shadow-offset-y = -7;
# Red color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-red = 0
# Green color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-green = 0
# Blue color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-blue = 0
# Hex string color value of shadow (#000000 - #FFFFFF, defaults to #000000). This option will override options set shadow-(red/green/blue)
# shadow-color = "#000000"
# Specify a list of conditions of windows that should have no shadow.
#
# examples:
# shadow-exclude = "n:e:Notification";
#
# shadow-exclude = []
shadow-exclude = [
"name = 'Notification'",
"class_g ?= 'Notify-osd'",
"_GTK_FRAME_EXTENTS@:c"
];
# Specify a list of conditions of windows that should have no shadow painted over, such as a dock window.
# clip-shadow-above = []
# Specify a X geometry that describes the region in which shadow should not
# be painted in, such as a dock window region. Use
# shadow-exclude-reg = "x10+0+0"
# for example, if the 10 pixels on the bottom of the screen should not have shadows painted on.
#
# shadow-exclude-reg = ""
# Crop shadow of a window fully on a particular Xinerama screen to the screen.
# xinerama-shadow-crop = false
#################################
# Fading #
#################################
# Fade windows in/out when opening/closing and when opacity changes,
# unless no-fading-openclose is used.
# fading = false
fading = true;
# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
# fade-in-step = 0.028
fade-in-step = 0.2;
# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
# fade-out-step = 0.03
fade-out-step = 0.2;
# The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
# fade-delta = 10
# Specify a list of conditions of windows that should not be faded.
# fade-exclude = []
# Do not fade on window open/close.
# no-fading-openclose = false
# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc.
# no-fading-destroyed-argb = false
#################################
# Transparency / Opacity #
#################################
# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
# inactive-opacity = 1
# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
# frame-opacity = 1.0
# Let inactive opacity set by -i override the '_NET_WM_WINDOW_OPACITY' values of windows.
# inactive-opacity-override = true
inactive-opacity-override = false;
# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0)
# active-opacity = 1.0
# Dim inactive windows. (0.0 - 1.0, defaults to 0.0)
# inactive-dim = 0.0
# Specify a list of conditions of windows that should never be considered focused.
# focus-exclude = []
# Use fixed inactive dim value, instead of adjusting according to window opacity.
# inactive-dim-fixed = 1.0
# Specify a list of opacity rules, in the format `PERCENT:PATTERN`,
# like `50:name *= "Firefox"`. picom-trans is recommended over this.
# Note we don't make any guarantee about possible conflicts with other
# programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows.
# example:
# opacity-rule = [ "80:class_g = 'URxvt'" ];
#
# opacity-rule = []
#################################
# Corners #
#################################
# Sets the radius of rounded window corners. When > 0, the compositor will
# round the corners of windows. Does not interact well with
# `transparent-clipping`.
corner-radius = 4
# Exclude conditions for rounded corners.
rounded-corners-exclude = [
"window_type = 'dock'",
"window_type = 'desktop'"
];
#################################
# Background-Blurring #
#################################
# Parameters for background blurring, see the *BLUR* section for more information.
blur-method = "dual_kawase"
blur-size = 12
#
# blur-deviation = false
#
blur-strength = 5
# Blur background of semi-transparent / ARGB windows.
# Bad in performance, with driver-dependent behavior.
# The name of the switch may change without prior notifications.
#
# blur-background = false
# Blur background of windows when the window frame is not opaque.
# Implies:
# blur-background
# Bad in performance, with driver-dependent behavior. The name may change.
#
# blur-background-frame = false
# Use fixed blur strength rather than adjusting according to window opacity.
# blur-background-fixed = false
# Specify the blur convolution kernel, with the following format:
# example:
# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
#
# blur-kern = ""
blur-kern = "3x3box";
# Exclude conditions for background blur.
# blur-background-exclude = []
blur-background-exclude = [
"window_type = 'dock'",
"window_type = 'desktop'",
"_GTK_FRAME_EXTENTS@:c"
];
#################################
# General Settings #
#################################
# Enable remote control via D-Bus. See the man page for more details.
# dbus = true
# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers.
# daemon = false
# Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`.
# `xrender` is the default one.
#
# backend = "glx"
backend = "glx";
# Enable/disable VSync.
# vsync = false
vsync = true;
# Enable remote control via D-Bus. See the *D-BUS API* section below for more details.
# dbus = false
# Try to detect WM windows (a non-override-redirect window with no
# child that has 'WM_STATE') and mark them as active.
#
# mark-wmwin-focused = false
mark-wmwin-focused = true;
# Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused.
# mark-ovredir-focused = false
mark-ovredir-focused = true;
# Try to detect windows with rounded corners and don't consider them
# shaped windows. The accuracy is not very high, unfortunately.
#
# detect-rounded-corners = false
detect-rounded-corners = true;
# Detect '_NET_WM_WINDOW_OPACITY' on client windows, useful for window managers
# not passing '_NET_WM_WINDOW_OPACITY' of client windows to frame windows.
#
# detect-client-opacity = false
detect-client-opacity = true;
# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy,
# provided that the WM supports it.
#
# use-ewmh-active-win = false
# Unredirect all windows if a full-screen opaque window is detected,
# to maximize performance for full-screen windows. Known to cause flickering
# when redirecting/unredirecting windows.
#
# unredir-if-possible = false
# Delay before unredirecting the window, in milliseconds. Defaults to 0.
# unredir-if-possible-delay = 0
# Conditions of windows that shouldn't be considered full-screen for unredirecting screen.
# unredir-if-possible-exclude = []
# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows
# in the same group focused at the same time.
#
# detect-transient = false
detect-transient = true;
# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same
# group focused at the same time. This usually means windows from the same application
# will be considered focused or unfocused at the same time.
# 'WM_TRANSIENT_FOR' has higher priority if detect-transient is enabled, too.
#
# detect-client-leader = false
# Resize damaged region by a specific number of pixels.
# A positive value enlarges it while a negative one shrinks it.
# If the value is positive, those additional pixels will not be actually painted
# to screen, only used in blur calculation, and such. (Due to technical limitations,
# with use-damage, those pixels will still be incorrectly painted to screen.)
# Primarily used to fix the line corruption issues of blur,
# in which case you should use the blur radius value here
# (e.g. with a 3x3 kernel, you should use `--resize-damage 1`,
# with a 5x5 one you use `--resize-damage 2`, and so on).
# May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly.
#
# resize-damage = 1
# Specify a list of conditions of windows that should be painted with inverted color.
# Resource-hogging, and is not well tested.
#
# invert-color-include = []
# GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer.
# Might cause incorrect opacity when rendering transparent content (but never
# practically happened) and may not work with blur-background.
# My tests show a 15% performance boost. Recommended.
#
# glx-no-stencil = false
# GLX backend: Avoid rebinding pixmap on window damage.
# Probably could improve performance on rapid window content changes,
# but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.).
# Recommended if it works.
#
# glx-no-rebind-pixmap = false
# Disable the use of damage information.
# This cause the whole screen to be redrawn every time, instead of the part of the screen
# has actually changed. Potentially degrades the performance, but might fix some artifacts.
# The opposing option is use-damage
#
# no-use-damage = false
use-damage = true;
# Use X Sync fence to sync clients' draw calls, to make sure all draw
# calls are finished before picom starts drawing. Needed on nvidia-drivers
# with GLX backend for some users.
#
# xrender-sync-fence = false
# GLX backend: Use specified GLSL fragment shader for rendering window
# contents. Read the man page for a detailed explanation of the interface.
#
# window-shader-fg = "default"
# Use rules to set per-window shaders. Syntax is SHADER_PATH:PATTERN, similar
# to opacity-rule. SHADER_PATH can be "default". This overrides window-shader-fg.
#
# window-shader-fg-rule = [
# "my_shader.frag:window_type != 'dock'"
# ]
# Force all windows to be painted with blending. Useful if you
# have a glx-fshader-win that could turn opaque pixels transparent.
#
# force-win-blend = false
# Do not use EWMH to detect fullscreen windows.
# Reverts to checking if a window is fullscreen based only on its size and coordinates.
#
# no-ewmh-fullscreen = false
# Dimming bright windows so their brightness doesn't exceed this set value.
# Brightness of a window is estimated by averaging all pixels in the window,
# so this could comes with a performance hit.
# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. (default: 1.0)
#
# max-brightness = 1.0
# Make transparent windows clip other windows like non-transparent windows do,
# instead of blending on top of them.
#
# transparent-clipping = false
# Specify a list of conditions of windows that should never have transparent
# clipping applied. Useful for screenshot tools, where you need to be able to
# see through transparent parts of the window.
#
# transparent-clipping-exclude = []
# Set the log level. Possible values are:
# "trace", "debug", "info", "warn", "error"
# in increasing level of importance. Case doesn't matter.
# If using the "TRACE" log level, it's better to log into a file
# using *--log-file*, since it can generate a huge stream of logs.
#
# log-level = "debug"
log-level = "warn";
# Set the log file.
# If *--log-file* is never specified, logs will be written to stderr.
# Otherwise, logs will to written to the given file, though some of the early
# logs might still be written to the stderr.
# When setting this option from the config file, it is recommended to use an absolute path.
#
# log-file = "/path/to/your/log/file"
# Show all X errors (for debugging)
# show-all-xerrors = false
# Write process ID to a file.
# write-pid-path = "/path/to/your/log/file"
# Window type settings
#
# 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard:
# "unknown", "desktop", "dock", "toolbar", "menu", "utility",
# "splash", "dialog", "normal", "dropdown_menu", "popup_menu",
# "tooltip", "notification", "combo", and "dnd".
#
# Following per window-type options are available: ::
#
# fade, shadow:::
# Controls window-type-specific shadow and fade settings.
#
# opacity:::
# Controls default opacity of the window type.
#
# focus:::
# Controls whether the window of this type is to be always considered focused.
# (By default, all window types except "normal" and "dialog" has this on.)
#
# full-shadow:::
# Controls whether shadow is drawn under the parts of the window that you
# normally won't be able to see. Useful when the window has parts of it
# transparent, and you want shadows in those areas.
#
# clip-shadow-above:::
# Controls whether shadows that would have been drawn above the window should
# be clipped. Useful for dock windows that should have no shadow painted on top.
#
# redir-ignore:::
# Controls whether this type of windows should cause screen to become
# redirected again after been unredirected. If you have unredir-if-possible
# set, and doesn't want certain window to cause unnecessary screen redirection,
# you can set this to `true`.
#
wintypes:
{
tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; };
dock = { shadow = false; clip-shadow-above = true; }
dnd = { shadow = false; }
popup_menu = { opacity = 0.8; }
dropdown_menu = { opacity = 0.8; }
};
+2
View File
@@ -0,0 +1,2 @@
set preview_images true
set preview_images_method kitty
+302
View File
@@ -0,0 +1,302 @@
" This is Venomade's vimrc
" Install Vim Plug
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" PLUGins
call plug#begin('~/.vim/plugged')
" Maybe replace with fzf in future
Plug 'ctrlpvim/ctrlp.vim'
" COC because YCM is too hard
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" Pretty Colors
Plug 'jackguo380/vim-lsp-cxx-highlight'
"put this into coc-settings.json
"{
"suggest.noselect": true,
"clangd.semanticHighlighting": true,
"coc.preferences.semanticTokensHighlights": false
"}
" λ Mathematical Crowbars λ
Plug 'neovimhaskell/haskell-vim'
" I'm too lazy to actually program
Plug 'Exafunction/codeium.vim'
" Getting Gruuvy
Plug 'dkasak/gruvbox'
" Space then... ummm
Plug 'liuchengxu/vim-which-key'
" Ahhh a lovely #00ff00 field
Plug 'chrisbra/Colorizer'
" Customize the flight path
Plug 'vim-airline/vim-airline'
" \("^_^")/
Plug 'LunarWatcher/auto-pairs'
" So take me back in time!!!
Plug 'farmergreg/vim-lastplace'
" One  please! Oooh and a  too!
" Plug 'ryanoasis/vim-devicons'
call plug#end()
" Colorscheme
colorscheme gruvbox
set bg=dark
" Undo History
set undofile
set undodir=~/.vim/undodir
" Common Settings
syntax on
filetype plugin indent on
set ts=2 sts=2 sw=4 et ai si
set nu rnu
set nowrap
set formatoptions-=cro
set splitbelow splitright
set encoding=UTF-8
set shell=zsh
set ignorecase
set smartcase
set incsearch
" Cursor Shapes
let &t_SI = "\<Esc>[6 q"
let &t_SR = "\<Esc>[4 q"
let &t_EI = "\<Esc>[2 q"
" Terminal Title
autocmd BufEnter * let &titlestring = '' . expand("%:t")
set title
" Airline Config
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#codeium#enabled = 1
let g:airline#extensions#tabline#formatter = 'unique_tail'
let g:airline_powerline_fonts = 1
let g:airline#extensions#coc#enabled = 1
let g:airline#extensions#coc#show_coc_status = 1
" Haskell Highlighting
let g:haskell_enable_quantification = 1 " to enable highlighting of `forall`
let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec`
let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc`
let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern`
let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles
let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static`
let g:haskell_backpack = 1 " to enable highlighting of backpack keywords
" Color Highlighting
set termguicolors
let g:colorizer_auto_color = 1
" AutoPairs
let g:AutoPairsMapBS = 1
" Recentre view on slow move
nnoremap j jzz
nnoremap k kzz
" Same for mouse
set mouse=a
map <ScrollWheelDown> 2jzz
map <ScrollWheelUp> 2kzz
" Leader Key
let mapleader = " "
" WhichKey
nnoremap <silent> <leader> :WhichKey '<Space>'<CR>
" Quick split movement
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
" Terminal Buffer
map <leader>t :term<CR>
" Fuzzy Find
map <leader>ff :CtrlP<CR>
map <leader>fb :CtrlPBuffer<CR>
map <leader>fa :CtrlPMixed<CR>
" Copy and Paste from System Clipboard
noremap <Leader>y "*y
noremap <Leader>p "*p
" Quick Add/Remove Semicolon
map <leader>; :s/\v(.)$/\=submatch(1)==';' ? '' : submatch(1).';'<CR>
" Buffers
map <leader>bk :bd<CR>
map <leader>bn :bn<CR>
map <leader>bp :bp<CR>
" Clang Build Individual File (No Includes)
" map <leader>bf :!clang -Werror % -o out/%:r && ./out/%:r <CR>
" Haskell Run File
map <leader>rh :!runhaskell %<CR>
" Remove Trailing Whitespaces on Save
autocmd BufWritePre * %s/\s\+$//e
" Codeium Config
let g:codeium_disable_bindings = 1
inoremap <silent><script><expr> <C-space> codeium#Accept()
" ----------
" COC Config
" ----------
set encoding=utf-8
set nobackup "DANGER
set nowritebackup "But it's needed :/
set updatetime=300
set signcolumn=yes
function! CheckBackspace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1) :
\ CheckBackspace() ? "\<Tab>" :
\ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
inoremap <silent><expr> <c-@> coc#refresh()
" GoTo code navigation
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Use K to show documentation in preview window
nnoremap <silent> K :call ShowDocumentation()<CR>
function! ShowDocumentation()
if CocAction('hasProvider', 'hover')
call CocActionAsync('doHover')
else
call feedkeys('K', 'in')
endif
endfunction
" Highlight the symbol and its references when holding the cursor
autocmd CursorHold * silent call CocActionAsync('highlight')
" Symbol renaming
nmap <leader>cn <Plug>(coc-rename)
" Formatting selected code
xmap <leader>cf <Plug>(coc-format-selected)
nmap <leader>cf <Plug>(coc-format-selected)
augroup mygroup
autocmd!
" Setup formatexpr specified filetype(s)
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
" Update signature help on jump placeholder
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
" Applying code actions to the selected code block
" Example: `<leader>aap` for current paragraph
xmap <leader>caa <Plug>(coc-codeaction-selected)
nmap <leader>caa <Plug>(coc-codeaction-selected)
" Remap keys for applying code actions at the cursor position
nmap <leader>cac <Plug>(coc-codeaction-cursor)
" Remap keys for apply code actions affect whole buffer
nmap <leader>cs <Plug>(coc-codeaction-source)
" Apply the most preferred quickfix action to fix diagnostic on the current line
nmap <leader>qf <Plug>(coc-fix-current)
" Remap keys for applying refactor code actions
nmap <silent> <leader>cre <Plug>(coc-codeaction-refactor)
xmap <silent> <leader>crs <Plug>(coc-codeaction-refactor-selected)
nmap <silent> <leader>crs <Plug>(coc-codeaction-refactor-selected)
" Run the Code Lens action on the current line
nmap <leader>cl <Plug>(coc-codelens-action)
" Map function and class text objects
" NOTE: Requires 'textDocument.documentSymbol' support from the language server
xmap if <Plug>(coc-funcobj-i)
omap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap af <Plug>(coc-funcobj-a)
xmap ic <Plug>(coc-classobj-i)
omap ic <Plug>(coc-classobj-i)
xmap ac <Plug>(coc-classobj-a)
omap ac <Plug>(coc-classobj-a)
" Remap <C-f> and <C-b> to scroll float windows/popups
if has('nvim-0.4.0') || has('patch-8.2.0750')
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
endif
" Use CTRL-S for selections ranges
" Requires 'textDocument/selectionRange' support of language server
nmap <silent> <C-s> <Plug>(coc-range-select)
xmap <silent> <C-s> <Plug>(coc-range-select)
" Add `:Format` command to format current buffer
command! -nargs=0 Format :call CocActionAsync('format')
" Add `:Fold` command to fold current buffer
command! -nargs=? Fold :call CocAction('fold', <f-args>)
" Add `:OR` command for organize imports of the current buffer
command! -nargs=0 OR :call CocActionAsync('runCommand', 'editor.action.organizeImport')
" Add (Neo)Vim's native statusline support
" NOTE: Please see `:h coc-status` for integrations with external plugins that
" provide custom statusline: lightline.vim, vim-airline
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
" Mappings for CoCList
" Show all diagnostics
nnoremap <silent><nowait> <space>cd :<C-u>CocList diagnostics<cr>
" Manage extensions
nnoremap <silent><nowait> <space>ce :<C-u>CocList extensions<cr>
" Show commands
nnoremap <silent><nowait> <space>cc :<C-u>CocList commands<cr>
" Find symbol of current document
nnoremap <silent><nowait> <space>co :<C-u>CocList outline<cr>
" Search workspace symbols
nnoremap <silent><nowait> <space>cs :<C-u>CocList -I symbols<cr>
" Do default action for next item
nnoremap <silent><nowait> <space>cj :<C-u>CocNext<CR>
" Do default action for previous item
nnoremap <silent><nowait> <space>ck :<C-u>CocPrev<CR>
" Resume latest coc list
nnoremap <silent><nowait> <space>cp :<C-u>CocListResume<CR>
+122
View File
@@ -0,0 +1,122 @@
Config {
-- appearance
font = "FantasqueSansM Nerd Font Bold 12"
, bgColor = "#1e1e2e"
, fgColor = "#cdd6f4"
, position = TopH 24
, border = BottomB
, borderColor = "#646464"
-- layout
, sepChar = "%" -- delineator between plugin names and straight text
, alignSep = "}{" -- separator between left-right alignment
, template = "  %StdinReader% }{ %mpris2% | %get-volume% | %get-brightness% | %get-battery% | %date% "
-- general behavior
, lowerOnStart = True -- send to bottom of window stack on start
, hideOnStart = False -- start with window unmapped (hidden)
, allDesktops = True -- show on all desktops
, overrideRedirect = True -- set the Override Redirect flag (Xlib)
, pickBroadest = False -- choose widest display (multi-monitor)
, persistent = True -- enable/disable hiding (True = disabled)
-- plugins
-- Numbers can be automatically colored according to their value. xmobar
-- decides color based on a three-tier/two-cutoff system, controlled by
-- command options:
-- --Low sets the low cutoff
-- --High sets the high cutoff
--
-- --low sets the color below --Low cutoff
-- --normal sets the color between --Low and --High cutoffs
-- --High sets the color above --High cutoff
--
-- The --template option controls how the plugin is displayed. Text
-- color can be set by enclosing in <fc></fc> tags. For more details
-- see http://projects.haskell.org/xmobar/#system-monitor-plugins.
, commands =
-- weather monitor
[ Run Weather "EGSC" [ "--template", "<skyCondition> @ <fc=#549ab8><tempC></fc>°C"
] 36000
-- StdinReader
, Run StdinReader
-- network activity monitor (dynamic interface resolution)
, Run DynNetwork [ "--template" , "Net: 󰁝 <tx>kB/s 󰁅 <rx>kB/s"
, "--Low" , "1000000" -- units: B/s
, "--High" , "5000000" -- units: B/s
, "--low" , "darkgreen"
, "--normal" , "darkorange"
, "--high" , "darkred"
] 10
-- cpu activity monitor
-- , Run MultiCpu [ "--template" , "Cpu: <total0>%|<total1>%"
, Run MultiCpu [ "--template" , "Cpu: <total0>%|<total1>%"
, "--Low" , "50" -- units: %
, "--High" , "85" -- units: %
, "--low" , "darkgreen"
, "--normal" , "darkorange"
, "--high" , "darkred"
] 10
-- cpu core temperature monitor
, Run CoreTemp [ "--template" , "Temp: <core0>°C|<core1>°C"
, "--Low" , "70" -- units: °C
, "--High" , "80" -- units: °C
, "--low" , "darkgreen"
, "--normal" , "darkorange"
, "--high" , "darkred"
] 50
-- memory usage monitor
, Run Memory [ "--template" ,"Mem: <usedratio>%"
, "--Low" , "20" -- units: %
, "--High" , "90" -- units: %
, "--low" , "darkgreen"
, "--normal" , "darkorange"
, "--high" , "darkred"
] 10
-- battery monitor
, Run Battery [ "--template" , "Batt: <acstatus>"
, "--Low" , "10" -- units: %
, "--High" , "80" -- units: %
, "--low" , "darkred"
, "--normal" , "darkorange"
, "--high" , "darkgreen"
, "--" -- battery specific options
-- discharging status
, "-o" , "<left>% (<timeleft>)"
-- AC "on" status
, "-O" , "<fc=#dAA520>Charging</fc>"
-- charged status
, "-i" , "<fc=#006000>Charged</fc>"
] 50
-- time and date indicator
-- (%F = y-m-d date, %a = day of week, %T = h:m:s time)
-- , Run Date "<fc=#ABABAB>%F (%a) %T</fc>" "date" 10
, Run Date "%a %b %_d <fc=#eca8f1>%H:%M</fc>" "date" 10
, Run Mpris2 "playerctld" ["-t", "<fc=#907F9B><artist></fc> - <fc=#C7B2D3><title></fc>"] 10
, Run Com "tomato" ["-t"] "tomato" 10
-- , Run Volume "default" "Master" ["--on", "󰕾", "--off", "󰝟"] 2
, Run Com "/home/venomade/.local/bin/get-volume" [] "get-volume" 5
, Run Com "/home/venomade/.local/bin/get-brightness" [] "get-brightness" 5
, Run Com "/home/venomade/.local/bin/get-battery" [] "get-battery" 10
-- keyboard layout indicator
, Run Kbd [ ("us(dvorak)" , "<fc=#00008B>DV</fc>")
, ("us" , "<fc=#8B0000>US</fc>")
]
]
}
+304
View File
@@ -0,0 +1,304 @@
-- IMPORTS
import Data.Map qualified as M
import Data.Monoid
import Graphics.X11.ExtraTypes.XF86
import System.Exit
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
import XMonad.Layout.Gaps
import XMonad.Layout.Spacing
import XMonad.Layout.ThreeColumns
import XMonad.StackSet qualified as W
import XMonad.Util.Run (spawnPipe)
import XMonad.Util.SpawnOnce (spawnOnce)
-- Terminal
myTerminal = "kitty"
-- Whether focus follows the mouse pointer.
myFocusFollowsMouse :: Bool
myFocusFollowsMouse = True
-- Whether clicking on a window to focus also passes the click to the window
myClickJustFocuses :: Bool
myClickJustFocuses = False
-- Mod Key (1=Alt 4=Super)
myModMask = mod4Mask
-- The default number of workspaces (virtual screens) and their names.
-- By default we use numeric strings, but any string may be used as a
-- workspace name. The number of workspaces is determined by the length
-- of this list.
--
-- A tagging example:
--
-- > workspaces = ["web", "irc", "code" ] ++ map show [4..9]
--
myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
-- Width of the window border in pixels.
myBorderWidth = 2
-- Border colors for unfocused and focused windows, respectively.
myNormalBorderColor = "#594C62"
myFocusedBorderColor = "#C7B2D3"
------------------------------------------------------------------------
-- Key bindings. Add, modify or remove key bindings here.
--
myKeys conf@(XConfig {XMonad.modMask = modm}) =
M.fromList $
-- launch a terminal
[ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf),
-- launch dmenu
((modm, xK_d), spawn "j4-dmenu-desktop --dmenu='dmenu -i'"),
-- launch dm-scripts menu
((modm .|. shiftMask, xK_d), spawn "dmenu_run"),
-- launch clipboard menu
((modm, xK_v), spawn "clipmenu"),
-- close focused window
((modm .|. shiftMask, xK_q), kill),
-- Brightness Up
((0, xF86XK_MonBrightnessUp), spawn "brightnessctl s 5%+"),
-- Brightness Down
((0, xF86XK_MonBrightnessDown), spawn "brightnessctl s 5%-"),
-- Volume Up
((0, xF86XK_AudioRaiseVolume), spawn "pactl set-sink-volume @DEFAULT_SINK@ +5%"),
-- Volume Down
((0, xF86XK_AudioLowerVolume), spawn "pactl set-sink-volume @DEFAULT_SINK@ -5%"),
-- Volume Mute
((0, xF86XK_AudioMute), spawn "pactl set-sink-mute @DEFAULT_SINK@ toggle"),
-- Rotate through the available layout algorithms
((modm, xK_space), sendMessage NextLayout),
-- Reset the layouts on the current workspace to default
((modm .|. shiftMask, xK_space), setLayout $ XMonad.layoutHook conf),
-- Resize viewed windows to the correct size
-- , ((modm, xK_n ), refresh)
-- Move focus to the next window
((modm, xK_Tab), windows W.focusDown),
-- Move focus to the next window
((modm, xK_e), windows W.focusDown),
-- Move focus to the previous window
((modm, xK_i), windows W.focusUp),
-- Move focus to the master window
((modm, xK_m), windows W.focusMaster),
-- Swap the focused window and the master window
((modm, xK_Return), windows W.swapMaster),
-- Swap the focused window with the next window
((modm .|. shiftMask, xK_e), windows W.swapDown),
-- Swap the focused window with the previous window
((modm .|. shiftMask, xK_i), windows W.swapUp),
-- Shrink the master area
((modm, xK_n), sendMessage Shrink),
-- Expand the master area
((modm, xK_o), sendMessage Expand),
-- Push window back into tiling
((modm, xK_t), withFocused $ windows . W.sink),
-- Increment the number of windows in the master area
((modm, xK_comma), sendMessage (IncMasterN 1)),
-- Deincrement the number of windows in the master area
((modm, xK_period), sendMessage (IncMasterN (-1))),
-- Toggle the status bar gap
-- Use this binding with avoidStruts from Hooks.ManageDocks.
-- See also the statusBar function from Hooks.DynamicLog.
--
-- , ((modm , xK_b ), sendMessage ToggleStruts)
-- Quit xmonad
((modm .|. shiftMask, xK_c), io (exitWith ExitSuccess)),
-- Restart xmonad
-- , ((modm , xK_q ), spawn "xmonad --recompile; pkill xmobar; xmonad --restart")
((modm, xK_q), spawn "pkill xmobar; xmonad --restart"),
-- Run xmessage with a summary of the default keybindings (useful for beginners)
((modm .|. shiftMask, xK_slash), spawn ("echo \"" ++ help ++ "\" | xmessage -file -"))
]
++
--
-- mod-[1..9], Switch to workspace N
-- mod-shift-[1..9], Move client to workspace N
--
[ ((m .|. modm, k), windows $ f i)
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9],
(f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]
]
-- ++
--
-- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
-- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
--
-- [((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
-- | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
-- , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
------------------------------------------------------------------------
-- Mouse bindings: default actions bound to mouse events
--
myMouseBindings (XConfig {XMonad.modMask = modm}) =
M.fromList $
-- mod-button1, Set the window to floating mode and move by dragging
[ ( (modm, button1),
( \w ->
focus w
>> mouseMoveWindow w
>> windows W.shiftMaster
)
),
-- mod-button2, Raise the window to the top of the stack
((modm, button2), (\w -> focus w >> windows W.shiftMaster)),
-- mod-button3, Set the window to floating mode and resize by dragging
( (modm, button3),
( \w ->
focus w
>> mouseResizeWindow w
>> windows W.shiftMaster
)
)
-- you may also bind events to the mouse scroll wheel (button4 and button5)
]
------------------------------------------------------------------------
-- Layouts:
-- You can specify and transform your layouts by modifying these values.
-- If you change layout bindings be sure to use 'mod-shift-space' after
-- restarting (with 'mod-q') to reset your layout state to the new
-- defaults, as xmonad preserves your old layout settings by default.
--
-- The available layouts. Note that each layout is separated by |||,
-- which denotes layout choice.
--
myLayout = avoidStruts $ spacingWithEdge 3 $ tiled ||| ThreeColMid 1 (3 / 100) (1 / 2) ||| Full
where
-- myLayout = gaps [(U,20), (D,20), (L,20), (R,20)] $ avoidStruts tiled ||| Mirror tiled ||| Full
-- default tiling algorithm partitions the screen into two panes
tiled = Tall nmaster delta ratio
-- The default number of windows in the master pane
nmaster = 1
-- Default proportion of screen occupied by master pane
ratio = 1 / 2
-- Percent of screen to increment by when resizing panes
delta = 3 / 100
------------------------------------------------------------------------
-- Window rules:
-- Execute arbitrary actions and WindowSet manipulations when managing
-- a new window. You can use this to, for example, always float a
-- particular program, or have a client always appear on a particular
-- workspace.
--
-- To find the property name associated with a program, use
-- > xprop | grep WM_CLASS
-- and click on the client you're interested in.
--
-- To match on the WM_NAME, you can use 'title' in the same way that
-- 'className' and 'resource' are used below.
--
myManageHook =
composeAll
[ className =? "mpv" --> doFloat,
resource =? "desktop_window" --> doIgnore
]
------------------------------------------------------------------------
-- Event handling
-- * EwmhDesktops users should change this to ewmhDesktopsEventHook
--
-- Defines a custom handler function for X Events. The function should
-- return (All True) if the default handler is to be run afterwards. To
-- combine event hooks use mappend or mconcat from Data.Monoid.
--
-- myEventHook = mempty
myEventHook = docksEventHook <+> handleEventHook def <+> fullscreenEventHook
------------------------------------------------------------------------
-- Status bars and logging
-- Perform an arbitrary action on each internal state change or X event.
-- See the 'XMonad.Hooks.DynamicLog' extension for examples.
--
myLogHook = return ()
------------------------------------------------------------------------
-- Startup hook
-- Perform an arbitrary action each time xmonad starts or is restarted
-- with mod-q. Used by, e.g., XMonad.Layout.PerWorkspace to initialize
-- per-workspace layout choices.
--
-- By default, do nothing.
myStartupHook = do
spawnOnce "setxkbmap -layout us -variant colemak -option caps:escape"
spawnOnce "xsetroot -cursor_name left_ptr"
spawnOnce "feh --bg-scale ~/.wallpapers/PastelPinkLightning.jpg &"
spawnOnce "picom &"
spawnOnce "clipmenud &"
------------------------------------------------------------------------
-- XMobar
myPP =
xmobarPP
{ ppCurrent = xmobarColor "#907F9B" "" . wrap "" "",
ppTitle = xmobarColor "#C7B2D3" "" . shorten 100,
ppSep = " | ",
ppOrder = \(ws : _ : t : _) -> [ws, t]
}
toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b)
------------------------------------------------------------------------
-- Now run xmonad with all the defaults we set up.
-- Run xmonad with the settings you specify. No need to modify this.
--
-- main = do
-- xmproc <- spawnPipe "xmobar -x 0 /home/venomade/.xmobarrc"
-- xmonad $ docks defaults
main = xmonad =<< statusBar "xmobar" myPP toggleStrutsKey defaults
-- A structure containing your configuration settings, overriding
-- fields in the default config. Any you don't override, will
-- use the defaults defined in xmonad/XMonad/Config.hs
--
-- No need to modify this.
--
defaults =
def
{ -- simple stuff
terminal = myTerminal,
focusFollowsMouse = myFocusFollowsMouse,
clickJustFocuses = myClickJustFocuses,
borderWidth = myBorderWidth,
modMask = myModMask,
workspaces = myWorkspaces,
normalBorderColor = myNormalBorderColor,
focusedBorderColor = myFocusedBorderColor,
-- key bindings
keys = myKeys,
mouseBindings = myMouseBindings,
-- hooks, layouts
layoutHook = myLayout,
manageHook = myManageHook,
handleEventHook = myEventHook,
logHook = myLogHook,
startupHook = myStartupHook
}
-- | Finally, a copy of the default bindings in simple textual tabular format.
help :: String
help = unlines ["Read xmonad.hs"]
+34
View File
@@ -0,0 +1,34 @@
autoload -U compinit
compinit
setopt COMPLETE_IN_WORD
eval "$(starship init zsh)"
#source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
#source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
DISABLE_AUTO_TITLE="true"
function set_terminal_title() {
echo -en "\e]2;$@\a"
}
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt appendhistory
setopt SHARE_HISTORY
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
bindkey "^[[3~" delete-char
alias l=eza
alias ls="eza -T"
alias vim=nvim
export path=($HOME/.local/bin $path)
[ -f "/home/venomade/.ghcup/env" ] && source "/home/venomade/.ghcup/env" # ghcup-env
+281
View File
@@ -0,0 +1,281 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, inputs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
inputs.home-manager.nixosModules.default
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "thinkpad"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/London";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_GB.UTF-8";
LC_IDENTIFICATION = "en_GB.UTF-8";
LC_MEASUREMENT = "en_GB.UTF-8";
LC_MONETARY = "en_GB.UTF-8";
LC_NAME = "en_GB.UTF-8";
LC_NUMERIC = "en_GB.UTF-8";
LC_PAPER = "en_GB.UTF-8";
LC_TELEPHONE = "en_GB.UTF-8";
LC_TIME = "en_GB.UTF-8";
};
# Enable the X11 windowing system.
services.xserver.enable = true;
services.xserver.excludePackages = [
pkgs.xterm
];
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
environment.gnome.excludePackages = with pkgs; [
epiphany
gnome-connections
gnome-tour
gnome.geary
gnome.gnome-characters
gnome.gnome-contacts
gnome.gnome-maps
gnome.gnome-music
gnome.simple-scan
gnome.totem
gnome.yelp
snapshot
];
services.xserver.libinput = {
enable = true;
touchpad = {
naturalScrolling = true;
};
};
services.xserver.displayManager = {
defaultSession = "none+xmonad";
#lightdm = {
# enable = true;
# greeter.enable = false;
#};
#autoLogin = {
# enable = true;
# user = "venomade";
#};
};
services.xserver.windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
config = builtins.readFile config/xmonad.hs;
};
services.picom = {
enable = true;
settings = {
shadow = true;
shadow-radius = 7;
shadow-offset-x = -7;
shadow-offset-y = -7;
fading = true;
fade-in-step = 0.2;
fade-out-step = 0.2;
inactive-opacity-override = false;
corner-radius = 4;
rounded-corners-exclude = [
"window_type = 'dock'"
"window_type = 'desktop'"
];
blur-method = "dual_kawase";
blur-size = 12;
blur-strength = 5;
blur-kern = "3x3box";
backend = "glx";
vsync = true;
mark-wmwin-focused = true;
mark-ovredir-focused = true;
detect-rounded-corners = true;
detect-client-opacity = true;
detect-transient = true;
use-damage = true;
};
};
# Location (It's approximate)
location = {
provider = "manual";
longitude = 52.2;
latitude = 0.1;
};
# Redshift
services.redshift = {
enable = true;
brightness = {
day = "1";
night = "1";
};
temperature = {
day = 5500;
night = 3700;
};
};
# Configure keymap in X11
services.xserver = {
layout = "us";
xkbVariant = "colemak";
xkbOptions = "caps:escape";
};
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.venomade = {
isNormalUser = true;
description = "Venomade";
extraGroups = [ "networkmanager" "wheel" ];
shell = pkgs.zsh;
packages = with pkgs; [
clang-tools
eza
firefox
gcc
ghc
haskellPackages.haskell-language-server
hut
musikcube
neovim
nil
nodejs_21
protonvpn-cli_2
starship
zsh
];
};
programs.zsh = {
enable = true;
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
};
home-manager = {
# also pass inputs to home-manager modules
extraSpecialArgs = {inherit inputs;};
users = {
"venomade" = import ./home.nix;
};
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
git
vim
wget
# XMonad
(dmenu.override {
patches = [
config/dmenu.patch
];
})
feh
haskellPackages.xmobar
j4-dmenu-desktop
kitty
ncpamixer
nerdfonts
playerctl
pulseaudio
tomato-c
zathura
ranger
redshift
# DMScripts
clipmenu
didyoumean
jq
xclip
translate-shell
# Laptop
brightnessctl
# NixOS is not linux
steam-run
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# NixOS is not linux
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
}
+48
View File
@@ -0,0 +1,48 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1704980804,
"narHash": "sha256-lPNNKdPqIYcjhhYIVwlajNt/HqVWbMOoSdNnwCvOP04=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "93e804e7f8a1eb88bde6117cd5046501e66aa4bd",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1704722960,
"narHash": "sha256-mKGJ3sPsT6//s+Knglai5YflJUF2DGj7Ai6Ynopz0kI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "317484b1ead87b9c1b8ac5261a8d2dd748a0492d",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
+28
View File
@@ -0,0 +1,28 @@
{
description = "Nixos config flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, ... }@inputs:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in
{
nixosConfigurations.default = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
modules = [
./configuration.nix
inputs.home-manager.nixosModules.default
];
};
};
}
+39
View File
@@ -0,0 +1,39 @@
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/01b1bbcb-ffab-488b-932a-f30551cb8d73";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/EA66-E4EE";
fsType = "vfat";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp2s0f0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp5s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
+117
View File
@@ -0,0 +1,117 @@
{ config, pkgs, ... }:
{
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = "venomade";
home.homeDirectory = "/home/venomade";
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "23.11"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = [
# # Adds the 'hello' command to your environment. It prints a friendly
# # "Hello, world!" when run.
# pkgs.hello
# # It is sometimes useful to fine-tune packages, for example, by applying
# # overrides. You can do that directly here, just don't forget the
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
# # fonts?
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
# # You can also create simple shell scripts directly inside your
# # configuration. For example, this adds a command 'my-hello' to your
# # environment:
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
".config/dmscripts/config".source = config/dmscripts-conf;
".config/kitty/kitty.conf".source = config/kitty.conf;
".config/picom/picom.conf".source = config/picom.conf;
".config/ranger/rc.conf".source = config/rc.conf;
".ghci".source = config/ghci;
".vim/coc-settings.json".source = config/coc-settings.json;
".vimrc".source = config/vimrc;
".xmobarrc".source = config/xmobarrc;
".zshrc".source = config/zshrc;
};
home.file."neovim" = {
source = ./config/neovim;
target = ".config/nvim";
recursive = true;
};
home.file."scripts" = {
source = ./scripts;
target = ".local/bin";
recursive = true;
};
home.file."wallpapers" = {
source = ./wallpapers;
target = ".wallpapers";
recursive = true;
};
home.file.".icons/default".source = "${pkgs.vanilla-dmz}/share/icons/Vanilla-DMZ";
# Home Manager can also manage your environment variables through
# 'home.sessionVariables'. If you don't want to manage your shell through Home
# Manager then you have to manually source 'hm-session-vars.sh' located at
# either
#
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# /etc/profiles/per-user/venomade/etc/profile.d/hm-session-vars.sh
#
home.sessionVariables = {
# EDITOR = "emacs";
};
programs.git = {
enable = true;
userEmail = "venomade@venomade.com";
userName = "venomade";
};
# Configure X11 Cursor
xsession.pointerCursor = {
package = pkgs.gnome.adwaita-icon-theme;
name = "Adwaita";
size = 38;
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}
+196
View File
@@ -0,0 +1,196 @@
#!/usr/bin/env bash
# Script name: _dm-helper
# Description: A helper script for the other scripts in the collection.
# Dependencies:
# GitLab: https://www.gitlab.com/dwt1/dmscripts
# License: https://www.gitlab.com/dwt1/dmscripts/LICENSE
# Contributors: Simon Ingelsson
# HostGrady
# aryak1
set -euo pipefail
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
echo "This is a helper-script it does not do anything on its own."
exit 1
fi
######################
# Error handling #
######################
# Simple warn function
warn() {
printf 'Warn: %s\n' "$1"
}
# Simple error function
err() {
printf 'Error: %s\n' "$1"
exit 1
}
############################
# Dislay server checks #
############################
# Boiler code for if you want to do something with display servers
#function() {
# case "$XDG_SESSION_TYPE" in
# 'x11') something with x;;
# 'wayland') something with wayland;;
# *) err "Unknown display server";;
# esac
#}
# Function to copy to clipboard with different tools depending on the display server
cp2cb() {
case "$XDG_SESSION_TYPE" in
'x11') xclip -r -selection clipboard ;;
'wayland') wl-copy -n ;;
*) err "Unknown display server" ;;
esac
}
grep-desktop() {
case "$XDG_SESSION_TYPE" in
'x11') grep "Name=" /usr/share/xsessions/*.desktop | cut -d'=' -f2 ;;
'wayland') grep "Name=" /usr/share/wayland-sessions/*.desktop | cut -d'=' -f2 || grep "Name=" /usr/share/xsessions/*.desktop | grep -i "wayland" | cut -d'=' -f2 | cut -d' ' -f1 ;;
*) err "Unknown display server" ;;
esac
}
###############
# Parsing #
###############
# simple function which provides a key-value pair in the form of the DM_XML_TAG and DM_XML_VALUE varaibles
xmlgetnext() {
local IFS='>'
# we need to mangle backslashes for this to work (SC2162)
# The DM_XML_* variables are global variables and are expected to be read and dealt with by someone else (SC2034)
# shellcheck disable=SC2162,SC2034
read -d '<' DM_XML_TAG DM_XML_VALUE
}
#################
# Help Function #
#################
# Every script has a '-h' option that displays the following information.
help() {
printf '%s%s%s\n' "Usage: $(basename "$0") [options]
$(grep '^# Description: ' "$0" | sed 's/# Description: /Description: /g')
$(grep '^# Dependencies: ' "$0" | sed 's/# Dependencies: /Dependencies: /g')
The folowing OPTIONS are accepted:
-h displays this help page
-d runs the script using 'dmenu'
-f runs the script using 'fzf'
-r runs the script using 'rofi'
Running" " $(basename "$0") " "without any argument defaults to using 'dmenu'
Run 'man dmscripts' for more information" >/dev/stderr
}
####################
# Handle Arguments #
####################
# this function is a simple parser designed to get the menu program and then exit prematurally
get_menu_program() {
# If script is run with '-d', it will use 'dmenu'
# If script is run with '-f', it will use 'fzf'
# If script is run with '-r', it will use 'rofi'
while getopts "dfrh" arg 2>/dev/null; do
case "${arg}" in
d) # shellcheck disable=SC2153
echo "${DMENU}"
return 0
;;
f) # shellcheck disable=SC2153
echo "${FMENU}"
return 0
;;
r) # shellcheck disable=SC2153
echo "${RMENU}"
return 0
;;
h)
help
return 1
;;
*)
echo "invalid option:
Type $(basename "$0") -h for help" >/dev/stderr
return 1
;;
esac
done
echo "Did not find menu argument, using \${DMENU}" >/dev/stderr
# shellcheck disable=SC2153
echo "${DMENU}"
}
####################
# Boilerplate Code #
####################
# this function will source the dmscripts config files in the order specified below:
#
# Config priority (in order of which code takes precendent over the other):
# 1. Git repository config - For developers
# 2. $XDG_CONFIG_HOME/dmscripts/config || $HOME/.config/dmscripts/config - For local edits
# 3. /etc/dmscripts/config - For the gloabl/default configuration
#
# Only 1 file is ever sourced
# this warning is simply not necessary anywhere in the scope
# shellcheck disable=SC1091
source_dmscripts_configs() {
# this is to ensure this variable is defined
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-}"
[ -f "../config/config" ] && source "../config/config" && return 0
[ -z "$XDG_CONFIG_HOME" ] && [ -f "$HOME/.config/dmscripts/config" ] && source "$HOME/.config/dmscripts/config" && return 0
[ -n "$XDG_CONFIG_HOME" ] && [ -f "$XDG_CONFIG_HOME/dmscripts/config" ] && source "$XDG_CONFIG_HOME/dmscripts/config" && return 0
[ -f "/etc/dmscripts/config" ] && source "/etc/dmscripts/config"
}
# checks the base configuration file and compares it with the local configuration file
# if the numbers are different then the code will return 0, else 1
#
# this does not check the git config as it doesn't make sense
configs_are_different() {
local _base_file=""
local _config_file=""
# DM_SHUTUP is a variable in the dmscript config that is intended to silence the notifications.
DM_SHUTUP="${DM_SHUTUP:-}"
# it cannot determine if the files are different if it does not exist
[ -f "/etc/dmscripts/config" ] && _base_file="/etc/dmscripts/config" || return 1
# this is essentially the same idea as seen previous just with different variable names
local _xdg_config_home="${XDG_CONFIG_HOME:-}"
[ -z "$_xdg_config_home" ] && [ -f "$HOME/.config/dmscripts/config" ] && _config_file="$HOME/.config/dmscripts/config"
[ -n "$_xdg_config_home" ] && [ -f "$XDG_CONFIG_HOME/dmscripts/config" ] && _config_file="$XDG_CONFIG_HOME/dmscripts/config"
# if there is no other config files then just exit.
[ -z "$_config_file" ] && return 1
_config_file_revision=$(grep "^_revision=" "${_config_file}")
_base_file_revision=$(grep "^_revision=" "${_base_file}")
if [[ ! "${_config_file_revision}" == "${_base_file_revision}" ]]; then
if [ -z "$DM_SHUTUP" ]; then
notify-send "dmscripts configuration outdated" "Review the differences of /etc/dmscripts/config and your local config and apply changes accordingly (dont forget to bump the revision number)"
fi
return 0
fi
return 1
}
+96
View File
@@ -0,0 +1,96 @@
#!/usr/bin/env bash
#
# Script name: dm-dictionary
# Description: Uses the translate package as a dictionary.
# Dependencies: dmenu, fzf, rofi, translate-shell, didyoumean
# GitLab: https://www.gitlab.com/dwt1/dmscripts
# License: https://www.gitlab.com/dwt1/dmscripts/LICENSE
# Contributors: Francesco Prem Solidoro
# Derek Taylor
# Set with the flags "-e", "-u","-o pipefail" cause the script to fail
# if certain things happen, which is a good thing. Otherwise, we can
# get hidden bugs that are hard to discover.
set -euo pipefail
# shellcheck disable=SC1091
source ./_dm-helper.sh 2>/dev/null || source _dm-helper.sh 2>/dev/null
source_dmscripts_configs
if configs_are_different; then
echo "$(date): configs are different" >>"$DM_CONFIG_DIFF_LOGFILE"
sleep 1
fi
main() {
# dmenu expects some sort of input piped into it.
# The echo to /dev/null is just a hacky way of giving
# dmenu some input without really giving any input.
# shellcheck disable=SC2260
word="$(echo "" >/dev/null | ${MENU} "Enter word to lookup:")"
testword="$(dym -c -n=1 "$word")"
if [ "$word" != "$testword" ]; then
keyword=$(dym -c "$word" | ${MENU} "was $word a misspelling?(select/no)")
if [ "$keyword" = "no" ] || [ "$keyword" = "n" ]; then
keyword="$word"
fi
else
keyword="$word"
fi
if ! [ "${keyword}" ]; then
printf 'No word inserted\n' >&2
exit 0
fi
$DMTERM trans -v -d "$keyword"
}
mainfzf() {
# shellcheck disable=SC2260
word="$(echo " " | fzf --bind 'return:print-query' --prompt "Enter word to lookup:")"
testword="$(dym -c -n=1 "$word")"
if [ "$word" != "$testword" ]; then
# shellcheck disable=SC2153
keyword=$(dym -c "$word" | ${FMENU} "was $word a misspelling?(select/no)")
if [ "$keyword" = "no" ] || [ "$keyword" = "n" ]; then
keyword="$word"
fi
else
keyword="$word"
fi
if ! [ "${keyword}" ]; then
printf 'No word inserted\n' >&2
exit 0
fi
$DMTERM trans -v -d "$keyword"
}
no_opt=1
# If script is run with '-d', it will use 'dmenu'
# If script is run with '-f', it will use 'fzf'
# If script is run with '-d', it will use 'rofi'
while getopts "dfrh" arg 2>/dev/null; do
case "${arg}" in
d) # shellcheck disable=SC2153
MENU=${DMENU}
[[ "${BASH_SOURCE[0]}" == "${0}" ]] && main
;;
f) # shellcheck disable=SC2153
[[ "${BASH_SOURCE[0]}" == "${0}" ]] && mainfzf ;;
r) # shellcheck disable=SC2153
MENU=${RMENU}
[[ "${BASH_SOURCE[0]}" == "${0}" ]] && main "@"
;;
h) help ;;
*) printf '%s\n' "Error: invalid option" "Type $(basename "$0") -h for help" ;;
esac
no_opt=0
done
# If script is run with NO argument, it will use 'dmenu'
[ $no_opt = 1 ] && MENU=${DMENU} && [[ "${BASH_SOURCE[0]}" == "${0}" ]] && main "$@"
+54
View File
@@ -0,0 +1,54 @@
#!/bin/bash
#
# Script name: dm-documents
# Description: Search for PDFs to open.
# Dependencies: dmenu, fzf, rofi, zathura
# GitLab: https://www.gitlab.com/dwt1/dmscripts
# License: https://www.gitlab.com/dwt1/dmscripts/LICENSE
# Contributors: Derek Taylor
# HostGrady
# Set with the flags "-e", "-u","-o pipefail" cause the script to fail
# if certain things happen, which is a good thing. Otherwise, we can
# get hidden bugs that are hard to discover.
set -euo pipefail
# shellcheck disable=SC1091
source ./_dm-helper.sh 2>/dev/null || source _dm-helper.sh 2>/dev/null
source_dmscripts_configs
if configs_are_different; then
echo "$(date): configs are different" >>"$DM_CONFIG_DIFF_LOGFILE"
sleep 1
fi
main() {
# PDF_VIEWER=zathura
files="$(find "$HOME" -maxdepth 4 -iname "*.pdf")"
choice=$(printf '%s\n' "${files[@]}" \
| cut -d '/' -f4- \
| sed -e 's/Documents/Dcs/g' \
-e 's/Downloads/Dwn/g' \
-e 's/Pictures/Pic/g' \
-e 's/Images/Img/g' \
-e 's/.pdf//g' \
| sort -g \
| ${MENU} "File: ") || exit 1
if [ "$choice" ]; then
file=$(
printf '%s' "$choice" \
| sed -e 's/Dcs/Documents/g' \
-e 's/Dwn/Downloads/g' \
-e 's/Pic/Pictures/g' \
-e 's/Img/Images/g'
)
"${PDF_VIEWER}" "$HOME/${file}.pdf"
else
echo "Program Terminated." && exit 0
fi
}
MENU="$(get_menu_program "$@")"
[[ "${BASH_SOURCE[0]}" == "${0}" ]] && main
+119
View File
@@ -0,0 +1,119 @@
#!/usr/bin/env bash
#
# Script name: dm-hub
# Description: A hub allowing you to execute all the other dmscripts.
# Dependencies: dmenu, fzf, rofi
# GitLab: https://www.gitlab.com/dwt1/dmscripts
# License: https://www.gitlab.com/dwt1/dmscripts/LICENSE
# Contributors: n-e0
# Simon Ingelsson
# Derek Taylor
# Set with the flags "-e", "-u","-o pipefail" cause the script to fail
# if certain things happen, which is a good thing. Otherwise, we can
# get hidden bugs that are hard to discover.
set -euo pipefail
_path=$(dirname "$(realpath "$0")")
# shellcheck disable=SC1091
source ./_dm-helper.sh 2>/dev/null || source _dm-helper.sh 2>/dev/null
source_dmscripts_configs
if configs_are_different; then
echo "$(date): configs are different" >>"$DM_CONFIG_DIFF_LOGFILE"
sleep 1
fi
function maindmenu() {
local _self
declare -A _scripts
_self=$(basename "$0")
while IFS= read -r -d '' script; do
# Every 'dmscript' should contain a line that begins with "# Description: ".
# Let's take that description and add it next to the script name in the dmenu.
script_name=$(echo "$(basename "${script}") $(grep '^# Description: ' "${script}")" | sed 's/# Description: /- /g')
[[ "${script_name}" == "${_self}" ]] && continue
_scripts[${script_name}]="${script}"
done < <(find "${_path}" -type f -regex ".*/dm-.*" -print0)
choice=$(printf '%s\n' "${!_scripts[@]}" | sort | grep ".*dm.*" | ${DMENU} 'Run Script:' "$@")
if [ "${choice}" ]; then
thecommand="$(printf '%s' "${_scripts["${choice}"]}" | awk '{print $1}')"
bash "$thecommand" -d "$@"
else
echo "Program terminated." && exit 0
fi
}
function mainfzf() {
local _self
declare -A _scripts
_self=$(basename "$0")
while IFS= read -r -d '' script; do
# Every 'dmscript' should contain a line that begins with "# Description: ".
# Let's take that description and add it next to the script name in the dmenu.
script_name=$(echo "$(basename "${script}") $(grep '^# Description: ' "${script}")" | sed 's/# Description: /- /g')
[[ "${script_name}" == "${_self}" ]] && continue
_scripts[${script_name}]="${script}"
done < <(find "${_path}" -type f -regex ".*/dm-.*" -print0)
choice=$(printf '%s\n' "${!_scripts[@]}" | sort | grep ".*dm.*" | ${FMENU} 'Run Script:')
if [ "${choice}" ]; then
thecommand="$(printf '%s' "${_scripts["${choice}"]}" | awk '{print $1}')"
bash "$thecommand" -f
else
echo "Program terminated." && exit 0
fi
}
function mainrofi() {
local _self
declare -A _scripts
_self=$(basename "$0")
while IFS= read -r -d '' script; do
# Every 'dmscript' should contain a line that begins with "# Description: ".
# Let's take that description and add it next to the script name in the dmenu.
script_name=$(echo "$(basename "${script}") $(grep '^# Description: ' "${script}")" | sed 's/# Description: /- /g')
[[ "${script_name}" == "${_self}" ]] && continue
_scripts[${script_name}]="${script}"
done < <(find "${_path}" -type f -regex ".*/dm-.*" -print0)
choice=$(printf '%s\n' "${!_scripts[@]}" | sort | grep ".*dm.*" | ${RMENU} 'Run Script:' "$@")
if [ "${choice}" ]; then
thecommand="$(printf '%s' "${_scripts["${choice}"]}" | awk '{print $1}')"
bash "$thecommand" -r "$@"
else
echo "Program terminated." && exit 0
fi
}
no_opt=1
# If script is run with '-d', it will use 'dmenu'
# If script is run with '-f', it will use 'fzf'
# If script is run with '-d', it will use 'rofi'
while getopts "dfrh" arg 2>/dev/null; do
case "${arg}" in
d) [[ "${BASH_SOURCE[0]}" == "${0}" ]] && maindmenu ;;
f) [[ "${BASH_SOURCE[0]}" == "${0}" ]] && mainfzf ;;
r) [[ "${BASH_SOURCE[0]}" == "${0}" ]] && mainrofi "$@" ;;
h) help ;;
*) printf '%s\n' "Error: invalid option" "Type $(basename "$0") -h for help" ;;
esac
no_opt=0
done
# If script is run with NO argument, it will use 'dmenu'
[ $no_opt = 1 ] && [[ "${BASH_SOURCE[0]}" == "${0}" ]] && maindmenu "$@"
# TODO: for some reason dm-template is broken with this script, needs investigating
+57
View File
@@ -0,0 +1,57 @@
#!/usr/bin/env bash
#
# Script name: dm-man
# Description: Search for a manpage or get a random one.
# Dependencies: dmenu, fzf, rofi, alacritty (edit DMTERM in dmscripts config if using another terminal)
# GitLab: https://www.gitlab.com/dwt1/dmscripts
# License: https://www.gitlab.com/dwt1/dmscripts/LICENSE
# Contributors: Derek Taylor
# Simon Ingelsson
# Set with the flags "-e", "-u","-o pipefail" cause the script to fail
# if certain things happen, which is a good thing. Otherwise, we can
# get hidden bugs that are hard to discover.
set -euo pipefail
# shellcheck disable=SC1091
source ./_dm-helper.sh 2>/dev/null || source _dm-helper.sh 2>/dev/null
source_dmscripts_configs
if configs_are_different; then
echo "$(date): configs are different" >>"$DM_CONFIG_DIFF_LOGFILE"
sleep 1
fi
main() {
# An array of options to choose.
local _options=("Search manpages" "Random manpage" "Quit")
# Piping the above array into dmenu.
# We use "printf '%s\n'" to format the array one item to a line.
choice=$(printf '%s\n' "${_options[@]}" | ${MENU} 'Manpages:')
# What to do when/if we choose one of the options.
case "$choice" in
'Search manpages')
# shellcheck disable=SC2086
man -k . | awk '{$3="-"; print $0}' \
| ${MENU} 'Search for:' \
| awk '{print $2, $1}' | tr -d '()' | xargs $DMTERM man
;;
'Random manpage')
# shellcheck disable=SC2086
man -k . | cut -d' ' -f1 | shuf -n 1 \
| ${MENU} 'Random manpage:' | xargs $DMTERM man
;;
'Quit')
echo "Program terminated." && exit 0
;;
*)
exit 0
;;
esac
}
MENU="$(get_menu_program "$@")"
[[ "${BASH_SOURCE[0]}" == "${0}" ]] && main
+61
View File
@@ -0,0 +1,61 @@
#!/usr/bin/env bash
#
# Script name: dm-note
# Description: Store multiple one-line texts or codes and copy one of them when needed.
# Dependencies: dmenu, fzf, rofi, xclip
# GitLab: https://www.gitlab.com/dwt1/dmscripts
# License: https://www.gitlab.com/dwt1/dmscripts/LICENSE
# Contributors: Fawzakin
# Derek Taylor
# Set with the flags "-e", "-u","-o pipefail" cause the script to fail
# if certain things happen, which is a good thing. Otherwise, we can
# get hidden bugs that are hard to discover.
set -euo pipefail
# shellcheck disable=SC1091
source ./_dm-helper.sh 2>/dev/null || source _dm-helper.sh 2>/dev/null
source_dmscripts_configs
if configs_are_different; then
echo "$(date): configs are different" >>"$DM_CONFIG_DIFF_LOGFILE"
sleep 1
fi
# TODO: Program is broken with FZF, fix later.
main() {
# Picking our options.
choice=$(printf 'Copy note\nNew note\nDelete note\nQuit' | ${MENU} 'Notes:')
# Choose what we should do with our choice.
case "$choice" in
'Copy note')
# shellcheck disable=SC2154
note_pick=$(${MENU} 'Copy:' <"${note_dir}")
[ -n "${note_pick}" ] && echo "${note_pick}" | cp2cb && notify-send -u normal "Note copied" "${note_pick}"
;;
'New note')
note_new=$(echo "" | ${MENU} 'Enter new note:')
# Making sure the input is not empty and not already exist in note_dir.
# The sed command should prevent grep from taking certain characters as a regex input.
[ -n "$note_new" ] && ! grep -q "^$(echo "${note_new}" | sed -e 's/\[/\\[/g;s/\]/\\]/g')\$" "${note_dir}" \
&& echo "${note_new}" >>"${note_dir}" && notify-send -u normal "Note created" "${note_new}"
;;
'Delete note')
note_del=$(${MENU} 'Delete:' <"${note_dir}")
# grep should always returns 0 regardless what happens.
grep -v "^$(echo "${note_del}" | sed -e 's/\[/\\[/g;s/\]/\\]/g')\$" "${note_dir}" >"/tmp/dmnote" || true
[ -n "${note_del}" ] && cp -f "/tmp/dmnote" "${note_dir}" && notify-send -u normal "Note deleted" "${note_del}"
;;
'Quit')
echo "Program terminated." && exit 0
;;
*)
exit 0
;;
esac
}
MENU="$(get_menu_program "$@")"
[[ "${BASH_SOURCE[0]}" == "${0}" ]] && main
+51
View File
@@ -0,0 +1,51 @@
#!/usr/bin/env bash
#
# Script name: dm-pipewire-out-switcher
# Description: Switch default output for pipewire.
# Dependencies: dmenu, fzf, rofi, pipewire, jq, pactl
# GitLab: https://www.gitlab.com/dwt1/dmscripts
# License: https://www.gitlab.com/dwt1/dmscripts/LICENSE
# Contributors: Simon Ingelsson
# Derek Taylor
# Set with the flags "-e", "-u","-o pipefail" cause the script to fail
# if certain things happen, which is a good thing. Otherwise, we can
# get hidden bugs that are hard to discover.
set -euo pipefail
# shellcheck disable=SC1091
source ./_dm-helper.sh 2>/dev/null || source _dm-helper.sh 2>/dev/null
source_dmscripts_configs
if configs_are_different; then
echo "$(date): configs are different" >>"$DM_CONFIG_DIFF_LOGFILE"
sleep 1
fi
get_default_sink() {
pactl --format=json info | jq -r .default_sink_name
}
get_all_sinks() {
pactl --format=json list short sinks \
| current=$(get_default_sink) jq -r '.[] | if .name == env.current then .state="* " else .state="" end | .state + .name'
}
main() {
choice=$(printf '%s\n' "$(get_all_sinks)" \
| sort \
| ${MENU} 'Sink: ') || exit 1
if [ "$choice" ]; then
if [[ "${choice}" == "* $(get_default_sink)" ]]; then
exit 0
fi
pactl set-default-sink "${choice}"
notify-send "Sink is now: ${choice}"
else
echo "Program terminated." && exit 0
fi
}
MENU="$(get_menu_program "$@")"
[[ "${BASH_SOURCE[0]}" == "${0}" ]] && main
+38
View File
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
#
# Script name: dm-dictionary
# Description: Uses didyoumean as a spellchecker.
# Dependencies: dmenu, fzf, rofi, didyoumean
# GitLab: https://www.gitlab.com/dwt1/dmscripts
# License: https://www.gitlab.com/dwt1/dmscripts/LICENSE
# Contributors: Francesco Prem Solidoro
# Derek Taylor
# Set with the flags "-e", "-u","-o pipefail" cause the script to fail
# if certain things happen, which is a good thing. Otherwise, we can
# get hidden bugs that are hard to discover.
set -euo pipefail
# shellcheck disable=SC1091
source ./_dm-helper.sh 2>/dev/null || source _dm-helper.sh 2>/dev/null
source_dmscripts_configs
if configs_are_different; then
echo "$(date): configs are different" >>"$DM_CONFIG_DIFF_LOGFILE"
sleep 1
fi
main() {
WORD="$(printf '%s' "" | ${MENU} "Enter Word:")"
if ! [ "${WORD}" ] || [ "${WORD}" = "quit" ]; then
printf 'No word inserted\n' >&2
exit 0
fi
dym -c "$WORD" | ${MENU} "Select Correct Spelling:" | xclip -selection clipboard
}
MENU="$(get_menu_program "$@")"
[[ "${BASH_SOURCE[0]}" == "${0}" ]] && main
+43
View File
@@ -0,0 +1,43 @@
#!/usr/bin/env bash
#
# Script name: dm-weather
# Description: Simple graphical weather app
# Dependencies: dmenu, curl, yad
# GitLab: https://www.gitlab.com/dwt1/dmscripts
# License: https://www.gitlab.com/dwt1/dmscripts/LICENSE
# Contributors: HostGrady
# Derek Taylor
# Set with the flags "-e", "-u","-o pipefail" cause the script to fail
# if certain things happen, which is a good thing. Otherwise, we can
# get hidden bugs that are hard to discover.
set -euo pipefail
# shellcheck disable=SC1091
source ./_dm-helper.sh 2>/dev/null || source _dm-helper.sh 2>/dev/null
source_dmscripts_configs
if configs_are_different; then
echo "$(date): configs are different" >>"$DM_CONFIG_DIFF_LOGFILE"
sleep 1
fi
main() {
# Here we obtain the location from the list in the config
# As this is loaded from other file it is technically not defined
# shellcheck disable=SC2154
_location="$(printf '%s\n' "${weather_locations}" | ${MENU} "Where do you want to see the weather?")"
echo "$_location"
# If $weather_opts is unset, give it an empty value
weather_opts+=''
# Curl wttr.in, a CLI weather app.
# curl -s "https://wttr.in/${_location// /%20}?T&${weather_opts}" | yad --text-info --maximized
kitty -e sh -c "curl -s 'https://wttr.in/${_location// /%20}?T&${weather_opts}'; read -n 1 -s"
}
MENU="$(get_menu_program "$@")"
[[ "${BASH_SOURCE[0]}" == "${0}" ]] && main
+54
View File
@@ -0,0 +1,54 @@
#!/usr/bin/env bash
#
# Script name: dm-websearch
# Description: Search various search engines (inspired by surfraw).
# Dependencies: dmenu, fzf, rofi, brave (change DMMBROWSER in dmscripts config if using another browser)
# GitLab: https://www.gitlab.com/dwt1/dmscripts
# License: https://www.gitlab.com/dwt1/dmscripts/LICENSE
# Contributors: Derek Taylor
# Ali Furkan Yıldız
# HostGrady
# Simon Ingelsson
# Set with the flags "-e", "-u","-o pipefail" cause the script to fail
# if certain things happen, which is a good thing. Otherwise, we can
# get hidden bugs that are hard to discover.
set -euo pipefail
# shellcheck disable=SC1091
source ./_dm-helper.sh 2>/dev/null || source _dm-helper.sh 2>/dev/null
source_dmscripts_configs
if configs_are_different; then
echo "$(date): configs are different" >>"$DM_CONFIG_DIFF_LOGFILE"
sleep 1
fi
main() {
if [ -z "${!websearch[*]}" ]; then
notify-send "dm-websearch: BREAKING CHANGES" "Due to breaking changes you must edit all declare statements in your config to include the g option. declare -A -> declare -Ag, declare -a -> declare -ag"
echo "$(date): dm-websearch: BREAKING CHANGES: Due to breaking changes you must edit all declare statements in your config to include the g option.
are -A -> declare -Ag
are -a -> declare -ag" >>"$DM_CONFIG_DIFF_LOGFILE"
sleep 2
exit 1
fi
# As this is loaded from other file it is technically not defined
# shellcheck disable=SC2154 # Choosing a search engine by name from array above.
engine=$(printf '%s\n' "${!websearch[@]}" | sort | ${MENU} 'Choose search engine:') || exit 1
# Getting the URL of the search engine we chose.
url="${websearch["${engine}"]}"
# Searching the chosen engine.
query=$(printf '%s' "$engine" | ${MENU} 'Enter search query:')
query="$(echo -n "${query}" | jq -s -R -r @uri)"
# Display search results in web browser
# shellcheck disable=SC2154
${DMBROWSER} "${url}${query}"
}
MENU="$(get_menu_program "$@")"
[[ "${BASH_SOURCE[0]}" == "${0}" ]] && main
+42
View File
@@ -0,0 +1,42 @@
#!/usr/bin/env bash
#
# script name: dm-wifi
# Description: Connect to wifi using dmenu
# Dependencies: dmenu, fzf, rofi, nmcli, Any Nerd Font
# GitLab: https://www.gitlab.com/dwt1/dmscripts
# License: https://www.gitlab.com/dwt1/dmscripts/LICENSE
# Contributor: WitherCubes
# Derek Taylor
# Set with the flags "-e", "-u","-o pipefail" cause the script to fail
# if certain things happen, which is a good thing. Otherwise, we can
# get hidden bugs that are hard to discover.
set -euo pipefail
# shellcheck disable=SC1091
source ./_dm-helper.sh 2>/dev/null || source _dm-helper.sh 2>/dev/null
source_dmscripts_configs
if configs_are_different; then
echo "$(date): configs are different" >>"$DM_CONFIG_DIFF_LOGFILE"
sleep 1
fi
main() {
# TODO: Fix cut line at some point
bssid=$(nmcli device wifi list | sed -n '1!p' | cut -b 9- | ${MENU} "Select Wifi  :" | cut -d' ' -f1)
pass=$(echo "" | ${MENU} "Enter Password  :")
# We are disabling a shellcheck warning about using && and || as it doesn't apply here.
# shellcheck disable=SC2015
[ -n "$pass" ] && nmcli device wifi connect "$bssid" password "$pass" || nmcli device wifi connect "$bssid"
sleep 10
if ping -q -c 2 -W 2 google.com >/dev/null; then
notify-send "Your internet is working :)"
else
notify-send "Your internet is not working :("
fi
}
MENU="$(get_menu_program "$@")"
[[ "${BASH_SOURCE[0]}" == "${0}" ]] && main
+87
View File
@@ -0,0 +1,87 @@
#!/usr/bin/env bash
#
# Script name: dm-youtube
# Description: Youtube subscription manager without API access
# Dependencies: dmenu, curl, a browser (brave by default)
# Gitlab: https://www.gitlab.com/dwt1/dmscripts
# License: https://www.gitlab.com/dwt1/dmscripts/LICENSE
# Contributors: HostGrady
# Derek Taylor
# Set with the flags "-e", "-u","-o pipefail" cause the script to fail
# if certain things happen, which is a good thing. Otherwise, we can
# get hidden bugs that are hard to discover.
set -euo pipefail
# shellcheck disable=SC1091
source ./_dm-helper.sh 2>/dev/null || source _dm-helper.sh 2>/dev/null
source_dmscripts_configs
if configs_are_different; then
echo "$(date): configs are different" >>"$DM_CONFIG_DIFF_LOGFILE"
sleep 1
fi
# this is a function for parsing youtube rss, see _dm-helper.sh for information on xmlgetnext
parse_youtube_feed() {
echo "$1" | while xmlgetnext; do
case $DM_XML_TAG in
'entry')
title=''
link=''
published=''
;;
'media:title')
title="$DM_XML_VALUE"
;;
'yt:videoId')
link="$DM_XML_VALUE"
;;
'published')
published="$(date --date="${DM_XML_VALUE}" "+%Y-%m-%d %H:%M")"
;;
'/entry')
echo " ${published} | ${link} | ${title}"
;;
esac
done
}
main() {
local _feed_url _channel _video
local _channel_id _video_id _video_list
if [ -z "${!youtube_channels[*]}" ]; then
notify-send "dm-youtube: BREAKING CHANGES" "Due to breaking changes you must edit all declare statements in your config to include the g option. declare -A -> declare -Ag, declare -a -> declare -ag"
echo "$(date): dm-youtube: BREAKING CHANGES: Due to breaking changes you must edit all declare statements in your config to include the g option.
are -A -> declare -Ag
are -a -> declare -ag" >>"$DM_CONFIG_DIFF_LOGFILE"
sleep 2
exit 1
fi
# Sorts the array and lets you select a channel with dmenu
# As this is loaded from other file it is technically not defined
# shellcheck disable=SC2154
_channel=$(printf '%s\n' "${!youtube_channels[@]}" | sort | ${MENU} 'Select Channel:')
# The way it's done here is most effective, it searchs for "=" then it takes
# everything before the = sign and leaves us with our variable used in the
# _feed_url variable
_channel_id=$(curl -s -f -L "${youtube_channels[${_channel}]}" | grep -o "channel_id=.*" | sed 's/".*//g')
_feed_url="https://www.youtube.com/feeds/videos.xml?channel_id=${_channel_id##*=}"
# parse rss
_video_list=$(parse_youtube_feed "$(curl -s "${_feed_url}")")
_video=$(printf '%s\n' "${_video_list}" | sort -r | ${MENU} 'Select Video')
_video_id=$(echo "${_video}" | cut -d'|' -f2 | sed -e 's/^[ \t]*//')
if [[ -n ${_video_id} ]]; then
# After the video is chosen, run it in your web browser
# shellcheck disable=SC2154
${DMBROWSER} "https://www.youtube.com/watch?v=${_video_id}"
fi
}
MENU="$(get_menu_program "$@")"
[[ "${BASH_SOURCE[0]}" == "${0}" ]] && main
+39
View File
@@ -0,0 +1,39 @@
#!/bin/sh
BATTERY_PATH="/sys/class/power_supply/BAT0"
# Check if the battery is present
if [ -d "$BATTERY_PATH" ]; then
# Get battery status (Charging, Discharging, Full, etc.)
status=$(cat "$BATTERY_PATH/status")
# Get battery percentage
capacity=$(cat "$BATTERY_PATH/capacity")
# Set default icon and color
icon=""
color=""
# Determine icon based on battery status
if [ "$status" == "Charging" ]; then
icon="󱟦" # Charging icon
else
icon="󱟤" # Discharging icon
fi
# Determine color based on battery percentage
if [ "$capacity" -le 20 ]; then
color="<fc=#f38ba8>" # Red
elif [ "$capacity" -le 50 ]; then
color="<fc=#fab387>" # Orange
elif [ "$capacity" -le 79 ]; then
color="<fc=#f9e2af>" # Yellow
else
color="<fc=#a6e3a1>" # Green
fi
# Display battery information with icon and color
echo "$color$icon $capacity%</fc>"
else
echo "Battery not found."
fi
+22
View File
@@ -0,0 +1,22 @@
#!/bin/sh
# Get the current brightness level as a percentage
brightness=$(brightnessctl g)
max_brightness=$(brightnessctl m)
# Perform float division and store the result with 2 decimal points
result=$(awk "BEGIN { printf \"%.2f\", $brightness / $max_brightness }")
# Convert the result to a percentage (multiply by 100) and round to the nearest whole number
percentage=$(awk "BEGIN { printf \"%.0f\", $result * 100 }")
# Set the icon based on the brightness level
if [ $percentage -le 33 ]; then
icon="󰃞"
elif [ $percentage -le 66 ]; then
icon="󰃟"
else
icon="󰃠"
fi
echo "$icon $percentage%"
+22
View File
@@ -0,0 +1,22 @@
#!/bin/sh
# Dependencies: pactl, awk
volume=$(pactl list sinks | awk '/^\s+Volume:/ {print $5}' | head -n 1 | tr -d '%')
muted=$(pactl list sinks | awk '/^\s+Mute:/ {print $2}' | head -n 1)
if [ "$muted" = "yes" ]; then
icon="󰝟"
else
if [ "$volume" -le 20 ]; then
icon="󰕿"
elif [ "$volume" -le 50 ]; then
icon="󰖀"
elif [ "$volume" -le 100 ]; then
icon="󰕾"
else
icon="󰝝"
fi
fi
echo "$icon $volume%"
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB