├── .gitignore ├── .gitmodules ├── README.md ├── alacritty └── .config │ └── alacritty │ └── alacritty.toml ├── awesome └── .config │ └── awesome │ ├── .luarc.json │ ├── README.md │ ├── config │ ├── autostart.lua │ ├── keybinds.lua │ ├── layout.lua │ └── screenshot.lua │ ├── helpers.lua │ ├── rc.lua │ ├── stylua.toml │ ├── theme │ ├── hello.jpg │ ├── theme.lua │ └── wall │ │ ├── 0202.jpg │ │ ├── 0220.jpg │ │ ├── akira.png │ │ ├── itachi.png │ │ ├── kiri.jpg │ │ ├── kirishu.jpg │ │ ├── neon.png │ │ ├── night.jpg │ │ └── pacman.png │ ├── ui │ ├── bar.lua │ ├── menu.lua │ └── titlebar.lua │ └── widgets │ ├── battery.lua │ ├── batteryarc.lua │ ├── calender.lua │ ├── checkbox-checked-symbolic.svg │ ├── chevron-down.svg │ ├── chevron-up.svg │ ├── json.lua │ ├── list-add-symbolic.svg │ ├── todo.lua │ └── window-close-symbolic.svg ├── cht-sh └── .local │ └── cht-sh │ └── db.yml ├── fish └── .config │ └── fish │ └── config.fish ├── flameshot └── .config │ └── flameshot │ └── flameshot.ini ├── ghostty └── .config │ └── ghostty │ └── config ├── gitconf └── .gitconfig ├── neofetch └── .config │ └── neofetch │ ├── config.conf │ └── config.old.conf ├── nix └── .config │ └── nix │ └── nix.conf ├── picom └── .config │ └── picom │ └── picom.conf ├── presenterm └── .config │ └── presenterm │ └── config.yaml ├── rofi └── .config │ └── rofi │ ├── config.rasi │ └── tokyo.rasi ├── scripts └── .local │ └── scripts │ ├── abs-usae │ ├── absolute-usae │ ├── base64url │ ├── battery-status │ ├── blocgen │ ├── certgenclient │ ├── certgenroot │ ├── clipboard │ ├── colors │ ├── cpu-usae │ ├── dctx │ ├── ecr-img │ ├── exstart │ ├── fontcheck │ ├── ghpush │ ├── kconf │ ├── kubesecret │ ├── lock │ ├── lockhook │ ├── mic-toggle │ ├── note │ ├── ram-usae │ ├── scropts │ ├── stategen │ ├── tmux-sessionizer │ ├── tmux-switch-session │ ├── totlines │ └── uuidv7 ├── starship └── .config │ └── starship.toml ├── tmux └── .config │ └── tmux │ ├── sensible.tmux │ └── tmux.conf ├── yazi └── .config │ └── yazi │ ├── keymap.toml │ ├── plugins │ └── smart-enter.yazi │ │ └── main.lua │ ├── theme.toml │ └── yazi.toml └── zsh └── .zshrc /.gitignore: -------------------------------------------------------------------------------- 1 | nvim/.config/nvim/lazy-lock.json 2 | 3 | # ignore everything inside fish directory 4 | fish/.config/fish/** 5 | # allow .fish files inside fish directory 6 | !fish/.config/fish/*.fish 7 | # allow the completions directory itself 8 | !fish/.config/fish/completions/ 9 | # allow .fish files inside fish/.config/fish/completions/ 10 | !fish/.config/fish/completions/*.fish 11 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "nvim/.config/nvim"] 2 | path = nvim/.config/nvim 3 | url = https://github.com/edr3x/nvim.git 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dotfiles 2 | 3 | ![desktop](https://user-images.githubusercontent.com/45848083/203314137-03c75847-dde5-427a-aff3-5bef0d3d11ff.png) 4 | ![rofi](https://user-images.githubusercontent.com/45848083/203314240-ec3effc0-8929-477d-8f36-8b5bac64c711.png) 5 | ![neovim](https://user-images.githubusercontent.com/45848083/214559991-f42dfa79-ff39-41b4-8475-58351cf5d20a.png) 6 | ![md-prev](https://user-images.githubusercontent.com/45848083/214560444-5b380255-f07c-41e8-a803-cfcc581fd9f6.png) 7 | ![firefox](https://user-images.githubusercontent.com/45848083/203314824-737c6de0-8ed5-4fd0-af41-0c4d1d566a18.png) 8 | 9 | - WM : [awesome](https://awesomewm.org/) 10 | - Bar : [wibar](https://awesomewm.org/apidoc/popups_and_bars/awful.wibar.html) 11 | - App Launcher : [Rofi](https://github.com/davatorium/rofi/) 12 | - Compositor : [Picom](https://github.com/yshui/picom) 13 | - Terminal : 14 | - Emulator : [Alacritty](https://alacritty.org/) 15 | - Shell : [Fish](https://fishshell.com/) 16 | - Prompt : [Starship](https://starship.rs/) 17 | - Font : [Fira-Code-Nerd-Font](https://github.com/ryanoasis/nerd-fonts) 18 | - Code Editor : [Neovim](https://neovim.io/) 19 | - Theme Manager : [lxappearance](https://archlinux.org/packages/community/x86_64/lxappearance/) 20 | - System Font : [Iosevka-Nerd-Font](https://github.com/ryanoasis/nerd-fonts) 21 | - Icon Theme : [Tela-circle-dracula](https://www.xfce-look.org/p/1359276/) 22 | 23 | ## Installing 24 | 25 | ```bash 26 | sudo pacman -S awesome alacritty fish neofetch neovim picom btop rofi clipmenu starship tmux stow git-delta 27 | ``` 28 | 29 | You will need `git` and GNU `stow` 30 | 31 | Clone into `$HOME` directory 32 | 33 | ```bash 34 | git clone https://github.com/edr3x/.dotfiles.git 35 | ``` 36 | 37 | Run `stow` to symlink everything or just select what you want 38 | 39 | ```bash 40 | stow */ # For Everything 41 | ``` 42 | 43 | ```bash 44 | stow nvim # Only nvim config 45 | ``` 46 | -------------------------------------------------------------------------------- /alacritty/.config/alacritty/alacritty.toml: -------------------------------------------------------------------------------- 1 | 2 | [[colors.indexed_colors]] 3 | color = "0xff9e64" 4 | index = 16 5 | 6 | [[colors.indexed_colors]] 7 | color = "0xdb4b4b" 8 | index = 17 9 | 10 | [colors.bright] 11 | black = "0x414868" 12 | blue = "0x7aa2f7" 13 | cyan = "0x7dcfff" 14 | green = "0x9ece6a" 15 | magenta = "0xbb9af7" 16 | red = "0xf7768e" 17 | white = "0xc0caf5" 18 | yellow = "0xe0af68" 19 | 20 | [colors.normal] 21 | black = "0x15161e" 22 | blue = "0x7aa2f7" 23 | cyan = "0x7dcfff" 24 | green = "0x9ece6a" 25 | magenta = "0xbb9af7" 26 | red = "0xf7768e" 27 | white = "0xa9b1d6" 28 | yellow = "0xe0af68" 29 | 30 | [colors.primary] 31 | background = "0x000000" # default value : '0x1a1b26' 32 | foreground = "0xc0caf5" 33 | 34 | [cursor.style] 35 | blinking = "Off" 36 | shape = "Block" 37 | 38 | [font] 39 | size = 10 40 | 41 | [font.bold] 42 | family = "Fira Code Nerd Font" 43 | style = "Bold" 44 | 45 | [font.bold_italic] 46 | family = "Iosevka Nerd Font" 47 | style = "Bold Italic" 48 | 49 | [font.italic] 50 | family = "Iosevka Nerd Font" 51 | style = "Italic" 52 | 53 | [font.normal] 54 | family = "Fira Code Nerd Font" 55 | style = "Regular" 56 | 57 | [[keyboard.bindings]] 58 | action = "Paste" 59 | key = "V" 60 | mods = "Control|Shift" 61 | 62 | [[keyboard.bindings]] 63 | action = "Copy" 64 | key = "C" 65 | mods = "Control|Shift" 66 | 67 | [[keyboard.bindings]] 68 | action = "ResetFontSize" 69 | key = "Key0" 70 | mods = "Control" 71 | 72 | [[keyboard.bindings]] 73 | action = "IncreaseFontSize" 74 | key = "Equals" 75 | mods = "Control" 76 | 77 | [[keyboard.bindings]] 78 | action = "DecreaseFontSize" 79 | key = "Minus" 80 | mods = "Control" 81 | 82 | [[keyboard.bindings]] 83 | action = "ScrollPageUp" 84 | key = "PageUp" 85 | mode = "~Alt" 86 | mods = "Shift" 87 | 88 | [[keyboard.bindings]] 89 | action = "ScrollPageDown" 90 | key = "PageDown" 91 | mode = "~Alt" 92 | mods = "Shift" 93 | 94 | [[keyboard.bindings]] 95 | action = "ScrollToTop" 96 | key = "Home" 97 | mode = "~Alt" 98 | mods = "Shift" 99 | 100 | [[keyboard.bindings]] 101 | action = "ScrollToBottom" 102 | key = "End" 103 | mode = "~Alt" 104 | mods = "Shift" 105 | 106 | [scrolling] 107 | history = 10000 108 | 109 | [selection] 110 | save_to_clipboard = true 111 | semantic_escape_chars = ",│`|:\"' ()[]{}<>\t" 112 | 113 | [terminal.shell] 114 | program = "/usr/bin/fish" 115 | 116 | [window] 117 | decorations = "none" 118 | dynamic_padding = true 119 | opacity = 0.45 120 | 121 | [general] 122 | live_config_reload = true 123 | 124 | [terminal] 125 | -------------------------------------------------------------------------------- /awesome/.config/awesome/.luarc.json: -------------------------------------------------------------------------------- 1 | { 2 | "diagnostics.disable": ["lowercase-global"], 3 | "diagnostics.globals": ["vim", "client", "awesome", "screen"] 4 | } 5 | -------------------------------------------------------------------------------- /awesome/.config/awesome/README.md: -------------------------------------------------------------------------------- 1 | # Minimal AwesomeWM config 2 | 3 | ## Requirement 4 | 5 | - [awesome](https://github.com/awesomeWM/awesome) 6 | - [pamixer](https://github.com/cdemoulins/pamixer) 7 | - [alacritty](https://github.com/alacritty/alacritty) 8 | - [rofi](https://github.com/davatorium/rofi) 9 | - [picom](https://github.com/pijulius/picom) 10 | - [brightnessctl](https://github.com/Hummer12007/brightnessctl) 11 | - [pavucontrol](https://github.com/pulseaudio/pavucontrol) 12 | 13 | ## Also Requires 14 | 15 | - `lxappearance` : for GTK themes 16 | 17 | - `xclip` : for clip 18 | 19 | - `flameshot` : for screenshot 20 | 21 | - `acpi` : for battery 22 | 23 | - `nm-connection-editor` : for network 24 | 25 | - `blueman` : for [bluetooth](https://wiki.archlinux.org/title/bluetooth#Installation) 26 | 27 | - `pulseaudio-bluetooth` : for bluetooth speakers 28 | 29 | - `arandr` : for multi monitor config 30 | -------------------------------------------------------------------------------- /awesome/.config/awesome/config/autostart.lua: -------------------------------------------------------------------------------- 1 | local autostart = require("awful").spawn.with_shell 2 | 3 | autostart("picom") 4 | autostart('setxkbmap -option "caps:escape"') 5 | autostart("clipmenud") 6 | autostart("lockhook") 7 | autostart("xset s off") 8 | autostart("xset -dpms") 9 | autostart("xset s noblank") 10 | -------------------------------------------------------------------------------- /awesome/.config/awesome/config/keybinds.lua: -------------------------------------------------------------------------------- 1 | local gears = require("gears") 2 | local awful = require("awful") 3 | local hotkeys_popup = require("awful.hotkeys_popup") 4 | 5 | local beautiful = require("beautiful") 6 | 7 | -- {{{ Key bindings 8 | globalkeys = gears.table.join( 9 | awful.key({ modkey }, "Return", function() 10 | awful.spawn(terminal) 11 | end, { description = "open default terminal", group = "launcher" }), 12 | 13 | awful.key({ modkey, "Control" }, "Return", function() 14 | awful.util.spawn("ghostty") 15 | end, { description = "open ghostty", group = "launcher" }), 16 | 17 | awful.key({ modkey }, "b", function() 18 | awful.util.spawn("firefox") 19 | end, { description = "open firefox", group = "launcher" }), 20 | 21 | awful.key({ modkey }, "v", function() 22 | awful.util.spawn("clipboard") 23 | end, { description = "open clipmenu", group = "launcher" }), 24 | 25 | awful.key({ altkey }, "Return", function() 26 | awful.util.spawn("rofi -show drun") 27 | end, { description = "run prompt", group = "launcher" }), 28 | 29 | awful.key({ modkey }, "e", function() 30 | awful.util.spawn("Thunar") 31 | end, { description = "run Thunar", group = "launcher" }), 32 | 33 | awful.key({ "Control", altkey, "Shift" }, "l", function() 34 | awful.util.spawn("lock") 35 | end, { description = "lock screen", group = "launcher" }), 36 | 37 | awful.key({ modkey }, "s", hotkeys_popup.show_help, { description = "show hotkeys", group = "awesome" }), 38 | 39 | awful.key({ modkey }, "w", function() 40 | mymainmenu:show() 41 | end, { description = "show main menu", group = "awesome" }), 42 | 43 | awful.key({ modkey, "Control" }, "r", awesome.restart, { description = "reload awesome", group = "awesome" }), 44 | 45 | awful.key({ modkey, "Shift" }, "q", awesome.quit, { description = "quit awesome", group = "awesome" }), 46 | 47 | -- brightness 48 | awful.key({}, "XF86MonBrightnessUp", function() 49 | awful.util.spawn("brightnessctl set +5%") 50 | end, { description = "Increase Brightness", group = "control" }), 51 | 52 | awful.key({}, "XF86MonBrightnessDown", function() 53 | awful.util.spawn("brightnessctl set 5%-") 54 | end, { description = "Decrease Brightness", group = "control" }), 55 | 56 | -- Audio 57 | awful.key({}, "XF86AudioRaiseVolume", function() 58 | awful.spawn("pamixer -i 5") 59 | end, { description = "increase volume", group = "control" }), 60 | 61 | awful.key({}, "XF86AudioLowerVolume", function() 62 | awful.spawn("pamixer -d 5") 63 | end, { description = "decrease volume", group = "control" }), 64 | 65 | awful.key({}, "XF86AudioMute", function() 66 | awful.spawn("pamixer -t") 67 | end, { description = "mute volume", group = "control" }), 68 | 69 | awful.key({ modkey, "Control" }, "v", function() 70 | awful.spawn("pavucontrol") 71 | end, { description = " Audio Contol all ", group = "control" }), 72 | 73 | awful.key({ modkey }, "Pause", function() 74 | awful.spawn("mic-toggle") 75 | end, { description = "Microphone toggle", group = "control" }), 76 | 77 | -- Screenshot 78 | awful.key( 79 | { modkey }, 80 | "Print", 81 | scrot_full, 82 | { description = "Take a screenshot of entire screen", group = "screenshot" } 83 | ), 84 | awful.key({}, "Print", scrot_selection, { description = "Take a screenshot of selection", group = "screenshot" }), 85 | 86 | awful.key( 87 | { "Control" }, 88 | "Print", 89 | scrot_selection_and_edit, 90 | { description = "Take a screenshot of selection and edit", group = "screenshot" } 91 | ), 92 | 93 | -- Display 94 | awful.key({ modkey, "Control" }, "p", function() 95 | awful.util.spawn('xrandr --output "eDP-1" --auto') 96 | end, { description = "duplicate screen", group = "display" }) 97 | ) 98 | 99 | globalkeys = gears.table.join( 100 | globalkeys, 101 | -- Switch to the previous tag 102 | awful.key({ modkey, altkey }, "h", awful.tag.viewprev, { description = "view previous", group = "tag" }), 103 | 104 | -- Switch to the next tag 105 | awful.key({ modkey, altkey }, "l", awful.tag.viewnext, { description = "view next", group = "tag" }), 106 | 107 | -- Go back to the tag 108 | awful.key({ modkey }, "Escape", awful.tag.history.restore, { description = "go back", group = "tag" }) 109 | ) 110 | 111 | -- Focus related keybindings 112 | globalkeys = gears.table.join( 113 | globalkeys, 114 | 115 | awful.key({ modkey }, "j", function() 116 | awful.client.focus.byidx(1) 117 | end, { description = "focus next by index", group = "client" }), 118 | awful.key({ modkey }, "k", function() 119 | awful.client.focus.byidx(-1) 120 | end, { description = "focus previous by index", group = "client" }), 121 | awful.key({ altkey }, "Tab", function() 122 | awful.client.focus.history.previous() 123 | if client.focus then 124 | client.focus:raise() 125 | end 126 | end, { description = "go back", group = "client" }), 127 | 128 | awful.key({ modkey }, "h", function() 129 | awful.screen.focus_relative(1) 130 | end, { description = "focus the next screen", group = "screen" }), 131 | 132 | awful.key({ modkey }, "l", function() 133 | awful.screen.focus_relative(-1) 134 | end, { description = "focus the previous screen", group = "screen" }), 135 | 136 | awful.key({ modkey, "Control" }, "n", function() 137 | local c = awful.client.restore() 138 | if c then 139 | c.minimized = false 140 | end 141 | end, { description = "restore minimized", group = "client" }) 142 | ) 143 | 144 | -- Layout related keybindings 145 | globalkeys = gears.table.join( 146 | globalkeys, 147 | 148 | awful.key({ modkey, "Shift" }, "j", function() 149 | awful.client.swap.byidx(1) 150 | end, { description = "swap with next client by index", group = "client" }), 151 | 152 | awful.key({ modkey, "Shift" }, "k", function() 153 | awful.client.swap.byidx(-1) 154 | end, { description = "swap with previous client by index", group = "client" }), 155 | 156 | awful.key({ modkey }, "u", awful.client.urgent.jumpto, { description = "jump to urgent client", group = "client" }), 157 | 158 | awful.key({ modkey }, "l", function() 159 | awful.tag.incmwfact(0.05) 160 | end, { description = "increase master width factor", group = "layout" }), 161 | 162 | awful.key({ modkey }, "h", function() 163 | awful.tag.incmwfact(-0.05) 164 | end, { description = "decrease master width factor", group = "layout" }), 165 | 166 | awful.key({ modkey, "Shift" }, "h", function() 167 | awful.tag.incnmaster(1, nil, true) 168 | end, { description = "increase the number of master clients", group = "layout" }), 169 | 170 | awful.key({ modkey, "Shift" }, "l", function() 171 | awful.tag.incnmaster(-1, nil, true) 172 | end, { description = "decrease the number of master clients", group = "layout" }), 173 | 174 | awful.key({ modkey, "Control" }, "h", function() 175 | awful.tag.incncol(1, nil, true) 176 | end, { description = "increase the number of columns", group = "layout" }), 177 | 178 | awful.key({ modkey, "Control" }, "l", function() 179 | awful.tag.incncol(-1, nil, true) 180 | end, { description = "decrease the number of columns", group = "layout" }), 181 | 182 | awful.key({ modkey }, "space", function() 183 | awful.layout.inc(1) 184 | end, { description = "select next", group = "layout" }), 185 | 186 | awful.key({ modkey, "Shift" }, "space", function() 187 | awful.layout.inc(-1) 188 | end, { description = "select previous", group = "layout" }) 189 | ) 190 | 191 | -- window related keybinds 192 | for i = 1, 9 do 193 | globalkeys = gears.table.join( 194 | globalkeys, 195 | -- View tag only. 196 | awful.key({ altkey }, "#" .. i + 9, function() 197 | local screen = awful.screen.focused() 198 | local tag = screen.tags[i] 199 | if tag then 200 | tag:view_only() 201 | end 202 | end, { description = "view tag #" .. i, group = "tag" }), 203 | -- Toggle tag display. 204 | awful.key({ altkey, "Control" }, "#" .. i + 9, function() 205 | local screen = awful.screen.focused() 206 | local tag = screen.tags[i] 207 | if tag then 208 | awful.tag.viewtoggle(tag) 209 | end 210 | end, { description = "toggle tag #" .. i, group = "tag" }), 211 | -- Move client to tag. 212 | awful.key({ altkey, "Shift" }, "#" .. i + 9, function() 213 | if client.focus then 214 | local tag = client.focus.screen.tags[i] 215 | if tag then 216 | client.focus:move_to_tag(tag) 217 | end 218 | end 219 | end, { description = "move focused client to tag #" .. i, group = "tag" }), 220 | -- Toggle tag on focused client. 221 | awful.key({ altkey, "Control", "Shift" }, "#" .. i + 9, function() 222 | if client.focus then 223 | local tag = client.focus.screen.tags[i] 224 | if tag then 225 | client.focus:toggle_tag(tag) 226 | end 227 | end 228 | end, { description = "toggle focused client on tag #" .. i, group = "tag" }) 229 | ) 230 | end 231 | 232 | clientkeys = gears.table.join( 233 | awful.key({ altkey }, "f", function(c) 234 | c.fullscreen = not c.fullscreen 235 | c:raise() 236 | end, { description = "toggle fullscreen", group = "client" }), 237 | awful.key({ modkey, "Shift" }, "x", function(c) 238 | c:kill() 239 | end, { description = "close", group = "client" }), 240 | awful.key( 241 | { modkey, "Control" }, 242 | "space", 243 | awful.client.floating.toggle, 244 | { description = "toggle floating", group = "client" } 245 | ), 246 | awful.key({ modkey, "Control" }, "Return", function(c) 247 | c:swap(awful.client.getmaster()) 248 | end, { description = "move to master", group = "client" }), 249 | awful.key({ modkey }, "o", function(c) 250 | c:move_to_screen() 251 | end, { description = "move to another screen", group = "screen" }), 252 | awful.key({ modkey }, "t", function(c) 253 | c.ontop = not c.ontop 254 | end, { description = "toggle keep on top", group = "client" }), 255 | awful.key({ modkey }, "n", function(c) 256 | -- The client currently has the input focus, so it cannot be 257 | -- minimized, since minimized clients can't have the focus. 258 | c.minimized = true 259 | end, { description = "minimize", group = "client" }), 260 | 261 | awful.key({ modkey }, "n", function(c) 262 | -- The client currently has the input focus, so it cannot be 263 | -- minimized, since minimized clients can't have the focus. 264 | c.minimized = true 265 | end, { description = "minimize", group = "client" }), 266 | 267 | awful.key({ modkey }, "m", function(c) 268 | c.maximized = not c.maximized 269 | c:raise() 270 | end, { description = "(un)maximize", group = "client" }), 271 | awful.key({ modkey, "Control" }, "m", function(c) 272 | c.maximized_vertical = not c.maximized_vertical 273 | c:raise() 274 | end, { description = "(un)maximize vertically", group = "client" }), 275 | awful.key({ modkey, "Shift" }, "m", function(c) 276 | c.maximized_horizontal = not c.maximized_horizontal 277 | c:raise() 278 | end, { description = "(un)maximize horizontally", group = "client" }) 279 | ) 280 | 281 | clientbuttons = gears.table.join( 282 | awful.button({}, 1, function(c) 283 | c:emit_signal("request::activate", "mouse_click", { raise = true }) 284 | end), 285 | awful.button({ modkey }, 1, function(c) 286 | c:emit_signal("request::activate", "mouse_click", { raise = true }) 287 | awful.mouse.client.move(c) 288 | end), 289 | awful.button({ modkey }, 3, function(c) 290 | c:emit_signal("request::activate", "mouse_click", { raise = true }) 291 | awful.mouse.client.resize(c) 292 | end) 293 | ) 294 | 295 | -- Set keys 296 | root.keys(globalkeys) 297 | -- }}} 298 | 299 | -- {{{ Mouse bindings 300 | root.buttons(gears.table.join( 301 | awful.button({}, 3, function() 302 | mymainmenu:toggle() 303 | end), 304 | awful.button({}, 4, awful.tag.viewnext), 305 | awful.button({}, 5, awful.tag.viewprev) 306 | )) 307 | -- }}} 308 | 309 | -- {{{ Rules 310 | -- Rules to apply to new clients (through the "manage" signal). 311 | awful.rules.rules = { 312 | -- All clients will match this rule. 313 | { 314 | rule = {}, 315 | properties = { 316 | border_width = beautiful.border_width, 317 | border_color = beautiful.border_normal, 318 | focus = awful.client.focus.filter, 319 | raise = true, 320 | keys = clientkeys, 321 | buttons = clientbuttons, 322 | screen = awful.screen.preferred, 323 | placement = awful.placement.no_overlap + awful.placement.no_offscreen, 324 | }, 325 | }, 326 | 327 | -- Floating clients. 328 | { 329 | rule_any = { 330 | instance = { 331 | "DTA", -- Firefox addon DownThemAll. 332 | "copyq", -- Includes session name in class. 333 | "pinentry", 334 | }, 335 | class = { 336 | "Arandr", 337 | "Blueman-manager", 338 | "Gpick", 339 | "Kruler", 340 | "MessageWin", -- kalarm. 341 | "Sxiv", 342 | "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size. 343 | "Wpa_gui", 344 | "veromix", 345 | "xtightvncviewer", 346 | }, 347 | 348 | -- Note that the name property shown in xprop might be set slightly after creation of the client 349 | -- and the name shown there might not match defined rules here. 350 | name = { 351 | "Event Tester", -- xev. 352 | }, 353 | role = { 354 | "AlarmWindow", -- Thunderbird's calendar. 355 | "ConfigManager", -- Thunderbird's about:config. 356 | "pop-up", -- e.g. Google Chrome's (detached) Developer Tools. 357 | }, 358 | }, 359 | properties = { floating = true }, 360 | }, 361 | 362 | -- Add titlebars to normal clients and dialogs 363 | { rule_any = { type = { "normal", "dialog" } }, properties = { titlebars_enabled = true } }, 364 | 365 | -- Set Firefox to always map on the tag named "2" on screen 1. 366 | -- { rule = { class = "Firefox" }, 367 | -- properties = { screen = 1, tag = "2" } }, 368 | } 369 | -- }} 370 | -------------------------------------------------------------------------------- /awesome/.config/awesome/config/layout.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | 3 | awful.layout.layouts = { 4 | awful.layout.suit.fair, 5 | awful.layout.suit.tile.bottom, 6 | awful.layout.suit.spiral, 7 | awful.layout.suit.tile.left, 8 | awful.layout.suit.max, 9 | awful.layout.suit.tile, 10 | awful.layout.suit.fair.horizontal, 11 | awful.layout.suit.tile.top, 12 | awful.layout.suit.floating, 13 | --awful.layout.suit.spiral.dwindle, 14 | --awful.layout.suit.max.fullscreen, 15 | --awful.layout.suit.magnifier, 16 | --awful.layout.suit.corner.nw, 17 | } 18 | -------------------------------------------------------------------------------- /awesome/.config/awesome/config/screenshot.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | 3 | screenshot = os.getenv("HOME") .. "/screenshots/$(date +%F_%T).png" 4 | 5 | function scrot_full() 6 | scrot("flameshot full -c -p " .. screenshot) 7 | end 8 | 9 | function scrot_selection_and_edit() 10 | scrot("flameshot gui -c --raw > " .. screenshot) 11 | end 12 | 13 | function scrot_selection() 14 | scrot("flameshot gui -s -c --raw > " .. screenshot) 15 | end 16 | 17 | function scrot(cmd) 18 | awful.util.spawn_with_shell(cmd) 19 | end 20 | -------------------------------------------------------------------------------- /awesome/.config/awesome/helpers.lua: -------------------------------------------------------------------------------- 1 | local gears = require("gears") 2 | 3 | local helpers = {} 4 | 5 | -- Create rounded rectangle shape (in one line) 6 | helpers.rrect = function(radius) 7 | return function(cr, width, height) 8 | gears.shape.rounded_rect(cr, width, height, radius) 9 | end 10 | end 11 | 12 | -- Markup helper 13 | helpers.colorize_text = function(txt, fg) 14 | return "" .. txt .. "" 15 | end 16 | 17 | helpers.add_hover_cursor = function(w, hover_cursor) 18 | local original_cursor = "left_ptr" 19 | 20 | w:connect_signal("mouse::enter", function() 21 | local w = _G.mouse.current_wibox 22 | if w then 23 | w.cursor = hover_cursor 24 | end 25 | end) 26 | 27 | w:connect_signal("mouse::leave", function() 28 | local w = _G.mouse.current_wibox 29 | if w then 30 | w.cursor = original_cursor 31 | end 32 | end) 33 | end 34 | 35 | return helpers 36 | -------------------------------------------------------------------------------- /awesome/.config/awesome/rc.lua: -------------------------------------------------------------------------------- 1 | pcall(require, "luarocks.loader") 2 | 3 | local awful = require("awful") 4 | local beautiful = require("beautiful") 5 | local naughty = require("naughty") 6 | 7 | -- Enable hotkeys help widget for VIM and other apps 8 | require("awful.autofocus") 9 | require("awful.hotkeys_popup.keys") 10 | require("config.screenshot") 11 | 12 | -- {{{ Error handling 13 | -- Check if awesome encountered an error during startup and fell back to 14 | -- another config (This code will only ever execute for the fallback config) 15 | if awesome.startup_errors then 16 | naughty.notify({ 17 | preset = naughty.config.presets.critical, 18 | title = "Oops, there were errors during startup!", 19 | text = awesome.startup_errors, 20 | }) 21 | end 22 | 23 | -- Handle runtime errors after startup 24 | do 25 | local in_error = false 26 | awesome.connect_signal("debug::error", function(err) 27 | -- Make sure we don't go into an endless error loop 28 | if in_error then 29 | return 30 | end 31 | in_error = true 32 | naughty.notify({ 33 | preset = naughty.config.presets.critical, 34 | title = "Oops, an error happened!", 35 | text = tostring(err), 36 | }) 37 | in_error = false 38 | end) 39 | end 40 | -- }}} 41 | 42 | -- {{{ Variable definitions 43 | 44 | -- Initialize theme 45 | -- Themes define colours, icons, font and wallpapers. 46 | beautiful.init("~/.config/awesome/theme/theme.lua") 47 | -- This is used later as the default terminal and editor to run. 48 | terminal = "alacritty" 49 | editor = os.getenv("EDITOR") or "nvim" 50 | editor_cmd = terminal .. " -e " .. editor 51 | 52 | modkey = "Mod4" 53 | altkey = "Mod1" 54 | -- }}} 55 | 56 | --{{{ imports 57 | -- autostart apps 58 | require("config.autostart") 59 | 60 | -- layout 61 | require("config.layout") 62 | 63 | -- keybinds 64 | require("config.keybinds") 65 | 66 | -- bar 67 | require("ui.bar") 68 | 69 | -- menu 70 | require("ui.menu") 71 | 72 | -- titlebar 73 | require("ui.titlebar") 74 | --}}} 75 | 76 | -- Keyboard map indicator and switcher 77 | mykeyboardlayout = awful.widget.keyboardlayout() 78 | 79 | -- {{{ Signals 80 | -- Signal function to execute when a new client appears. 81 | client.connect_signal("manage", function(c) 82 | -- Set the windows at the slave, 83 | -- i.e. put it at the end of others instead of setting it master. 84 | -- if not awesome.startup then awful.client.setslave(c) end 85 | 86 | if awesome.startup and not c.size_hints.user_position and not c.size_hints.program_position then 87 | -- Prevent clients from being unreachable after screen count changes. 88 | awful.placement.no_offscreen(c) 89 | end 90 | end) 91 | 92 | -- Enable sloppy focus, so that focus follows mouse. 93 | client.connect_signal("mouse::enter", function(c) 94 | c:emit_signal("request::activate", "mouse_enter", { raise = false }) 95 | end) 96 | 97 | -- change border colors 98 | client.connect_signal("focus", function(c) 99 | c.border_color = beautiful.border_color_active 100 | end) 101 | 102 | client.connect_signal("unfocus", function(c) 103 | c.border_color = beautiful.border_color_normal 104 | end) 105 | 106 | -- }}} 107 | -------------------------------------------------------------------------------- /awesome/.config/awesome/stylua.toml: -------------------------------------------------------------------------------- 1 | indent_type = "Spaces" 2 | line_endings = "Unix" 3 | indent_width = 4 4 | column_width = 120 5 | quote_style = "AutoPreferDouble" 6 | call_parentheses = "Always" 7 | -------------------------------------------------------------------------------- /awesome/.config/awesome/theme/hello.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edr3x/.dotfiles/6e633fec9dad01c1e5ed48039ac9fa2ca8c379c3/awesome/.config/awesome/theme/hello.jpg -------------------------------------------------------------------------------- /awesome/.config/awesome/theme/theme.lua: -------------------------------------------------------------------------------- 1 | local theme_assets = require("beautiful.theme_assets") 2 | local xresources = require("beautiful.xresources") 3 | local dpi = xresources.apply_dpi 4 | local gears = require("gears") 5 | local gfs = require("gears.filesystem") 6 | local themes_path = gfs.get_themes_dir() 7 | 8 | local theme = {} 9 | 10 | theme.confdir = os.getenv("HOME") .. "/.config/awesome/theme" 11 | theme.wallpaper = theme.confdir .. "/wall/night.jpg" 12 | theme.font_name = "Iosevka Nerd Font" 13 | theme.taglist_font = "FiraCode Nerd Font, 14" 14 | theme.background = "#1a1b26" 15 | theme.foreground = "#c0caf5" 16 | theme.black = "#1C252C" 17 | theme.red = "#f7768e" 18 | theme.green = "#9ece6a" 19 | theme.yellow = "#e0af68" 20 | theme.blue = "#7aa2f7" 21 | theme.magenta = "#BC83E3" 22 | theme.cyan = "#67AFC1" 23 | theme.white = "#D9D7D6" 24 | theme.blacks = "#484E5B" 25 | theme.reds = "#F16269" 26 | theme.greens = "#8CD7AA" 27 | theme.yellows = "#E9967E" 28 | theme.blues = "#79AAEB" 29 | theme.magentas = "#C488EC" 30 | theme.cyans = "#7ACFE4" 31 | theme.whites = "#E5E5E5" 32 | theme.darker_bg = "#0A1419" 33 | theme.lighter_bg = "#162026" 34 | theme.transparent = "#00000000" 35 | 36 | theme.notification_icon = gears.surface.load_uncached(gfs.get_configuration_dir() .. "theme/hello.jpg") 37 | theme.font = "Iosevka Nerd Font, Bold 10" 38 | theme.font_name = "Iosevka Nerd Font" 39 | theme.icon_font = "Iosevka Nerd Font" 40 | theme.icon_font2 = "Iosevka Nerd Font" 41 | 42 | theme.bg_normal = "#061115" 43 | theme.bg_subtle = "#0a171c" 44 | theme.bg_focus = "#1C252C" 45 | theme.bg_cal = "#78B892" 46 | theme.bg_urgent = "#DF5B61" 47 | theme.bg_minimize = "#484e5b" 48 | theme.bg_wibar = "#00000073" 49 | theme.bg_systray = theme.bg_normal 50 | 51 | theme.fg_normal = "#D9D7D6" 52 | theme.fg_focus = "#D9D7D6" 53 | theme.fg_urgent = "#D9D7D6" 54 | theme.fg_minimize = "#D9D7D6" 55 | 56 | theme.useless_gap = dpi(7) 57 | theme.border_width = dpi(2) 58 | theme.border_color_normal = "#505050" 59 | theme.border_color_active = "#00CED1" 60 | theme.border_color_marked = "#91231c" 61 | 62 | theme.titlebar_bg_focus = theme.bg_subtle 63 | theme.titlebar_bg_normal = theme.bg_normal 64 | 65 | theme.taglist_fg_focus = "#8cedff" 66 | theme.taglist_fg_occupied = "#e4ad7b" 67 | theme.taglist_bg_focus = "#00000000" 68 | theme.taglist_bg_occupied = "#00000000" 69 | theme.taglist_bg_empty = "#00000000" 70 | theme.taglist_fg_empty = "#666666" 71 | 72 | theme.taglist_squares_sel = nil 73 | theme.taglist_squares_unsel = nil 74 | 75 | theme.menu_submenu_icon = themes_path .. "default/submenu.png" 76 | theme.menu_height = dpi(15) 77 | theme.menu_width = dpi(100) 78 | 79 | -- Generate Awesome icon: 80 | theme.awesome_icon = theme_assets.awesome_icon(theme.menu_height, theme.bg_focus, theme.fg_focus) 81 | 82 | theme.icon_theme = nil 83 | 84 | -- Set different colors for urgent notifications. 85 | -- rnotification.connect_signal("request::rules", function() 86 | -- rnotification.append_rule({ 87 | -- rule = { urgency = "critical" }, 88 | -- properties = { bg = "#ff0000", fg = "#ffffff" }, 89 | -- }) 90 | -- end) 91 | 92 | return theme 93 | -------------------------------------------------------------------------------- /awesome/.config/awesome/theme/wall/0202.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edr3x/.dotfiles/6e633fec9dad01c1e5ed48039ac9fa2ca8c379c3/awesome/.config/awesome/theme/wall/0202.jpg -------------------------------------------------------------------------------- /awesome/.config/awesome/theme/wall/0220.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edr3x/.dotfiles/6e633fec9dad01c1e5ed48039ac9fa2ca8c379c3/awesome/.config/awesome/theme/wall/0220.jpg -------------------------------------------------------------------------------- /awesome/.config/awesome/theme/wall/akira.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edr3x/.dotfiles/6e633fec9dad01c1e5ed48039ac9fa2ca8c379c3/awesome/.config/awesome/theme/wall/akira.png -------------------------------------------------------------------------------- /awesome/.config/awesome/theme/wall/itachi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edr3x/.dotfiles/6e633fec9dad01c1e5ed48039ac9fa2ca8c379c3/awesome/.config/awesome/theme/wall/itachi.png -------------------------------------------------------------------------------- /awesome/.config/awesome/theme/wall/kiri.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edr3x/.dotfiles/6e633fec9dad01c1e5ed48039ac9fa2ca8c379c3/awesome/.config/awesome/theme/wall/kiri.jpg -------------------------------------------------------------------------------- /awesome/.config/awesome/theme/wall/kirishu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edr3x/.dotfiles/6e633fec9dad01c1e5ed48039ac9fa2ca8c379c3/awesome/.config/awesome/theme/wall/kirishu.jpg -------------------------------------------------------------------------------- /awesome/.config/awesome/theme/wall/neon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edr3x/.dotfiles/6e633fec9dad01c1e5ed48039ac9fa2ca8c379c3/awesome/.config/awesome/theme/wall/neon.png -------------------------------------------------------------------------------- /awesome/.config/awesome/theme/wall/night.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edr3x/.dotfiles/6e633fec9dad01c1e5ed48039ac9fa2ca8c379c3/awesome/.config/awesome/theme/wall/night.jpg -------------------------------------------------------------------------------- /awesome/.config/awesome/theme/wall/pacman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edr3x/.dotfiles/6e633fec9dad01c1e5ed48039ac9fa2ca8c379c3/awesome/.config/awesome/theme/wall/pacman.png -------------------------------------------------------------------------------- /awesome/.config/awesome/ui/bar.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local gears = require("gears") 3 | local wibox = require("wibox") 4 | local beautiful = require("beautiful") 5 | local xresources = require("beautiful.xresources") 6 | local dpi = xresources.apply_dpi 7 | local helpers = require("helpers") 8 | 9 | local function set_wallpaper(s) 10 | -- Wallpaper 11 | if beautiful.wallpaper then 12 | local wallpaper = beautiful.wallpaper 13 | -- If wallpaper is a function, call it with the screen 14 | if type(wallpaper) == "function" then 15 | wallpaper = wallpaper(s) 16 | end 17 | gears.wallpaper.maximized(wallpaper, s, true) 18 | end 19 | end 20 | 21 | -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) 22 | screen.connect_signal("property::geometry", set_wallpaper) 23 | 24 | local battary_arc = require("widgets.batteryarc") 25 | local todo_widget = require("widgets.todo") 26 | 27 | local time = wibox.widget({ 28 | widget = wibox.container.background, 29 | { 30 | widget = wibox.container.margin, 31 | margins = 10, 32 | { 33 | widget = wibox.widget.textclock("%l:%M %p"), 34 | font = beautiful.font_name .. " Bold 11", 35 | align = "center", 36 | }, 37 | }, 38 | }) 39 | 40 | awful.screen.connect_for_each_screen(function(s) 41 | -- Wallpaper 42 | set_wallpaper(s) 43 | 44 | -- Each screen has its own tag table. 45 | awful.tag( 46 | { " ", "  ", " 󰙯 ", "  ", " 󰘳 ", "  ", " 󱙋 ", " 󱘗 ", "  " }, 47 | s, 48 | awful.layout.layouts[1] 49 | ) 50 | 51 | -- Create a promptbox for each screen 52 | s.mypromptbox = awful.widget.prompt() 53 | 54 | -- Create an imagebox widget which will contain an icon indicating which layout we're using. 55 | -- We need one layoutbox per screen. 56 | s.mylayoutbox = awful.widget.layoutbox(s) 57 | s.mylayoutbox:buttons(gears.table.join( 58 | awful.button({}, 1, function() 59 | awful.layout.inc(1) 60 | end), 61 | awful.button({}, 3, function() 62 | awful.layout.inc(-1) 63 | end), 64 | awful.button({}, 4, function() 65 | awful.layout.inc(-1) 66 | end), 67 | awful.button({}, 5, function() 68 | awful.layout.inc(1) 69 | end) 70 | )) 71 | 72 | -- Create a taglist widget 73 | s.mytaglist = awful.widget.taglist({ 74 | screen = s, 75 | filter = awful.widget.taglist.filter.all, 76 | buttons = gears.table.join( 77 | awful.button({}, 1, function(t) 78 | t:view_only() 79 | end), 80 | awful.button({ modkey }, 1, function(t) 81 | if client.focus then 82 | client.focus:move_to_tag(t) 83 | end 84 | end), 85 | awful.button({}, 3, awful.tag.viewtoggle), 86 | awful.button({ modkey }, 3, function(t) 87 | if client.focus then 88 | client.focus:toggle_tag(t) 89 | end 90 | end), 91 | awful.button({}, 4, function(t) 92 | awful.tag.viewnext(t.screen) 93 | end), 94 | awful.button({}, 5, function(t) 95 | awful.tag.viewprev(t.screen) 96 | end) 97 | ), 98 | }) 99 | 100 | -- Create a tasklist widget 101 | s.mytasklist = awful.widget.tasklist({ 102 | screen = s, 103 | filter = awful.widget.tasklist.filter.currenttags, 104 | buttons = gears.table.join( 105 | awful.button({}, 1, function(c) 106 | c:activate({ context = "tasklist", action = "toggle_minimization" }) 107 | end), 108 | awful.button({}, 3, function() 109 | awful.menu.client_list({ theme = { width = 250 } }) 110 | end), 111 | awful.button({}, 4, function() 112 | awful.client.focus.byidx(-1) 113 | end), 114 | awful.button({}, 5, function() 115 | awful.client.focus.byidx(1) 116 | end) 117 | ), 118 | }) 119 | 120 | s.mywibar = awful.wibar({ 121 | type = "dock", 122 | ontop = true, 123 | stretch = false, 124 | height = dpi(38), 125 | bg = beautiful.bg_wibar, 126 | width = s.geometry.width - dpi(30), 127 | shape = helpers.rrect(8), 128 | screen = s, 129 | }) 130 | 131 | awful.placement.top(s.mywibar, { margins = dpi(8) }) 132 | 133 | --{{{ Remove wibar on full screen 134 | local function remove_wibar(c) 135 | if c.fullscreen or c.maximized then 136 | c.screen.mywibar.visible = false 137 | else 138 | c.screen.mywibar.visible = true 139 | end 140 | end 141 | 142 | local function add_wibar(c) 143 | if c.fullscreen or c.maximized then 144 | c.screen.mywibar.visible = true 145 | end 146 | end 147 | 148 | ---}}} 149 | 150 | -- Hide bar when a splash widget is visible 151 | awesome.connect_signal("widgets::splash::visibility", function(vis) 152 | screen.primary.mywibar.visible = not vis 153 | end) 154 | 155 | client.connect_signal("property::fullscreen", remove_wibar) 156 | 157 | client.connect_signal("request::unmanage", add_wibar) 158 | 159 | -- Add widgets to the wibox 160 | s.mywibar:setup({ 161 | { 162 | { 163 | layout = wibox.layout.align.horizontal, 164 | expand = "none", 165 | -- tags 166 | { 167 | s.mytaglist, 168 | margins = dpi(2), 169 | widget = wibox.container.margin, 170 | }, 171 | 172 | -- clock 173 | time, 174 | -- systray 175 | { 176 | todo_widget(), 177 | wibox.widget.systray(), 178 | battary_arc({ 179 | show_current_level = true, 180 | show_notification_mode = "on_click", 181 | }), 182 | layout = wibox.layout.fixed.horizontal, 183 | }, 184 | }, 185 | left = dpi(15), 186 | right = dpi(15), 187 | widget = wibox.container.margin, 188 | }, 189 | shape = helpers.rrect(beautiful.border_radius), 190 | widget = wibox.container.background, 191 | }) 192 | end) 193 | -------------------------------------------------------------------------------- /awesome/.config/awesome/ui/menu.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local menubar = require("menubar") 3 | local beautiful = require("beautiful") 4 | local hotkeys_popup = require("awful.hotkeys_popup") 5 | 6 | myawesomemenu = { 7 | { 8 | "hotkeys", 9 | function() 10 | hotkeys_popup.show_help(nil, awful.screen.focused()) 11 | end, 12 | }, 13 | { "manual", terminal .. " -e man awesome" }, 14 | { "edit config", editor_cmd .. " " .. awesome.conffile }, 15 | { "restart", awesome.restart }, 16 | { 17 | "quit", 18 | function() 19 | awesome.quit() 20 | end, 21 | }, 22 | } 23 | 24 | mymainmenu = 25 | awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, { "open terminal", terminal } } }) 26 | 27 | mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, menu = mymainmenu }) 28 | 29 | -- Menubar configuration 30 | menubar.utils.terminal = terminal -- Set the terminal for applications that require it 31 | -------------------------------------------------------------------------------- /awesome/.config/awesome/ui/titlebar.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local wibox = require("wibox") 3 | local gears = require("gears") 4 | 5 | client.connect_signal("request::titlebars", function(c) 6 | awful 7 | .titlebar(c, { 8 | size = 0.5, 9 | position = "left", 10 | }) 11 | :setup({ 12 | { 13 | layout = wibox.layout.fixed.vertical, 14 | spacing = 13, 15 | }, 16 | widget = wibox.container.margin, 17 | top = 15, 18 | left = 15, 19 | right = 15, 20 | }) 21 | end) 22 | 23 | client.connect_signal("manage", function(c) 24 | c.shape = function(cr, w, h) 25 | gears.shape.rounded_rect(cr, w, h, 8) 26 | end 27 | end) 28 | -------------------------------------------------------------------------------- /awesome/.config/awesome/widgets/battery.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local wibox = require("wibox") 3 | local beautiful = require("beautiful") 4 | local helpers = require("helpers") 5 | 6 | local function get_battery_color(percentage) 7 | if percentage >= 80 then 8 | return beautiful.white 9 | elseif percentage >= 50 then 10 | return beautiful.yellow 11 | elseif percentage >= 20 then 12 | return beautiful.orange 13 | else 14 | return beautiful.red 15 | end 16 | end 17 | 18 | local function update_battery_widget(widget, stdout) 19 | -- set default text color 20 | local colored_text = helpers.colorize_text(stdout, beautiful.yellow) 21 | 22 | local battery_percentage = tonumber(string.match(stdout, "(%d+)%%")) 23 | if battery_percentage then 24 | local color = get_battery_color(battery_percentage) 25 | colored_text = helpers.colorize_text(stdout, color) 26 | end 27 | 28 | widget:set_markup(colored_text) 29 | end 30 | 31 | local battery_widget = wibox.widget.textbox() 32 | 33 | -- NOTE: this runs script from https://github.com/edr3x/.dotfiles/blob/master/scripts/.local/scripts/battery-status 34 | -- thus put the script on your $PATH 35 | awful.widget.watch("battery-status", 10, update_battery_widget, battery_widget) 36 | 37 | local battery_status = { 38 | widget = wibox.container.margin, 39 | { 40 | widget = battery_widget, 41 | font = beautiful.font_name .. " Bold 11", 42 | align = "center", 43 | }, 44 | left = 10, 45 | } 46 | 47 | return battery_status 48 | -------------------------------------------------------------------------------- /awesome/.config/awesome/widgets/batteryarc.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local beautiful = require("beautiful") 3 | local naughty = require("naughty") 4 | local wibox = require("wibox") 5 | local watch = require("awful.widget.watch") 6 | 7 | local HOME = os.getenv("HOME") 8 | local WIDGET_DIR = HOME .. "/.config/awesome/theme" 9 | 10 | local batteryarc_widget = {} 11 | 12 | local function worker(user_args) 13 | local args = user_args or {} 14 | 15 | local font = args.font or beautiful.font_name .. " Bold 9" 16 | local arc_thickness = args.arc_thickness or 2 17 | local show_current_level = args.show_current_level or false 18 | local size = args.size or 24 19 | local timeout = args.timeout or 10 20 | local show_notification_mode = args.show_notification_mode or "on_hover" -- on_hover / on_click 21 | local notification_position = args.notification_position or "top_right" -- see naughty.notify position argument 22 | 23 | local main_color = args.main_color or beautiful.fg_color 24 | local bg_color = args.bg_color or "#ffffff11" 25 | local low_level_color = args.low_level_color or "#e53935" 26 | local medium_level_color = args.medium_level_color or "#c0ca33" 27 | local charging_color = args.charging_color or "#43a047" 28 | 29 | local warning_msg_title = args.warning_msg_title or "Houston, we have a problem" 30 | local warning_msg_text = args.warning_msg_text or "Battery is dying" 31 | local warning_msg_position = args.warning_msg_position or "bottom_right" 32 | local warning_msg_icon = args.warning_msg_icon or WIDGET_DIR .. "/hello.jpg" 33 | local enable_battery_warning = args.enable_battery_warning 34 | if enable_battery_warning == nil then 35 | enable_battery_warning = true 36 | end 37 | 38 | local text = wibox.widget({ 39 | font = font, 40 | align = "center", 41 | valign = "center", 42 | widget = wibox.widget.textbox, 43 | }) 44 | 45 | local text_with_background = wibox.container.background(text) 46 | 47 | batteryarc_widget = wibox.widget({ 48 | text_with_background, 49 | max_value = 100, 50 | rounded_edge = true, 51 | thickness = arc_thickness, 52 | start_angle = 4.71238898, -- 2pi*3/4 53 | forced_height = size, 54 | forced_width = size, 55 | bg = bg_color, 56 | paddings = 2, 57 | widget = wibox.container.arcchart, 58 | }) 59 | 60 | local last_battery_check = os.time() 61 | 62 | --[[ Show warning notification ]] 63 | local function show_battery_warning() 64 | naughty.notify({ 65 | icon = warning_msg_icon, 66 | icon_size = 100, 67 | text = warning_msg_text, 68 | title = warning_msg_title, 69 | timeout = 25, -- show the warning for a longer time 70 | hover_timeout = 0.5, 71 | position = warning_msg_position, 72 | bg = "#F06060", 73 | fg = "#EEE9EF", 74 | width = 300, 75 | }) 76 | end 77 | 78 | local function update_widget(widget, stdout) 79 | local charge = 0 80 | local status 81 | for s in stdout:gmatch("[^\r\n]+") do 82 | local cur_status, charge_str, _ = string.match(s, ".+: ([%a%s]+), (%d?%d?%d)%%,?(.*)") 83 | if cur_status ~= nil and charge_str ~= nil then 84 | local cur_charge = tonumber(charge_str) 85 | if cur_charge > charge then 86 | status = cur_status 87 | charge = cur_charge 88 | end 89 | end 90 | end 91 | 92 | widget.value = charge 93 | 94 | if status == "Charging" then 95 | text_with_background.bg = charging_color 96 | text_with_background.fg = "#000000" 97 | else 98 | text_with_background.bg = "#00000000" 99 | text_with_background.fg = main_color 100 | end 101 | 102 | if show_current_level == true then 103 | --- if battery is fully charged (100) there is not enough place for three digits, so we don't show any text 104 | text.text = charge == 100 and "" or string.format("%d", charge) 105 | else 106 | text.text = "" 107 | end 108 | 109 | if charge < 15 and charge > 0 then 110 | widget.colors = { low_level_color } 111 | if enable_battery_warning and status ~= "Charging" and os.difftime(os.time(), last_battery_check) > 300 then 112 | -- if 5 minutes have elapsed since the last warning 113 | last_battery_check = os.time() 114 | 115 | show_battery_warning() 116 | end 117 | elseif charge > 15 and charge < 40 then 118 | widget.colors = { medium_level_color } 119 | else 120 | widget.colors = { main_color } 121 | end 122 | end 123 | 124 | watch("acpi", timeout, update_widget, batteryarc_widget) 125 | 126 | -- Popup with battery info 127 | local notification 128 | local function show_battery_status() 129 | awful.spawn.easy_async([[bash -c 'acpi']], function(stdout, _, _, _) 130 | naughty.destroy(notification) 131 | notification = naughty.notify({ 132 | text = stdout, 133 | title = "Battery status", 134 | timeout = 5, 135 | width = 200, 136 | position = notification_position, 137 | }) 138 | end) 139 | end 140 | 141 | if show_notification_mode == "on_hover" then 142 | batteryarc_widget:connect_signal("mouse::enter", function() 143 | show_battery_status() 144 | end) 145 | batteryarc_widget:connect_signal("mouse::leave", function() 146 | naughty.destroy(notification) 147 | end) 148 | elseif show_notification_mode == "on_click" then 149 | batteryarc_widget:connect_signal("button::press", function(_, _, _, button) 150 | if button == 1 then 151 | show_battery_status() 152 | end 153 | end) 154 | end 155 | 156 | return batteryarc_widget 157 | end 158 | 159 | return setmetatable(batteryarc_widget, { 160 | __call = function(_, ...) 161 | return worker(...) 162 | end, 163 | }) 164 | -------------------------------------------------------------------------------- /awesome/.config/awesome/widgets/calender.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local beautiful = require("beautiful") 3 | local wibox = require("wibox") 4 | local gears = require("gears") 5 | 6 | local calendar_widget = {} 7 | 8 | local function worker() 9 | local calendar_themes = { 10 | custom = { 11 | bg = beautiful.bg_normal, 12 | fg = beautiful.fg_normal, 13 | focus_date_bg = beautiful.bg_focus, 14 | focus_date_fg = beautiful.fg_focus, 15 | weekend_day_bg = beautiful.bg_subtle, 16 | weekday_fg = beautiful.whites, 17 | header_fg = beautiful.yellow, 18 | border = beautiful.cyan, 19 | }, 20 | } 21 | 22 | local theme = "custom" 23 | local radius = 8 24 | local next_month_button = 4 -- mouse scroll up 25 | local previous_month_button = 5 -- mouse scroll down 26 | local start_sunday = true 27 | 28 | local styles = {} 29 | local function rounded_shape(size) 30 | return function(cr, width, height) 31 | gears.shape.rounded_rect(cr, width, height, size) 32 | end 33 | end 34 | 35 | styles.month = { 36 | padding = 4, 37 | bg_color = calendar_themes[theme].bg, 38 | border_width = 0, 39 | } 40 | 41 | styles.normal = { 42 | markup = function(t) 43 | return t 44 | end, 45 | shape = rounded_shape(4), 46 | } 47 | 48 | styles.focus = { 49 | fg_color = calendar_themes[theme].focus_date_fg, 50 | bg_color = calendar_themes[theme].focus_date_bg, 51 | markup = function(t) 52 | return "" .. t .. "" 53 | end, 54 | shape = rounded_shape(4), 55 | } 56 | 57 | styles.header = { 58 | fg_color = calendar_themes[theme].header_fg, 59 | bg_color = calendar_themes[theme].bg, 60 | markup = function(t) 61 | return "" .. t .. "" 62 | end, 63 | } 64 | 65 | styles.weekday = { 66 | fg_color = calendar_themes[theme].weekday_fg, 67 | bg_color = calendar_themes[theme].bg, 68 | markup = function(t) 69 | return "" .. t .. "" 70 | end, 71 | } 72 | 73 | local function decorate_cell(widget, flag, date) 74 | if flag == "monthheader" and not styles.monthheader then 75 | flag = "header" 76 | end 77 | 78 | -- highlight only today's day 79 | if flag == "focus" then 80 | local today = os.date("*t") 81 | if not (today.month == date.month and today.year == date.year) then 82 | flag = "normal" 83 | end 84 | end 85 | 86 | local props = styles[flag] or {} 87 | if props.markup and widget.get_text and widget.set_markup then 88 | widget:set_markup(props.markup(widget:get_text())) 89 | end 90 | -- Change bg color for weekends 91 | local default_bg 92 | if flag == "normal" then 93 | local d = { year = date.year, month = (date.month or 1), day = (date.day or 1) } 94 | local weekday = tonumber(os.date("%w", os.time(d))) 95 | default_bg = (weekday == 0 or weekday == 6) and calendar_themes[theme].weekend_day_bg 96 | or calendar_themes[theme].bg 97 | end 98 | local ret = wibox.widget({ 99 | { 100 | { 101 | widget, 102 | halign = "center", 103 | widget = wibox.container.place, 104 | }, 105 | margins = (props.padding or 2) + (props.border_width or 0), 106 | widget = wibox.container.margin, 107 | }, 108 | shape = props.shape, 109 | shape_border_color = props.border_color or "#000000", 110 | shape_border_width = props.border_width or 0, 111 | fg = props.fg_color or calendar_themes[theme].fg, 112 | bg = props.bg_color or default_bg, 113 | widget = wibox.container.background, 114 | }) 115 | 116 | return ret 117 | end 118 | 119 | local cal = wibox.widget({ 120 | date = os.date("*t"), 121 | font = beautiful.get_font(), 122 | fn_embed = decorate_cell, 123 | long_weekdays = true, 124 | start_sunday = start_sunday, 125 | week_numbers = false, 126 | widget = wibox.widget.calendar.month, 127 | }) 128 | 129 | local popup = awful.popup({ 130 | ontop = true, 131 | visible = false, 132 | shape = rounded_shape(radius), 133 | offset = { y = 5 }, 134 | border_width = 2, 135 | border_color = calendar_themes[theme].border, 136 | widget = cal, 137 | }) 138 | 139 | popup:buttons(awful.util.table.join( 140 | awful.button({}, next_month_button, function() 141 | local a = cal:get_date() 142 | a.month = a.month + 1 143 | cal:set_date(nil) 144 | cal:set_date(a) 145 | popup:set_widget(cal) 146 | end), 147 | awful.button({}, previous_month_button, function() 148 | local a = cal:get_date() 149 | a.month = a.month - 1 150 | cal:set_date(nil) 151 | cal:set_date(a) 152 | popup:set_widget(cal) 153 | end) 154 | )) 155 | 156 | function calendar_widget.toggle() 157 | if popup.visible then 158 | -- to faster render the calendar refresh it and just hide 159 | cal:set_date(nil) -- the new date is not set without removing the old one 160 | cal:set_date(os.date("*t")) 161 | popup:set_widget(nil) -- just in case 162 | popup:set_widget(cal) 163 | popup.visible = not popup.visible 164 | else 165 | awful.placement.top(popup, { margins = { top = 60 }, parent = awful.screen.focused() }) 166 | popup.visible = true 167 | end 168 | end 169 | 170 | return calendar_widget 171 | end 172 | 173 | return setmetatable(calendar_widget, { 174 | __call = function() 175 | return worker() 176 | end, 177 | }) 178 | -------------------------------------------------------------------------------- /awesome/.config/awesome/widgets/checkbox-checked-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 21 | 23 | 24 | 26 | image/svg+xml 27 | 29 | Gnome Symbolic Icon Theme 30 | 31 | 32 | 33 | 67 | 79 | 80 | Gnome Symbolic Icon Theme 82 | 84 | 90 | 95 | 101 | 102 | 108 | 113 | 119 | 124 | 130 | 136 | 142 | 148 | 149 | -------------------------------------------------------------------------------- /awesome/.config/awesome/widgets/chevron-down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /awesome/.config/awesome/widgets/chevron-up.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /awesome/.config/awesome/widgets/json.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- json.lua 3 | -- 4 | -- Copyright (c) 2020 rxi 5 | -- 6 | -- Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | -- this software and associated documentation files (the "Software"), to deal in 8 | -- the Software without restriction, including without limitation the rights to 9 | -- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | -- of the Software, and to permit persons to whom the Software is furnished to do 11 | -- so, subject to the following conditions: 12 | -- 13 | -- The above copyright notice and this permission notice shall be included in all 14 | -- copies or substantial portions of the Software. 15 | -- 16 | -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | -- SOFTWARE. 23 | -- 24 | 25 | local json = { _version = "0.1.2" } 26 | 27 | ------------------------------------------------------------------------------- 28 | -- Encode 29 | ------------------------------------------------------------------------------- 30 | 31 | local encode 32 | 33 | local escape_char_map = { 34 | ["\\"] = "\\", 35 | ['"'] = '"', 36 | ["\b"] = "b", 37 | ["\f"] = "f", 38 | ["\n"] = "n", 39 | ["\r"] = "r", 40 | ["\t"] = "t", 41 | } 42 | 43 | local escape_char_map_inv = { ["/"] = "/" } 44 | for k, v in pairs(escape_char_map) do 45 | escape_char_map_inv[v] = k 46 | end 47 | 48 | local function escape_char(c) 49 | return "\\" .. (escape_char_map[c] or string.format("u%04x", c:byte())) 50 | end 51 | 52 | local function encode_nil(val) 53 | return "null" 54 | end 55 | 56 | local function encode_table(val, stack) 57 | local res = {} 58 | stack = stack or {} 59 | 60 | -- Circular reference? 61 | if stack[val] then 62 | error("circular reference") 63 | end 64 | 65 | stack[val] = true 66 | 67 | if rawget(val, 1) ~= nil or next(val) == nil then 68 | -- Treat as array -- check keys are valid and it is not sparse 69 | local n = 0 70 | for k in pairs(val) do 71 | if type(k) ~= "number" then 72 | error("invalid table: mixed or invalid key types") 73 | end 74 | n = n + 1 75 | end 76 | if n ~= #val then 77 | error("invalid table: sparse array") 78 | end 79 | -- Encode 80 | for i, v in ipairs(val) do 81 | table.insert(res, encode(v, stack)) 82 | end 83 | stack[val] = nil 84 | return "[" .. table.concat(res, ",") .. "]" 85 | else 86 | -- Treat as an object 87 | for k, v in pairs(val) do 88 | if type(k) ~= "string" then 89 | error("invalid table: mixed or invalid key types") 90 | end 91 | table.insert(res, encode(k, stack) .. ":" .. encode(v, stack)) 92 | end 93 | stack[val] = nil 94 | return "{" .. table.concat(res, ",") .. "}" 95 | end 96 | end 97 | 98 | local function encode_string(val) 99 | return '"' .. val:gsub('[%z\1-\31\\"]', escape_char) .. '"' 100 | end 101 | 102 | local function encode_number(val) 103 | -- Check for NaN, -inf and inf 104 | if val ~= val or val <= -math.huge or val >= math.huge then 105 | error("unexpected number value '" .. tostring(val) .. "'") 106 | end 107 | return string.format("%.14g", val) 108 | end 109 | 110 | local type_func_map = { 111 | ["nil"] = encode_nil, 112 | ["table"] = encode_table, 113 | ["string"] = encode_string, 114 | ["number"] = encode_number, 115 | ["boolean"] = tostring, 116 | } 117 | 118 | encode = function(val, stack) 119 | local t = type(val) 120 | local f = type_func_map[t] 121 | if f then 122 | return f(val, stack) 123 | end 124 | error("unexpected type '" .. t .. "'") 125 | end 126 | 127 | function json.encode(val) 128 | return (encode(val)) 129 | end 130 | 131 | ------------------------------------------------------------------------------- 132 | -- Decode 133 | ------------------------------------------------------------------------------- 134 | 135 | local parse 136 | 137 | local function create_set(...) 138 | local res = {} 139 | for i = 1, select("#", ...) do 140 | res[select(i, ...)] = true 141 | end 142 | return res 143 | end 144 | 145 | local space_chars = create_set(" ", "\t", "\r", "\n") 146 | local delim_chars = create_set(" ", "\t", "\r", "\n", "]", "}", ",") 147 | local escape_chars = create_set("\\", "/", '"', "b", "f", "n", "r", "t", "u") 148 | local literals = create_set("true", "false", "null") 149 | 150 | local literal_map = { 151 | ["true"] = true, 152 | ["false"] = false, 153 | ["null"] = nil, 154 | } 155 | 156 | local function next_char(str, idx, set, negate) 157 | for i = idx, #str do 158 | if set[str:sub(i, i)] ~= negate then 159 | return i 160 | end 161 | end 162 | return #str + 1 163 | end 164 | 165 | local function decode_error(str, idx, msg) 166 | local line_count = 1 167 | local col_count = 1 168 | for i = 1, idx - 1 do 169 | col_count = col_count + 1 170 | if str:sub(i, i) == "\n" then 171 | line_count = line_count + 1 172 | col_count = 1 173 | end 174 | end 175 | error(string.format("%s at line %d col %d", msg, line_count, col_count)) 176 | end 177 | 178 | local function codepoint_to_utf8(n) 179 | -- http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=iws-appendixa 180 | local f = math.floor 181 | if n <= 0x7f then 182 | return string.char(n) 183 | elseif n <= 0x7ff then 184 | return string.char(f(n / 64) + 192, n % 64 + 128) 185 | elseif n <= 0xffff then 186 | return string.char(f(n / 4096) + 224, f(n % 4096 / 64) + 128, n % 64 + 128) 187 | elseif n <= 0x10ffff then 188 | return string.char(f(n / 262144) + 240, f(n % 262144 / 4096) + 128, f(n % 4096 / 64) + 128, n % 64 + 128) 189 | end 190 | error(string.format("invalid unicode codepoint '%x'", n)) 191 | end 192 | 193 | local function parse_unicode_escape(s) 194 | local n1 = tonumber(s:sub(1, 4), 16) 195 | local n2 = tonumber(s:sub(7, 10), 16) 196 | -- Surrogate pair? 197 | if n2 then 198 | return codepoint_to_utf8((n1 - 0xd800) * 0x400 + (n2 - 0xdc00) + 0x10000) 199 | else 200 | return codepoint_to_utf8(n1) 201 | end 202 | end 203 | 204 | local function parse_string(str, i) 205 | local res = "" 206 | local j = i + 1 207 | local k = j 208 | 209 | while j <= #str do 210 | local x = str:byte(j) 211 | 212 | if x < 32 then 213 | decode_error(str, j, "control character in string") 214 | elseif x == 92 then -- `\`: Escape 215 | res = res .. str:sub(k, j - 1) 216 | j = j + 1 217 | local c = str:sub(j, j) 218 | if c == "u" then 219 | local hex = str:match("^[dD][89aAbB]%x%x\\u%x%x%x%x", j + 1) 220 | or str:match("^%x%x%x%x", j + 1) 221 | or decode_error(str, j - 1, "invalid unicode escape in string") 222 | res = res .. parse_unicode_escape(hex) 223 | j = j + #hex 224 | else 225 | if not escape_chars[c] then 226 | decode_error(str, j - 1, "invalid escape char '" .. c .. "' in string") 227 | end 228 | res = res .. escape_char_map_inv[c] 229 | end 230 | k = j + 1 231 | elseif x == 34 then -- `"`: End of string 232 | res = res .. str:sub(k, j - 1) 233 | return res, j + 1 234 | end 235 | 236 | j = j + 1 237 | end 238 | 239 | decode_error(str, i, "expected closing quote for string") 240 | end 241 | 242 | local function parse_number(str, i) 243 | local x = next_char(str, i, delim_chars) 244 | local s = str:sub(i, x - 1) 245 | local n = tonumber(s) 246 | if not n then 247 | decode_error(str, i, "invalid number '" .. s .. "'") 248 | end 249 | return n, x 250 | end 251 | 252 | local function parse_literal(str, i) 253 | local x = next_char(str, i, delim_chars) 254 | local word = str:sub(i, x - 1) 255 | if not literals[word] then 256 | decode_error(str, i, "invalid literal '" .. word .. "'") 257 | end 258 | return literal_map[word], x 259 | end 260 | 261 | local function parse_array(str, i) 262 | local res = {} 263 | local n = 1 264 | i = i + 1 265 | while 1 do 266 | local x 267 | i = next_char(str, i, space_chars, true) 268 | -- Empty / end of array? 269 | if str:sub(i, i) == "]" then 270 | i = i + 1 271 | break 272 | end 273 | -- Read token 274 | x, i = parse(str, i) 275 | res[n] = x 276 | n = n + 1 277 | -- Next token 278 | i = next_char(str, i, space_chars, true) 279 | local chr = str:sub(i, i) 280 | i = i + 1 281 | if chr == "]" then 282 | break 283 | end 284 | if chr ~= "," then 285 | decode_error(str, i, "expected ']' or ','") 286 | end 287 | end 288 | return res, i 289 | end 290 | 291 | local function parse_object(str, i) 292 | local res = {} 293 | i = i + 1 294 | while 1 do 295 | local key, val 296 | i = next_char(str, i, space_chars, true) 297 | -- Empty / end of object? 298 | if str:sub(i, i) == "}" then 299 | i = i + 1 300 | break 301 | end 302 | -- Read key 303 | if str:sub(i, i) ~= '"' then 304 | decode_error(str, i, "expected string for key") 305 | end 306 | key, i = parse(str, i) 307 | -- Read ':' delimiter 308 | i = next_char(str, i, space_chars, true) 309 | if str:sub(i, i) ~= ":" then 310 | decode_error(str, i, "expected ':' after key") 311 | end 312 | i = next_char(str, i + 1, space_chars, true) 313 | -- Read value 314 | val, i = parse(str, i) 315 | -- Set 316 | res[key] = val 317 | -- Next token 318 | i = next_char(str, i, space_chars, true) 319 | local chr = str:sub(i, i) 320 | i = i + 1 321 | if chr == "}" then 322 | break 323 | end 324 | if chr ~= "," then 325 | decode_error(str, i, "expected '}' or ','") 326 | end 327 | end 328 | return res, i 329 | end 330 | 331 | local char_func_map = { 332 | ['"'] = parse_string, 333 | ["0"] = parse_number, 334 | ["1"] = parse_number, 335 | ["2"] = parse_number, 336 | ["3"] = parse_number, 337 | ["4"] = parse_number, 338 | ["5"] = parse_number, 339 | ["6"] = parse_number, 340 | ["7"] = parse_number, 341 | ["8"] = parse_number, 342 | ["9"] = parse_number, 343 | ["-"] = parse_number, 344 | ["t"] = parse_literal, 345 | ["f"] = parse_literal, 346 | ["n"] = parse_literal, 347 | ["["] = parse_array, 348 | ["{"] = parse_object, 349 | } 350 | 351 | parse = function(str, idx) 352 | local chr = str:sub(idx, idx) 353 | local f = char_func_map[chr] 354 | if f then 355 | return f(str, idx) 356 | end 357 | decode_error(str, idx, "unexpected character '" .. chr .. "'") 358 | end 359 | 360 | function json.decode(str) 361 | if type(str) ~= "string" then 362 | error("expected argument of type string, got " .. type(str)) 363 | end 364 | local res, idx = parse(str, next_char(str, 1, space_chars, true)) 365 | idx = next_char(str, idx, space_chars, true) 366 | if idx <= #str then 367 | decode_error(str, idx, "trailing garbage") 368 | end 369 | return res 370 | end 371 | 372 | return json 373 | -------------------------------------------------------------------------------- /awesome/.config/awesome/widgets/list-add-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 21 | 23 | 30 | 37 | 41 | 45 | 46 | 53 | 63 | 66 | 70 | 71 | 80 | 89 | 90 | 111 | 115 | 119 | 123 | 127 | 132 | 133 | 135 | 136 | 138 | image/svg+xml 139 | 141 | 142 | 143 | 144 | 149 | 156 | 157 | 158 | -------------------------------------------------------------------------------- /awesome/.config/awesome/widgets/todo.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local wibox = require("wibox") 3 | local gears = require("gears") 4 | local spawn = require("awful.spawn") 5 | local beautiful = require("beautiful") 6 | local gfs = require("gears.filesystem") 7 | 8 | local json = require("widgets.json") 9 | 10 | local HOME_DIR = os.getenv("HOME") 11 | local WIDGET_DIR = HOME_DIR .. "/.config/awesome/widgets" 12 | local STORAGE = HOME_DIR .. "/.cache/awmw/todo-widget/todos.json" 13 | 14 | local GET_TODO_ITEMS = 'bash -c "cat ' .. STORAGE .. '"' 15 | 16 | local rows = { layout = wibox.layout.fixed.vertical } 17 | local todo_widget = {} 18 | local update_widget 19 | todo_widget.widget = wibox.widget({ 20 | { 21 | { 22 | { 23 | { 24 | id = "icon", 25 | forced_height = 16, 26 | forced_width = 16, 27 | widget = wibox.widget.imagebox, 28 | }, 29 | valign = "center", 30 | layout = wibox.container.place, 31 | }, 32 | { 33 | id = "txt", 34 | widget = wibox.widget.textbox, 35 | }, 36 | spacing = 4, 37 | layout = wibox.layout.fixed.horizontal, 38 | }, 39 | margins = 4, 40 | layout = wibox.container.margin, 41 | }, 42 | shape = function(cr, width, height) 43 | gears.shape.rounded_rect(cr, width, height, 4) 44 | end, 45 | widget = wibox.container.background, 46 | set_text = function(self, new_value) 47 | self:get_children_by_id("txt")[1].text = new_value 48 | end, 49 | set_icon = function(self, new_value) 50 | self:get_children_by_id("icon")[1].image = new_value 51 | end, 52 | }) 53 | 54 | function todo_widget:update_counter(todos) 55 | local todo_count = 0 56 | for _, p in ipairs(todos) do 57 | if not p.status then 58 | todo_count = todo_count + 1 59 | end 60 | end 61 | 62 | todo_widget.widget:set_text(todo_count) 63 | end 64 | 65 | local popup = awful.popup({ 66 | bg = beautiful.bg_normal, 67 | ontop = true, 68 | visible = false, 69 | shape = gears.shape.rounded_rect, 70 | border_width = 1, 71 | border_color = beautiful.bg_focus, 72 | maximum_width = 400, 73 | offset = { y = 5 }, 74 | widget = {}, 75 | }) 76 | 77 | local add_button = wibox.widget({ 78 | { 79 | { 80 | image = WIDGET_DIR .. "/list-add-symbolic.svg", 81 | resize = false, 82 | widget = wibox.widget.imagebox, 83 | }, 84 | top = 11, 85 | left = 8, 86 | right = 8, 87 | layout = wibox.container.margin, 88 | }, 89 | shape = function(cr, width, height) 90 | gears.shape.circle(cr, width, height, 12) 91 | end, 92 | widget = wibox.container.background, 93 | }) 94 | 95 | add_button:connect_signal("button::press", function() 96 | local pr = awful.widget.prompt() 97 | 98 | table.insert( 99 | rows, 100 | wibox.widget({ 101 | { 102 | { 103 | pr.widget, 104 | spacing = 8, 105 | layout = wibox.layout.align.horizontal, 106 | }, 107 | margins = 8, 108 | layout = wibox.container.margin, 109 | }, 110 | bg = beautiful.bg_normal, 111 | widget = wibox.container.background, 112 | }) 113 | ) 114 | awful.prompt.run({ 115 | prompt = "New item: ", 116 | bg = beautiful.bg_normal, 117 | bg_cursor = beautiful.fg_urgent, 118 | textbox = pr.widget, 119 | exe_callback = function(input_text) 120 | if not input_text or #input_text == 0 then 121 | return 122 | end 123 | spawn.easy_async(GET_TODO_ITEMS, function(stdout) 124 | local res = json.decode(stdout) 125 | table.insert(res.todo_items, { todo_item = input_text, status = false }) 126 | spawn.easy_async_with_shell("echo '" .. json.encode(res) .. "' > " .. STORAGE, function() 127 | spawn.easy_async(GET_TODO_ITEMS, function(items) 128 | update_widget(items) 129 | end) 130 | end) 131 | end) 132 | end, 133 | }) 134 | popup:setup(rows) 135 | end) 136 | add_button:connect_signal("mouse::enter", function(c) 137 | c:set_bg(beautiful.bg_focus) 138 | end) 139 | add_button:connect_signal("mouse::leave", function(c) 140 | c:set_bg(beautiful.bg_normal) 141 | end) 142 | 143 | local function worker(user_args) 144 | local args = user_args or {} 145 | 146 | local icon = args.icon or WIDGET_DIR .. "/checkbox-checked-symbolic.svg" 147 | 148 | todo_widget.widget:set_icon(icon) 149 | 150 | function update_widget(stdout) 151 | local result = json.decode(stdout) 152 | if result == nil or result == "" then 153 | result = {} 154 | end 155 | todo_widget:update_counter(result.todo_items) 156 | 157 | for i = 0, #rows do 158 | rows[i] = nil 159 | end 160 | 161 | local first_row = wibox.widget({ 162 | { 163 | { widget = wibox.widget.textbox }, 164 | { 165 | markup = 'ToDo', 166 | align = "center", 167 | forced_width = 350, -- for horizontal alignment 168 | forced_height = 40, 169 | widget = wibox.widget.textbox, 170 | }, 171 | add_button, 172 | spacing = 8, 173 | layout = wibox.layout.fixed.horizontal, 174 | }, 175 | bg = beautiful.bg_normal, 176 | widget = wibox.container.background, 177 | }) 178 | 179 | table.insert(rows, first_row) 180 | 181 | for i, todo_item in ipairs(result.todo_items) do 182 | local checkbox = wibox.widget({ 183 | checked = todo_item.status, 184 | color = beautiful.bg_normal, 185 | paddings = 2, 186 | shape = gears.shape.circle, 187 | forced_width = 20, 188 | forced_height = 20, 189 | check_color = beautiful.fg_urgent, 190 | widget = wibox.widget.checkbox, 191 | }) 192 | 193 | checkbox:connect_signal("button::press", function(c) 194 | c:set_checked(not c.checked) 195 | todo_item.status = not todo_item.status 196 | result.todo_items[i] = todo_item 197 | spawn.easy_async_with_shell("echo '" .. json.encode(result) .. "' > " .. STORAGE, function() 198 | todo_widget:update_counter(result.todo_items) 199 | end) 200 | end) 201 | 202 | local trash_button = wibox.widget({ 203 | { 204 | { 205 | image = WIDGET_DIR .. "/window-close-symbolic.svg", 206 | resize = false, 207 | widget = wibox.widget.imagebox, 208 | }, 209 | margins = 5, 210 | layout = wibox.container.margin, 211 | }, 212 | border_width = 1, 213 | shape = function(cr, width, height) 214 | gears.shape.circle(cr, width, height, 10) 215 | end, 216 | widget = wibox.container.background, 217 | }) 218 | 219 | trash_button:connect_signal("button::press", function() 220 | table.remove(result.todo_items, i) 221 | spawn.easy_async_with_shell("printf '" .. json.encode(result) .. "' > " .. STORAGE, function() 222 | spawn.easy_async(GET_TODO_ITEMS, function(items) 223 | update_widget(items) 224 | end) 225 | end) 226 | end) 227 | 228 | local move_up = wibox.widget({ 229 | image = WIDGET_DIR .. "/chevron-up.svg", 230 | resize = false, 231 | widget = wibox.widget.imagebox, 232 | }) 233 | 234 | move_up:connect_signal("button::press", function() 235 | local temp = result.todo_items[i] 236 | result.todo_items[i] = result.todo_items[i - 1] 237 | result.todo_items[i - 1] = temp 238 | spawn.easy_async_with_shell("printf '" .. json.encode(result) .. "' > " .. STORAGE, function() 239 | spawn.easy_async(GET_TODO_ITEMS, function(items) 240 | update_widget(items) 241 | end) 242 | end) 243 | end) 244 | 245 | local move_down = wibox.widget({ 246 | image = WIDGET_DIR .. "/chevron-down.svg", 247 | resize = false, 248 | widget = wibox.widget.imagebox, 249 | }) 250 | 251 | move_down:connect_signal("button::press", function() 252 | local temp = result.todo_items[i] 253 | result.todo_items[i] = result.todo_items[i + 1] 254 | result.todo_items[i + 1] = temp 255 | spawn.easy_async_with_shell("printf '" .. json.encode(result) .. "' > " .. STORAGE, function() 256 | spawn.easy_async(GET_TODO_ITEMS, function(items) 257 | update_widget(items) 258 | end) 259 | end) 260 | end) 261 | 262 | local move_buttons = { 263 | layout = wibox.layout.fixed.vertical, 264 | } 265 | 266 | if i == 1 and #result.todo_items > 1 then 267 | table.insert(move_buttons, move_down) 268 | elseif i == #result.todo_items and #result.todo_items > 1 then 269 | table.insert(move_buttons, move_up) 270 | elseif #result.todo_items > 1 then 271 | table.insert(move_buttons, move_up) 272 | table.insert(move_buttons, move_down) 273 | end 274 | 275 | local row = wibox.widget({ 276 | { 277 | { 278 | { 279 | checkbox, 280 | valign = "center", 281 | layout = wibox.container.place, 282 | }, 283 | { 284 | { 285 | text = todo_item.todo_item, 286 | align = "left", 287 | widget = wibox.widget.textbox, 288 | }, 289 | left = 10, 290 | layout = wibox.container.margin, 291 | }, 292 | { 293 | { 294 | move_buttons, 295 | valign = "center", 296 | layout = wibox.container.place, 297 | }, 298 | { 299 | trash_button, 300 | valign = "center", 301 | layout = wibox.container.place, 302 | }, 303 | spacing = 8, 304 | layout = wibox.layout.align.horizontal, 305 | }, 306 | spacing = 8, 307 | layout = wibox.layout.align.horizontal, 308 | }, 309 | margins = 8, 310 | layout = wibox.container.margin, 311 | }, 312 | bg = beautiful.bg_normal, 313 | widget = wibox.container.background, 314 | }) 315 | 316 | row:connect_signal("mouse::enter", function(c) 317 | c:set_bg(beautiful.bg_focus) 318 | end) 319 | row:connect_signal("mouse::leave", function(c) 320 | c:set_bg(beautiful.bg_normal) 321 | end) 322 | 323 | table.insert(rows, row) 324 | end 325 | 326 | popup:setup(rows) 327 | end 328 | 329 | todo_widget.widget:buttons(gears.table.join(awful.button({}, 1, function() 330 | if popup.visible then 331 | todo_widget.widget:set_bg("#00000000") 332 | popup.visible = not popup.visible 333 | else 334 | todo_widget.widget:set_bg(beautiful.bg_focus) 335 | popup:move_next_to(mouse.current_widget_geometry) 336 | end 337 | end))) 338 | 339 | spawn.easy_async(GET_TODO_ITEMS, function(stdout) 340 | update_widget(stdout) 341 | end) 342 | 343 | return todo_widget.widget 344 | end 345 | 346 | if not gfs.file_readable(STORAGE) then 347 | spawn.easy_async( 348 | string.format([[bash -c "dirname %s | xargs mkdir -p && echo '{\"todo_items\":{}}' > %s"]], STORAGE, STORAGE) 349 | ) 350 | end 351 | 352 | return setmetatable(todo_widget, { 353 | __call = function(_, ...) 354 | return worker(...) 355 | end, 356 | }) 357 | -------------------------------------------------------------------------------- /awesome/.config/awesome/widgets/window-close-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 38 | 41 | 42 | Gnome Symbolic Icon Theme 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | Gnome Symbolic Icon Theme 53 | 54 | 55 | 56 | 58 | 62 | 65 | 68 | 71 | 74 | 78 | 83 | 84 | 85 | 86 | 89 | 92 | 95 | 96 | -------------------------------------------------------------------------------- /cht-sh/.local/cht-sh/db.yml: -------------------------------------------------------------------------------- 1 | postgres: 2 | start: 3 | docker run --name -e POSTGRES_PASSWORD= -p 5432:5432 -d postgres 4 | connect: 5 | postgresql://postgres:@localhost:5432/ 6 | 7 | mongoDB: 8 | start: 9 | docker run -d --name -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME= -e MONGO_INITDB_ROOT_PASSWORD= mongo 10 | connect: 11 | mongodb://:@0.0.0.0:27017/ 12 | 13 | less: 14 | docker run --name -p 27017:27017 -d mongo 15 | short-one: 16 | mongodb://localhost/ 17 | -------------------------------------------------------------------------------- /fish/.config/fish/config.fish: -------------------------------------------------------------------------------- 1 | set fish_greeting 2 | set fish_color_normal brcyan 3 | set fish_color_command brcyan 4 | set fish_color_error '#ff6c6b' 5 | set fish_color_param '#04cc85' 6 | set fish_color_autosuggestion '#7d7d7d' 7 | 8 | # me lazy 9 | alias c "clear" 10 | alias k "kubectl" 11 | alias x "exit" 12 | alias vi "nvim" 13 | alias vim "nvim" 14 | alias rm "trash" 15 | alias lf "yazi" 16 | alias cc "clang" 17 | alias cxx "clang++" 18 | alias tf "terraform" 19 | alias unset 'set --erase' 20 | alias ssh "TERM=xterm-256color $(which ssh)" 21 | alias xclip "xclip -selection clipboard" 22 | alias nocaps 'setxkbmap -option "caps:escape"' 23 | 24 | # change ownership of file to oneself 25 | alias own 'sudo chown $(id -u):$(id -g)' 26 | 27 | # get only status code from curl response 28 | alias cures 'curl -I -s -o /dev/null -w "%{http_code}"' 29 | 30 | # utils 31 | alias dot "tmux-sessionizer ~/.dotfiles" 32 | alias fetch "neofetch --config ~/.config/neofetch/config.old.conf" 33 | alias scrkey "screenkey -s small --opacity 0.6 -p fixed -g 30%x7%+69%-2%" 34 | alias nodepurge "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +" 35 | 36 | # assume cli 37 | alias ac="source /usr/local/bin/assume.fish -c" 38 | alias at="source /usr/local/bin/assume.fish -t" 39 | alias assume="source /usr/local/bin/assume.fish" 40 | 41 | # abbreviation for cd .. alias 42 | function multicd 43 | set -l length (math (string length -- $argv) - 1) 44 | echo cd (string repeat -n $length ../) 45 | end 46 | 47 | abbr --add dotdot --regex '^\.\.+$' --function multicd 48 | 49 | alias cdd 'cd "$(fd -t d . | fzf --prompt="Select directory to jump: " --height=~30% --layout=reverse --border --exit-0)"' # cd with steroids 50 | 51 | # better ls 52 | alias ls "exa -a --icons --group-directories-first" 53 | alias ll "exa -lah --icons --no-time --git --group-directories-first" 54 | alias lt "exa -lh --icons --no-user --git -T -L 4 --ignore-glob='.git|node_modules' --group-directories-first --no-permissions --no-filesize --no-time" 55 | 56 | # git 57 | alias gd "git diff" 58 | alias gs "git status" 59 | alias ggpush "git push" 60 | alias ggpull "git pull --rebase" 61 | alias fuckyou "git push --force" 62 | 63 | ## git worktree 64 | alias gls "git worktree list" 65 | alias gadd "git worktree add" 66 | alias gmv "git worktree move" 67 | alias grm "git worktree remove" 68 | 69 | # docker 70 | alias dps "docker ps" 71 | alias dcd "docker-compose down" 72 | alias dcu "docker-compose up -d" 73 | 74 | # kubernetes 75 | alias kns "kubens | fzf --prompt='Select namespace: ' --height=~50% --layout=reverse --border | xargs kubens" 76 | alias kctx "kubectx | fzf --prompt='Select context: ' --height=~50% --layout=reverse --border | xargs kubectx" 77 | 78 | # Rick 79 | alias rick "curl -s -L https://raw.githubusercontent.com/keroserene/rickrollrc/master/roll.sh | bash" 80 | 81 | # TMUX 82 | alias tls "tmux ls" # lists currently running sessions 83 | alias ta "tmux a" # attach to any of running session 84 | alias tnew "tmux new -s" # creates new tmux session 85 | alias tkl "tmux kill-server" # kills all tmux sessions 86 | alias tk1 "tmux kill-session -t" # kill specific running session ( specify session name after this command ) 87 | 88 | # sessionizer script 89 | bind \cf "tmux-sessionizer" 90 | 91 | # arrow left and right on alt + h/l 92 | bind \eh backward-char 93 | bind \el forward-char 94 | 95 | # Path variables 96 | set PATH "$PATH":"$HOME/go/bin" 97 | set PATH "$PATH":"$HOME/.bun/bin" 98 | set PATH "$PATH":"$HOME/.krew/bin" 99 | set PATH "$PATH":"$HOME/.local/bin" 100 | set PATH "$PATH":"$HOME/.cargo/bin" 101 | set PATH "$PATH":"$HOME/.cargo/env" 102 | set PATH "$PATH":"$HOME/.linkerd2/bin" 103 | set PATH "$PATH":"$HOME/.local/scripts" 104 | set PATH "$PATH":"$HOME/.local/share/fnm" 105 | set PATH "$PATH":"$HOME/.dev/flutter/bin" 106 | set PATH "$PATH":"$HOME/.dev/android-studio/bin" 107 | set PATH "$PATH":"$HOME/.local/share/bob/nvim-bin" 108 | 109 | # node stuffs 110 | set FNM_PATH "/home/r3x/.local/share/fnm" 111 | if [ -d "$FNM_PATH" ] 112 | set PATH "$FNM_PATH" $PATH 113 | fnm env | source 114 | end 115 | alias p "pnpm" 116 | alias px "pnpx" 117 | set -gx PNPM_HOME "/home/r3x/.local/share/pnpm" 118 | set -gx PATH "$PNPM_HOME" $PATH 119 | 120 | # defaults 121 | export VISUAL="nvim" 122 | export EDITOR="nvim" 123 | export TERM="alacritty" 124 | export KUBECONFIG="$HOME/.kube/config" 125 | 126 | starship init fish | source 127 | -------------------------------------------------------------------------------- /flameshot/.config/flameshot/flameshot.ini: -------------------------------------------------------------------------------- 1 | [General] 2 | checkForUpdates=false 3 | contrastOpacity=175 4 | disabledTrayIcon=true 5 | filenamePattern=%F_%H:%M:%S 6 | saveAfterCopy=false 7 | saveAsFileExtension=png 8 | savePath=/home/r3x/screenshots 9 | savePathFixed=true 10 | showDesktopNotification=false 11 | showHelp=false 12 | showSidePanelButton=false 13 | showStartupLaunchMessage=false 14 | uiColor=#42f5fa 15 | undoLimit=99 16 | -------------------------------------------------------------------------------- /ghostty/.config/ghostty/config: -------------------------------------------------------------------------------- 1 | foreground = c0caf5 2 | background = 000000 3 | 4 | theme = tokyonight 5 | 6 | window-decoration = false 7 | background-opacity = 0.47 8 | 9 | cursor-style = block 10 | cursor-style-blink = false 11 | shell-integration-features = no-cursor 12 | 13 | # disable all font ligatures 14 | font-feature = -calt 15 | font-feature = -liga 16 | font-feature = -dlig 17 | 18 | font-size = 13 19 | font-family = "Fira Code Nerd Font" 20 | font-family-bold = "Fira Code Nerd Font" 21 | font-family-italic = "Iosevka Nerd Font" 22 | font-family-bold-italic = "Iosevka Nerd Font" 23 | 24 | confirm-close-surface = false 25 | -------------------------------------------------------------------------------- /gitconf/.gitconfig: -------------------------------------------------------------------------------- 1 | [init] 2 | defaultBranch = main 3 | 4 | [pull] 5 | ff = only 6 | 7 | [core] 8 | pager = delta 9 | 10 | [interactive] 11 | diffFilter = delta --color-only 12 | 13 | [delta] 14 | navigate = true 15 | light = false 16 | side-by-side = true 17 | line-numbers = true 18 | 19 | [diff] 20 | colorMoved = default 21 | 22 | [merge] 23 | tool = vimdiff 24 | conflictstyle = diff3 25 | 26 | [mergetool] 27 | keepBackup = false 28 | 29 | [mergetool "vimdiff"] 30 | cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J' 31 | 32 | [alias] 33 | lg = log --oneline --graph --decorate --all 34 | contributors = shortlog -s -n --all --no-merges 35 | 36 | [user] 37 | name = edr3x 38 | email = dhunganaannanta@gmail.com 39 | -------------------------------------------------------------------------------- /neofetch/.config/neofetch/config.conf: -------------------------------------------------------------------------------- 1 | 2 | print_info() { 3 | info "$(color 4) " distro 4 | info "$(color 7) " kernel 5 | info "$(color 13) " wm 6 | info "$(color 15) " term 7 | info "$(color 3) " shell 8 | info "$(color 5)󰍛 " cpu 9 | info "$(color 2) " memory 10 | info "$(color 14)󰥔 " uptime 11 | } 12 | 13 | kernel_shorthand="on" 14 | 15 | distro_shorthand="tiny" 16 | 17 | os_arch="off" 18 | 19 | cpu_brand="off" 20 | 21 | speed_shorthand="on" 22 | 23 | shell_path="off" 24 | 25 | shell_version="off" 26 | 27 | bold="on" 28 | 29 | underline_enabled="on" 30 | 31 | underline_char="─" 32 | 33 | separator=" ▐ " 34 | 35 | block_range=(0 15) 36 | 37 | color_blocks="on" 38 | 39 | block_width=3 40 | 41 | block_height=1 42 | 43 | bar_char_elapsed="-" 44 | 45 | bar_char_total="=" 46 | 47 | bar_border="on" 48 | 49 | bar_length=15 50 | 51 | # Progress bar colors 52 | # When set to distro, uses your distro"s logo colors. 53 | # 54 | # Default: "distro", "distro" 55 | # Values: "distro", "num" 56 | # Flag: --bar_colors 57 | # 58 | # Example: 59 | # neofetch --bar_colors 3 4 60 | # neofetch --bar_colors distro 5 61 | bar_color_elapsed="distro" 62 | bar_color_total="distro" 63 | 64 | 65 | # Info display 66 | # Display a bar with the info. 67 | # 68 | # Default: "off" 69 | # Values: "bar", "infobar", "barinfo", "off" 70 | # Flags: --cpu_display 71 | # --memory_display 72 | # --battery_display 73 | # --disk_display 74 | # 75 | # Example: 76 | # bar: "[---=======]" 77 | # infobar: "info [---=======]" 78 | # barinfo: "[---=======] info" 79 | # off: "info" 80 | cpu_display="off" 81 | memory_display="off" 82 | battery_display="off" 83 | disk_display="off" 84 | 85 | 86 | # Backend Settings 87 | 88 | # Image backend. 89 | # 90 | # Default: "ascii" 91 | # Values: "ascii", "caca", "chafa", "jp2a", "iterm2", "off", 92 | # "termpix", "pixterm", "tycat", "w3m", "kitty", "ueberzug" 93 | # Flag: --backend 94 | image_backend="kitty" 95 | 96 | # Image Source 97 | # 98 | # Which image or ascii file to display. 99 | # 100 | # Default: "auto" 101 | # Values: "auto", "ascii", "wallpaper", "/path/to/img", "/path/to/ascii", "/path/to/dir/" 102 | # "command output (neofetch --ascii "$(fortune | cowsay -W 30)")" 103 | # Flag: --source 104 | # 105 | # NOTE: "auto" will pick the best image source for whatever image backend is used. 106 | # In ascii mode, distro ascii art will be used and in an image mode, your 107 | # wallpaper will be used. 108 | # image_source="/home/barbarossa/.config/neofetch/dna_ascii" 109 | 110 | 111 | # Ascii Options 112 | 113 | # Ascii distro 114 | # Which distro"s ascii art to display. 115 | # 116 | # Default: "auto" 117 | # Values: "auto", "distro_name" 118 | # Flag: --ascii_distro 119 | # 120 | # NOTE: Arch and Ubuntu have "old" logo variants. 121 | # Change this to "arch_old" or "ubuntu_old" to use the old logos. 122 | # NOTE: Ubuntu has flavor variants. 123 | # Change this to "Lubuntu", "Xubuntu", "Ubuntu-GNOME" or "Ubuntu-Budgie" to use the flavors. 124 | # NOTE: Arch, Crux and Gentoo have a smaller logo variant. 125 | # Change this to "arch_small", "crux_small" or "gentoo_small" to use the small logos. 126 | printf "\n" 127 | ascii_distro="arch_small" 128 | 129 | # Ascii Colors 130 | # 131 | # Default: "distro" 132 | # Values: "distro", "num" "num" "num" "num" "num" "num" 133 | # Flag: --ascii_colors 134 | # 135 | # Example: 136 | # ascii_colors=(distro) - Ascii is colored based on Distro colors. 137 | # ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors. 138 | ascii_colors=(6 6 4 8 8 6) 139 | 140 | # Bold ascii logo 141 | # Whether or not to bold the ascii logo. 142 | # 143 | # Default: "on" 144 | # Values: "on", "off" 145 | # Flag: --ascii_bold 146 | ascii_bold="on" 147 | 148 | 149 | # Image Options 150 | 151 | # Image loop 152 | # Setting this to on will make neofetch redraw the image constantly until 153 | # Ctrl+C is pressed. This fixes display issues in some terminal emulators. 154 | # 155 | # Default: "off" 156 | # Values: "on", "off" 157 | # Flag: --loop 158 | image_loop="off" 159 | 160 | # Thumbnail directory 161 | # 162 | # Default: "~/.cache/thumbnails/neofetch" 163 | # Values: "dir" 164 | thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch" 165 | 166 | # Crop mode 167 | # 168 | # Default: "normal" 169 | # Values: "normal", "fit", "fill" 170 | # Flag: --crop_mode 171 | # 172 | # See this wiki page to learn about the fit and fill options. 173 | # https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F 174 | crop_mode="fill" 175 | 176 | # Crop offset 177 | # Note: Only affects "normal" crop mode. 178 | # 179 | # Default: "center" 180 | # Values: "northwest", "north", "northeast", "west", "center" 181 | # "east", "southwest", "south", "southeast" 182 | # Flag: --crop_offset 183 | crop_offset="center" 184 | 185 | # Image size 186 | # The image is half the terminal width by default. 187 | # 188 | # Default: "auto" 189 | # Values: "auto", "00px", "00%", "none" 190 | # Flags: --image_size 191 | # --size 192 | image_size="440px" 193 | 194 | # Gap between image and text 195 | gap=4 196 | 197 | # Image offsets 198 | # Only works with the w3m backend. 199 | yoffset=0 200 | xoffset=0 201 | 202 | # Image background color 203 | # Only works with the w3m backend. 204 | # 205 | # Default: " 206 | # Values: "color", "blue" 207 | # Flag: --bg_color 208 | background_color= 209 | 210 | 211 | # Misc Options 212 | 213 | # Stdout mode 214 | # Turn off all colors and disables image backend (ASCII/Image). 215 | # Useful for piping into another command. 216 | # Default: "off" 217 | # Values: "on", "off" 218 | stdout="off" 219 | -------------------------------------------------------------------------------- /neofetch/.config/neofetch/config.old.conf: -------------------------------------------------------------------------------- 1 | 2 | print_info() { 3 | info title 4 | info underline 5 | 6 | info "${c1} OS" os 7 | info "${c1} ├ " distro 8 | info "${c1} ├ " kernel 9 | info "${c1} ├󰏗 " packages 10 | info "${c1} └ " shell 11 | echo 12 | info "${c2} DE/WM" wm 13 | info "${c2} ├󰳫 " theme 14 | info "${c2} ├󰳫 " icons 15 | info "${c2} └ " term 16 | echo 17 | info "${c3} PC" model 18 | info "${c3} ├󰍛 " cpu 19 | info "${c3} ├󰍹 " gpu 20 | info "${c3} ├ " memory 21 | info "${c3} ├󰥔 " uptime 22 | info "${c3} └ " resolution 23 | 24 | info cols 25 | 26 | } 27 | 28 | ##--------- Title 29 | 30 | # Hide/Show Fully qualified domain name. 31 | # 32 | # Default: 'off' 33 | # Values: 'on', 'off' 34 | # Flag: --title_fqdn 35 | title_fqdn="off" 36 | 37 | 38 | ##--------- Kernel 39 | 40 | # Shorten the output of the kernel function. 41 | # 42 | # Default: 'on' 43 | # Values: 'on', 'off' 44 | # Flag: --kernel_shorthand 45 | # Supports: Everything except *BSDs (except PacBSD and PC-BSD) 46 | # 47 | # Example: 48 | # on: '4.8.9-1-ARCH' 49 | # off: 'Linux 4.8.9-1-ARCH' 50 | kernel_shorthand="on" 51 | 52 | 53 | ##--------- Distro 54 | 55 | # Shorten the output of the distro function 56 | # 57 | # Default: 'off' 58 | # Values: 'on', 'tiny', 'off' 59 | # Flag: --distro_shorthand 60 | # Supports: Everything except Windows and Haiku 61 | distro_shorthand="off" 62 | 63 | # Show/Hide OS Architecture. 64 | # Show 'x86_64', 'x86' and etc in 'Distro:' output. 65 | # 66 | # Default: 'on' 67 | # Values: 'on', 'off' 68 | # Flag: --os_arch 69 | # 70 | # Example: 71 | # on: 'Arch Linux x86_64' 72 | # off: 'Arch Linux' 73 | os_arch="on" 74 | 75 | 76 | ##--------- Uptime 77 | 78 | # Shorten the output of the uptime function 79 | # 80 | # Default: 'on' 81 | # Values: 'on', 'tiny', 'off' 82 | # Flag: --uptime_shorthand 83 | # 84 | # Example: 85 | # on: '2 days, 10 hours, 3 mins' 86 | # tiny: '2d 10h 3m' 87 | # off: '2 days, 10 hours, 3 minutes' 88 | uptime_shorthand="on" 89 | 90 | 91 | ##--------- Memory 92 | 93 | # Show memory pecentage in output. 94 | # 95 | # Default: 'off' 96 | # Values: 'on', 'off' 97 | # Flag: --memory_percent 98 | # 99 | # Example: 100 | # on: '1801MiB / 7881MiB (22%)' 101 | # off: '1801MiB / 7881MiB' 102 | memory_percent="on" 103 | 104 | # Change memory output unit. 105 | # 106 | # Default: 'mib' 107 | # Values: 'kib', 'mib', 'gib' 108 | # Flag: --memory_unit 109 | # 110 | # Example: 111 | # kib '1020928KiB / 7117824KiB' 112 | # mib '1042MiB / 6951MiB' 113 | # gib: ' 0.98GiB / 6.79GiB' 114 | memory_unit="mib" 115 | 116 | 117 | ##--------- Packages 118 | 119 | # Show/Hide Package Manager names. 120 | # 121 | # Default: 'tiny' 122 | # Values: 'on', 'tiny' 'off' 123 | # Flag: --package_managers 124 | # 125 | # Example: 126 | # on: '998 (pacman), 8 (flatpak), 4 (snap)' 127 | # tiny: '908 (pacman, flatpak, snap)' 128 | # off: '908' 129 | package_managers="on" 130 | 131 | 132 | ##--------- Shell 133 | 134 | # Show the path to $SHELL 135 | # 136 | # Default: 'off' 137 | # Values: 'on', 'off' 138 | # Flag: --shell_path 139 | # 140 | # Example: 141 | # on: '/bin/bash' 142 | # off: 'bash' 143 | shell_path="off" 144 | 145 | # Show $SHELL version 146 | # 147 | # Default: 'on' 148 | # Values: 'on', 'off' 149 | # Flag: --shell_version 150 | # 151 | # Example: 152 | # on: 'bash 4.4.5' 153 | # off: 'bash' 154 | shell_version="on" 155 | 156 | 157 | ##--------- CPU 158 | 159 | # CPU speed type 160 | # 161 | # Default: 'bios_limit' 162 | # Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'. 163 | # Flag: --speed_type 164 | # Supports: Linux with 'cpufreq' 165 | # NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value. 166 | speed_type="bios_limit" 167 | 168 | # CPU speed shorthand 169 | # 170 | # Default: 'off' 171 | # Values: 'on', 'off'. 172 | # Flag: --speed_shorthand 173 | # NOTE: This flag is not supported in systems with CPU speed less than 1 GHz 174 | # 175 | # Example: 176 | # on: 'i7-6500U (4) @ 3.1GHz' 177 | # off: 'i7-6500U (4) @ 3.100GHz' 178 | speed_shorthand="on" 179 | 180 | # Enable/Disable CPU brand in output. 181 | # 182 | # Default: 'on' 183 | # Values: 'on', 'off' 184 | # Flag: --cpu_brand 185 | # 186 | # Example: 187 | # on: 'Intel i7-6500U' 188 | # off: 'i7-6500U (4)' 189 | cpu_brand="on" 190 | 191 | # CPU Speed 192 | # Hide/Show CPU speed. 193 | # 194 | # Default: 'on' 195 | # Values: 'on', 'off' 196 | # Flag: --cpu_speed 197 | # 198 | # Example: 199 | # on: 'Intel i7-6500U (4) @ 3.1GHz' 200 | # off: 'Intel i7-6500U (4)' 201 | cpu_speed="on" 202 | 203 | # CPU Cores 204 | # Display CPU cores in output 205 | # 206 | # Default: 'logical' 207 | # Values: 'logical', 'physical', 'off' 208 | # Flag: --cpu_cores 209 | # Support: 'physical' doesn't work on BSD. 210 | # 211 | # Example: 212 | # logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores) 213 | # physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores) 214 | # off: 'Intel i7-6500U @ 3.1GHz' 215 | cpu_cores="logical" 216 | 217 | # CPU Temperature 218 | # Hide/Show CPU temperature. 219 | # Note the temperature is added to the regular CPU function. 220 | # 221 | # Default: 'off' 222 | # Values: 'C', 'F', 'off' 223 | # Flag: --cpu_temp 224 | # Supports: Linux, BSD 225 | # NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable 226 | # coretemp kernel module. This only supports newer Intel processors. 227 | # 228 | # Example: 229 | # C: 'Intel i7-6500U (4) @ 3.1GHz [27.2°C]' 230 | # F: 'Intel i7-6500U (4) @ 3.1GHz [82.0°F]' 231 | # off: 'Intel i7-6500U (4) @ 3.1GHz' 232 | cpu_temp="on" 233 | 234 | 235 | ##--------- GPU 236 | 237 | # Enable/Disable GPU Brand 238 | # 239 | # Default: 'on' 240 | # Values: 'on', 'off' 241 | # Flag: --gpu_brand 242 | # 243 | # Example: 244 | # on: 'AMD HD 7950' 245 | # off: 'HD 7950' 246 | gpu_brand="on" 247 | 248 | # Which GPU to display 249 | # 250 | # Default: 'all' 251 | # Values: 'all', 'dedicated', 'integrated' 252 | # Flag: --gpu_type 253 | # Supports: Linux 254 | # 255 | # Example: 256 | # all: 257 | # GPU1: AMD HD 7950 258 | # GPU2: Intel Integrated Graphics 259 | # 260 | # dedicated: 261 | # GPU1: AMD HD 7950 262 | # 263 | # integrated: 264 | # GPU1: Intel Integrated Graphics 265 | gpu_type="dedicated" 266 | 267 | 268 | ##--------- Resolution 269 | 270 | # Display refresh rate next to each monitor 271 | # Default: 'off' 272 | # Values: 'on', 'off' 273 | # Flag: --refresh_rate 274 | # Supports: Doesn't work on Windows. 275 | # 276 | # Example: 277 | # on: '1920x1080 @ 60Hz' 278 | # off: '1920x1080' 279 | refresh_rate="off" 280 | 281 | 282 | ##--------- Gtk Theme / Icons / Font 283 | 284 | # Shorten output of GTK Theme / Icons / Font 285 | # 286 | # Default: 'off' 287 | # Values: 'on', 'off' 288 | # Flag: --gtk_shorthand 289 | # 290 | # Example: 291 | # on: 'Numix, Adwaita' 292 | # off: 'Numix [GTK2], Adwaita [GTK3]' 293 | gtk_shorthand="off" 294 | 295 | # Enable/Disable gtk2 Theme / Icons / Font 296 | # 297 | # Default: 'on' 298 | # Values: 'on', 'off' 299 | # Flag: --gtk2 300 | # 301 | # Example: 302 | # on: 'Numix [GTK2], Adwaita [GTK3]' 303 | # off: 'Adwaita [GTK3]' 304 | gtk2="on" 305 | 306 | # Enable/Disable gtk3 Theme / Icons / Font 307 | # 308 | # Default: 'on' 309 | # Values: 'on', 'off' 310 | # Flag: --gtk3 311 | # 312 | # Example: 313 | # on: 'Numix [GTK2], Adwaita [GTK3]' 314 | # off: 'Numix [GTK2]' 315 | gtk3="on" 316 | 317 | 318 | ##--------- IP Address 319 | 320 | # Website to ping for the public IP 321 | # 322 | # Default: 'http://ident.me' 323 | # Values: 'url' 324 | # Flag: --ip_host 325 | public_ip_host="http://ident.me" 326 | 327 | # Public IP timeout. 328 | # 329 | # Default: '2' 330 | # Values: 'int' 331 | # Flag: --ip_timeout 332 | public_ip_timeout=2 333 | 334 | # Desktop Environment 335 | 336 | # Show Desktop Environment version 337 | # 338 | # Default: 'on' 339 | # Values: 'on', 'off' 340 | # Flag: --de_version 341 | de_version="on" 342 | 343 | 344 | ##--------- Disk 345 | 346 | # Which disks to display. 347 | # The values can be any /dev/sdXX, mount point or directory. 348 | # NOTE: By default we only show the disk info for '/'. 349 | # 350 | # Default: '/' 351 | # Values: '/', '/dev/sdXX', '/path/to/drive'. 352 | # Flag: --disk_show 353 | # 354 | # Example: 355 | # disk_show=('/' '/dev/sdb1'): 356 | # 'Disk (/): 74G / 118G (66%)' 357 | # 'Disk (/mnt/Videos): 823G / 893G (93%)' 358 | # 359 | # disk_show=('/'): 360 | # 'Disk (/): 74G / 118G (66%)' 361 | # 362 | disk_show=('/') 363 | 364 | # Disk subtitle. 365 | # What to append to the Disk subtitle. 366 | # 367 | # Default: 'mount' 368 | # Values: 'mount', 'name', 'dir', 'none' 369 | # Flag: --disk_subtitle 370 | # 371 | # Example: 372 | # name: 'Disk (/dev/sda1): 74G / 118G (66%)' 373 | # 'Disk (/dev/sdb2): 74G / 118G (66%)' 374 | # 375 | # mount: 'Disk (/): 74G / 118G (66%)' 376 | # 'Disk (/mnt/Local Disk): 74G / 118G (66%)' 377 | # 'Disk (/mnt/Videos): 74G / 118G (66%)' 378 | # 379 | # dir: 'Disk (/): 74G / 118G (66%)' 380 | # 'Disk (Local Disk): 74G / 118G (66%)' 381 | # 'Disk (Videos): 74G / 118G (66%)' 382 | # 383 | # none: 'Disk: 74G / 118G (66%)' 384 | # 'Disk: 74G / 118G (66%)' 385 | # 'Disk: 74G / 118G (66%)' 386 | disk_subtitle="mount" 387 | 388 | # Disk percent. 389 | # Show/Hide disk percent. 390 | # 391 | # Default: 'on' 392 | # Values: 'on', 'off' 393 | # Flag: --disk_percent 394 | # 395 | # Example: 396 | # on: 'Disk (/): 74G / 118G (66%)' 397 | # off: 'Disk (/): 74G / 118G' 398 | disk_percent="on" 399 | 400 | 401 | ##--------- Song 402 | 403 | # Manually specify a music player. 404 | # 405 | # Default: 'auto' 406 | # Values: 'auto', 'player-name' 407 | # Flag: --music_player 408 | # 409 | # Available values for 'player-name': 410 | # 411 | # amarok 412 | # audacious 413 | # banshee 414 | # bluemindo 415 | # clementine 416 | # cmus 417 | # deadbeef 418 | # deepin-music 419 | # dragon 420 | # elisa 421 | # exaile 422 | # gnome-music 423 | # gmusicbrowser 424 | # gogglesmm 425 | # guayadeque 426 | # io.elementary.music 427 | # iTunes 428 | # juk 429 | # lollypop 430 | # mocp 431 | # mopidy 432 | # mpd 433 | # muine 434 | # netease-cloud-music 435 | # olivia 436 | # playerctl 437 | # pogo 438 | # pragha 439 | # qmmp 440 | # quodlibet 441 | # rhythmbox 442 | # sayonara 443 | # smplayer 444 | # spotify 445 | # strawberry 446 | # tauonmb 447 | # tomahawk 448 | # vlc 449 | # xmms2d 450 | # xnoise 451 | # yarock 452 | music_player="auto" 453 | 454 | # Format to display song information. 455 | # 456 | # Default: '%artist% - %album% - %title%' 457 | # Values: '%artist%', '%album%', '%title%' 458 | # Flag: --song_format 459 | # 460 | # Example: 461 | # default: 'Song: Jet - Get Born - Sgt Major' 462 | song_format="%artist% - %album% - %title%" 463 | 464 | # Print the Artist, Album and Title on separate lines 465 | # 466 | # Default: 'off' 467 | # Values: 'on', 'off' 468 | # Flag: --song_shorthand 469 | # 470 | # Example: 471 | # on: 'Artist: The Fratellis' 472 | # 'Album: Costello Music' 473 | # 'Song: Chelsea Dagger' 474 | # 475 | # off: 'Song: The Fratellis - Costello Music - Chelsea Dagger' 476 | song_shorthand="off" 477 | 478 | # 'mpc' arguments (specify a host, password etc). 479 | # 480 | # Default: '' 481 | # Example: mpc_args=(-h HOST -P PASSWORD) 482 | mpc_args=() 483 | 484 | 485 | ##--------- Text Colors 486 | 487 | # Text Colors 488 | # 489 | # Default: 'distro' 490 | # Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' 491 | # Flag: --colors 492 | # 493 | # Each number represents a different part of the text in 494 | # this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info' 495 | # 496 | # Example: 497 | # colors=(distro) - Text is colored based on Distro colors. 498 | # colors=(4 6 1 8 8 6) - Text is colored in the order above. 499 | colors=(distro) 500 | 501 | 502 | ##--------- Text Options 503 | 504 | # Toggle bold text 505 | # 506 | # Default: 'on' 507 | # Values: 'on', 'off' 508 | # Flag: --bold 509 | bold="on" 510 | 511 | # Enable/Disable Underline 512 | # 513 | # Default: 'on' 514 | # Values: 'on', 'off' 515 | # Flag: --underline 516 | underline_enabled="on" 517 | 518 | # Underline character 519 | # 520 | # Default: '-' 521 | # Values: 'string' 522 | # Flag: --underline_char 523 | underline_char="󰍴" 524 | 525 | # Info Separator 526 | # Replace the default separator with the specified string. 527 | # 528 | # Default: ':' 529 | # Flag: --separator 530 | # 531 | # Example: 532 | # separator="->": 'Shell-> bash' 533 | # separator=" =": 'WM = dwm' 534 | separator="->" 535 | 536 | 537 | ##--------- Color Blocks 538 | 539 | # Color block range 540 | # The range of colors to print. 541 | # 542 | # Default: '0', '15' 543 | # Values: 'num' 544 | # Flag: --block_range 545 | # 546 | # Example: 547 | # 548 | # Display colors 0-7 in the blocks. (8 colors) 549 | # neofetch --block_range 0 7 550 | # 551 | # Display colors 0-15 in the blocks. (16 colors) 552 | # neofetch --block_range 0 15 553 | block_range=(0 15) 554 | 555 | # Toggle color blocks 556 | # 557 | # Default: 'on' 558 | # Values: 'on', 'off' 559 | # Flag: --color_blocks 560 | color_blocks="on" 561 | 562 | # Color block width in spaces 563 | # 564 | # Default: '3' 565 | # Values: 'num' 566 | # Flag: --block_width 567 | block_width=3 568 | 569 | # Color block height in lines 570 | # 571 | # Default: '1' 572 | # Values: 'num' 573 | # Flag: --block_height 574 | block_height=1 575 | 576 | # Color Alignment 577 | # 578 | # Default: 'auto' 579 | # Values: 'auto', 'num' 580 | # Flag: --col_offset 581 | # 582 | # Number specifies how far from the left side of the terminal (in spaces) to 583 | # begin printing the columns, in case you want to e.g. center them under your 584 | # text. 585 | # Example: 586 | # col_offset="auto" - Default behavior of neofetch 587 | # col_offset=7 - Leave 7 spaces then print the colors 588 | col_offset="auto" 589 | 590 | ##--------- Progress Bars 591 | 592 | # Bar characters 593 | # 594 | # Default: '-', '=' 595 | # Values: 'string', 'string' 596 | # Flag: --bar_char 597 | # 598 | # Example: 599 | # neofetch --bar_char 'elapsed' 'total' 600 | # neofetch --bar_char '-' '=' 601 | bar_char_elapsed="-" 602 | bar_char_total="=" 603 | 604 | # Toggle Bar border 605 | # 606 | # Default: 'on' 607 | # Values: 'on', 'off' 608 | # Flag: --bar_border 609 | bar_border="on" 610 | 611 | # Progress bar length in spaces 612 | # Number of chars long to make the progress bars. 613 | # 614 | # Default: '15' 615 | # Values: 'num' 616 | # Flag: --bar_length 617 | bar_length=15 618 | 619 | # Progress bar colors 620 | # When set to distro, uses your distro's logo colors. 621 | # 622 | # Default: 'distro', 'distro' 623 | # Values: 'distro', 'num' 624 | # Flag: --bar_colors 625 | # 626 | # Example: 627 | # neofetch --bar_colors 3 4 628 | # neofetch --bar_colors distro 5 629 | bar_color_elapsed="distro" 630 | bar_color_total="distro" 631 | 632 | # Info display 633 | # Display a bar with the info. 634 | # 635 | # Default: 'off' 636 | # Values: 'bar', 'infobar', 'barinfo', 'off' 637 | # Flags: --cpu_display 638 | # --memory_display 639 | # --battery_display 640 | # --disk_display 641 | # 642 | # Example: 643 | # bar: '[---=======]' 644 | # infobar: 'info [---=======]' 645 | # barinfo: '[---=======] info' 646 | # off: 'info' 647 | cpu_display="on" 648 | memory_display="on" 649 | battery_display="on" 650 | disk_display="off" 651 | 652 | 653 | ##--------- Backend Settings 654 | 655 | # Image backend. 656 | # 657 | # Default: 'ascii' 658 | # Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off', 659 | # 'pot', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' 660 | # Flag: --backend 661 | image_backend="ascii" 662 | 663 | # Image Source 664 | # 665 | # Which image or ascii file to display. 666 | # 667 | # Default: 'auto' 668 | # Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/' 669 | # 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")' 670 | # Flag: --source 671 | # 672 | # NOTE: 'auto' will pick the best image source for whatever image backend is used. 673 | # In ascii mode, distro ascii art will be used and in an image mode, your 674 | # wallpaper will be used. 675 | image_source="auto" 676 | 677 | 678 | ##--------- Ascii Options 679 | 680 | # Ascii distro 681 | # Which distro's ascii art to display. 682 | # 683 | # Default: 'auto' 684 | # Values: 'auto', 'distro_name' 685 | # Flag: --ascii_distro 686 | # NOTE: AIX, Alpine, Anarchy, Android, Antergos, antiX, "AOSC OS", 687 | # "AOSC OS/Retro", Apricity, ArcoLinux, ArchBox, ARCHlabs, 688 | # ArchStrike, XFerience, ArchMerge, Arch, Artix, Arya, Bedrock, 689 | # Bitrig, BlackArch, BLAG, BlankOn, BlueLight, bonsai, BSD, 690 | # BunsenLabs, Calculate, Carbs, CentOS, Chakra, ChaletOS, 691 | # Chapeau, Chrom*, Cleanjaro, ClearOS, Clear_Linux, Clover, 692 | # Condres, Container_Linux, CRUX, Cucumber, Debian, Deepin, 693 | # DesaOS, Devuan, DracOS, DarkOs, DragonFly, Drauger, Elementary, 694 | # EndeavourOS, Endless, EuroLinux, Exherbo, Fedora, Feren, FreeBSD, 695 | # FreeMiNT, Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, Pentoo, 696 | # gNewSense, GNOME, GNU, GoboLinux, Grombyang, Guix, Haiku, Huayra, 697 | # Hyperbola, janus, Kali, KaOS, KDE_neon, Kibojoe, Kogaion, 698 | # Korora, KSLinux, Kubuntu, LEDE, LFS, Linux_Lite, 699 | # LMDE, Lubuntu, Lunar, macos, Mageia, MagpieOS, Mandriva, 700 | # Manjaro, Maui, Mer, Minix, LinuxMint, MX_Linux, Namib, 701 | # Neptune, NetBSD, Netrunner, Nitrux, NixOS, Nurunner, 702 | # NuTyX, OBRevenge, OpenBSD, openEuler, OpenIndiana, openmamba, 703 | # OpenMandriva, OpenStage, OpenWrt, osmc, Oracle, OS Elbrus, PacBSD, 704 | # Parabola, Pardus, Parrot, Parsix, TrueOS, PCLinuxOS, Peppermint, 705 | # popos, Porteus, PostMarketOS, Proxmox, Puppy, PureOS, Qubes, Radix, 706 | # Raspbian, Reborn_OS, Redstar, Redcore, Redhat, Refracted_Devuan, 707 | # Regata, Rosa, sabotage, Sabayon, Sailfish, SalentOS, Scientific, 708 | # Septor, SereneLinux, SharkLinux, Siduction, Slackware, SliTaz, 709 | # SmartOS, Solus, Source_Mage, Sparky, Star, SteamOS, SunOS, 710 | # openSUSE_Leap, openSUSE_Tumbleweed, openSUSE, SwagArch, Tails, 711 | # Trisquel, Ubuntu-Budgie, Ubuntu-GNOME, Ubuntu-MATE, Ubuntu-Studio, 712 | # Ubuntu, Venom, Void, Obarun, windows10, Windows7, Xubuntu, Zorin, 713 | # and IRIX have ascii logos 714 | # NOTE: Arch, Ubuntu, Redhat, and Dragonfly have 'old' logo variants. 715 | # Use '{distro name}_old' to use the old logos. 716 | # NOTE: Ubuntu has flavor variants. 717 | # Change this to Lubuntu, Kubuntu, Xubuntu, Ubuntu-GNOME, 718 | # Ubuntu-Studio, Ubuntu-Mate or Ubuntu-Budgie to use the flavors. 719 | # NOTE: Arcolinux, Dragonfly, Fedora, Alpine, Arch, Ubuntu, 720 | # CRUX, Debian, Gentoo, FreeBSD, Mac, NixOS, OpenBSD, android, 721 | # Antrix, CentOS, Cleanjaro, ElementaryOS, GUIX, Hyperbola, 722 | # Manjaro, MXLinux, NetBSD, Parabola, POP_OS, PureOS, 723 | # Slackware, SunOS, LinuxLite, OpenSUSE, Raspbian, 724 | # postmarketOS, and Void have a smaller logo variant. 725 | # Use '{distro name}_small' to use the small variants. 726 | ascii_distro="arch" 727 | 728 | # Ascii Colors 729 | # 730 | # Default: 'distro' 731 | # Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' 732 | # Flag: --ascii_colors 733 | # 734 | # Example: 735 | # ascii_colors=(distro) - Ascii is colored based on Distro colors. 736 | # ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors. 737 | ascii_colors=(1 2 3 4 5 6 7 8) 738 | 739 | # Bold ascii logo 740 | # Whether or not to bold the ascii logo. 741 | # 742 | # Default: 'on' 743 | # Values: 'on', 'off' 744 | # Flag: --ascii_bold 745 | ascii_bold="on" 746 | 747 | 748 | ##--------- Image Options 749 | 750 | # Image loop 751 | # Setting this to on will make neofetch redraw the image constantly until 752 | # Ctrl+C is pressed. This fixes display issues in some terminal emulators. 753 | # 754 | # Default: 'off' 755 | # Values: 'on', 'off' 756 | # Flag: --loop 757 | image_loop="off" 758 | 759 | # Thumbnail directory 760 | # 761 | # Default: '~/.cache/thumbnails/neofetch' 762 | # Values: 'dir' 763 | thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch" 764 | 765 | # Crop mode 766 | # 767 | # Default: 'normal' 768 | # Values: 'normal', 'fit', 'fill' 769 | # Flag: --crop_mode 770 | # 771 | # See this wiki page to learn about the fit and fill options. 772 | # https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F 773 | crop_mode="normal" 774 | 775 | # Crop offset 776 | # Note: Only affects 'normal' crop mode. 777 | # 778 | # Default: 'center' 779 | # Values: 'northwest', 'north', 'northeast', 'west', 'center' 780 | # 'east', 'southwest', 'south', 'southeast' 781 | # Flag: --crop_offset 782 | crop_offset="center" 783 | 784 | # Image size 785 | # The image is half the terminal width by default. 786 | # 787 | # Default: 'auto' 788 | # Values: 'auto', '00px', '00%', 'none' 789 | # Flags: --image_size 790 | # --size 791 | image_size="auto" 792 | 793 | # Gap between image and text 794 | # 795 | # Default: '3' 796 | # Values: 'num', '-num' 797 | # Flag: --gap 798 | gap=2 799 | 800 | # Image offsets 801 | # Only works with the w3m backend. 802 | # 803 | # Default: '0' 804 | # Values: 'px' 805 | # Flags: --xoffset 806 | # --yoffset 807 | yoffset=0 808 | xoffset=0 809 | 810 | # Image background color 811 | # Only works with the w3m backend. 812 | # 813 | # Default: '' 814 | # Values: 'color', 'blue' 815 | # Flag: --bg_color 816 | background_color= 817 | 818 | 819 | ##--------- Misc Options 820 | 821 | # Stdout mode 822 | # Turn off all colors and disables image backend (ASCII/Image). 823 | # Useful for piping into another command. 824 | # Default: 'off' 825 | # Values: 'on', 'off' 826 | stdout="off" 827 | -------------------------------------------------------------------------------- /nix/.config/nix/nix.conf: -------------------------------------------------------------------------------- 1 | experimental-features = nix-command flakes 2 | -------------------------------------------------------------------------------- /picom/.config/picom/picom.conf: -------------------------------------------------------------------------------- 1 | ################################# 2 | # 3 | # Backend 4 | # 5 | ################################# 6 | 7 | # Backend to use: "xrender" or "glx". 8 | # GLX backend is typically much faster but depends on a sane driver. 9 | # backend = "xrender"; 10 | backend = "glx"; 11 | # backend = "xrender" 12 | 13 | ################################# 14 | # 15 | # GLX backend 16 | # 17 | ################################# 18 | 19 | glx-no-stencil = false; 20 | 21 | # GLX backend: Copy unmodified regions from front buffer instead of redrawing them all. 22 | # My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified, 23 | # but a 20% increase when only 1/4 is. 24 | # My tests on nouveau show terrible slowdown. 25 | glx-copy-from-front = false; 26 | 27 | # GLX backend: Use MESA_copy_sub_buffer to do partial screen update. 28 | # My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated. 29 | # May break VSync and is not available on some drivers. 30 | # Overrides --glx-copy-from-front. 31 | # glx-use-copysubbuffermesa = true; 32 | 33 | # GLX backend: Avoid rebinding pixmap on window damage. 34 | # Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe). 35 | # Recommended if it works. 36 | # glx-no-rebind-pixmap = true; 37 | 38 | # GLX backend: GLX buffer swap method we assume. 39 | # Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1). 40 | # undefined is the slowest and the safest, and the default value. 41 | # copy is fastest, but may fail on some drivers, 42 | # 2-6 are gradually slower but safer (6 is still faster than 0). 43 | # Usually, double buffer means 2, triple buffer means 3. 44 | # buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers. 45 | # Useless with --glx-use-copysubbuffermesa. 46 | # Partially breaks --resize-damage. 47 | # Defaults to undefined. 48 | #glx-swap-method = "undefined"; 49 | 50 | ################################# 51 | # 52 | # Shadows 53 | # 54 | ################################# 55 | # shadow = true; 56 | # no-dnd-shadow = true; 57 | # no-dock-shadow = true; 58 | # clear-shadow = true; 59 | # shadow-radius = 10; 60 | # shadow-offset-x = 0; 61 | # shadow-offset-y = 0; 62 | 63 | log-level = "warn"; 64 | #change your username here 65 | #log-file = "/home/erik/.config/compton.log"; 66 | 67 | # The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches 68 | # (most applications are fine, only apps that do weird things with xshapes or argb are affected). 69 | # This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher. 70 | shadow-exclude = [ 71 | "! name~=''", 72 | "name = 'Notification'", 73 | "name = 'Plank'", 74 | "name = 'Docky'", 75 | "name = 'Kupfer'", 76 | "name = 'xfce4-notifyd'", 77 | "name *= 'VLC'", 78 | "name *= 'compton'", 79 | # "name *= 'Chromium'", 80 | # "name *= 'Chrome'", 81 | # "class_g = 'Firefox' && argb", 82 | "class_g = 'Conky'", 83 | "class_g = 'Kupfer'", 84 | "class_g = 'Synapse'", 85 | "class_g ?= 'Notify-osd'", 86 | "class_g ?= 'Cairo-dock'", 87 | "class_g = 'Cairo-clock'", 88 | "class_g ?= 'Xfce4-notifyd'", 89 | "class_g ?= 'Xfce4-power-manager'", 90 | # "_GTK_FRAME_EXTENTS@:c", 91 | # "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'" 92 | ]; 93 | # Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners) 94 | shadow-ignore-shaped = false; 95 | 96 | ################################# 97 | # 98 | # Opacity 99 | # 100 | ################################# 101 | 102 | # inactive-opacity = 1; 103 | # active-opacity = 1; 104 | # frame-opacity = 1; 105 | # inactive-opacity-override = false; 106 | 107 | # Dim inactive windows. (0.0 - 1.0) 108 | # inactive-dim = 0.2; 109 | # Do not let dimness adjust based on window opacity. 110 | # inactive-dim-fixed = true; 111 | # Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred. 112 | corner-radius = 0; 113 | # blur-background = true; 114 | # # blur 115 | blur: { 116 | method = "dual_kawase"; 117 | strength = 4; 118 | background = true; 119 | background-frame = true; 120 | background-fixed = false; 121 | } 122 | # blur: 123 | # { 124 | # method = "kawase"; 125 | # strength = 100; 126 | # background = true; 127 | # background-frame = true; 128 | # background-fixed = true; 129 | # } 130 | # Blur background of opaque windows with transparent frames as well. 131 | # blur-background-frame = true; 132 | # Do not let blur radius adjust based on window opacity. 133 | # blur-background-fixed = true; 134 | blur-background-exclude = [ 135 | # "window_type = 'dock'", 136 | "window_type = 'desktop'", 137 | "_GTK_FRAME_EXTENTS@:c" 138 | ]; 139 | 140 | ################################# 141 | # 142 | # Fading 143 | # 144 | ################################# 145 | 146 | # Fade windows during opacity changes. 147 | fading = true; 148 | # The time between steps in a fade in milliseconds. (default 10). 149 | fade-delta = 3; 150 | # Opacity change between steps while fading in. (default 0.028). 151 | fade-in-step = 0.03; 152 | # Opacity change between steps while fading out. (default 0.03). 153 | fade-out-step = 0.03; 154 | # Fade windows in/out when opening/closing 155 | # no-fading-openclose = true; 156 | 157 | # Specify a list of conditions of windows that should not be faded. 158 | fade-exclude = [ ]; 159 | 160 | ################################# 161 | # 162 | # Other 163 | # 164 | ################################# 165 | 166 | # Try to detect WM windows and mark them as active. 167 | mark-wmwin-focused = true; 168 | # Mark all non-WM but override-redirect windows active (e.g. menus). 169 | mark-ovredir-focused = true; 170 | # Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events. 171 | # Usually more reliable but depends on a EWMH-compliant WM. 172 | use-ewmh-active-win = true; 173 | # Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on. 174 | detect-rounded-corners = true; 175 | 176 | # Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of client windows to frame windows. 177 | # This prevents opacity being ignored for some apps. 178 | # For example without this enabled my xfce4-notifyd is 100% opacity no matter what. 179 | detect-client-opacity = true; 180 | 181 | # Specify refresh rate of the screen. 182 | # If not specified or 0, compton will try detecting this with X RandR extension. 183 | #refresh-rate = 0; 184 | 185 | # Vertical synchronization: match the refresh rate of the monitor 186 | # this breaks transparency in virtualbox - put a "#" before next line to fix that 187 | vsync = true; 188 | 189 | # Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing. 190 | # Reported to have no effect, though. 191 | dbe = false; 192 | 193 | # Limit compton to repaint at most once every 1 / refresh_rate second to boost performance. 194 | # This should not be used with --vsync drm/opengl/opengl-oml as they essentially does --sw-opti's job already, 195 | # unless you wish to specify a lower refresh rate than the actual value. 196 | #sw-opti = true; 197 | 198 | # Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games. 199 | # Known to cause flickering when redirecting/unredirecting windows. 200 | unredir-if-possible = false; 201 | 202 | # Specify a list of conditions of windows that should always be considered focused. 203 | focus-exclude = [ ]; 204 | 205 | # Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time. 206 | detect-transient = true; 207 | # Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time. 208 | # WM_TRANSIENT_FOR has higher priority if --detect-transient is enabled, too. 209 | detect-client-leader = true; 210 | 211 | ################################# 212 | # 213 | # Window type settings 214 | # 215 | ################################# 216 | 217 | wintypes: 218 | { 219 | tooltip = { fade = true; shadow = true; opacity = 0.9; focus = true;}; 220 | dock = { shadow = false; blur-background = true; }; 221 | dnd = { shadow = false; } 222 | popup_menu = { opacity = 0.9; } 223 | dropdown_menu = { opacity = 0.9; } 224 | }; 225 | 226 | rounded-corners-exclude = [ 227 | "class_g = 'dwm'", 228 | "class_g = 'dwmsystray'", 229 | "window_type = 'dock'" 230 | ]; 231 | 232 | ###################### 233 | # 234 | # XSync 235 | # See: https://github.com/yshui/compton/commit/b18d46bcbdc35a3b5620d817dd46fbc76485c20d 236 | # 237 | ###################### 238 | 239 | # Use X Sync fence to sync clients' draw calls. Needed on nvidia-drivers with GLX backend for some users. 240 | xrender-sync-fence = false; 241 | 242 | opacity-rule = [ 243 | #"55:class_g = 'alacitty' && focused", 244 | #"30:class_g = 'alacitty' && !focused" 245 | # "100:name *?= 'zsh' && focused", 246 | "100:name *?= 'nvim'", 247 | "100:name *?= 'vim'", 248 | "100:name *?= 'vi'", 249 | "100:name *?= 'nano'", 250 | "90:class_g = 'kitty'", 251 | "50:class_g = 'xterm'", 252 | # "95:class_g= 'discord'" 253 | ]; 254 | -------------------------------------------------------------------------------- /presenterm/.config/presenterm/config.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # yaml-language-server: $schema=https://raw.githubusercontent.com/mfontanini/presenterm/master/config-file-schema.json 3 | defaults: 4 | # override the terminal font size when in windows or when using sixel. 5 | terminal_font_size: 16 6 | 7 | # the theme to use by default in every presentation unless overridden. 8 | theme: dark 9 | 10 | # the image protocol to use. 11 | image_protocol: kitty-local 12 | 13 | options: 14 | # whether slides are automatically terminated when a slide title is found. 15 | implicit_slide_ends: false 16 | 17 | # the prefix to use for commands. 18 | command_prefix: "" 19 | 20 | # show all lists incrementally, by implicitly adding pauses in between elements. 21 | incremental_lists: false 22 | 23 | # this option tells presenterm you don't care about extra parameters in 24 | # presentation's front matter. This can be useful if you're trying to load a 25 | # presentation made for another tool 26 | strict_front_matter_parsing: true 27 | 28 | # whether to treat a thematic break as a slide end. 29 | end_slide_shorthand: false 30 | snippet: 31 | exec: 32 | enable: true 33 | render: 34 | threads: 2 35 | -------------------------------------------------------------------------------- /rofi/.config/rofi/config.rasi: -------------------------------------------------------------------------------- 1 | configuration { 2 | modes: "window,run,ssh,drun"; 3 | sorting-method: "normal"; 4 | show-icons:true; 5 | matching: "regex"; 6 | drun-match-fields: "name"; 7 | display-run: "Menu:"; 8 | display-ssh: "SSH:"; 9 | display-drun: "Apps:"; 10 | display-window: "Windows:"; 11 | } 12 | 13 | @theme "tokyo" 14 | 15 | * { 16 | font: "Iosevka Nerd Font 12"; 17 | 18 | background-color: transparent; 19 | text-color: @fg0; 20 | 21 | margin: 0px; 22 | padding: 0px; 23 | spacing: 0px; 24 | } 25 | 26 | window { 27 | location: center; 28 | width: 480; 29 | y-offset: -20; 30 | border-radius: 24px; 31 | 32 | border: 1px; 33 | border-color: @bg3; 34 | background-color: @bg0; 35 | } 36 | 37 | mainbox { 38 | padding: 12px; 39 | } 40 | 41 | inputbar { 42 | background-color: @bg1; 43 | border-color: @bg3; 44 | border-radius: 16px; 45 | border: 2px; 46 | 47 | padding: 8px 16px; 48 | spacing: 8px; 49 | children: [ prompt, entry ]; 50 | } 51 | 52 | prompt { 53 | text-color: @blue; 54 | } 55 | 56 | entry { 57 | placeholder: "Search"; 58 | placeholder-color: @cyan; 59 | } 60 | 61 | message { 62 | margin: 12px 0 0; 63 | border-radius: 16px; 64 | border-color: @bg2; 65 | background-color: @bg2; 66 | } 67 | 68 | textbox { 69 | padding: 8px 24px; 70 | background-color: @bg2; 71 | } 72 | 73 | listview { 74 | background-color: transparent; 75 | margin: 12px 0 0; 76 | columns: 1; 77 | lines: 2; 78 | 79 | fixed-height: false; 80 | } 81 | 82 | element { 83 | padding: 8px 16px; 84 | spacing: 8px; 85 | border-radius: 16px; 86 | } 87 | 88 | element normal urgent { 89 | text-color: @urgent; 90 | } 91 | 92 | element normal active { 93 | text-color: @accent; 94 | } 95 | 96 | element selected normal, element selected active { 97 | background-color: @bg2; 98 | } 99 | 100 | element-icon { 101 | size: 1em; 102 | vertical-align: 0.5; 103 | } 104 | 105 | element-text { 106 | text-color: inherit; 107 | } 108 | -------------------------------------------------------------------------------- /rofi/.config/rofi/tokyo.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | bg0 : #1a1b26; 3 | bg1 : #1f2335; 4 | bg2 : #24283b; 5 | bg3 : #414868; 6 | fg0 : #c0caf5; 7 | fg1 : #a9b1d6; 8 | fg2 : #737aa2; 9 | red : #f7768e; 10 | green : #9ece6a; 11 | yellow : #e0af68; 12 | blue : #7aa2f7; 13 | magenta : #9a7ecc; 14 | cyan : #4abaaf; 15 | 16 | accent: @red; 17 | urgent: @yellow; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /scripts/.local/scripts/abs-usae: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ -z "$1" ]; then 4 | echo "Usage: $0 " 5 | exit 1 6 | fi 7 | 8 | CONTAINER_ID=$1 9 | 10 | TOTAL_CPUS=$(nproc) 11 | 12 | CPU_USAGE=$(docker stats --no-stream --format "{{.CPUPerc}}" $CONTAINER_ID | tr -d '%') 13 | 14 | ABSOLUTE_CPU_USAGE=$(echo "$CPU_USAGE * $TOTAL_CPUS / 100" | bc -l) 15 | 16 | echo "Usage: $ABSOLUTE_CPU_USAGE%" 17 | -------------------------------------------------------------------------------- /scripts/.local/scripts/absolute-usae: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ -z "$1" ]; then 4 | echo "Usage: $0 " 5 | exit 1 6 | fi 7 | 8 | CONTAINER_ID=$1 9 | 10 | CPU_PERCENT=$(docker stats $CONTAINER_ID --no-stream --format "{{.CPUPerc}}" | tr -d '%') 11 | 12 | echo "CPU_PERCENT: $CPU_PERCENT" 13 | 14 | if [ -z "$CPU_PERCENT" ]; then 15 | echo "Could not retrieve CPU usage for container $CONTAINER_ID" 16 | exit 1 17 | fi 18 | 19 | TOTAL_CORES=$(nproc) 20 | 21 | echo "TOTAL_CORES: $TOTAL_CORES" 22 | 23 | TOTAL_CAPACITY=$(echo "$TOTAL_CORES * 100" | bc) 24 | 25 | echo "TOTAL_CAPACITY: $TOTAL_CAPACITY" 26 | 27 | ABSOLUTE_CPU_USAGE=$(echo "scale=2; $CPU_PERCENT / 100 * $TOTAL_CAPACITY" | bc) 28 | 29 | echo "Absolute CPU usage of container $CONTAINER_ID: $ABSOLUTE_CPU_USAGE CPU units" 30 | -------------------------------------------------------------------------------- /scripts/.local/scripts/base64url: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | encode() { 4 | local input="$1" 5 | if [ -z "$input" ]; then 6 | input=$(cat) 7 | fi 8 | echo -n "$input" | base64 -w0 | tr '+/' '-_' | tr -d '=' 9 | } 10 | 11 | decode() { 12 | local input="$1" 13 | if [ -z "$input" ]; then 14 | input=$(cat) 15 | fi 16 | local len=$(( ${#input} % 4 )) 17 | if [ $len -eq 2 ]; then input="${input}==" 18 | elif [ $len -eq 3 ]; then input="${input}=" 19 | fi 20 | echo -n "$input" | tr '_-' '/+' | base64 -d 21 | } 22 | 23 | if [ "$1" == "-d" ] || [ "$1" == "--decode" ]; then 24 | if [ -n "$2" ]; then 25 | decode "$2" 26 | else 27 | decode 28 | fi 29 | else 30 | if [ -n "$1" ]; then 31 | encode "$1" 32 | else 33 | encode 34 | fi 35 | fi 36 | -------------------------------------------------------------------------------- /scripts/.local/scripts/battery-status: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | remaining=`acpi -b | tail -1 | cut -d, -f2 | tr -d '[:space:]%'` 4 | status=`acpi -b | tail -1 | awk -F"[, ]" '{printf $3}'` 5 | 6 | if [ $status = "Discharging" ]; then 7 | icon="󰂁" 8 | else 9 | icon="" 10 | fi 11 | 12 | echo $icon $remaining% 13 | -------------------------------------------------------------------------------- /scripts/.local/scripts/blocgen: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | has_command=false 4 | 5 | to_pascal_case() { 6 | input="$1" 7 | output="$(echo $input | sed -E 's/(^|_)([a-z])/\U\2/g')" 8 | echo "$output" 9 | } 10 | 11 | while getopts ":c:b:h" opt; do 12 | case $opt in 13 | c) 14 | # Code to run if -c flag is provided 15 | topascal=$(to_pascal_case "$OPTARG") 16 | mkdir ${OPTARG}_cubit 17 | cd ${OPTARG}_cubit 18 | 19 | touch "${OPTARG}_cubit.dart" 20 | echo "import 'package:flutter_bloc/flutter_bloc.dart'; 21 | import 'package:equatable/equatable.dart'; 22 | 23 | part '${OPTARG}_state.dart'; 24 | 25 | class ${topascal}Cubit extends Cubit<${topascal}State> { 26 | ${topascal}Cubit() : super(${topascal}State.initial()); 27 | }" > "${OPTARG}_cubit.dart" 28 | 29 | touch "${OPTARG}_state.dart" 30 | echo "part of '${OPTARG}_cubit.dart'; 31 | 32 | class ${topascal}State extends Equatable {}" > "${OPTARG}_state.dart" 33 | 34 | has_command=true 35 | 36 | echo "Cubit created successfully: ${OPTARG}_cubit" 37 | ;; 38 | b) 39 | # Code to run if -b flag is provided 40 | topascal=$(to_pascal_case "$OPTARG") 41 | mkdir ${OPTARG}_bloc 42 | cd ${OPTARG}_bloc 43 | 44 | # First file 45 | touch "${OPTARG}_bloc.dart" 46 | echo " import 'package:flutter_bloc/flutter_bloc.dart'; 47 | import 'package:equatable/equatable.dart'; 48 | 49 | part '${OPTARG}_event.dart'; 50 | part '${OPTARG}_state.dart'; 51 | 52 | class ${topascal}Bloc extends Bloc<${topascal}Event, ${topascal}State> { 53 | ${topascal}Bloc() : super(${topascal}State.initial()) { 54 | on<${topascal}Event>((event, emit) { 55 | // TODO: implement event handler 56 | }); 57 | } 58 | }" > "${OPTARG}_bloc.dart" 59 | 60 | # Second file 61 | touch "${OPTARG}_event.dart" 62 | echo "part of 'counter_bloc.dart'; 63 | 64 | abstract class ${topascal}Event extends Equatable { 65 | const ${topascal}Event(); 66 | 67 | @override 68 | List get props => []; 69 | }" > "${OPTARG}_event.dart" 70 | 71 | # Third file 72 | touch "${OPTARG}_state.dart" 73 | echo "part of '${OPTARG}_bloc.dart'; 74 | 75 | class ${topascal}State extends Equatable {}" > "${OPTARG}_state.dart" 76 | 77 | has_command=true 78 | 79 | echo "BLoC created successfully: ${OPTARG}_bloc" 80 | ;; 81 | h ) 82 | # Help information 83 | echo "Usage: blocgen [-b name] [-c name] [-h]" 84 | echo " -b Generate BLoC with name" 85 | echo " -c Generate Cubit with name" 86 | echo " -h Display this help message" 87 | exit 0 88 | ;; 89 | \?) 90 | echo "Invalid option: -$OPTARG" >&2 91 | exit 1 92 | ;; 93 | : ) 94 | echo "Option -$OPTARG requires an argument" >&2 95 | exit 1 96 | ;; 97 | * ) 98 | echo "Invalid command. Use -h option to see usage instructions." >&2 99 | exit 1 100 | ;; 101 | esac 102 | done 103 | 104 | if ! $has_command; then 105 | echo "No command specified. Use -h option to see usage instructions." >&2 106 | exit 1 107 | fi 108 | -------------------------------------------------------------------------------- /scripts/.local/scripts/certgenclient: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | print_usage() { 4 | echo "Usage: certgenclient -f -c -k " 5 | echo "Options:" 6 | echo " -f : Output filename (without extension)" 7 | echo " -c : Relative path to root CA certificate" 8 | echo " -k : Relative path to root CA key" 9 | echo " -h : Display this help message" 10 | } 11 | 12 | while getopts "f:c:k:h" opt; do 13 | case "$opt" in 14 | f) filename="$OPTARG" ;; 15 | c) rootCA_crt="$OPTARG" ;; 16 | k) rootCA_key="$OPTARG" ;; 17 | h) print_usage 18 | exit 0 19 | ;; 20 | \?) echo "Invalid option: -$OPTARG" >&2 21 | print_usage 22 | exit 1 23 | ;; 24 | esac 25 | done 26 | 27 | if [ -z "$filename" ] || [ -z "$rootCA_crt" ] || [ -z "$rootCA_key" ]; then 28 | echo "Error: Missing required arguments." 29 | print_usage 30 | exit 1 31 | fi 32 | 33 | # Create api key for domain 34 | openssl genrsa -out "$filename.key" 2048 35 | 36 | # Create csr from the generated key 37 | openssl req -new -sha256 -key "$filename.key" -subj "/C=US/ST=CA/O=MyOrg, Inc./CN=$filename" -out "$filename.csr" 38 | 39 | # Sign the csr with root CA and generate the certificate 40 | openssl x509 -req -in "$filename.csr" -CA "$rootCA_crt" -CAkey "$rootCA_key" -CAcreateserial -out "$filename.crt" -days 500 -sha256 41 | 42 | echo "Certificates generated successfully." 43 | -------------------------------------------------------------------------------- /scripts/.local/scripts/certgenroot: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | print_usage() { 4 | echo " Usage: $0 " 5 | echo " file_name: Common Name for the root certificate" 6 | echo " Example: $0 api.local" 7 | } 8 | 9 | if [ "$#" -ne 1 ]; then 10 | echo "Error: Missing required argument." 11 | print_usage 12 | exit 1 13 | fi 14 | 15 | file_name="$1" 16 | 17 | # Create root key 18 | openssl genrsa -des3 -out "$file_name.key" 4096 19 | 20 | # Create and self-sign the Root Certificate 21 | openssl req -x509 -new -nodes -key "$file_name.key" -sha256 -days 1024 -out "$file_name.crt" 22 | 23 | echo "Root certificate generated successfully." 24 | -------------------------------------------------------------------------------- /scripts/.local/scripts/clipboard: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CM_LAUNCHER=rofi clipmenu 4 | -------------------------------------------------------------------------------- /scripts/.local/scripts/colors: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Default 4 | width=$(tput cols 2>/dev/null || echo 80) 5 | height=1 6 | 7 | while getopts ":h:" opt; do 8 | case ${opt} in 9 | h ) 10 | height=${OPTARG} 11 | ;; 12 | \? ) 13 | echo "Usage: $(basename "$0") [-h ]" >&2 14 | exit 1 15 | ;; 16 | esac 17 | done 18 | 19 | shift $((OPTIND -1)) 20 | 21 | awk -v term_cols="${width}" -v term_lines="${height}" ' 22 | BEGIN { 23 | s="/\\"; 24 | total_cols=term_cols*term_lines; 25 | for (colnum = 0; colnum255) g = 510-g; 30 | printf "\033[48;2;%d;%d;%dm", r,g,b; 31 | printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b; 32 | printf "%s\033[0m", substr(s,colnum%2+1,1); 33 | if (colnum%term_cols==term_cols-1) printf "\n"; 34 | } 35 | printf "\n"; 36 | } 37 | ' 38 | -------------------------------------------------------------------------------- /scripts/.local/scripts/cpu-usae: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat /proc/stat | grep cpu | tail -1 | awk '{print ($5*100)/($2+$3+$4+$5+$6+$7+$8+$9+$10)}' | awk '{print 100-$1}' | xargs printf "%.1f" 4 | -------------------------------------------------------------------------------- /scripts/.local/scripts/dctx: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | contexts=$(docker context ls | awk '{if ($1 != "NAME") print $1}') 4 | 5 | selected_option=$(printf "%s\n" "${contexts[@]}" | fzf --prompt="Select docker contexts: " --height=~50% --layout=reverse --border --exit-0) 6 | 7 | docker context use $selected_option 8 | -------------------------------------------------------------------------------- /scripts/.local/scripts/ecr-img: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | svc=$1 4 | if [ -z "$svc" ]; then 5 | echo "Usage: $0 " 6 | exit 1 7 | fi 8 | 9 | aws ecr describe-images --repository-name $svc --query 'imageDetails[*].[imagePushedAt, imageTags]' --output json | jq -r '. | sort_by(.[0]) | reverse | .[:10] | map(select(.[1] != null)) | .[] | "\(.[])"' 10 | -------------------------------------------------------------------------------- /scripts/.local/scripts/exstart: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | git clone git@github.com:edr3x/ts-express-starter.git 4 | 5 | cd ts-express-starter 6 | 7 | rm -rf .git 8 | 9 | git init 10 | 11 | yarn 12 | 13 | nvim src/index.ts 14 | -------------------------------------------------------------------------------- /scripts/.local/scripts/fontcheck: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "Normal" 4 | echo -e "\033[1mBold\033[22m" 5 | echo -e "\033[3mItalic\033[23m" 6 | echo -e "\033[3;1mBold Italic\033[0m" 7 | echo -e "\033[4mUnderline\033[24m" 8 | echo "== === !== >= <= =>" 9 | echo "   󰾆   󱑥 󰒲 󰗼" 10 | -------------------------------------------------------------------------------- /scripts/.local/scripts/ghpush: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | git init 4 | 5 | gh repo create --private --source=. 6 | 7 | touch README.md 8 | 9 | git add . 10 | 11 | git commit -m 'init' 12 | 13 | git push --set-upstream origin master 14 | -------------------------------------------------------------------------------- /scripts/.local/scripts/kconf: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #------------------------------------------------- 4 | # ------------ kconf ------------------ 5 | # author: github.com/razzkumar 6 | #------------------------------------------------- 7 | 8 | # Disclaimer 9 | # must put all k8s configs inside ~/.kube/conf/ before running this script 10 | 11 | unset KUBECONFIG 12 | 13 | KUBECONFIG=$(find ~/.kube/conf/ -type f | tr '\n' ':') kubectl config view --flatten > ~/.kube/config 14 | 15 | chmod 600 ~/.kube/config 16 | 17 | export KUBECONFIG=~/.kube/config 18 | 19 | kubectx 20 | -------------------------------------------------------------------------------- /scripts/.local/scripts/kubesecret: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | print_usage(){ 4 | echo "Usage: kubesecret -s " 5 | echo "Options:" 6 | echo " -s : Name of the secret" 7 | echo " -n : Namespace of the secret (default: default)" 8 | echo " -o : Output file (default: secret-data.txt)" 9 | echo " -h : Help" 10 | } 11 | 12 | 13 | while getopts "s:n:h" opt; do 14 | case $opt in 15 | s) secret_name="$OPTARG" 16 | ;; 17 | n) namespace="$OPTARG" 18 | ;; 19 | o) output_file="$OPTARG" 20 | ;; 21 | h) print_usage 22 | exit 0 23 | ;; 24 | \?) echo "Invalid option -$OPTARG" >&2 25 | ;; 26 | esac 27 | done 28 | 29 | 30 | if [ -z "$secret_name" ]; then 31 | echo "Secret name is required" 32 | print_usage 33 | exit 1 34 | fi 35 | 36 | if [ -z "$namespace" ]; then 37 | namespace="default" 38 | fi 39 | 40 | if [ -z "$output_file" ]; then 41 | output_file="secret-data" 42 | fi 43 | 44 | kubectl get secret $secret_name -n $namespace -o json | jq -r '.data | with_entries(select(.value != null)) | to_entries[] | .key + ": " + (.value | @base64d)' > $output_file.txt 45 | 46 | echo "Secret data written to $output_file.txt" 47 | -------------------------------------------------------------------------------- /scripts/.local/scripts/lock: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # require i3lock-color maim 4 | image=$(mktemp --tmpdir --suffix=.png lock.XXXXXXXXXX) 5 | trap 'rm -f "$image"' SIGINT SIGTERM EXIT 6 | 7 | # Adjust the blur strength 8 | blur_strength=4 9 | 10 | maim -u -m 1 \ 11 | | magick png:- -blur 0x$blur_strength \ 12 | -fill "#282828" -colorize 10% \ 13 | "$image" 14 | 15 | i3lock \ 16 | --color=282828 \ 17 | --image="$image" \ 18 | --inside-color=282828FF \ 19 | --insidever-color=282828FF \ 20 | --insidewrong-color=282828FF \ 21 | --ring-color=282828FF \ 22 | --ringver-color=FABD2FFF \ 23 | --ringwrong-color=FB4934FF \ 24 | --separator-color=282828FF \ 25 | --line-color=8cedffFF \ 26 | --keyhl-color=EBDBB2FF \ 27 | --bshl-color=FB4934FF \ 28 | --ring-width=4 \ 29 | --radius=32 \ 30 | --ind-pos="x+w/2:y+h/2" \ 31 | --time-color=8cedffFF \ 32 | --time-pos='ix-180:iy+12' \ 33 | --time-pos='ix-r-50:iy+12' \ 34 | --time-str='%I:%M:%S %p' \ 35 | --time-font='monospace' \ 36 | --time-align=2 \ 37 | --time-size=32 \ 38 | --date-color=8cedffFF \ 39 | --date-pos='ix+180:iy+12' \ 40 | --date-pos='ix+r+50:iy+12' \ 41 | --date-str='%d %B %Y' \ 42 | --date-font='monospace' \ 43 | --date-align=1 \ 44 | --date-size=32 \ 45 | --greeter-pos='x+100:iy+12' \ 46 | --verif-color=00000000 \ 47 | --wrong-color=00000000 \ 48 | --modif-color=00000000 \ 49 | --layout-color=00000000 \ 50 | --greeter-color=00000000 \ 51 | --verif-text='' \ 52 | --wrong-text='' \ 53 | --noinput-text='' \ 54 | --lock-text='' \ 55 | --lockfailed-text='' \ 56 | --greeter-text='' \ 57 | --ignore-empty-password \ 58 | --pass-media-keys \ 59 | --pass-screen-keys \ 60 | --indicator \ 61 | --clock 62 | -------------------------------------------------------------------------------- /scripts/.local/scripts/lockhook: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Exit silently if xidlehook is not installed 4 | if ! command -v xidlehook &> /dev/null; then 5 | exit 0 6 | fi 7 | 8 | export PRIMARY_DISPLAY="$(xrandr | awk '/ primary/{print $1}')" 9 | 10 | # paru -S xidlehook 11 | xidlehook \ 12 | `# Don't lock when there's a fullscreen application` \ 13 | --not-when-fullscreen \ 14 | `# Don't lock when there's audio playing` \ 15 | --not-when-audio \ 16 | `# Dim the screen after 120 seconds, undim if user becomes active` \ 17 | --timer 120 \ 18 | 'xrandr --output "$PRIMARY_DISPLAY" --brightness .3' \ 19 | 'xrandr --output "$PRIMARY_DISPLAY" --brightness 1' \ 20 | `# Undim & lock after 30 more seconds` \ 21 | --timer 30 \ 22 | 'xrandr --output "$PRIMARY_DISPLAY" --brightness 1; lock' \ 23 | '' \ 24 | -------------------------------------------------------------------------------- /scripts/.local/scripts/mic-toggle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | state=`pacmd list-sources | awk '/muted/ { print $2 }' | head -2 | tail -1` 4 | micStatus="no" 5 | if [ $state = "yes" ]; then 6 | micStatus="on" 7 | icon="/home/r3x/.config/awesome/icons/mic.svg" 8 | else 9 | micStatus="off" 10 | icon="/home/r3x/.config/awesome/icons/mic-mute.svg" 11 | fi 12 | 13 | pactl set-source-mute 1 toggle 14 | 15 | notify-send --hint=int:transient:1 -t 1600 -i $icon "Mic switched: $micStatus" 16 | -------------------------------------------------------------------------------- /scripts/.local/scripts/note: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | bat ~/.local/cht-sh/$1.yml 4 | -------------------------------------------------------------------------------- /scripts/.local/scripts/ram-usae: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mem_usage=$(free -m | awk 'NR==2{printf "%.1f", ($3 + $5)/1024}') 4 | 5 | echo "$mem_usage" 6 | -------------------------------------------------------------------------------- /scripts/.local/scripts/scropts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | laptop_display="$(xrandr | awk '/ primary/{print $1}')" 4 | external_display="$(xrandr | awk '/ connected/ && !/ primary/ {print $1}')" 5 | 6 | duplicate="Duplicate" 7 | extend_top="Extend top" 8 | extend_left="Extend left" 9 | extend_right="Extend right" 10 | extend_bottom="Extend bottom" 11 | turn_off_laptop="Turn off laptop screen" 12 | 13 | options=("$duplicate" "$extend_top" "$extend_left" "$extend_right" "$extend_bottom" "$turn_off_laptop") 14 | 15 | selected_option=$(printf "%s\n" "${options[@]}" | fzf --prompt="Select a display configuration: " --height=~50% --layout=reverse --border --exit-0) 16 | 17 | case "$selected_option" in 18 | "$turn_off_laptop") 19 | xrandr --output "$laptop_display" --off 20 | ;; 21 | "$extend_bottom") 22 | xrandr --output "$laptop_display" --auto --top "$external_display" 23 | ;; 24 | "$extend_top") 25 | xrandr --output "$laptop_display" --auto --below "$external_display" 26 | ;; 27 | "$duplicate") 28 | xrandr --output "$laptop_display" --auto --same-as "$external_display" 29 | ;; 30 | "$extend_right") 31 | xrandr --output "$laptop_display" --auto --left-of "$external_display" 32 | ;; 33 | "$extend_left") 34 | xrandr --output "$laptop_display" --auto --right-of "$external_display" 35 | ;; 36 | *) 37 | echo "Invalid option selected." 38 | ;; 39 | esac 40 | -------------------------------------------------------------------------------- /scripts/.local/scripts/stategen: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Had 0 idea to write lua script for code-action in nvim so .......... 4 | # This is for my personal preference of flutter_bloc state class generator 5 | 6 | classname=`awk '/class/ {print $2}' "$1"` 7 | 8 | types=`awk '/final/ {print $2}' "$1"` 9 | 10 | vars=`awk '/final/ {print $3}' "$1" | awk '{gsub(";",""); print}'` 11 | 12 | first_type=`echo "$types" | sed -n '1p'` 13 | second_type=`echo "$types" | sed -n '2p'` 14 | third_type=`echo "$types" | sed -n '3p'` 15 | 16 | first_var=`echo "$vars" | sed -n '1p'` 17 | second_var=`echo "$vars" | sed -n '2p'` 18 | third_var=`echo "$vars" | sed -n '3p'` 19 | 20 | prev_content=`cat "$1" | tr -d '}'` 21 | 22 | echo "${prev_content} 23 | 24 | const ${classname}({ 25 | required this.${first_var}, 26 | required this.${second_var}, 27 | required this.${third_var}, 28 | }); 29 | 30 | factory ${classname}.initial() => ${classname}( 31 | ${first_var}: init, 32 | ${second_var}: init, 33 | ${third_var}: init, 34 | ); 35 | 36 | @override 37 | List get props => [${first_var}, ${second_var}, ${third_var}]; 38 | 39 | @override 40 | bool get stringify => true; 41 | 42 | ${classname} copyWith({ 43 | ${first_type}? ${first_var}, 44 | ${second_type}? ${second_var}, 45 | ${third_type}? ${third_var}, 46 | }) { 47 | return ${classname}( 48 | ${first_var}: ${first_var} ?? this.${first_var}, 49 | ${second_var}: ${second_var} ?? this.${second_var}, 50 | ${third_var}: ${third_var} ?? this.${third_var}, 51 | ); 52 | } 53 | }" > "$1" 54 | -------------------------------------------------------------------------------- /scripts/.local/scripts/tmux-sessionizer: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [[ $# -eq 1 ]]; then 4 | selected=$1 5 | else 6 | selected=$(find \ 7 | ~/projects/work \ 8 | ~/projects/personal \ 9 | ~/projects/learning/ \ 10 | ~/projects/work/webpoint \ 11 | ~/projects/work/oneaccord \ 12 | ~/projects/of_all_things \ 13 | ~/projects/of_all_things/playground \ 14 | -mindepth 1 -maxdepth 1 -type d | fzf --prompt="Select project: " --height=~80% --layout=reverse --border --exit-0) 15 | fi 16 | 17 | if [[ -z $selected ]]; then 18 | exit 0 19 | fi 20 | 21 | selected_name=$(basename "$selected" | tr . _) 22 | tmux_running=$(pgrep tmux) 23 | 24 | if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then 25 | tmux new-session -s $selected_name -c $selected 26 | exit 0 27 | fi 28 | 29 | if ! tmux has-session -t=$selected_name 2> /dev/null; then 30 | tmux new-session -ds $selected_name -c $selected 31 | fi 32 | 33 | if [[ -z $TMUX ]]; then 34 | tmux attach -t $selected_name 35 | else 36 | tmux switch-client -t $selected_name 37 | fi 38 | -------------------------------------------------------------------------------- /scripts/.local/scripts/tmux-switch-session: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | session=$(tmux list-sessions -F "#{session_name}" | fzf --prompt="Select tmux session: " --height=~80% --layout=reverse --border --exit-0) 4 | 5 | # If a session was selected, switch to it 6 | if [ -n "$session" ]; then 7 | tmux switch-client -t "$session" 8 | else 9 | echo "No session selected." 10 | fi 11 | -------------------------------------------------------------------------------- /scripts/.local/scripts/totlines: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | function count_lines { 4 | local file="$1" 5 | local lines=$(wc -l < "$file") 6 | echo "$lines" 7 | } 8 | 9 | function count_lines_recursive { 10 | local dir="$1" 11 | local count=0 12 | for file in "$dir"/*; do 13 | if [[ -d "$file" ]]; then 14 | count=$((count + $(count_lines_recursive "$file"))) 15 | elif [[ -f "$file" ]]; then 16 | count=$((count + $(count_lines "$file"))) 17 | fi 18 | done 19 | echo "$count" 20 | } 21 | 22 | if [[ $# -ne 1 ]]; then 23 | echo "Usage: $0 " 24 | exit 1 25 | fi 26 | 27 | file_or_dir="$1" 28 | if [[ -d "$file_or_dir" ]]; then 29 | count=$(count_lines_recursive "$file_or_dir") 30 | echo "Total number of lines in $file_or_dir: $count" 31 | elif [[ -f "$file_or_dir" ]]; then 32 | count=$(count_lines "$file_or_dir") 33 | echo "Number of lines in $file_or_dir: $count" 34 | else 35 | echo "Error: $file_or_dir is not a file or directory" 36 | exit 1 37 | fi 38 | -------------------------------------------------------------------------------- /scripts/.local/scripts/uuidv7: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | uuidv7() { 4 | # random bytes 5 | rand_bytes=$(dd if=/dev/urandom bs=1 count=16 2>/dev/null | xxd -p) 6 | 7 | # current timestamp in ms 8 | timestamp=$(date +%s%3N) 9 | t_hex=$(printf "%012x" $timestamp) 10 | 11 | # timestamp 12 | value[0]=${t_hex:0:2} 13 | value[1]=${t_hex:2:2} 14 | value[2]=${t_hex:4:2} 15 | value[3]=${t_hex:6:2} 16 | value[4]=${t_hex:8:2} 17 | value[5]=${t_hex:10:2} 18 | 19 | # version / rand_a 20 | value[6]=$(printf "%02x" $((0x70 | (0x${rand_bytes:12:2} & 0x0F)))) 21 | value[7]=${rand_bytes:14:2} 22 | 23 | # variant / rand_b 24 | value[8]=$(printf "%02x" $((0x80 | (0x${rand_bytes:16:2} & 0x3F)))) 25 | 26 | # rand_b 27 | value[9]=${rand_bytes:18:2} 28 | value[10]=${rand_bytes:20:2} 29 | value[11]=${rand_bytes:22:2} 30 | value[12]=${rand_bytes:24:2} 31 | value[13]=${rand_bytes:26:2} 32 | value[14]=${rand_bytes:28:2} 33 | value[15]=${rand_bytes:30:2} 34 | 35 | echo "${value[@]}" 36 | } 37 | 38 | for byte in $(uuidv7); do 39 | printf "%s" "$byte" 40 | done 41 | echo 42 | -------------------------------------------------------------------------------- /starship/.config/starship.toml: -------------------------------------------------------------------------------- 1 | "$schema" = 'https://starship.rs/config-schema.json' 2 | add_newline = true 3 | 4 | right_format = """$git_metrics$memory_usage$time""" 5 | 6 | [battery] 7 | charging_symbol = ' ' 8 | discharging_symbol = '󰂁 ' 9 | 10 | [[battery.display]] 11 | threshold = 30 12 | 13 | [character] 14 | error_symbol = "[✖](#FF0000) " 15 | success_symbol = "[❯](#00FF00)" 16 | 17 | [cmd_duration] 18 | format = " took [$duration]($style)" 19 | min_time = 10 20 | 21 | [directory] 22 | truncation_length = 3 23 | read_only = " " 24 | format = "[$path]($style)[$lock_symbol]($lock_style) " 25 | 26 | [git_branch] 27 | format = " [$symbol$branch]($style) " 28 | symbol = " " 29 | style = "#FFFF00" 30 | 31 | [git_commit] 32 | commit_hash_length = 8 33 | style = "bright white" 34 | 35 | [git_state] 36 | format = '[\($state( $progress_current of $progress_total)\)]($style) ' 37 | 38 | [git_status] 39 | conflicted = "⚔️ " 40 | ahead = "⇡ ×${count} " 41 | behind = "⇣ ×${count} " 42 | diverged = "⇕ ×${ahead_count}  ×${behind_count} " 43 | untracked = " ×${count} " 44 | stashed = " 📦 " 45 | modified = "! ×${count} " 46 | staged = " ×${count} " 47 | renamed = " ×${count} " 48 | deleted = "✘ ×${count} " 49 | style = "bright-white" 50 | format = "$all_status$ahead_behind" 51 | 52 | [git_metrics] 53 | disabled = false 54 | 55 | [hostname] 56 | ssh_only = false 57 | format = " [$hostname]($style) " 58 | trim_at = "-" 59 | style = "#A020F0" 60 | disabled = true 61 | 62 | [memory_usage] 63 | format = "$symbol[${ram}( )]($style) " 64 | threshold = 40 65 | symbol = "  " 66 | style = "#6ba4cf" 67 | disabled = false 68 | 69 | [username] 70 | disabled = true 71 | style_user = "#00FF00" 72 | format = "[$user]($style) @" 73 | show_always = true 74 | 75 | [time] 76 | disabled = false 77 | format = '[\[ $time \]]($style) ' 78 | time_format = '%I:%M %p' 79 | 80 | [package] 81 | disabled = true 82 | 83 | [aws] 84 | symbol = " " 85 | 86 | [kubernetes] 87 | format = '[󱃾 $context \($namespace\)](#7dfa94) ' 88 | disabled = false 89 | 90 | [c] 91 | symbol = " " 92 | 93 | [dart] 94 | symbol = " " 95 | 96 | [docker_context] 97 | symbol = " " 98 | 99 | [golang] 100 | symbol = " " 101 | 102 | [haskell] 103 | symbol = " " 104 | 105 | [hg_branch] 106 | symbol = " " 107 | 108 | [java] 109 | symbol = " " 110 | 111 | [nix_shell] 112 | symbol = " " 113 | 114 | [nodejs] 115 | symbol = " " 116 | 117 | [python] 118 | symbol = " " 119 | 120 | [rust] 121 | symbol = " " 122 | 123 | [terraform] 124 | symbol = "󱁢 " 125 | -------------------------------------------------------------------------------- /tmux/.config/tmux/sensible.tmux: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | # used to match output from `tmux list-keys` 6 | KEY_BINDING_REGEX="bind-key[[:space:]]\+\(-r[[:space:]]\+\)\?\(-T prefix[[:space:]]\+\)\?" 7 | 8 | is_osx() { 9 | local platform=$(uname) 10 | [ "$platform" == "Darwin" ] 11 | } 12 | 13 | iterm_terminal() { 14 | [[ "${TERM_PROGRAM}" =~ ^iTerm || "${LC_TERMINAL}" =~ ^iTerm ]] 15 | } 16 | 17 | command_exists() { 18 | local command="$1" 19 | type "$command" >/dev/null 2>&1 20 | } 21 | 22 | # returns prefix key, e.g. 'C-a' 23 | prefix() { 24 | tmux show-option -gv prefix 25 | } 26 | 27 | # if prefix is 'C-a', this function returns 'a' 28 | prefix_without_ctrl() { 29 | local prefix="$(prefix)" 30 | echo "$prefix" | cut -d '-' -f2 31 | } 32 | 33 | option_value_not_changed() { 34 | local option="$1" 35 | local default_value="$2" 36 | local option_value=$(tmux show-option -gv "$option") 37 | [ "$option_value" == "$default_value" ] 38 | } 39 | 40 | server_option_value_not_changed() { 41 | local option="$1" 42 | local default_value="$2" 43 | local option_value=$(tmux show-option -sv "$option") 44 | [ "$option_value" == "$default_value" ] 45 | } 46 | 47 | key_binding_not_set() { 48 | local key="${1//\\/\\\\}" 49 | if $(tmux list-keys | grep -q "${KEY_BINDING_REGEX}${key}[[:space:]]"); then 50 | return 1 51 | else 52 | return 0 53 | fi 54 | } 55 | 56 | key_binding_not_changed() { 57 | local key="$1" 58 | local default_value="$2" 59 | if $(tmux list-keys | grep -q "${KEY_BINDING_REGEX}${key}[[:space:]]\+${default_value}"); then 60 | # key still has the default binding 61 | return 0 62 | else 63 | return 1 64 | fi 65 | } 66 | 67 | get_tmux_config() { 68 | local tmux_config_xdg="${XDG_CONFIG_HOME:-$HOME/.config}/tmux/tmux.conf" 69 | local tmux_config="$HOME/.tmux.conf" 70 | 71 | if [ -f "${tmux_config_xdg}" ]; then 72 | echo "${tmux_config_xdg}" 73 | else 74 | echo ${tmux_config} 75 | fi 76 | } 77 | 78 | main() { 79 | # OPTIONS 80 | 81 | # address vim mode switching delay (http://superuser.com/a/252717/65504) 82 | if server_option_value_not_changed "escape-time" "500"; then 83 | tmux set-option -s escape-time 0 84 | fi 85 | 86 | # increase scrollback buffer size 87 | if option_value_not_changed "history-limit" "2000"; then 88 | tmux set-option -g history-limit 50000 89 | fi 90 | 91 | # tmux messages are displayed for 4 seconds 92 | if option_value_not_changed "display-time" "750"; then 93 | tmux set-option -g display-time 4000 94 | fi 95 | 96 | # refresh 'status-left' and 'status-right' more often 97 | if option_value_not_changed "status-interval" "15"; then 98 | tmux set-option -g status-interval 5 99 | fi 100 | 101 | # required (only) on OS X 102 | if is_osx && command_exists "reattach-to-user-namespace" && option_value_not_changed "default-command" ""; then 103 | tmux set-option -g default-command "reattach-to-user-namespace -l $SHELL" 104 | fi 105 | 106 | # upgrade $TERM, tmux 1.9 107 | if option_value_not_changed "default-terminal" "screen"; then 108 | tmux set-option -g default-terminal "screen-256color" 109 | fi 110 | # upgrade $TERM, tmux 2.0+ 111 | if server_option_value_not_changed "default-terminal" "screen"; then 112 | tmux set-option -s default-terminal "screen-256color" 113 | fi 114 | 115 | # emacs key bindings in tmux command prompt (prefix + :) are better than 116 | # vi keys, even for vim users 117 | tmux set-option -g status-keys emacs 118 | 119 | # focus events enabled for terminals that support them 120 | tmux set-option -g focus-events on 121 | 122 | # super useful when using "grouped sessions" and multi-monitor setup 123 | if ! iterm_terminal; then 124 | tmux set-window-option -g aggressive-resize on 125 | fi 126 | 127 | # DEFAULT KEY BINDINGS 128 | 129 | local prefix="$(prefix)" 130 | local prefix_without_ctrl="$(prefix_without_ctrl)" 131 | 132 | # if C-b is not prefix 133 | if [ $prefix != "C-b" ]; then 134 | # unbind obsolete default binding 135 | if key_binding_not_changed "C-b" "send-prefix"; then 136 | tmux unbind-key C-b 137 | fi 138 | 139 | # pressing `prefix + prefix` sends to the shell 140 | if key_binding_not_set "$prefix"; then 141 | tmux bind-key "$prefix" send-prefix 142 | fi 143 | fi 144 | 145 | # If Ctrl-a is prefix then `Ctrl-a + a` switches between alternate windows. 146 | # Works for any prefix character. 147 | if key_binding_not_set "$prefix_without_ctrl"; then 148 | tmux bind-key "$prefix_without_ctrl" last-window 149 | fi 150 | 151 | # easier switching between next/prev window 152 | if key_binding_not_set "C-p"; then 153 | tmux bind-key C-p previous-window 154 | fi 155 | if key_binding_not_set "C-n"; then 156 | tmux bind-key C-n next-window 157 | fi 158 | 159 | # source `.tmux.conf` file - as suggested in `man tmux` 160 | if key_binding_not_set "R"; then 161 | local tmux_config=$(get_tmux_config) 162 | 163 | tmux bind-key R run-shell " \ 164 | tmux source-file ${tmux_config} > /dev/null; \ 165 | tmux display-message 'Sourced ${tmux_config}!'" 166 | fi 167 | } 168 | main 169 | -------------------------------------------------------------------------------- /tmux/.config/tmux/tmux.conf: -------------------------------------------------------------------------------- 1 | set-option -g prefix M-a 2 | unbind-key M-a 3 | bind-key M-a send-prefix 4 | 5 | set -g base-index 1 6 | set -g status-interval 1 7 | set -g history-limit 20000 8 | 9 | set -g mouse on 10 | 11 | # 256 colors and undercurls 12 | set -g default-terminal 'tmux-256color' 13 | set -as terminal-overrides ',alacritty*:Tc' 14 | set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' 15 | set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' 16 | 17 | # automatically restore last saved tmux session 18 | set -g @continuum-restore 'on' 19 | 20 | # switch windows 21 | bind -n M-n next-window 22 | bind -n M-p previous-window 23 | 24 | # resize panes 25 | bind -n S-Up resize-pane -U 2 26 | bind -n S-Down resize-pane -D 2 27 | bind -n S-Left resize-pane -L 2 28 | bind -n S-Right resize-pane -R 2 29 | 30 | # window split vertical or horizontal 31 | bind-key v split-window -h 32 | bind-key h split-window -v 33 | 34 | # Vim like copy paste 35 | set-window-option -g mode-keys vi 36 | bind-key -T copy-mode-vi v send -X begin-selection 37 | bind-key -T copy-mode-vi V send -X select-line 38 | bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel 'xclip -in -selection clipboard' 39 | 40 | # fzf jump 41 | bind-key -r f run-shell "tmux neww ~/.local/scripts/tmux-sessionizer" 42 | bind-key -r e run-shell "tmux neww ~/.local/scripts/tmux-switch-session" 43 | bind-key -r k run-shell "~/.local/scripts/tmux-sessionizer ~/.dotfiles" 44 | bind-key -r n run-shell "~/.local/scripts/tmux-sessionizer ~/.dotfiles/nvim/.config/nvim" 45 | 46 | # tmux-vim-navigator 47 | # check if we're in a Vim process 48 | is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ 49 | | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" 50 | 51 | bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L' 52 | bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D' 53 | bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U' 54 | bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R' 55 | 56 | # bar decoration 57 | bg=default 58 | fg="#d3d3d3" 59 | orange="#e78a4e" 60 | highlight="#89DDFF" 61 | 62 | wg_time="#[nobold]#[bg=${bg},fg=${orange}] %I:%M" 63 | wg_date="#[bold]#[bg=${bg},fg=${highlight}] %d-%b" 64 | ram="#[nobold]#[bg=${bg},fg=${fg}]  #(ram-usae)GB" 65 | cpu="#[nobold]#[bg=${bg},fg=${orange}] #(cpu-usae)%" 66 | batt="#[nobold]#[bg=${bg},fg=${highlight}] #(battery-status)" 67 | prfx="#[nobold]#[bg=${bg},fg=${fg}] #{?client_prefix,,}" 68 | 69 | set-option -g status-justify left 70 | set-option -g renumber-windows on 71 | set-option -g status-left-length 100 72 | set-option -g status-right-length 150 73 | 74 | set -g status-style "bg=${bg} fg=${fg}" 75 | setw -g window-status-current-style fg=${orange},bg=${bg} 76 | 77 | set -g window-status-separator "" 78 | set -g window-status-format "#[nobold]#[bg=${bg},fg=${fg}] #W " 79 | set -g window-status-current-format "#[nobold]#[bg=${bg},fg=${orange}] #W " 80 | 81 | set -g status-left "#[bold]#[bg=${bg},fg=${highlight}] #S " 82 | set -g status-right "${prfx} ${cpu} ${ram} ${batt} ${wg_time} ${wg_date} " 83 | 84 | set -g pane-border-style fg=${fg} 85 | set -g pane-active-border-style fg=${fg} 86 | 87 | set-window-option -g mode-style "bg=${orange} fg=#121212" 88 | 89 | set -g message-style fg=${orange},bg=${bg} 90 | set -g message-command-style fg=${orange},bg=${bg} 91 | 92 | # tmux plugins 93 | run-shell ~/.config/tmux/sensible.tmux 94 | 95 | bind-key r source-file ~/.config/tmux/tmux.conf \; display-message " Config Reloaded" 96 | -------------------------------------------------------------------------------- /yazi/.config/yazi/keymap.toml: -------------------------------------------------------------------------------- 1 | [[manager.prepend_keymap]] 2 | on = [ "l" ] 3 | run = "plugin smart-enter" 4 | desc = "Enter the child directory, or open the file" 5 | -------------------------------------------------------------------------------- /yazi/.config/yazi/plugins/smart-enter.yazi/main.lua: -------------------------------------------------------------------------------- 1 | --- @sync entry 2 | return { 3 | entry = function() 4 | local h = cx.active.current.hovered 5 | ya.manager_emit(h and h.cha.is_dir and "enter" or "open", { hovered = true }) 6 | end, 7 | } 8 | -------------------------------------------------------------------------------- /yazi/.config/yazi/theme.toml: -------------------------------------------------------------------------------- 1 | [status] 2 | separator_open = "" 3 | separator_close = "" 4 | separator_style = { fg = "reset", bg = "reset" } 5 | 6 | # Mode 7 | mode_normal = { fg = "#89DDFF", bg = "reset" } 8 | mode_select = { fg = "#e78a4e", bg = "reset" } 9 | mode_unset = { fg = "#e78a4e", bg = "reset" } 10 | 11 | [manager] 12 | border_symbol = " " 13 | -------------------------------------------------------------------------------- /yazi/.config/yazi/yazi.toml: -------------------------------------------------------------------------------- 1 | [manager] 2 | ratio = [1, 2, 3] 3 | sort_dir_first = true 4 | show_symlink = true 5 | 6 | [preview] 7 | max_width = 1000 8 | image_quality = 70 9 | 10 | [opener] 11 | open = [ 12 | { run = 'xdg-open "$@"', block = false, desc = "Open" }, 13 | ] 14 | 15 | [open] 16 | prepend_rules = [ 17 | { mime = "video/*", use = "open" }, 18 | ] 19 | -------------------------------------------------------------------------------- /zsh/.zshrc: -------------------------------------------------------------------------------- 1 | alias vi="nvim" 2 | alias vim="nvim" 3 | alias e="thunar ." 4 | alias x="exit" 5 | alias c="clear" 6 | alias k="kubectl" 7 | alias tf="terraform" 8 | alias ls="exa -a --icons --group-directories-first" 9 | alias ll="exa -lah --icons --color automatic --no-time --git --group-directories-first" 10 | alias lt="exa -lh --icons --color automatic --no-user --git -T -L 4 --ignore-glob='.git|node_modules' --group-directories-first --no-permissions --no-filesize --no-time" 11 | 12 | alias ..="cd .." 13 | alias ...="cd ../.." 14 | alias cdd='cd "$(fd -t d . | fzf)"' 15 | 16 | # TMUX 17 | alias tls="tmux ls" 18 | alias ta="tmux a -t " 19 | alias tnew="tmux new -s" 20 | alias tkl="tmux kill-server" 21 | alias tk1="tmux kill-session -t" 22 | 23 | bindkey -s ^f "tmux-sessionizer\n" 24 | 25 | export TERM="alacritty" 26 | export EDITOR="nvim" 27 | export VISUAL="nvim" 28 | export KUBECONFIG=~/.kube/config 29 | 30 | eval "$(starship init zsh)" 31 | --------------------------------------------------------------------------------