"
5 | exit 1
6 | fi
7 |
8 | SRC_DIR=$(realpath "$1")
9 | DEST_DIR=$(realpath "$2")
10 |
11 | if [ ! -d "$SRC_DIR" ]; then
12 | echo "Error: Source directory does not exist: $SRC_DIR"
13 | exit 1
14 | fi
15 |
16 | if [ ! -w "$DEST_DIR" ] && ! mkdir -p "$DEST_DIR"; then
17 | echo "Error: Cannot create or write to destination: $DEST_DIR"
18 | exit 1
19 | fi
20 |
21 | if ! command -v zip >/dev/null; then
22 | echo "Error: zip is not installed"
23 | exit 1
24 | fi
25 |
26 | cd "$SRC_DIR"
27 |
28 | for dir in */; do
29 | if [ -d "$dir" ]; then
30 | zip -r "$DEST_DIR/${dir%/}.zip" "$dir" &&
31 | echo "Compressed: $dir -> $DEST_DIR/${dir%/}.zip"
32 | fi
33 | done
34 |
35 | cd -
36 |
37 | echo "All folders compressed into $DEST_DIR"
38 |
--------------------------------------------------------------------------------
/.config/awesome/ui/wibar/layoutlist.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local wibox = require("wibox")
3 | local dpi = require("beautiful.xresources").apply_dpi
4 |
5 | local layoutlist = function(s)
6 | return awful.widget.layoutlist({
7 | layout = wibox.layout.fixed.horizontal,
8 | screen = s,
9 | widget_template = {
10 | {
11 | {
12 | id = "icon_role",
13 | scaling_quality = "fast",
14 | widget = wibox.widget.imagebox,
15 | },
16 | top = dpi(2) * 2,
17 | bottom = dpi(2) * 2,
18 | left = dpi(6),
19 | right = dpi(6),
20 | widget = wibox.container.margin,
21 | },
22 | id = "background_role",
23 | widget = wibox.container.background,
24 | },
25 | })
26 | end
27 |
28 | return layoutlist
29 |
--------------------------------------------------------------------------------
/.config/nvim/lua/plugins/colorscheme.lua:
--------------------------------------------------------------------------------
1 | return {
2 | -- Tokyonight
3 | {
4 | "folke/tokyonight.nvim",
5 | lazy = false,
6 | priority = 1000,
7 | config = function()
8 | require("tokyonight").setup({
9 | style = "night",
10 | })
11 | -- vim.cmd.colorscheme("tokyonight")
12 | end,
13 | },
14 | -- kanagawa
15 | {
16 | "rebelot/kanagawa.nvim",
17 | lazy = false,
18 | priority = 1000,
19 | config = function()
20 | -- vim.cmd.colorscheme("kanagawa")
21 | end,
22 | },
23 | -- Vscode
24 | {
25 | "Mofiqul/vscode.nvim",
26 | lazy = false,
27 | priority = 1000,
28 | config = function()
29 | -- vim.cmd.colorscheme("vscode")
30 | end,
31 | },
32 | -- Hybrid
33 | {
34 | "HoNamDuong/hybrid.nvim",
35 | lazy = false,
36 | priority = 1000,
37 | config = function()
38 | vim.cmd.colorscheme("hybrid")
39 | end,
40 | },
41 | }
42 |
--------------------------------------------------------------------------------
/.config/awesome/ui/wibar/minimization.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local wibox = require("wibox")
3 | local beautiful = require("beautiful")
4 | local dpi = require("beautiful.xresources").apply_dpi
5 |
6 | local utils = require("utils")
7 | local keys = require("config").keys
8 |
9 | local minimization = wibox.widget({
10 | {
11 | left = dpi(6),
12 | right = dpi(6),
13 | widget = wibox.container.margin,
14 | },
15 | bg = beautiful.colors.primary_dark,
16 | widget = wibox.container.background,
17 | buttons = {
18 | awful.button({}, 1, nil, function()
19 | utils.client.toggle_minimization_clients()
20 | end),
21 | },
22 | })
23 |
24 | awful.tooltip({
25 | objects = { minimization },
26 | text = "Click to toggle minimization",
27 | align = "bottom",
28 | mode = "outside",
29 | })
30 |
31 | awful.keyboard.append_global_keybindings({
32 | awful.key({ keys.super }, "z", function()
33 | utils.client.toggle_minimization_clients()
34 | end, { description = "Toggle minimization", group = "awesome" }),
35 | })
36 |
37 | return minimization
38 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 HoNamDuong
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # ❤ ~/.dotfiles
4 |
5 | This repository contains my personal Linux configuration files.
6 |
7 | ## Introduction
8 |
9 | Here are some details about my setup:
10 |
11 | | **Distro** | Arch Linux |
12 | | :------------: | :-------------------------------------------------: |
13 | | **WM** | [Awesome](https://github.com/awesomeWM/awesome/) |
14 | | **Compositor** | [Picom](https://github.com/yshui/picom) |
15 | | **Launcher** | [Rofi](https://github.com/davatorium/rofi/) |
16 | | **Terminal** | [Alacritty](https://github.com/alacritty/alacritty) |
17 | | **Shell** | [Zsh](https://www.zsh.org/) |
18 | | **Editor** | [Neovim](https://github.com/neovim/neovim/) |
19 |
20 | ## Gallery
21 |
22 |
23 | Awesome
24 |
25 |
26 | 
27 |
28 |
29 |
30 |
31 |
32 | Launcher
33 |
34 |
35 | 
36 |
37 |
38 |
39 |
40 | ## Setup
41 |
42 | Setup for Arch Linux [here](./docs/SETUP.md)
43 |
44 |
45 |
--------------------------------------------------------------------------------
/.local/bin/randomwallpaper:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Randomize wallpaper for multiple monitors
3 |
4 | if [[ -n $1 ]]; then
5 | WALLPAPER_DIR=$1
6 | else
7 | WALLPAPER_DIR=$HOME/Pictures//Wallpapers/
8 | fi
9 |
10 | if [[ ! -d $WALLPAPER_DIR ]]; then
11 | echo "randomwallpaper: $WALLPAPER_DIR is not a directory or does not exist"
12 | exit 127
13 | fi
14 |
15 | if [[ -z "$(find $WALLPAPER_DIR -iregex '.*\.\(png\|jpg\|jpeg\)' -type f)" ]]; then
16 | echo "randomwallpaper: there are no images in $WALLPAPER_DIR"
17 | exit 1
18 | fi
19 |
20 | if [[ $XDG_SESSION_TYPE == "wayland" ]]; then
21 | for i in $(xrandr --listactivemonitors | awk 'NR>1 {print $4}'); do
22 | [ -f /usr/bin/swww ] &&
23 | swww img $(find $WALLPAPER_DIR -iregex ".*.\(png\|jpg\|jpeg\)" -type f | shuf -n 1) --outputs=$i --transition-type=fade --transition-fps=60
24 | done
25 | elif [[ $XDG_SESSION_TYPE == "x11" ]]; then
26 | for ((i = 0; i < $(xrandr --listactivemonitors | awk 'NR==1 {print $2}'); i++)); do
27 | [ -f /usr/bin/nitrogen ] &&
28 | nitrogen --set-zoom-fill $(find $WALLPAPER_DIR -iregex ".*.\(png\|jpg\|jpeg\)" -type f | shuf -n 1) --head=$i --save &>/dev/null
29 | done
30 | else
31 | echo "randomwallpaper: XDG_SESSION_TYPE is not x11 or wayland"
32 | exit 1
33 | fi
34 |
--------------------------------------------------------------------------------
/.config/neofetch/config.conf:
--------------------------------------------------------------------------------
1 | print_info() {
2 |
3 | info cols
4 |
5 | # info underline
6 | # info title
7 |
8 | info "$(color 1) Distro" distro
9 | info "$(color 2) Packages" packages
10 | info "$(color 3) DE" de
11 | info "$(color 3) WM" wm
12 | info "$(color 4) Terminal" term
13 | info "$(color 5) Shell" shell
14 | info "$(color 6) CPU" cpu
15 | info "$(color 1) GPU" gpu
16 | info "$(color 2) Memory" memory
17 | info "$(color 3) Disk" disk
18 |
19 | # info "$(color 4) Uptime" uptime
20 | # info "$(color 5) Host" model
21 | # info "$(color 6) Kernel" kernel
22 | # info "$(color 1) WM Theme" wm_theme
23 | # info "$(color 2) Theme" theme
24 | # info "$(color 3) Icons" icons
25 | # info "$(color 4) Terminal Font" term_font
26 | # info "$(color 5) Resolution" resolution
27 | # info "$(color 6) GPU Driver" gpu_driver
28 | # info "$(color 1) CPU Usage" cpu_usage
29 | # info "$(color 2) Battery" battery
30 | # info "$(color 3) Font" font
31 | # info "$(color 4) Song" song
32 | # [[ "$player" ]] && prin "$(color 5) Music Player" "$player"
33 | # info "$(color 6) Local IP" local_ip
34 | # info "$(color 1) Public IP" public_ip
35 | # info "$(color 2) Users" users
36 | # info "$(color 3) Locale" locale
37 |
38 | }
39 |
40 | # Info Separator
41 | separator=" "
42 |
43 | # Image backend.
44 | image_backend="off"
45 |
--------------------------------------------------------------------------------
/.config/awesome/config.lua:
--------------------------------------------------------------------------------
1 | local config = {}
2 |
3 | config.apps = {
4 | terminal = os.getenv("TERMINAL"),
5 | editor = os.getenv("TERMINAL") .. " -e " .. os.getenv("EDITOR"),
6 | run = "run",
7 | launcher = "launcher",
8 | powermenu = "powermenu",
9 | }
10 |
11 | config.actions = {
12 | -- Power
13 | lock = "loginctl lock-session self",
14 | logout = "loginctl kill-session self",
15 | suspend = "systemctl suspend",
16 | hibernate = "systemctl hibernate",
17 | reboot = "systemctl reboot",
18 | poweroff = "systemctl poweroff",
19 | -- screenshot
20 | screenshot = "scrot --multidisp --exec 'mv $f ~/Pictures/ && xdg-open ~/Pictures/$f'",
21 | screenshot_area = "scrot --select --freeze --exec 'mv $f ~/Pictures/ && xdg-open ~/Pictures/$f'",
22 | screenshot_window = "scrot --focused --border --exec 'mv $f ~/Pictures/ && xdg-open ~/Pictures/$f'",
23 | screenshot_delay = "scrot --delay 5 --exec 'mv $f ~/Pictures/ && xdg-open ~/Pictures/$f'",
24 | -- other
25 | randomize_wallpaper = "randomwallpaper",
26 | switch_user = "dm-tool switch-to-greeter",
27 | }
28 |
29 | config.keys = {
30 | super = "Mod4",
31 | alt = "Mod1",
32 | shift = "Shift",
33 | control = "Control",
34 | }
35 |
36 | config.tags = {
37 | name = {
38 | "General",
39 | "Code",
40 | "Browser",
41 | "File",
42 | "Document",
43 | "Media",
44 | "Tool",
45 | "Chat",
46 | "Game",
47 | "Setting",
48 | },
49 | }
50 |
51 | return config
52 |
--------------------------------------------------------------------------------
/.local/bin/extract_archives:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | if [ "$#" -ne 2 ]; then
4 | echo "Usage: $0 "
5 | exit 1
6 | fi
7 |
8 | SRC_DIR=$(realpath "$1")
9 | DEST_DIR=$(realpath "$2")
10 |
11 | if [ ! -d "$SRC_DIR" ]; then
12 | echo "Error: Source directory does not exist: $SRC_DIR"
13 | exit 1
14 | fi
15 |
16 | if [ ! -w "$DEST_DIR" ] && ! mkdir -p "$DEST_DIR"; then
17 | echo "Error: Cannot create or write to destination: $DEST_DIR"
18 | exit 1
19 | fi
20 |
21 | for cmd in unzip tar 7z unrar; do
22 | if ! command -v "$cmd" >/dev/null; then
23 | echo "Error: $cmd is not installed"
24 | exit 1
25 | fi
26 | done
27 |
28 | for archive in "$SRC_DIR"/*.{zip,tar,tar.gz,tgz,7z,rar}; do
29 | if [ -f "$archive" ]; then
30 | echo "Extracting: $archive to $DEST_DIR"
31 | case "$archive" in
32 | *.zip)
33 | unzip -o "$archive" -d "$DEST_DIR"
34 | ;;
35 | *.tar)
36 | tar -xf "$archive" -C "$DEST_DIR"
37 | ;;
38 | *.tar.gz | *.tgz)
39 | tar -xzf "$archive" -C "$DEST_DIR"
40 | ;;
41 | *.7z)
42 | 7z x "$archive" -o"$DEST_DIR"
43 | ;;
44 | *.rar)
45 | unrar x -o+ "$archive" "$DEST_DIR"
46 | ;;
47 | *)
48 | echo "Unsupported file type: $archive"
49 | ;;
50 | esac && echo "Extracted: $archive" || echo "Failed: $archive"
51 | fi
52 | done
53 |
54 | echo "All archives extracted to $DEST_DIR"
55 |
--------------------------------------------------------------------------------
/.config/nvim/init.lua:
--------------------------------------------------------------------------------
1 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
2 | if not (vim.uv or vim.loop).fs_stat(lazypath) then
3 | local lazyrepo = "https://github.com/folke/lazy.nvim.git"
4 | local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
5 | if vim.v.shell_error ~= 0 then
6 | vim.api.nvim_echo({
7 | { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
8 | { out, "WarningMsg" },
9 | { "\nPress any key to exit..." },
10 | }, true, {})
11 | vim.fn.getchar()
12 | os.exit(1)
13 | end
14 | end
15 | vim.opt.rtp:prepend(lazypath)
16 |
17 | require("core.options")
18 | require("core.keymaps")
19 | require("core.autocommands")
20 |
21 | require("lazy").setup({
22 | lockfile = vim.fn.stdpath("data") .. "/lazy/lazy-lock.json", -- lockfile generated after running update.
23 | spec = {
24 | { import = "plugins" }, -- import your plugins
25 | },
26 | ui = {
27 | border = "rounded", -- The border to use for the UI window.
28 | },
29 | install = {
30 | colorscheme = { "hybrid" }, -- try to load one of these colorschemes when starting an installation during startup
31 | },
32 | checker = {
33 | enabled = true, -- automatically check for plugin updates
34 | notify = false, -- get a notification when new updates are found
35 | },
36 | change_detection = {
37 | enabled = true, -- automatically check for config file changes and reload the ui
38 | notify = false, -- get a notification when changes are found
39 | },
40 | })
41 |
--------------------------------------------------------------------------------
/.config/zathura/zathurarc:
--------------------------------------------------------------------------------
1 | # Hybrid theme
2 | set notification-error-bg "#cc6666"
3 | set notification-error-fg "#1d1f21"
4 | set notification-warning-bg "#f0c674"
5 | set notification-warning-fg "#1d1f21"
6 | set notification-bg "#c5c8c6"
7 | set notification-fg "#1d1f21"
8 | set completion-bg "#373B41"
9 | set completion-fg "#eaeaea"
10 | set completion-group-bg "#373B41"
11 | set completion-group-fg "#eaeaea"
12 | set completion-highlight-bg "#81a2be"
13 | set completion-highlight-fg "#1d1f21"
14 | set index-bg "#373B41"
15 | set index-fg "#eaeaea"
16 | set index-active-bg "#81a2be"
17 | set index-active-fg "#1d1f21"
18 | set inputbar-bg "#1d1f21"
19 | set inputbar-fg "#eaeaea"
20 | set statusbar-bg "#373B41"
21 | set statusbar-fg "#eaeaea"
22 | set highlight-color "rgba(240, 198, 116, 0.5)" "#f0c674"
23 | set highlight-active-color "rgba(204, 102, 102, 0.5)" "#cc6666"
24 | set default-bg "#1d1f21"
25 | set default-fg "#eaeaea"
26 | set recolor-lightcolor "#1d1f21"
27 | set recolor-darkcolor "#eaeaea"
28 |
29 | # Font
30 | set font "monospace normal 14"
31 |
32 | # Enables recoloring
33 | set recolor "true"
34 | set recolor-keephue "true"
35 | set recolor-reverse-video "true"
36 |
37 | # Enable copy to clipboard
38 | set selection-clipboard "clipboard"
39 |
40 | # Keyring
41 | map set recolor
42 |
--------------------------------------------------------------------------------
/.local/bin/showcolors256:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | showcolors256() {
4 | local row col blockrow blockcol red green blue
5 | local showcolor=_showcolor256_${1:-bg}
6 | local white="\033[1;37m"
7 | local reset="\033[0m"
8 |
9 | echo 16 standard color codes:
10 | for row in {0..1}; do
11 | for col in {0..7}; do
12 | $showcolor $((row * 8 + col)) $row
13 | done
14 | echo
15 | done
16 | echo
17 |
18 | echo 6·6·6 RGB color codes:
19 | for blockrow in {0..2}; do
20 | for red in {0..5}; do
21 | for blockcol in {0..1}; do
22 | green=$((blockrow * 2 + blockcol))
23 | for blue in {0..5}; do
24 | $showcolor $((red * 36 + green * 6 + blue + 16)) $green
25 | done
26 | echo -n " "
27 | done
28 | echo
29 | done
30 | echo
31 | done
32 |
33 | echo 24 grayscale color codes:
34 | for row in {0..1}; do
35 | for col in {0..11}; do
36 | $showcolor $((row * 12 + col + 232)) $row
37 | done
38 | echo
39 | done
40 | echo
41 | }
42 |
43 | _showcolor256_fg() {
44 | local code=$(printf %03d $1)
45 | echo -ne "\033[38;5;${code}m"
46 | echo -nE " $code "
47 | echo -ne "\033[0m"
48 | }
49 |
50 | _showcolor256_bg() {
51 | if (($2 % 2 == 0)); then
52 | echo -ne "\033[1;37m"
53 | else
54 | echo -ne "\033[0;30m"
55 | fi
56 | local code=$(printf %03d $1)
57 | echo -ne "\033[48;5;${code}m"
58 | echo -nE " $code "
59 | echo -ne "\033[0m"
60 | }
61 |
62 | showcolors256 "$1"
63 |
--------------------------------------------------------------------------------
/.config/awesome/ui/wibar/taglist.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local wibox = require("wibox")
3 | local dpi = require("beautiful.xresources").apply_dpi
4 |
5 | local taglist = function(s)
6 | return awful.widget.taglist({
7 | screen = s,
8 | filter = awful.widget.taglist.filter.noempty,
9 | buttons = {
10 | awful.button({}, 1, function(t)
11 | t:view_only()
12 | end),
13 | awful.button({}, 3, awful.tag.viewtoggle),
14 | -- awful.button({}, 4, function(t)
15 | -- awful.tag.viewprev(t.screen)
16 | -- end),
17 | -- awful.button({}, 5, function(t)
18 | -- awful.tag.viewnext(t.screen)
19 | -- end),
20 | },
21 | widget_template = {
22 | {
23 | {
24 | {
25 | id = "icon_role",
26 | widget = wibox.widget.imagebox,
27 | },
28 | -- {
29 | -- id = "text_role",
30 | -- widget = wibox.widget.textbox,
31 | -- },
32 | -- spacing = dpi(6),
33 | layout = wibox.layout.fixed.horizontal,
34 | },
35 | top = dpi(2),
36 | bottom = dpi(2),
37 | left = dpi(6),
38 | right = dpi(6),
39 | widget = wibox.container.margin,
40 | },
41 | id = "background_role",
42 | widget = wibox.container.background,
43 | },
44 | })
45 | end
46 |
47 | return taglist
48 |
--------------------------------------------------------------------------------
/.config/awesome/ui/wibar/clock.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local wibox = require("wibox")
3 | local beautiful = require("beautiful")
4 | local dpi = require("beautiful.xresources").apply_dpi
5 |
6 | local clock = wibox.widget({
7 | {
8 | {
9 | {
10 | id = "clock_icon_role",
11 | image = beautiful.clock_icon,
12 | resize = true,
13 | halign = "center",
14 | valign = "center",
15 | forced_width = dpi(6) * 3,
16 | forced_height = dpi(6) * 3,
17 | widget = wibox.widget.imagebox,
18 | },
19 | {
20 | id = "clock_text_role",
21 | format = "%H:%M",
22 | halign = "center",
23 | valign = "center",
24 | widget = wibox.widget.textclock,
25 | },
26 | spacing = dpi(6),
27 | layout = wibox.layout.fixed.horizontal,
28 | },
29 | left = dpi(6),
30 | right = dpi(6),
31 | widget = wibox.container.margin,
32 | },
33 | bg = beautiful.colors.background,
34 | widget = wibox.container.background,
35 | })
36 |
37 | awful.tooltip({
38 | objects = { clock },
39 | timer_function = function()
40 | return os.date("Today is %A %B %d %Y\nThe time is %T\nClick to copy time to the clipboard")
41 | end,
42 | align = "bottom",
43 | mode = "outside",
44 | })
45 |
46 | clock:add_button(awful.button({}, 1, nil, function()
47 | local time = tostring(os.date("%Y%m%d%H%M"))
48 | io.popen("xclip -selection clipboard", "w"):write(time):close()
49 | end))
50 |
51 | return clock
52 |
--------------------------------------------------------------------------------
/.config/nvim/lua/plugins/treesitter.lua:
--------------------------------------------------------------------------------
1 | return {
2 | -- Parser generator tool
3 | {
4 | "nvim-treesitter/nvim-treesitter",
5 | event = { "BufReadPre", "BufNewFile" },
6 | build = ":TSUpdate",
7 | dependencies = {
8 | "nvim-treesitter/nvim-treesitter-textobjects",
9 | },
10 | config = function()
11 | require("nvim-treesitter.configs").setup({
12 | ensure_installed = {
13 | "bash",
14 | "c",
15 | "comment",
16 | "css",
17 | "diff",
18 | "html",
19 | "javascript",
20 | "json",
21 | "jsonc",
22 | "lua",
23 | "markdown",
24 | "markdown_inline",
25 | "python",
26 | "query",
27 | "regex",
28 | "vim",
29 | "yaml",
30 | },
31 | auto_install = true,
32 | highlight = { enable = true },
33 | indent = { enable = true },
34 | incremental_selection = {
35 | enable = true,
36 | keymaps = {
37 | init_selection = "",
38 | node_incremental = "",
39 | scope_incremental = false,
40 | node_decremental = "",
41 | },
42 | },
43 | -- nvim-treesitter/nvim-treesitter-textobjects
44 | textobjects = {},
45 | })
46 | end,
47 | },
48 | }
49 |
--------------------------------------------------------------------------------
/.config/awesome/ui/wibar/tasklist.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local wibox = require("wibox")
3 | local dpi = require("beautiful.xresources").apply_dpi
4 |
5 | local utils = require("utils")
6 |
7 | local tasklist = function(s)
8 | return awful.widget.tasklist({
9 | screen = s,
10 | filter = awful.widget.tasklist.filter.currenttags,
11 | buttons = {
12 | awful.button({}, 1, function(c)
13 | c:activate({ context = "tasklist", action = "toggle_minimization" })
14 | end),
15 | awful.button({}, 2, function(c)
16 | c:kill()
17 | end),
18 | awful.button({}, 3, function(c)
19 | awesome.emit_signal("clientmenu::toggle", c)
20 | end),
21 | -- awful.button({}, 4, function()
22 | -- awful.client.focus.byidx(-1)
23 | -- end),
24 | -- awful.button({}, 5, function()
25 | -- awful.client.focus.byidx(1)
26 | -- end),
27 | },
28 | layout = { layout = wibox.layout.fixed.horizontal },
29 | widget_template = {
30 | {
31 | {
32 | id = "client_icon_role",
33 | widget = wibox.widget.imagebox,
34 | },
35 | top = dpi(2),
36 | bottom = dpi(2),
37 | left = dpi(6),
38 | right = dpi(6),
39 | widget = wibox.container.margin,
40 | },
41 | id = "background_role",
42 | widget = wibox.container.background,
43 | create_callback = function(self, c, index, clients)
44 | self:get_children_by_id("client_icon_role")[1].image = utils.client.get_icon_client(c)
45 | end,
46 | },
47 | })
48 | end
49 |
50 | return tasklist
51 |
--------------------------------------------------------------------------------
/.config/htop/htoprc:
--------------------------------------------------------------------------------
1 | # Beware! This file is rewritten by htop when settings are changed in the interface.
2 | # The parser is also very primitive, and not human-friendly.
3 | htop_version=3.3.0
4 | config_reader_min_version=3
5 | fields=0 48 17 18 38 39 40 2 46 47 49 1
6 | hide_kernel_threads=1
7 | hide_userland_threads=0
8 | hide_running_in_container=0
9 | shadow_other_users=0
10 | show_thread_names=0
11 | show_program_path=1
12 | highlight_base_name=0
13 | highlight_deleted_exe=1
14 | shadow_distribution_path_prefix=0
15 | highlight_megabytes=1
16 | highlight_threads=1
17 | highlight_changes=0
18 | highlight_changes_delay_secs=5
19 | find_comm_in_cmdline=1
20 | strip_exe_from_cmdline=1
21 | show_merged_command=0
22 | header_margin=1
23 | screen_tabs=1
24 | detailed_cpu_time=0
25 | cpu_count_from_one=0
26 | show_cpu_usage=1
27 | show_cpu_frequency=0
28 | show_cpu_temperature=0
29 | degree_fahrenheit=0
30 | update_process_names=0
31 | account_guest_in_cpu_meter=0
32 | color_scheme=0
33 | enable_mouse=1
34 | delay=15
35 | hide_function_bar=0
36 | header_layout=two_50_50
37 | column_meters_0=LeftCPUs2 RightCPUs2 Memory Swap
38 | column_meter_modes_0=1 1 1 1
39 | column_meters_1=Tasks LoadAverage Uptime DiskIO NetworkIO Battery
40 | column_meter_modes_1=2 2 2 2 2 2
41 | tree_view=1
42 | sort_key=47
43 | tree_sort_key=0
44 | sort_direction=-1
45 | tree_sort_direction=1
46 | tree_view_always_by_pid=0
47 | all_branches_collapsed=0
48 | screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT M_SHARE STATE PERCENT_CPU PERCENT_MEM TIME Command
49 | .sort_key=PERCENT_MEM
50 | .tree_sort_key=PID
51 | .tree_view_always_by_pid=0
52 | .tree_view=1
53 | .sort_direction=-1
54 | .tree_sort_direction=1
55 | .all_branches_collapsed=0
56 | screen:I/O=PID USER IO_PRIORITY IO_RATE IO_READ_RATE IO_WRITE_RATE PERCENT_SWAP_DELAY PERCENT_IO_DELAY Command
57 | .sort_key=IO_RATE
58 | .tree_sort_key=PID
59 | .tree_view_always_by_pid=0
60 | .tree_view=1
61 | .sort_direction=-1
62 | .tree_sort_direction=1
63 | .all_branches_collapsed=0
64 |
--------------------------------------------------------------------------------
/.config/awesome/ui/dashboard/init.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local wibox = require("wibox")
3 | local beautiful = require("beautiful")
4 | local dpi = require("beautiful.xresources").apply_dpi
5 |
6 | local keys = require("config").keys
7 |
8 | local calendar_widget = require("ui.dashboard.calendar")
9 | local clock_widget = require("ui.dashboard.clock")
10 | local notifications_widget = require("ui.dashboard.notifications")
11 |
12 | local workarea = screen.primary.workarea
13 |
14 | local dashboard = wibox({
15 | widget = {
16 | {
17 | {
18 | {
19 | calendar_widget,
20 | clock_widget,
21 | fill_space = true,
22 | spacing = dpi(6) * 2,
23 | layout = wibox.layout.fixed.horizontal,
24 | },
25 | bottom = dpi(6) * 2,
26 | widget = wibox.container.margin,
27 | },
28 | notifications_widget,
29 | nil,
30 | layout = wibox.layout.align.vertical,
31 | },
32 | margins = dpi(6) * 2,
33 | widget = wibox.container.margin,
34 | },
35 | type = "dock",
36 | screen = screen.primary,
37 | visible = false,
38 | ontop = true,
39 | width = dpi(6) * 10 * 7,
40 | height = workarea.height - (beautiful.useless_gap * 4) - (beautiful.border_width * 2),
41 | border_width = beautiful.border_width,
42 | border_color = beautiful.colors.secondary,
43 | })
44 |
45 | awful.placement.left(dashboard, {
46 | honor_workarea = true,
47 | margins = beautiful.useless_gap * 2,
48 | })
49 |
50 | awesome.connect_signal("dashboard::toggle", function()
51 | dashboard.visible = not dashboard.visible
52 | end)
53 |
54 | awful.keyboard.append_global_keybindings({
55 | awful.key({ keys.super }, "d", function()
56 | awesome.emit_signal("dashboard::toggle")
57 | end, { description = "Toggle dashboard", group = "awesome" }),
58 | })
59 |
--------------------------------------------------------------------------------
/.local/bin/powermenu:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | mesg="Uptime: $(uptime -p | sed -e 's/up //g')"
4 |
5 | lock='Lock'
6 | logout='Logout'
7 | suspend='Suspend'
8 | hibernate="Hibernate"
9 | reboot='Reboot'
10 | poweroff='Poweroff'
11 |
12 | get_choice() {
13 | if [ -f /usr/bin/rofi ]; then
14 | list_col='6'
15 | list_row='1'
16 | echo -e "$lock\n$logout\n$suspend\n$hibernate\n$reboot\n$poweroff" |
17 | rofi \
18 | -dmenu \
19 | -mesg "$mesg" \
20 | -i \
21 | -theme-str "
22 | configuration {
23 | show-icons: false;
24 | }
25 | window {
26 | width: 1000px;
27 | }
28 | listview {
29 | columns: $list_col;
30 | lines: $list_row;
31 | scrollbar: false;
32 | }
33 | inputbar {
34 | enabled: false;
35 | }
36 | element-text {
37 | horizontal-align: 0.5;
38 | }"
39 | elif [ -f /usr/bin/dmenu ]; then
40 | echo -e "$lock\n$logout\n$suspend\n$hibernate\n$reboot\n$poweroff" |
41 | dmenu \
42 | -i \
43 | -p "$mesg" \
44 | -fn 'monospace-14' \
45 | -nf '#c5c8c6' \
46 | -nb '#1d1f21' \
47 | -sf '#c5c8c6' \
48 | -sb '#373B41'
49 | else
50 | exit 0
51 | fi
52 | }
53 |
54 | choice="$(get_choice)"
55 |
56 | case ${choice} in
57 | $lock)
58 | loginctl lock-session self
59 | ;;
60 | $logout)
61 | loginctl kill-session self
62 | ;;
63 | $suspend)
64 | /usr/bin/systemctl suspend
65 | ;;
66 | $hibernate)
67 | /usr/bin/systemctl hibernate
68 | ;;
69 | $reboot)
70 | /usr/bin/systemctl reboot
71 | ;;
72 | $poweroff)
73 | /usr/bin/systemctl poweroff
74 | ;;
75 | esac
76 |
--------------------------------------------------------------------------------
/.config/awesome/utils/color.lua:
--------------------------------------------------------------------------------
1 | local rawset = rawset
2 | local tonumber = tonumber
3 | local math = math
4 | local string = string
5 | local gcolor = require("gears.color")
6 | local gdebug = require("gears.debug")
7 |
8 | local M = {
9 | black = "#000000",
10 | white = "#FFFFFF",
11 | transparent = "#00000000",
12 | unknown = "#FFFF00", -- Something bright, easy to spot
13 | }
14 |
15 | function M.change(value, args)
16 | if not args then
17 | return value or M.black
18 | end
19 |
20 | local r, g, b, a = gcolor.parse_color(value)
21 | if r == nil then
22 | return M.black
23 | end
24 |
25 | if args.lighten then
26 | if args.lighten > 0 then
27 | r = r + ((1 - r) * args.lighten)
28 | g = g + ((1 - g) * args.lighten)
29 | b = b + ((1 - b) * args.lighten)
30 | elseif args.lighten < 0 then
31 | r = r + (r * args.lighten)
32 | g = g + (g * args.lighten)
33 | b = b + (b * args.lighten)
34 | end
35 | end
36 |
37 | if args.alpha then
38 | a = args.alpha
39 | end
40 |
41 | local function get_channel_value(channel)
42 | channel = channel * 255
43 | return math.floor(channel < 0 and 0 or (channel > 255 and 255 or channel))
44 | end
45 |
46 | r = get_channel_value(r)
47 | g = get_channel_value(g)
48 | b = get_channel_value(b)
49 | a = get_channel_value(a)
50 |
51 | if a < 255 then
52 | return string.format("#%02x%02x%02x%02x", r, g, b, a)
53 | else
54 | return string.format("#%02x%02x%02x", r, g, b)
55 | end
56 | end
57 |
58 | M.palette_metatable = {}
59 |
60 | function M.palette_metatable.__index(t, k)
61 | local name, value = string.match(k, "^([_%a]+)_(%d+)$")
62 | if not name then
63 | gdebug.print_warning("Unknown color '" .. k .. "'")
64 | rawset(t, k, M.unknown)
65 | return M.unknown
66 | end
67 | value = (tonumber(value) - 100) / 100
68 |
69 | local source_color = t[name]
70 | local new_color = M.change(source_color, { lighten = value })
71 |
72 | rawset(t, k, new_color)
73 | return new_color
74 | end
75 |
76 | return M
77 |
--------------------------------------------------------------------------------
/.config/nvim/lua/plugins/formatting.lua:
--------------------------------------------------------------------------------
1 | return {
2 | "stevearc/conform.nvim",
3 | dependencies = {
4 | "williamboman/mason.nvim",
5 | },
6 | lazy = true,
7 | event = { "BufWritePre" },
8 | cmd = { "ConformInfo" },
9 | keys = {
10 | {
11 | "lf",
12 | function()
13 | require("conform").format({ async = true, lsp_fallback = true })
14 | end,
15 | mode = { "n", "v" },
16 | desc = "Format document",
17 | },
18 | },
19 | opts = {
20 | -- Define formatters
21 | formatters_by_ft = {
22 | javascript = { "prettier" },
23 | typescript = { "prettier" },
24 | javascriptreact = { "prettier" },
25 | typescriptreact = { "prettier" },
26 | css = { "prettier" },
27 | html = { "prettier" },
28 | json = { "prettier" },
29 | yaml = { "prettier" },
30 | markdown = { "prettier" },
31 | lua = { "stylua" },
32 | bash = { "shfmt" },
33 | },
34 | -- Customize formatters
35 | formatters = {
36 | ["stylua"] = {
37 | prepend_args = {
38 | "--indent-type",
39 | "Spaces",
40 | "--column-width",
41 | "200",
42 | },
43 | },
44 | ["prettier"] = {
45 | prepend_args = {
46 | "--tab-width",
47 | "4",
48 | "--print-width",
49 | "120",
50 | "--no-semi",
51 | "--single-quote",
52 | "--config-precedence",
53 | "file-override",
54 | },
55 | },
56 | ["shfmt"] = {
57 | prepend_args = {
58 | "--indent",
59 | "4",
60 | },
61 | },
62 | },
63 | },
64 | init = function()
65 | -- If you want the formatexpr, here is the place to set it
66 | vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
67 | end,
68 | }
69 |
--------------------------------------------------------------------------------
/.config/.xprofile:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Adds ~/.local/bin and its subdirectories to $PATH
4 | export PATH="${PATH}:${HOME}/.local/bin"
5 |
6 | # XDG paths
7 | export XDG_CACHE_HOME="$HOME/.cache"
8 | export XDG_CONFIG_HOME="$HOME/.config"
9 | export XDG_DATA_HOME="$HOME/.local/share"
10 | export XDG_STATE_HOME="$HOME/.local/state"
11 |
12 | # Default program
13 | export EDITOR="nvim"
14 | export VISUAL="nvim"
15 | export TERMINAL="alacritty"
16 | export BROWSER="google-chrome-stable"
17 |
18 | # Ibus
19 | export GTK_IM_MODULE="ibus"
20 | export QT_IM_MODULE="ibus"
21 | export XMODIFIERS="@im=ibus"
22 |
23 | # Other
24 | export QT_QPA_PLATFORMTHEME="qt5ct"
25 | export ZDOTDIR="$HOME/.config/zsh"
26 | export BAT_THEME="base16"
27 | export RIPGREP_CONFIG_PATH="$HOME/.config/ripgrep/.ripgreprc"
28 | export TIMEFMT=$'\n\nCPU\t%P\nuser\t%*U\nsystem\t%*S\ntotal\t%*E'
29 | # export GTK_THEME="Orchis-Dark-Compact"
30 |
31 | # Monitor config
32 | [ -f ~/.screenlayout/single.sh ] && . ~/.screenlayout/single.sh &
33 | # [ -f ~/.screenlayout/dual.sh ] && . ~/.screenlayout/dual.sh &
34 | # Enable numlock
35 | [ -f /usr/bin/numlockx ] && numlockx &
36 | # Set a delay of 500ms and a rate of 40Hz
37 | [ -f /usr/bin/xset ] && xset r rate 500 40 &
38 | # Disable the screensaver
39 | [ -f /usr/bin/xset ] && xset s off && xset s noblank && xset -dpms &
40 | # Set locker utility
41 | [ -f /usr/bin/xss-lock ] && [ -f /usr/bin/slock ] && xss-lock /usr/bin/slock &
42 | # Network Manager Applet
43 | [ -f /usr/bin/nm-applet ] && nm-applet &
44 | # # Blueman Applet
45 | [ -f /usr/bin/blueman-applet ] && blueman-applet &
46 | # Set randomize wallpaper every 10 minutes
47 | bash -c '[ -f ~/.local/bin/randomwallpaper ] && while true; do ~/.local/bin/randomwallpaper && sleep 10m || break ; done' &
48 | # Load config nvidia-settings
49 | [ -f /usr/bin/nvidia-settings ] && nvidia-settings --load-config-only &
50 | # Ibus Daemon
51 | [ -f /usr/bin/ibus-daemon ] && ibus-daemon -rxRd &
52 | # Authentication
53 | [ -f /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 ] && /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
54 | # Clipboard manager
55 | [ -f /usr/bin/copyq ] && sh -c "sleep 1 && copyq --start-server" &
56 | # # Compositor
57 | # [ -f /usr/bin/picom ] && picom -b &
58 |
--------------------------------------------------------------------------------
/.config/awesome/ui/wibar/init.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local wibox = require("wibox")
3 | local dpi = require("beautiful.xresources").apply_dpi
4 |
5 | local tasklist = require("ui.wibar.tasklist")
6 | local taglist = require("ui.wibar.taglist")
7 | local layoutlist = require("ui.wibar.layoutlist")
8 |
9 | local minimization = require("ui.wibar.minimization")
10 | local dashboard = require("ui.wibar.dashboard")
11 | local clock = require("ui.wibar.clock")
12 | local systray = require("ui.wibar.systray")
13 | local playerbox = require("ui.wibar.playerbox")
14 | -- local volume = require("ui.wibar.volume")
15 | -- local mic = require("ui.wibar.mic")
16 | local cpu = require("ui.wibar.cpu")
17 | local memory = require("ui.wibar.memory")
18 | -- local gpu = require("ui.wibar.gpu")
19 | -- local net = require("ui.wibar.net")
20 |
21 | screen.connect_signal("request::desktop_decoration", function(s)
22 | local is_primary = s == screen.primary
23 |
24 | s.wibox = awful.wibar({
25 | -- visible = false,
26 | position = "top",
27 | screen = s,
28 | widget = {
29 | -- Left
30 | {
31 | is_primary and dashboard,
32 | taglist(s),
33 | is_primary and systray,
34 | tasklist(s),
35 | layout = wibox.layout.fixed.horizontal,
36 | },
37 | -- Middle
38 | {
39 | {
40 | playerbox,
41 | forced_width = dpi(6) * 50,
42 | widget = wibox.container.place,
43 | },
44 | widget = wibox.container.place,
45 | },
46 | -- Right
47 | {
48 | -- is_primary and net,
49 | -- is_primary and gpu,
50 | is_primary and memory,
51 | is_primary and cpu,
52 | -- is_primary and volume,
53 | -- is_primary and mic,
54 | is_primary and clock,
55 | layoutlist(s),
56 | minimization,
57 | layout = wibox.layout.fixed.horizontal,
58 | },
59 | layout = wibox.layout.align.horizontal,
60 | },
61 | })
62 | end)
63 |
--------------------------------------------------------------------------------
/.config/alacritty/alacritty.toml:
--------------------------------------------------------------------------------
1 | # Source https://alacritty.org/config-alacritty.html
2 |
3 | [env]
4 | # Export env
5 | TERM = "alacritty"
6 |
7 | [window]
8 | # Blank space added around the window in pixels.
9 | padding = { x = 8, y = 4 }
10 | # Window decorations
11 | decorations = "full"
12 | # Allow terminal applications to change Alacritty's window title.
13 | dynamic_title = true
14 | # Background opacity
15 | # opacity = 0.95
16 | # Prefer resizing window by discrete steps equal to cell dimensions.
17 | # resize_increments = true
18 |
19 | [font]
20 | # The normal (roman) font face to use.
21 | normal = { family = "Hack Nerd Font" }
22 | # Point size of the font
23 | size = 14
24 |
25 | [colors]
26 | # When true, bold text is drawn using the bright variant of colors.
27 | draw_bold_text_with_bright_colors = true
28 |
29 | # Hybrid theme
30 | [colors.primary]
31 | background = "#1d1f21"
32 | foreground = "#c5c8c6"
33 |
34 | [colors.normal]
35 | black = "#1d1f21"
36 | red = "#cc6666"
37 | green = "#b5bd68"
38 | yellow = "#f0c674"
39 | blue = "#81a2be"
40 | magenta = "#b294bb"
41 | cyan = "#8abeb7"
42 | white = "#c5c8c6"
43 |
44 | [colors.bright]
45 | black = "#373B41"
46 | red = "#d54e53"
47 | green = "#b9ca4a"
48 | yellow = "#e7c547"
49 | blue = "#7aa6da"
50 | magenta = "#c397d8"
51 | cyan = "#70c0b1"
52 | white = "#eaeaea"
53 |
54 | [keyboard]
55 | # Multiple keybindings
56 | bindings = [
57 | { key = "Back", mods = "Control", chars = "\u0017" },
58 | { key = "Return", mods = "Control|Shift", action = "SpawnNewInstance" },
59 | ]
60 |
61 | [selection]
62 | # When set to `true`, selected text will be copied to the primary clipboard.
63 | save_to_clipboard = true
64 |
65 | [[hints.enabled]]
66 | # Terminal hints can be used to find text or hyperlinks in the visible part of the terminal and pipe it to other applications.
67 | command = { program = "alacritty", args = [ "-e", "xdg-open" ] }
68 | hyperlinks = true
69 | post_processing = true
70 | persist = false
71 | mouse.enabled = true
72 | binding = { key = "U", mods = "Control|Shift" }
73 | regex = "(ipfs:|ipns:|magnet:|mailto:|gemini://|gopher://|https://|http://|news:|file:|git://|ssh:|ftp://)[^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+"
74 |
--------------------------------------------------------------------------------
/.config/picom/picom.conf:
--------------------------------------------------------------------------------
1 | # Shadow
2 |
3 | # Enabled client-side shadows on windows.
4 | shadow = true;
5 | # The blur radius for shadows,
6 | shadow-radius = 20;
7 | # The opacity of shadows.
8 | shadow-opacity = 0.5;
9 | # The left offset for shadows,
10 | shadow-offset-x = -20;
11 | # The top offset for shadows,
12 | shadow-offset-y = -20;
13 | # Specify a list of conditions of windows that should have no shadow.
14 | shadow-exclude = [
15 | "class_g = 'conky'",
16 | "class_g = 'Screenkey'",
17 | "_GTK_FRAME_EXTENTS@:c"
18 | ];
19 |
20 |
21 |
22 | # Opacity
23 |
24 | # Opacity of inactive windows.
25 | inactive-opacity = 0.9;
26 | # Opacity of window titlebars and borders.
27 | frame-opacity = 0.9;
28 | # Default opacity for active windows.
29 | active-opacity = 1.0
30 | # Dim inactive windows.
31 | inactive-dim = 0.0
32 | # Specify a list of conditions of windows that should never be considered focused.
33 | focus-exclude = [
34 | "class_g = 'Rofi'",
35 | "x = 0 && y = 0 && override_redirect = true",
36 | ];
37 | # Specify a list of opacity rules, in the format `PERCENT:PATTERN`,
38 | opacity-rule = [
39 | "100:_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'"
40 | ];
41 |
42 |
43 |
44 | # Fading
45 |
46 | # Fade windows in/out when opening/closing and when opacity changes,
47 | fading = true;
48 | # Opacity change between steps while fading in.
49 | fade-in-step = 0.05;
50 | # Opacity change between steps while fading out.
51 | fade-out-step = 0.05;
52 | # The time between steps in fade step,
53 | fade-delta = 5;
54 | # Specify a list of conditions of windows that should not be faded.
55 | fade-exclude = [];
56 |
57 |
58 |
59 | # General Settings
60 |
61 | # Specify the backend to use: `xrender`, `glx`, `egl` or `xr_glx_hybrid`.
62 | # `xrender` is the default one.
63 | backend = "glx";
64 | # Enable/disable VSync.
65 | vsync = true;
66 | # GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer.
67 | glx-no-stencil = true;
68 | # GLX backend: Avoid rebinding pixmap on window damage.
69 | glx-no-rebind-pixmap = false;
70 | # Disable the use of damage information.
71 | use-damage = true;
72 | # Use X Sync fence to sync clients' draw calls, to make sure all draw
73 | # calls are finished before picom starts drawing. Needed on nvidia-drivers
74 | # with GLX backend for some users.
75 | xrender-sync-fence = true;
76 |
77 |
78 | # Window type settings
79 |
80 | wintypes: {
81 | # dock = { shadow = false; clip-shadow-above = true; }
82 | # dnd = { shadow = false; }
83 | # menu = { shadow = false; }
84 | # popup_menu = { shadow = false; }
85 | # tooltip = { shadow = false; }
86 | };
87 |
--------------------------------------------------------------------------------
/.config/awesome/ui/titlebar.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local wibox = require("wibox")
3 | local beautiful = require("beautiful")
4 | local dpi = require("beautiful.xresources").apply_dpi
5 |
6 | local utils = require("utils")
7 | local keys = require("config").keys
8 |
9 | client.connect_signal("request::titlebars", function(c)
10 | local buttons = {
11 | awful.button({}, 1, function()
12 | c:activate({ context = "titlebar", action = "mouse_move" })
13 | end),
14 | awful.button({}, 2, function()
15 | c:kill()
16 | end),
17 | awful.button({}, 3, function()
18 | c:activate({ context = "titlebar", action = "mouse_resize" })
19 | end),
20 | }
21 |
22 | awful.titlebar(c, {
23 | size = beautiful.wibar_height,
24 | }).widget = {
25 | {
26 | -- Left
27 | {
28 | -- awful.titlebar.widget.iconwidget(c),
29 | {
30 | image = utils.client.get_icon_client(c),
31 | widget = wibox.widget.imagebox,
32 | },
33 | buttons = buttons,
34 | layout = wibox.layout.fixed.horizontal,
35 | },
36 | -- Middle
37 | {
38 | {
39 | halign = "center",
40 | widget = awful.titlebar.widget.titlewidget(c),
41 | },
42 | left = dpi(6) * 2,
43 | right = dpi(6) * 2,
44 | buttons = buttons,
45 | widget = wibox.container.margin,
46 | },
47 | -- Right
48 | {
49 | awful.titlebar.widget.stickybutton(c),
50 | awful.titlebar.widget.ontopbutton(c),
51 | awful.titlebar.widget.floatingbutton(c),
52 | awful.titlebar.widget.minimizebutton(c),
53 | awful.titlebar.widget.maximizedbutton(c),
54 | awful.titlebar.widget.closebutton(c),
55 | spacing = dpi(6),
56 | layout = wibox.layout.fixed.horizontal,
57 | },
58 | layout = wibox.layout.align.horizontal,
59 | },
60 | top = dpi(2),
61 | bottom = dpi(2),
62 | left = dpi(6),
63 | right = dpi(6),
64 | widget = wibox.container.margin,
65 | }
66 | end)
67 |
68 | client.connect_signal("request::default_keybindings", function()
69 | awful.keyboard.append_client_keybindings({
70 | awful.key({ keys.super }, "b", function(c)
71 | awful.titlebar.toggle(c)
72 | end, { description = "Toggle titlebar", group = "client" }),
73 | })
74 | end)
75 |
--------------------------------------------------------------------------------
/.config/awesome/ui/layoutlist.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local wibox = require("wibox")
3 | local beautiful = require("beautiful")
4 | local dpi = require("beautiful.xresources").apply_dpi
5 |
6 | local keys = require("config").keys
7 |
8 | screen.connect_signal("request::desktop_decoration", function(s)
9 | s.layoutlist = awful.popup({
10 | screen = s,
11 | widget = awful.widget.layoutlist({
12 | screen = s,
13 | widget_template = {
14 | {
15 | {
16 | {
17 | {
18 | id = "icon_role",
19 | scaling_quality = "fast",
20 | widget = wibox.widget.imagebox,
21 | },
22 | strategy = "exact",
23 | width = dpi(6) * 10 * 2,
24 | height = dpi(6) * 10 * 2,
25 | widget = wibox.container.constraint,
26 | },
27 | {
28 | id = "text_role",
29 | halign = "center",
30 | valign = "center",
31 | widget = wibox.widget.textbox,
32 | },
33 | spacing = dpi(6) * 2,
34 | layout = wibox.layout.fixed.vertical,
35 | },
36 | margins = dpi(6) * 2,
37 | widget = wibox.container.margin,
38 | },
39 | id = "background_role",
40 | widget = wibox.container.background,
41 | },
42 | }),
43 | type = "dock",
44 | placement = awful.placement.centered,
45 | border_width = beautiful.border_width,
46 | border_color = beautiful.colors.secondary,
47 | ontop = true,
48 | visible = false,
49 | })
50 | end)
51 |
52 | -- Switch layout
53 | awful.keygrabber({
54 | start_callback = function()
55 | awful.screen.focused().layoutlist.visible = true
56 | end,
57 | stop_callback = function()
58 | awful.screen.focused().layoutlist.visible = false
59 | end,
60 | export_keybindings = true,
61 | stop_event = "release",
62 | stop_key = { "Escape", "Super_L", "Super_R" },
63 | keybindings = {
64 | {
65 | { keys.super },
66 | " ",
67 | function()
68 | awful.layout.inc(1)
69 | end,
70 | {
71 | description = "Select next layout",
72 | group = "layout",
73 | },
74 | },
75 | {
76 | { keys.super, "Shift" },
77 | " ",
78 | function()
79 | awful.layout.inc(-1)
80 | end,
81 | {
82 | description = "Select previous layout",
83 | group = "layout",
84 | },
85 | },
86 | },
87 | })
88 |
--------------------------------------------------------------------------------
/.config/awesome/ui/wibar/mic.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local wibox = require("wibox")
3 | local gears = require("gears")
4 | local beautiful = require("beautiful")
5 | local dpi = require("beautiful.xresources").apply_dpi
6 |
7 | local pango = require("utils").pango
8 |
9 | local mic = wibox.widget({
10 | {
11 | {
12 | {
13 | id = "mic_icon_role",
14 | image = beautiful.mic_icon,
15 | resize = true,
16 | halign = "center",
17 | valign = "center",
18 | forced_width = dpi(6) * 3,
19 | forced_height = dpi(6) * 3,
20 | widget = wibox.widget.imagebox,
21 | },
22 | {
23 | id = "mic_text_role",
24 | halign = "center",
25 | valign = "center",
26 | widget = wibox.widget.textbox,
27 | },
28 | spacing = dpi(6),
29 | layout = wibox.layout.fixed.horizontal,
30 | },
31 | left = dpi(6),
32 | right = dpi(6),
33 | widget = wibox.container.margin,
34 | },
35 | bg = beautiful.colors.background,
36 | widget = wibox.container.background,
37 | buttons = {
38 | awful.button({}, 1, function()
39 | awful.spawn("pactl set-source-mute @DEFAULT_SOURCE@ toggle")
40 | awesome.emit_signal("mic::changed")
41 | end),
42 | awful.button({}, 4, function()
43 | awful.spawn("pactl set-source-volume @DEFAULT_SOURCE@ +5%")
44 | awesome.emit_signal("mic::changed")
45 | end),
46 | awful.button({}, 5, function()
47 | awful.spawn("pactl set-source-volume @DEFAULT_SOURCE@ -5%")
48 | awesome.emit_signal("mic::changed")
49 | end),
50 | },
51 | })
52 |
53 | awesome.connect_signal("mic::changed", function()
54 | awful.spawn.easy_async({ "sh", "-c", "pactl get-source-volume @DEFAULT_SOURCE@ | awk 'NR==1{print $5}' && pactl get-source-mute @DEFAULT_SOURCE@ | awk 'NR==1{print $2}'" }, function(out)
55 | local value, muted = string.match(out, "^(.-)\n(.-)\n$")
56 | if muted == "yes" then
57 | mic:get_children_by_id("mic_text_role")[1].markup = pango.span({ "muted", foreground = beautiful.colors.medium })
58 | mic:get_children_by_id("mic_icon_role")[1].image = beautiful.mic_mute_icon
59 | else
60 | mic:get_children_by_id("mic_text_role")[1].markup = value
61 | mic:get_children_by_id("mic_icon_role")[1].image = beautiful.mic_icon
62 | end
63 | end)
64 | end)
65 |
66 | awful.spawn.easy_async("which pactl", function(stdout, stderr, reason, exit_code)
67 | if exit_code == 0 then
68 | gears.timer({
69 | timeout = 5,
70 | call_now = true,
71 | autostart = true,
72 | callback = function()
73 | awesome.emit_signal("mic::changed")
74 | end,
75 | })
76 | else
77 | mic.visible = false
78 | end
79 | end)
80 |
81 | return mic
82 |
--------------------------------------------------------------------------------
/.config/awesome/ui/wibar/volume.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local wibox = require("wibox")
3 | local gears = require("gears")
4 | local beautiful = require("beautiful")
5 | local dpi = require("beautiful.xresources").apply_dpi
6 |
7 | local pango = require("utils").pango
8 |
9 | local volume = wibox.widget({
10 | {
11 | {
12 | {
13 | id = "volume_icon_role",
14 | image = beautiful.volume_icon,
15 | resize = true,
16 | halign = "center",
17 | valign = "center",
18 | forced_width = dpi(6) * 3,
19 | forced_height = dpi(6) * 3,
20 | widget = wibox.widget.imagebox,
21 | },
22 | {
23 | id = "volume_text_role",
24 | halign = "center",
25 | valign = "center",
26 | widget = wibox.widget.textbox,
27 | },
28 | spacing = dpi(6),
29 | layout = wibox.layout.fixed.horizontal,
30 | },
31 | left = dpi(6),
32 | right = dpi(6),
33 | widget = wibox.container.margin,
34 | },
35 | bg = beautiful.colors.background,
36 | widget = wibox.container.background,
37 | buttons = {
38 | awful.button({}, 1, function()
39 | awful.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")
40 | awesome.emit_signal("volume::changed")
41 | end),
42 | awful.button({}, 4, function()
43 | awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ +5%")
44 | awesome.emit_signal("volume::changed")
45 | end),
46 | awful.button({}, 5, function()
47 | awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ -5%")
48 | awesome.emit_signal("volume::changed")
49 | end),
50 | },
51 | })
52 |
53 | awesome.connect_signal("volume::changed", function()
54 | awful.spawn.easy_async({ "sh", "-c", "pactl get-sink-volume @DEFAULT_SINK@ | awk 'NR==1{print $5}' && pactl get-sink-mute @DEFAULT_SINK@ | awk 'NR==1{print $2}'" }, function(out)
55 | local value, muted = string.match(out, "^(.-)\n(.-)\n$")
56 | if muted == "yes" then
57 | volume:get_children_by_id("volume_text_role")[1].markup = pango.span({ "muted", foreground = beautiful.colors.medium })
58 | volume:get_children_by_id("volume_icon_role")[1].image = beautiful.volume_mute_icon
59 | else
60 | volume:get_children_by_id("volume_text_role")[1].markup = value
61 | volume:get_children_by_id("volume_icon_role")[1].image = beautiful.volume_icon
62 | end
63 | end)
64 | end)
65 |
66 | awful.spawn.easy_async("which pactl", function(stdout, stderr, reason, exit_code)
67 | if exit_code == 0 then
68 | gears.timer({
69 | timeout = 5,
70 | call_now = true,
71 | autostart = true,
72 | callback = function()
73 | awesome.emit_signal("volume::changed")
74 | end,
75 | })
76 | else
77 | volume.visible = false
78 | end
79 | end)
80 |
81 | return volume
82 |
--------------------------------------------------------------------------------
/.config/nvim/lua/core/autocommands.lua:
--------------------------------------------------------------------------------
1 | vim.api.nvim_create_autocmd("FileType", {
2 | pattern = {
3 | "help",
4 | "man",
5 | "query",
6 | "qf",
7 | "checkhealth",
8 | "dap-float",
9 | "gitsigns-blame"
10 | },
11 | callback = function(event)
12 | vim.bo[event.buf].buflisted = false
13 | vim.keymap.set("n", "q", "close", { buffer = event.buf, silent = true })
14 | end,
15 | desc = "Close some filetypes with ",
16 | })
17 |
18 | vim.api.nvim_create_autocmd("TextYankPost", {
19 | callback = function()
20 | vim.highlight.on_yank()
21 | end,
22 | desc = "Highlight on yank",
23 | })
24 |
25 | vim.api.nvim_create_autocmd({ "VimResized" }, {
26 | callback = function()
27 | vim.cmd("tabdo wincmd =")
28 | end,
29 | desc = "Auto adjust resize",
30 | })
31 |
32 | vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
33 | callback = function()
34 | vim.cmd("set formatoptions-=cro")
35 | end,
36 | desc = "Disable automatic comment in newline",
37 | })
38 |
39 | vim.api.nvim_create_autocmd({ "BufWritePre" }, {
40 | callback = function(event)
41 | if event.match:match("^%w%w+://") then
42 | return
43 | end
44 | local file = vim.loop.fs_realpath(event.match) or event.match
45 | vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
46 | end,
47 | desc = "Auto create dir when saving a file",
48 | })
49 |
50 | vim.api.nvim_create_augroup("CursorInsertMode", { clear = true })
51 | vim.api.nvim_create_autocmd({ "InsertLeave", "WinEnter" }, {
52 | callback = function()
53 | vim.opt.cursorline = true
54 | end,
55 | group = "CursorInsertMode",
56 | desc = "Enable cursorline in normal mode",
57 | })
58 |
59 | vim.api.nvim_create_autocmd({ "InsertEnter", "WinLeave" }, {
60 | callback = function()
61 | vim.opt.cursorline = false
62 | end,
63 | group = "CursorInsertMode",
64 | desc = "Disable cursorline on insert",
65 | })
66 |
67 | -- vim.api.nvim_create_autocmd("BufRead", {
68 | -- callback = function()
69 | -- vim.api.nvim_create_autocmd("BufWinEnter", {
70 | -- once = true,
71 | -- callback = function()
72 | -- vim.defer_fn(function()
73 | -- vim.cmd([[:silent! loadview]])
74 | -- end, 60)
75 | -- end,
76 | -- desc = "Load the view for the current file",
77 | -- })
78 | -- end,
79 | -- })
80 | --
81 | -- vim.api.nvim_create_autocmd({ "BufWritePost" }, {
82 | -- callback = function()
83 | -- vim.cmd([[:mkview]])
84 | -- end,
85 | -- desc = "Store the view for the current window",
86 | -- })
87 |
88 | -- if vim.fn.has("wsl") == 1 then
89 | -- vim.api.nvim_create_autocmd("TextYankPost", {
90 | -- group = vim.api.nvim_create_augroup("Yank", { clear = true }),
91 | -- callback = function()
92 | -- vim.fn.system("clip.exe", vim.fn.getreg('"'))
93 | -- end,
94 | -- desc = "Yanking to windows clipboard from nvim (WSL)",
95 | -- })
96 | -- end
97 |
--------------------------------------------------------------------------------
/.config/nvim/lua/core/options.lua:
--------------------------------------------------------------------------------
1 | vim.opt.breakindent = true -- Maintain indent when wrapping indented lines
2 | vim.opt.linebreak = true -- Wrap at word boundaries
3 | vim.opt.clipboard = "unnamedplus" -- Sync with system clipboard
4 | vim.opt.completeopt = { "menu", "menuone", "noselect" } -- Mostly just for cmp
5 | vim.opt.confirm = true -- Confirm to save changes before exiting modified buffer
6 | vim.opt.cursorline = true -- Enable highlighting of the current line
7 | vim.opt.expandtab = true -- Convert tabs to spaces
8 | vim.opt.fileencoding = "utf-8" -- The encoding written to a file
9 | vim.opt.ignorecase = true -- Ignore case
10 | vim.opt.laststatus = 3 -- Global statusline
11 | vim.opt.mouse = "a" -- Enable mouse mode
12 | vim.opt.number = true -- Print line number
13 | vim.opt.pumheight = 10 -- Maximum number of entries in a popup
14 | vim.opt.updatetime = 300 -- Faster completion (4000ms default)
15 | vim.opt.shiftround = true -- Round indent
16 | vim.opt.shiftwidth = 4 -- Size of an indent
17 | vim.opt.showmode = false -- Don't show mode since we have a statusline
18 | vim.opt.showtabline = 0 -- Never show tabs
19 | vim.opt.scrolloff = 4 -- Minimal number of screen lines to keep above and below the cursor
20 | vim.opt.sidescrolloff = 8 -- Minimal number of screen columns to keep to the left and right of the cursor
21 | vim.opt.signcolumn = "yes" -- Always show the sign column, otherwise it would shift the text each time
22 | vim.opt.smartcase = true -- Don't ignore case with capitals
23 | vim.opt.smartindent = true -- Insert indents automatically
24 | vim.opt.splitbelow = true -- Put new windows below current
25 | vim.opt.splitright = true -- Put new windows right of current
26 | vim.opt.tabstop = 4 -- Insert 4 spaces for a tab
27 | vim.opt.termguicolors = true -- True color support
28 | vim.opt.virtualedit = "block" -- Allow cursor to move where there is no text in visual block mode
29 | vim.opt.whichwrap:append("<,>,[,],h,l") -- Keys allowed to move to the previous/next line when the beginning/end of line is reached
30 | vim.opt.wrap = true -- Enable line wrap
31 | vim.opt.ruler = false -- Hide the line and column number of the cursor position
32 | vim.opt.undofile = true -- Automatically saves undo history to an undo file
33 | vim.opt.fillchars:append({ eob = " " }) -- show empty lines at the end of a buffer as ` ` {default `~`}
34 | -- Session options
35 | vim.opt.sessionoptions = { "buffers", "curdir", "folds", "help", "tabpages", "terminal", "winsize" }
36 | -- Fold option
37 | vim.opt.foldmethod = "expr"
38 | vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
39 | vim.opt.foldlevel = 99
40 | vim.opt.foldlevelstart = 99
41 | -- Spell check
42 | vim.opt.spell = false
43 | vim.opt.spelllang = { "en" }
44 | vim.opt.spelloptions = "camel"
45 | -- List mode
46 | vim.opt.list = true -- Show some invisible characters (tabs...
47 | vim.opt.listchars:append({
48 | space = "·",
49 | eol = "⤶",
50 | extends = "▷",
51 | precedes = "◁",
52 | })
53 |
54 | -- vim.o.winborder = 'rounded' -- Defines the default border style of floating windows
55 | -- vim.opt.textwidth = 80 -- Maximum width of text that is being inserted
56 | -- vim.opt.colorcolumn = "+1" -- Set the colour column to highlight one column after the 'textwidth'
57 | -- vim.opt.iskeyword:append("-") -- Treats words with `-` as single words
58 |
--------------------------------------------------------------------------------
/.config/awesome/ui/dashboard/notifications.lua:
--------------------------------------------------------------------------------
1 | local wibox = require("wibox")
2 | local awful = require("awful")
3 | local beautiful = require("beautiful")
4 | local naughty = require("naughty")
5 | local dpi = require("beautiful.xresources").apply_dpi
6 |
7 | local pango = require("utils").pango
8 |
9 | local notifications = wibox.widget({
10 | {
11 | {
12 | {
13 | {
14 | {
15 | id = "header_role",
16 | markup = pango.b("Notifications") .. " " .. #naughty.notification_list.children,
17 | align = "center",
18 | valign = "center",
19 | widget = wibox.widget.textbox,
20 | },
21 | top = dpi(6),
22 | bottom = dpi(6),
23 | left = dpi(6) * 2,
24 | right = dpi(6) * 2,
25 | widget = wibox.container.margin,
26 | },
27 | fg = beautiful.colors.foreground,
28 | bg = beautiful.colors.secondary,
29 | widget = wibox.container.background,
30 | },
31 | nil,
32 | {
33 | {
34 | {
35 | markup = pango.b("Clear"),
36 | align = "center",
37 | valign = "center",
38 | widget = wibox.widget.textbox,
39 | buttons = {
40 | awful.button({}, 1, function()
41 | naughty.notification_list:reset()
42 | naughty.destroy_all_notifications()
43 | end),
44 | },
45 | },
46 | top = dpi(6),
47 | bottom = dpi(6),
48 | left = dpi(6) * 2,
49 | right = dpi(6) * 2,
50 | widget = wibox.container.margin,
51 | },
52 | fg = beautiful.colors.background,
53 | bg = beautiful.colors.high,
54 | widget = wibox.container.background,
55 | },
56 | layout = wibox.layout.align.horizontal,
57 | },
58 | naughty.notification_list,
59 | spacing = dpi(6) * 2,
60 | layout = wibox.layout.fixed.vertical,
61 | },
62 | {
63 | id = "empty_role",
64 | {
65 | markup = pango.i("NO NOTIFICATIONS"),
66 | align = "center",
67 | valign = "center",
68 | widget = wibox.widget.textbox,
69 | },
70 | visible = true,
71 | widget = wibox.container.place,
72 | },
73 | nil,
74 | layout = wibox.layout.align.vertical,
75 | })
76 |
77 | naughty.notification_list:connect_signal("widget::layout_changed", function()
78 | notifications:get_children_by_id("header_role")[1].markup = pango.b("Notifications") .. " " .. #naughty.notification_list.children
79 | if #naughty.notification_list.children == 0 then
80 | notifications:get_children_by_id("empty_role")[1].visible = true
81 | else
82 | notifications:get_children_by_id("empty_role")[1].visible = false
83 | end
84 | end)
85 |
86 | return notifications
87 |
--------------------------------------------------------------------------------
/.config/awesome/ui/clientmenu.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local beautiful = require("beautiful")
3 | local dpi = require("beautiful.xresources").apply_dpi
4 |
5 | local clientmenu = nil
6 |
7 | local default_messages = {
8 | close = "Close",
9 | minimize = "Minimize",
10 | maximized_active = "Unmaximize",
11 | maximized_inactive = "Maximize",
12 | floating_active = "Tiling",
13 | floating_inactive = "Floating",
14 | ontop_active = "NotOnTop",
15 | ontop_inactive = "OnTop",
16 | sticky_active = "NotSticky",
17 | sticky_inactive = "Sticky",
18 | }
19 |
20 | local function build_item(c, name, selector, action)
21 | local item = {
22 | name = nil,
23 | icon = nil,
24 | action = action,
25 | }
26 |
27 | local img = selector()
28 | if type(img) ~= "nil" then
29 | if type(img) == "boolean" then
30 | if img then
31 | img = "active"
32 | else
33 | img = "inactive"
34 | end
35 | end
36 |
37 | local prefix = "normal"
38 | if c.active then
39 | prefix = "focus"
40 | end
41 |
42 | if img ~= "" then
43 | prefix = prefix .. "_"
44 | end
45 |
46 | item.name = default_messages[name .. "_" .. img] or default_messages[name] or name
47 |
48 | item.icon = beautiful["titlebar_" .. name .. "_button_" .. prefix .. img]
49 | end
50 |
51 | return { item.name, item.action, item.icon }
52 | end
53 |
54 | local function build_menu(c)
55 | local floating_buttom = build_item(c, "floating", function()
56 | return c.floating
57 | end, function()
58 | c.floating = not c.floating
59 | end)
60 |
61 | local close_buttom = build_item(c, "close", function()
62 | return ""
63 | end, function()
64 | c:kill()
65 | end)
66 |
67 | local minimize_buttom = build_item(c, "minimize", function()
68 | return ""
69 | end, function()
70 | c.minimized = not c.minimized
71 | end)
72 |
73 | local maximized_buttom = build_item(c, "maximized", function()
74 | return c.maximized
75 | end, function()
76 | c.maximized = not c.maximized
77 | end)
78 |
79 | local ontop_buttom = build_item(c, "ontop", function()
80 | return c.ontop
81 | end, function()
82 | c.ontop = not c.ontop
83 | end)
84 |
85 | local sticky_buttom = build_item(c, "sticky", function()
86 | return c.sticky
87 | end, function()
88 | c.sticky = not c.sticky
89 | end)
90 |
91 | local menu = awful.menu({
92 | items = {
93 | ontop_buttom,
94 | sticky_buttom,
95 | floating_buttom,
96 | not c.minimized and minimize_buttom,
97 | maximized_buttom,
98 | close_buttom,
99 | },
100 | theme = {
101 | width = dpi(6) * 10 * 3,
102 | -- border_color = c.active and beautiful.colors.primary,
103 | },
104 | })
105 |
106 | menu:show()
107 |
108 | return menu
109 | end
110 |
111 | local function toggle(c)
112 | if clientmenu and clientmenu.wibox.visible then
113 | clientmenu:hide()
114 | clientmenu = nil
115 | else
116 | clientmenu = build_menu(c)
117 | end
118 | end
119 |
120 | awesome.connect_signal("clientmenu::toggle", function(c)
121 | toggle(c)
122 | end)
123 |
--------------------------------------------------------------------------------
/.config/tmux/tmux.conf:
--------------------------------------------------------------------------------
1 | # Remap prefix from 'C-b' to 'C-a'
2 | unbind C-b
3 | set -g prefix C-a
4 | bind C-a send-prefix
5 |
6 | # Add binding to reload tmux.conf for fast
7 | bind r source-file ~/.config/tmux/tmux.conf \; display "Reloaded!"
8 |
9 | # Split panes using | and _
10 | unbind '"'
11 | unbind '%'
12 | bind | split-window -h -c "#{pane_current_path}"
13 | bind _ split-window -v -c "#{pane_current_path}"
14 |
15 | # Pane select
16 | bind -r k select-pane -U
17 | bind -r j select-pane -D
18 | bind -r h select-pane -L
19 | bind -r l select-pane -R
20 |
21 | # Resizing pane
22 | bind -r C-k resize-pane -U 5
23 | bind -r C-j resize-pane -D 5
24 | bind -r C-h resize-pane -L 5
25 | bind -r C-l resize-pane -R 5
26 |
27 | # Vim style copy / paste
28 | bind -T copy-mode-vi v send -X begin-selection
29 | bind -T copy-mode-vi y send -X copy-pipe-and-cancel
30 |
31 | # Set the default terminal
32 | set -g default-terminal "tmux-256color"
33 | set -ag terminal-overrides ',*:RGB' # True color support
34 | set -ag terminal-overrides ',*:Smulx=\E[4::%p1%dm' # Undercurl support
35 | set -ag terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # Underscore colours
36 |
37 | # Set default shell
38 | set -g default-shell $SHELL
39 |
40 | # The delay between prefix and command
41 | set -g escape-time 10
42 |
43 | # Focus events are requested from the terminal
44 | set -g focus-events on
45 |
46 | # Enable mouse support
47 | set -g mouse on
48 |
49 | # Increase History
50 | set -g history-limit 10000
51 |
52 | # Use vi key bindings in copy mode
53 | set -g mode-keys vi
54 |
55 | # No bells at all
56 | set -g bell-action none
57 |
58 | # Highlight window when it has new activity, display an alert.
59 | set -g monitor-activity on
60 | set -g visual-activity on
61 |
62 | # Numbering windows and panes
63 | set -g base-index 1
64 | set -g pane-base-index 1
65 | set -g renumber-windows on
66 |
67 | # Messaging
68 | set -g message-style "fg=yellow,bg=black"
69 | set -g message-command-style "fg=blue,bg=black"
70 |
71 | # Pane number display
72 | set -g display-panes-time 3000
73 | set -g display-panes-colour "white"
74 | set -g display-panes-active-colour "blue"
75 |
76 | # Pane border
77 | set -g pane-border-style "fg=brightblack,bg=black"
78 | set -g pane-active-border-style "fg=blue,bg=black"
79 |
80 | # Status
81 | set -g status-keys vi
82 | set -g status-interval 2
83 | set -g status-position top
84 | set -g status-justify left # right|left|centre
85 | set -g status-style "fg=white,bg=black"
86 |
87 | set -g status-left-length 50
88 | set -g status-left "#[fg=white,bg=black]#{?client_prefix,#[reverse] #{client_key_table} #[noreverse], #{client_key_table} }#[default]"
89 | set -ag status-left "#[fg=black,bg=blue] #{session_name} #[default]"
90 |
91 | set -g status-right-length 100
92 | set -g status-right "#[fg=white,bg=black] #(echo #{pane_current_path} | sed 's#$HOME#~#g') #{pane_pid} #{pane_index} #[default]"
93 | set -ag status-right "#[fg=white,bg=brightblack] #{user} #[default]"
94 | set -ag status-right "#[fg=black,bg=blue] #{host} #[default]"
95 | set -ag status-right "#[fg=white,bg=black]#{?pane_in_mode,#[reverse] #{pane_mode} #[noreverse],}#[default]"
96 |
97 | set -g window-status-separator ""
98 | set -g window-status-format "#[fg=white,bg=black] #{window_index} #{window_name}#{?window_flags, #{window_flags} , }#[default]"
99 | set -g window-status-current-format "#[fg=brightwhite,bg=brightblack] #{window_index} #{window_name}#{?window_flags, #{window_flags} , }#[default]"
100 |
--------------------------------------------------------------------------------
/.config/awesome/ui/wibar/cpu.lua:
--------------------------------------------------------------------------------
1 | local wibox = require("wibox")
2 | local gears = require("gears")
3 | local beautiful = require("beautiful")
4 | local dpi = require("beautiful.xresources").apply_dpi
5 |
6 | local pango = require("utils").pango
7 |
8 | -- Source https://github.com/vicious-widgets/vicious
9 |
10 | -- Initialize function tables
11 | local cpu_usage = {}
12 | local cpu_total = {}
13 | local cpu_active = {}
14 |
15 | -- {{{ CPU widget type
16 | local get_cpu = function()
17 | local cpu_lines = {}
18 |
19 | -- Get CPU stats
20 | local f = io.open("/proc/stat")
21 |
22 | if f == nil then
23 | return
24 | end
25 |
26 | for line in f:lines() do
27 | if string.sub(line, 1, 3) ~= "cpu" then
28 | break
29 | end
30 |
31 | cpu_lines[#cpu_lines + 1] = {}
32 |
33 | for i in string.gmatch(line, "[%s]+([^%s]+)") do
34 | table.insert(cpu_lines[#cpu_lines], i)
35 | end
36 | end
37 | f:close()
38 |
39 | -- Ensure tables are initialized correctly
40 | for i = #cpu_total + 1, #cpu_lines do
41 | cpu_total[i] = 0
42 | cpu_usage[i] = 0
43 | cpu_active[i] = 0
44 | end
45 |
46 | for i, v in ipairs(cpu_lines) do
47 | -- Calculate totals
48 | local total_new = 0
49 | for j = 1, #v do
50 | total_new = total_new + v[j]
51 | end
52 | local active_new = total_new - (v[4] + v[5])
53 |
54 | -- Calculate percentage
55 | local diff_total = total_new - cpu_total[i]
56 | local diff_active = active_new - cpu_active[i]
57 |
58 | if diff_total == 0 then
59 | diff_total = 1E-6
60 | end
61 | cpu_usage[i] = math.floor((diff_active / diff_total) * 100)
62 |
63 | -- Store totals
64 | cpu_total[i] = total_new
65 | cpu_active[i] = active_new
66 | end
67 |
68 | return cpu_usage
69 | end
70 | -- }}}
71 |
72 | local cpu = wibox.widget({
73 | {
74 | {
75 | {
76 | id = "cpu_icon_role",
77 | image = beautiful.cpu_icon,
78 | resize = true,
79 | halign = "center",
80 | valign = "center",
81 | forced_width = dpi(6) * 3,
82 | forced_height = dpi(6) * 3,
83 | widget = wibox.widget.imagebox,
84 | },
85 | {
86 | id = "cpu_text_role",
87 | halign = "center",
88 | valign = "center",
89 | widget = wibox.widget.textbox,
90 | },
91 | spacing = dpi(6),
92 | layout = wibox.layout.fixed.horizontal,
93 | },
94 | left = dpi(6),
95 | right = dpi(6),
96 | widget = wibox.container.margin,
97 | },
98 | bg = beautiful.colors.background,
99 | widget = wibox.container.background,
100 | })
101 |
102 | gears.timer({
103 | timeout = 1,
104 | call_now = true,
105 | autostart = true,
106 | callback = function()
107 | local cpu_usep = get_cpu()[1]
108 | local cpu_usep_fg_color = beautiful.colors.low
109 |
110 | if cpu_usep > 70 then
111 | cpu_usep_fg_color = beautiful.colors.high
112 | elseif 30 <= cpu_usep and cpu_usep <= 70 then
113 | cpu_usep_fg_color = beautiful.colors.medium
114 | end
115 |
116 | cpu:get_children_by_id("cpu_text_role")[1].markup = pango.span({ cpu_usep .. "%", foreground = cpu_usep_fg_color })
117 | end,
118 | })
119 |
120 | return cpu
121 |
--------------------------------------------------------------------------------
/.config/awesome/ui/switcher.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local beautiful = require("beautiful")
3 | local dpi = require("beautiful.xresources").apply_dpi
4 |
5 | local utils = require("utils")
6 | local keys = require("config").keys
7 |
8 | local switcher = nil
9 |
10 | local function get_items()
11 | local items = {}
12 |
13 | for _, c in ipairs(awful.client.focus.history.list) do
14 | local tag = c:tags()[1]
15 | local name = " TAG " .. (tag.name or "") .. " CLIENT " .. (c.class or "") .. "\n TITLE " .. (c.name or "")
16 |
17 | items[#items + 1] = {
18 | name,
19 | function()
20 | if not c.valid then
21 | return
22 | end
23 | if c.hidden then
24 | c.hidden = false
25 | end
26 | if not c:isvisible() then
27 | awful.tag.viewmore(c:tags(), c.screen)
28 | end
29 | c:emit_signal("request::activate", "switcher", { raise = true })
30 | -- Focus screen when switch clients
31 | awful.screen.focus(c.screen)
32 | end,
33 | -- c.icon,
34 | utils.client.get_icon_client(c),
35 | }
36 | end
37 |
38 | return items
39 | end
40 |
41 | local function toggle()
42 | if switcher and switcher.wibox.visible then
43 | local sel = switcher.sel or 0
44 | switcher:exec(sel)
45 | switcher:hide()
46 | switcher = nil
47 | else
48 | local workarea = awful.screen.focused().workarea
49 |
50 | local items = get_items()
51 | switcher = awful.menu({
52 | items = items,
53 | theme = {
54 | width = dpi(6) * 10 * 10,
55 | height = dpi(6) * 10,
56 | font = beautiful.font,
57 | },
58 | })
59 | switcher:show({
60 | coords = {
61 | x = ((workarea.width - switcher.width) / 2) + workarea.x,
62 | y = ((workarea.height - switcher.height) / 2) + workarea.y,
63 | },
64 | })
65 | switcher:item_enter(1)
66 | end
67 | end
68 |
69 | local function select_next()
70 | if switcher and switcher.wibox.visible then
71 | local sel = switcher.sel or 0
72 | local sel_new = sel + 1 > #switcher.items and 1 or sel + 1
73 | switcher:item_enter(sel_new)
74 | end
75 | end
76 |
77 | local function select_previous()
78 | if switcher and switcher.wibox.visible then
79 | local sel = switcher.sel or 0
80 | local sel_new = sel - 1 < 1 and #switcher.items or sel - 1
81 | switcher:item_enter(sel_new)
82 | end
83 | end
84 |
85 | -- Switch client
86 | awful.keygrabber({
87 | start_callback = function()
88 | toggle()
89 | end,
90 | stop_callback = function()
91 | toggle()
92 | end,
93 | export_keybindings = true,
94 | stop_event = "release",
95 | stop_key = { "Escape", "Alt_L", "Alt_R" },
96 | keybindings = {
97 | {
98 | { keys.alt },
99 | "Tab",
100 | function()
101 | select_next()
102 | end,
103 | { description = "Select next client", group = "client" },
104 | },
105 | {
106 | { keys.alt, "Shift" },
107 | "Tab",
108 | function()
109 | select_previous()
110 | end,
111 | { description = "Select previous client", group = "client" },
112 | },
113 | },
114 | })
115 |
--------------------------------------------------------------------------------
/.config/nvim/lua/plugins/lsp.lua:
--------------------------------------------------------------------------------
1 | -- List LSP server name
2 | local lsp_servers = {
3 | -- LSP
4 | "lua_ls",
5 | "clangd",
6 | "ts_ls",
7 | "emmet_ls",
8 | "html",
9 | "cssls",
10 | "tailwindcss",
11 | "intelephense",
12 | "jsonls",
13 | "pylsp",
14 | }
15 | -- List mason.nvim server name
16 | local other_servers = {
17 | -- Formatter
18 | "stylua",
19 | "prettier",
20 | "shfmt",
21 | -- DAP
22 | "js-debug-adapter",
23 | "codelldb",
24 | -- Linter
25 | "cspell",
26 | "eslint_d",
27 | "cpplint",
28 | }
29 | -- List setting for LSP server
30 | local settings = {
31 | ["lua_ls"] = {
32 | settings = {
33 | Lua = {
34 | diagnostics = {
35 | globals = { "vim" },
36 | },
37 | workspace = {
38 | library = {
39 | [vim.fn.expand("$VIMRUNTIME/lua")] = true,
40 | [vim.fn.stdpath("config") .. "/lua"] = true,
41 | },
42 | },
43 | },
44 | },
45 | },
46 | ["jsonls"] = {
47 | settings = {
48 | json = {
49 | validate = { enable = true },
50 | },
51 | },
52 | },
53 | }
54 |
55 | vim.api.nvim_create_autocmd("LspNotify", {
56 | callback = function(args)
57 | vim.keymap.set("n", "K", function()
58 | vim.lsp.buf.hover({ border = "rounded" })
59 | end, { buffer = args.buf })
60 | vim.keymap.set("i", "", function()
61 | vim.lsp.buf.signature_help({ border = "rounded" })
62 | end, { buffer = args.buf })
63 | end,
64 | })
65 |
66 | return {
67 | -- LSP config
68 | {
69 | "neovim/nvim-lspconfig",
70 | event = { "BufReadPre", "BufNewFile" },
71 | keys = {
72 | { "l", "LspInfo", desc = "LSP information" },
73 | },
74 | config = function()
75 | vim.diagnostic.config({
76 | virtual_text = true,
77 | })
78 |
79 | for key, _ in pairs(settings) do
80 | if settings[key] ~= nil then
81 | vim.lsp.config(key, settings[key])
82 | end
83 | end
84 | end,
85 | },
86 | {
87 | "mason-org/mason.nvim",
88 | build = ":MasonUpdate",
89 | dependencies = { "mason-org/mason-lspconfig.nvim" },
90 | config = function()
91 | require("mason").setup({ max_concurrent_installers = 2 })
92 | require("mason-lspconfig").setup()
93 |
94 | local registry = require("mason-registry")
95 | registry:on(
96 | "package:handle",
97 | vim.schedule_wrap(function(pkg, handle)
98 | print(string.format("Installing %s", pkg.name))
99 | end)
100 | )
101 | registry:on(
102 | "package:install:success",
103 | vim.schedule_wrap(function(pkg, handle)
104 | print(string.format("%s was successfully installed", pkg.name))
105 | end)
106 | )
107 |
108 | local lspconfig_to_package = require("mason-lspconfig").get_mappings().lspconfig_to_package
109 | for _, server in ipairs(lsp_servers) do
110 | table.insert(other_servers, lspconfig_to_package[server])
111 | end
112 |
113 | local function ensure_installed()
114 | for _, tool in ipairs(other_servers) do
115 | local p = registry.get_package(tool)
116 | if not p:is_installed() then
117 | p:install()
118 | end
119 | end
120 | end
121 | if registry.refresh then
122 | registry.refresh(ensure_installed)
123 | else
124 | ensure_installed()
125 | end
126 | end,
127 | },
128 | }
129 |
--------------------------------------------------------------------------------
/.config/nvim/lua/core/keymaps.lua:
--------------------------------------------------------------------------------
1 | -- normal_mode = "n",
2 | -- insert_mode = "i",
3 | -- visual_mode = "v",
4 | -- visual_block_mode = "x",
5 | -- term_mode = "t",
6 | -- command_mode = "c",
7 |
8 | -- Remap space as leader key
9 | vim.g.mapleader = " "
10 | vim.g.maplocalleader = "\\"
11 |
12 | -- For conciseness
13 | local map = vim.keymap.set
14 |
15 | -- Move to window
16 | map("n", "", "h", { silent = true, desc = "Go to left window" })
17 | map("n", "", "j", { silent = true, desc = "Go to lower window" })
18 | map("n", "", "k", { silent = true, desc = "Go to upper window" })
19 | map("n", "", "l", { silent = true, desc = "Go to right window" })
20 | -- Resize window
21 | map("n", "", ":resize +5", { silent = true, desc = "Increase window height" })
22 | map("n", "", ":resize -5", { silent = true, desc = "Decrease window height" })
23 | map("n", "", ":vertical resize -5", { silent = true, desc = "Decrease window width" })
24 | map("n", "", ":vertical resize +5", { silent = true, desc = "Increase window width" })
25 | -- Buffer
26 | map("n", "bb", "b#", { desc = "Switch to other buffer" })
27 | map("n", "bd", "bd", { desc = "Delete buffer" })
28 | map("n", "bD", "%bd", { desc = "Delete all buffers" })
29 | map("n", "[b", "bprevious", { desc = "Previous buffer" })
30 | map("n", "]b", "bnext", { desc = "Next buffer" })
31 | -- Tab
32 | map("n", "n", "tabnew", { desc = "New tab" })
33 | map("n", "c", "tabclose", { desc = "Close tab" })
34 | map("n", "o", "tabonly", { desc = "Only tab" })
35 | map("n", "[", "tabprevious", { desc = "Previous tab" })
36 | map("n", "]", "tabnext", { desc = "Next tab" })
37 | -- Quickfix
38 | map("n", "[q", "cprev", { desc = "Previous quickfix" })
39 | map("n", "]q", "cnext", { desc = "Next quickfix" })
40 | -- Move lines
41 | map("n", "", ":move .+1==", { desc = "Moving lines down" })
42 | map("n", "", ":move .-2==", { desc = "Moving lines up" })
43 | map("i", "", ":move .+1==gi", { desc = "Moving lines down" })
44 | map("i", "", ":move .-2==gi", { desc = "Moving lines up" })
45 | map("v", "", ":move '>+1gv=gv", { desc = "Moving lines down" })
46 | map("v", "", ":move '<-2gv=gv", { desc = "Moving lines up" })
47 | -- Motion cursor
48 | map({ "n", "v" }, "", "_", { desc = "Start of line (no-blank)" })
49 | map({ "n", "v" }, "", "g_", { desc = "End of line (no-blank)" })
50 | -- Better indent
51 | map("v", "<", "", ">gv", { desc = "Indent right" })
53 | -- Toggle
54 | map("n", "ts", "set spell!", { desc = "Toggle spell" })
55 | map("n", "tw", "set wrap!", { desc = "Toggle wrap" })
56 | map("n", "tn", "set number!", { desc = "Toggle number column" })
57 | map("n", "tr", "set relativenumber!", { desc = "Toggle relative column" })
58 | -- Commands
59 | map("n", ";c", "checkhealth", { desc = "Check health" })
60 | map("n", ";C", "e $MYVIMRC", { desc = "Open config neovim" })
61 | map("n", ";r", "source %", { desc = "Refresh config" })
62 | map("n", ";t", "bo 10new term://$SHELLi", { desc = "Open terminal" })
63 | map("n", ";n", "enew", { desc = "New file" })
64 | map("n", ";i", vim.show_pos, { desc = "Inspect Pos" })
65 | map("n", ";s", function() vim.cmd([[%s/\s\+$//e]]) end, { desc = "Remove trailing whitespace" })
66 | map("n", "K", "norm! K", { desc = "Keywordprg" })
67 | -- Other
68 | map("n", "a", "ggVG", { desc = "Visual all" })
69 | map("n", "q", "qa", { desc = "Quit" })
70 | map("n", "w", "w", { desc = "Save" })
71 | map("n", "x", '"_x', { desc = "Delete single character without copying into register" })
72 | map("n", "", "nohlsearch", { desc = "Clear hlsearch" })
73 | map("t", "", "", { desc = "Exit terminal mode" })
74 | map("x", "/", "y/\\V=escape(@\",'/\\')N", { desc = "Search for visually selected text" })
75 | map("x", "p", "P", { desc = "Put without overwriting registers" })
76 |
--------------------------------------------------------------------------------
/.config/awesome/ui/mainmenu.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local beautiful = require("beautiful")
3 | local menu_gen = require("menubar.menu_gen")
4 |
5 | local config = require("config")
6 | local keys = require("config").keys
7 |
8 | -- Add other category
9 | menu_gen.all_categories.other = { app_type = nil, name = "Other", icon_name = "applications-other", use = true }
10 |
11 | -- Source https://github.com/lcpz/awesome-freedesktop
12 | -- Use MenuBar parsing utils to build a menu for Awesome
13 | local function build_menu(args)
14 | local before = args.before or {}
15 | local result = {}
16 | local after = args.after or {}
17 |
18 | local menu = awful.menu()
19 |
20 | menu_gen.generate(function(entries)
21 | -- Add category icons
22 | for k, v in pairs(menu_gen.all_categories) do
23 | table.insert(result, { k, {}, v.icon })
24 | end
25 |
26 | -- Get items table
27 | for _, v in pairs(entries) do
28 | if not v.category then
29 | v.category = "other"
30 | end
31 | for _, cat in pairs(result) do
32 | if cat[1] == v.category then
33 | table.insert(cat[2], { v.name, v.cmdline, v.icon })
34 | break
35 | end
36 | end
37 | end
38 |
39 | -- Cleanup things a bit
40 | for i = #result, 1, -1 do
41 | local v = result[i]
42 | if #v[2] == 0 then
43 | -- Remove unused categories
44 | table.remove(result, i)
45 | else
46 | -- Sort entries alphabetically (by name)
47 | table.sort(v[2], function(a, b)
48 | return string.byte(a[1]) < string.byte(b[1])
49 | end)
50 | -- Replace category name with nice name
51 | v[1] = menu_gen.all_categories[v[1]].name
52 | end
53 | end
54 |
55 | -- Sort categories alphabetically also
56 | table.sort(result, function(a, b)
57 | return string.byte(a[1]) < string.byte(b[1])
58 | end)
59 |
60 | -- Add items to menu
61 | for _, v in pairs(before) do
62 | menu:add(v)
63 | end
64 | for _, v in pairs(result) do
65 | menu:add(v)
66 | end
67 | for _, v in pairs(after) do
68 | menu:add(v)
69 | end
70 | end)
71 |
72 | return menu
73 | end
74 |
75 | local mainmenu = build_menu({
76 | before = {
77 | {
78 | "Awesome",
79 | {
80 | {
81 | "Hotkeys",
82 | function()
83 | awesome.emit_signal("hotkeys::show")
84 | end,
85 | beautiful.keyboard_icon,
86 | },
87 | { "Manual", config.apps.terminal .. " -e man awesome", beautiful.book_icon },
88 | { "Edit config", config.apps.editor .. " " .. awesome.conffile, beautiful.edit_icon },
89 | { "Reload", awesome.restart, beautiful.refresh_icon },
90 | },
91 | beautiful.awesome_icon,
92 | },
93 | },
94 | after = {
95 | { "Open terminal", config.apps.terminal, beautiful.terminal_icon },
96 | { "Randomize wallpaper", config.actions.randomize_wallpaper, beautiful.image_icon },
97 | { "Take screenshot", config.actions.screenshot, beautiful.camera_icon },
98 | { "Switch user", config.actions.switch_user, beautiful.switch_user_icon },
99 | { "Lock", config.actions.lock, beautiful.lock_icon },
100 | { "Logout", config.actions.logout, beautiful.logout_icon },
101 | { "Suspend", config.actions.suspend, beautiful.suspend_icon },
102 | { "Hibernate", config.actions.hibernate, beautiful.hibernate_icon },
103 | { "Reboot", config.actions.reboot, beautiful.reboot_icon },
104 | { "Poweroff", config.actions.poweroff, beautiful.poweroff_icon },
105 | },
106 | })
107 |
108 | awesome.connect_signal("mainmenu::toggle", function()
109 | mainmenu:toggle()
110 | end)
111 |
112 | awful.keyboard.append_global_keybindings({
113 | awful.key({ keys.super }, "w", function()
114 | awesome.emit_signal("mainmenu::toggle")
115 | end, { description = "Show main menu", group = "awesome" }),
116 | })
117 |
--------------------------------------------------------------------------------
/.config/lsd/config.yaml:
--------------------------------------------------------------------------------
1 | # == Classic ==
2 | # This is a shorthand to override some of the options to be backwards compatible
3 | # with `ls`. It affects the "color"->"when", "sorting"->"dir-grouping", "date"
4 | # and "icons"->"when" options.
5 | # Possible values: false, true
6 | classic: false
7 |
8 | # == Blocks ==
9 | # This specifies the columns and their order when using the long and the tree
10 | # layout.
11 | # Possible values: permission, user, group, context, size, date, name, inode, links, git
12 | blocks:
13 | - permission
14 | - links
15 | - user
16 | - group
17 | - size
18 | - date
19 | - name
20 |
21 | # == Color ==
22 | # This has various color options. (Will be expanded in the future.)
23 | color:
24 | # When to colorize the output.
25 | # When "classic" is set, this is set to "never".
26 | # Possible values: never, auto, always
27 | when: auto
28 | # How to colorize the output.
29 | # When "classic" is set, this is set to "no-color".
30 | # Possible values: default, custom
31 | # When "custom" is set, lsd will look in the config directory for `colors.yaml`.
32 | theme: custom
33 |
34 | # == Date ==
35 | # This specifies the date format for the date column. The freeform format
36 | # accepts a strftime like string.
37 | # When "classic" is set, this is set to "date".
38 | # Possible values: date, locale, relative, '+'
39 | # `date_format` will be a `strftime` formatted value. e.g. `date: '+%d %b %y %X'` will give you a date like this: 17 Jun 21 20:14:55
40 | date: '+%Y-%m-%d %H:%M'
41 |
42 | # == Dereference ==
43 | # Whether to dereference symbolic links.
44 | # Possible values: false, true
45 | dereference: false
46 |
47 | # == Display ==
48 | # What items to display. Do not specify this for the default behavior.
49 | # Possible values: all, almost-all, directory-only
50 | # display: all
51 |
52 | # == Icons ==
53 | icons:
54 | # When to use icons.
55 | # When "classic" is set, this is set to "never".
56 | # Possible values: always, auto, never
57 | when: auto
58 | # Which icon theme to use.
59 | # Possible values: fancy, unicode
60 | theme: fancy
61 | # Separator between icon and the name
62 | # Default to 1 space
63 | separator: ' '
64 |
65 | # == Ignore Globs ==
66 | # A list of globs to ignore when listing.
67 | # ignore-globs:
68 | # - .git
69 |
70 | # == Indicators ==
71 | # Whether to add indicator characters to certain listed files.
72 | # Possible values: false, true
73 | indicators: false
74 |
75 | # == Layout ==
76 | # Which layout to use. "oneline" might be a bit confusing here and should be
77 | # called "one-per-line". It might be changed in the future.
78 | # Possible values: grid, tree, oneline
79 | layout: grid
80 |
81 | # == Recursion ==
82 | recursion:
83 | # Whether to enable recursion.
84 | # Possible values: false, true
85 | enabled: false
86 | # How deep the recursion should go. This has to be a positive integer. Leave
87 | # it unspecified for (virtually) infinite.
88 | # depth: 3
89 |
90 | # == Size ==
91 | # Specifies the format of the size column.
92 | # Possible values: default, short, bytes
93 | size: default
94 |
95 | # == Permission ==
96 | # Specify the format of the permission column
97 | # Possible value: rwx, octal, attributes (windows only), disable
98 | permission: rwx
99 |
100 | # == Sorting ==
101 | sorting:
102 | # Specify what to sort by.
103 | # Possible values: extension, name, time, size, version
104 | column: time
105 | # Whether to reverse the sorting.
106 | # Possible values: false, true
107 | reverse: false
108 | # Whether to group directories together and where.
109 | # When "classic" is set, this is set to "none".
110 | # Possible values: first, last, none
111 | dir-grouping: first
112 |
113 | # == No Symlink ==
114 | # Whether to omit showing symlink targets
115 | # Possible values: false, true
116 | no-symlink: false
117 |
118 | # == Total size ==
119 | # Whether to display the total size of directories.
120 | # Possible values: false, true
121 | total-size: false
122 |
123 | # == Hyperlink ==
124 | # Attach hyperlink to filenames
125 | # Possible values: always, auto, never
126 | hyperlink: always
127 |
128 | # == Symlink arrow ==
129 | # Specifies how the symlink arrow display, chars in both ascii and utf8
130 | symlink-arrow: ⇒
131 |
132 | # == Header ==
133 | # Whether to display block headers.
134 | # Possible values: false, true
135 | header: false
136 |
--------------------------------------------------------------------------------
/setup:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Color
4 | Reset='\033[0m'
5 |
6 | Black='\033[0;30m'
7 | Red='\033[0;31m'
8 | Green='\033[0;32m'
9 | Yellow='\033[0;33m'
10 | Blue='\033[0;34m'
11 | Purple='\033[0;35m'
12 | Cyan='\033[0;36m'
13 | White='\033[0;37m'
14 |
15 | BrightBlack='\033[1;30m'
16 | BrightRed='\033[1;31m'
17 | BrightGreen='\033[1;32m'
18 | BrightYellow='\033[1;33m'
19 | BrightBlue='\033[1;34m'
20 | BrightPurple='\033[1;35m'
21 | BrightCyan='\033[1;36m'
22 | BrightWhite='\033[1;37m'
23 |
24 | # Path
25 | DOTFILES_DIR="$HOME/.dotfiles"
26 | CONFIG_DIR="$DOTFILES_DIR/.config"
27 | BIN_DIR="$DOTFILES_DIR/.local/bin"
28 | SPECIAL_FILES=(".config/.xprofile" ".config/.Xresources" ".config/.dircolors")
29 |
30 | clear
31 |
32 | # Check if the dotfiles directory exists
33 | if [ ! -d "$DOTFILES_DIR" ]; then
34 | echo -e "${Red}Error: $DOTFILES_DIR does not exist. Please check the path.${Reset}"
35 | exit 1
36 | fi
37 |
38 | FILES_AND_DIRS=()
39 |
40 | # Check if .config directory exists
41 | if [ -d "$CONFIG_DIR" ]; then
42 | while IFS= read -r item; do
43 | FILES_AND_DIRS+=(".config/$item")
44 | done < <(find "$CONFIG_DIR" -mindepth 1 -maxdepth 1 -exec basename {} \;)
45 | else
46 | echo -e "${Yellow}Warning: $CONFIG_DIR not found. Skipping.${Reset}"
47 | fi
48 |
49 | # Check if .local/bin directory exists
50 | if [ -d "$BIN_DIR" ]; then
51 | while IFS= read -r item; do
52 | FILES_AND_DIRS+=(".local/bin/$item")
53 | done < <(find "$BIN_DIR" -mindepth 1 -maxdepth 1 -exec basename {} \;)
54 | else
55 | echo -e "${Yellow}Warning: $BIN_DIR not found. Skipping.${Reset}"
56 | fi
57 |
58 | # If no files found, exit
59 | if [ ${#FILES_AND_DIRS[@]} -eq 0 ]; then
60 | echo -e "${Red}No valid dotfiles found. Exiting!${Reset}"
61 | exit 1
62 | fi
63 |
64 | # Display the list for user selection
65 | echo -e "${BrightCyan}Available dotfiles in $DOTFILES_DIR:${Reset}"
66 | cols=2
67 | for ((i = 0; i < ${#FILES_AND_DIRS[@]}; i += cols)); do
68 | line=""
69 | for ((j = 0; j < cols; j++)); do
70 | index=$((i + j))
71 | if [ $index -lt ${#FILES_AND_DIRS[@]} ]; then
72 | line+=$(printf "${Green}[%2d]${Reset} %-30s " "$index" "${FILES_AND_DIRS[$index]}")
73 | fi
74 | done
75 | echo "$line"
76 | done
77 |
78 | # Instructions
79 | echo -e "\n${BrightPurple}Instructions:${Reset}"
80 | echo -e "Enter the numbers of the files or folders to link (space-separated)."
81 | echo -e "Enter ${Green}[a]${Reset} to select all."
82 | echo -e "Enter ${Blue}[m]${Reset} for misc."
83 | echo -e "Enter ${Red}[q]${Reset} to quit."
84 |
85 | # Read user input
86 | read -rp "$(echo -e "${Blue}Your choice:${Reset} ")" -a SELECTION
87 |
88 | # Process user selection
89 | CHOSEN_ITEMS=()
90 |
91 | # If no selection found, exit
92 | if [ ${#SELECTION[@]} -eq 0 ]; then
93 | echo -e "${Red}Nothing selected. Exiting!${Reset}"
94 | exit 1
95 | elif [[ " ${SELECTION[*]} " =~ " q " ]]; then
96 | echo -e "${Red}Exiting!${Reset}"
97 | exit 0
98 | elif [[ " ${SELECTION[*]} " =~ " m " ]]; then
99 | sudo sed -i -e 's/#Color/Color/g' /etc/pacman.conf &&
100 | echo "[pacman] Automatically enable colors only when pacman’s output is on a tty."
101 | sudo sed -i -e 's/#VerbosePkgLists/VerbosePkgLists/g' /etc/pacman.conf &&
102 | echo "[pacman] Displays name, version and size of target packages formatted as a table for upgrade, sync and remove operations."
103 | [ -f /usr/bin/xdg-user-dirs-update ] && xdg-user-dirs-update &&
104 | echo "[xdg-user-dirs] Update XDG user dir configuration."
105 | echo -e "${Red}Exiting!${Reset}"
106 | exit 0
107 | elif [[ " ${SELECTION[*]} " =~ " a " ]]; then
108 | CHOSEN_ITEMS=("${FILES_AND_DIRS[@]}")
109 | else
110 | for index in "${SELECTION[@]}"; do
111 | if [[ "$index" =~ ^[0-9]+$ ]] && [ "$index" -lt "${#FILES_AND_DIRS[@]}" ]; then
112 | CHOSEN_ITEMS+=("${FILES_AND_DIRS[$index]}")
113 | else
114 | echo -e "${Red}Invalid selection: $index${Reset}"
115 | fi
116 | done
117 | fi
118 |
119 | # Create symlinks
120 | echo -e "${Cyan}Creating symlinks...${Reset}"
121 | for item in "${CHOSEN_ITEMS[@]}"; do
122 | source="$DOTFILES_DIR/$item"
123 | target="$HOME/$item"
124 |
125 | # If the file is special, link it to $HOME instead of $HOME/.config
126 | if [[ " ${SPECIAL_FILES[*]} " =~ " $item " ]]; then
127 | target="$HOME/${item##*/}" # Extracts the filename only
128 | else
129 | target="$HOME/$item"
130 | fi
131 |
132 | # Create parent directory if needed
133 | mkdir -pv "$(dirname "$target")"
134 |
135 | # Create symlink
136 | ln -sfvr "$source" "$(dirname "$target")"
137 | done &&
138 | echo -e "${BrightBlue}Setup complete!${Reset}"
139 |
--------------------------------------------------------------------------------
/.config/awesome/utils/init.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local gstring = require("gears.string")
3 | local gtable = require("gears.table")
4 | local beautiful = require("beautiful")
5 | local menubar_utils = require("menubar.utils")
6 |
7 | local utils = {
8 | tag = {},
9 | client = {},
10 | pango = {},
11 | }
12 |
13 | -- Source https://github.com/lcpz/lain
14 | -- Non-empty tag browsing
15 | -- direction in {-1, 1} <-> {previous, next} non-empty tag
16 | function utils.tag.view_nonempty(direction, sc)
17 | direction = direction or 1
18 | local s = sc or awful.screen.focused()
19 | local tags = s.tags
20 | local sel = s.selected_tag
21 |
22 | if sel == nil then
23 | tags[1]:view_only()
24 | return
25 | end
26 |
27 | local i = sel.index
28 |
29 | repeat
30 | i = i + direction
31 |
32 | -- Wrap around when we reach one of the bounds
33 | if i > #tags then
34 | i = i - #tags
35 | end
36 | if i < 1 then
37 | i = i + #tags
38 | end
39 |
40 | local t = tags[i]
41 |
42 | -- Stop when we get back to where we started
43 | if t == sel then
44 | break
45 | end
46 |
47 | -- If it's The One, view it.
48 | if #t:clients() > 0 then
49 | t:view_only()
50 | return
51 | end
52 | until false
53 | end
54 |
55 | -- Toggle space between clients
56 | function utils.tag.toggle_gap()
57 | local gap = awful.tag.getgap()
58 | if gap == 0 then
59 | awful.tag.setgap(beautiful.useless_gap)
60 | else
61 | awful.tag.setgap(0)
62 | end
63 | end
64 |
65 | ---Convert lua table to pango "span".
66 | ---@param data table|string
67 | ---@param separator? string # Value separator.
68 | ---@return string
69 | function utils.pango.span(data, separator)
70 | if type(data) == "table" then
71 | separator = separator or ""
72 |
73 | local t = ""
74 | for _, v in ipairs(data) do
75 | t = t .. separator .. v
76 | end
77 |
78 | local s = "" .. t .. ""
85 | elseif type(data) == "string" then
86 | return data
87 | end
88 | return ""
89 | end
90 |
91 | ---@param data string
92 | ---@return string
93 | function utils.pango.escape(data)
94 | return gstring.xml_escape(data)
95 | end
96 |
97 | ---@param data string
98 | ---@return string
99 | function utils.pango.b(data)
100 | return "" .. data .. ""
101 | end
102 |
103 | ---@param data string
104 | ---@return string
105 | function utils.pango.i(data)
106 | return "" .. data .. ""
107 | end
108 |
109 | ---@param data string
110 | ---@return string
111 | function utils.pango.u(data)
112 | return "" .. data .. ""
113 | end
114 |
115 | -- Get icon client with beautiful.icon_theme
116 | function utils.client.get_icon_client(c)
117 | if not c.class then
118 | return c.icon
119 | end
120 | return menubar_utils.lookup_icon(string.lower(c.class)) or c.icon or beautiful.package_icon
121 | end
122 |
123 | -- Toggle minimize all clients in current tag
124 | function utils.client.toggle_minimization_clients()
125 | local s = awful.screen.focused()
126 | local clients = client.get(s)
127 | local tags = s.selected_tags
128 |
129 | local function set_minimized(value)
130 | for _, c in pairs(clients) do
131 | if c.sticky then
132 | c.minimized = value
133 | end
134 | local ctags = c:tags()
135 | for _, t in ipairs(tags) do
136 | if gtable.hasitem(ctags, t) then
137 | c.minimized = value
138 | end
139 | end
140 | end
141 | end
142 |
143 | local function check_no_minimized()
144 | for _, c in pairs(clients) do
145 | if c.sticky then
146 | if c.minimized == false then
147 | return true
148 | end
149 | end
150 | local ctags = c:tags()
151 | for _, t in ipairs(tags) do
152 | if gtable.hasitem(ctags, t) then
153 | if c.minimized == false then
154 | return true
155 | end
156 | end
157 | end
158 | end
159 | return false
160 | end
161 |
162 | local no_minimized = check_no_minimized()
163 | if no_minimized then
164 | set_minimized(true)
165 | else
166 | set_minimized(false)
167 | end
168 | end
169 |
170 | return utils
171 |
--------------------------------------------------------------------------------
/.config/awesome/ui/wibar/memory.lua:
--------------------------------------------------------------------------------
1 | local wibox = require("wibox")
2 | local gears = require("gears")
3 | local beautiful = require("beautiful")
4 | local dpi = require("beautiful.xresources").apply_dpi
5 |
6 | local pango = require("utils").pango
7 |
8 | -- Source https://github.com/vicious-widgets/vicious
9 |
10 | -- {{{ Memory widget type
11 | local get_mem = function()
12 | local _mem = { buf = {}, swp = {} }
13 |
14 | -- Get MEM info
15 | for line in io.lines("/proc/meminfo") do
16 | for k, v in string.gmatch(line, "([%a]+):[%s]+([%d]+).+") do
17 | if k == "MemTotal" then
18 | _mem.total = math.floor(v / 1024)
19 | elseif k == "MemFree" then
20 | _mem.buf.f = math.floor(v / 1024)
21 | elseif k == "MemAvailable" then
22 | _mem.buf.a = math.floor(v / 1024)
23 | elseif k == "Buffers" then
24 | _mem.buf.b = math.floor(v / 1024)
25 | elseif k == "Cached" then
26 | _mem.buf.c = math.floor(v / 1024)
27 | elseif k == "SwapTotal" then
28 | _mem.swp.t = math.floor(v / 1024)
29 | elseif k == "SwapFree" then
30 | _mem.swp.f = math.floor(v / 1024)
31 | end
32 | end
33 | end
34 |
35 | -- Calculate memory percentage
36 | _mem.free = _mem.buf.a
37 | _mem.inuse = _mem.total - _mem.free
38 | _mem.bcuse = _mem.total - _mem.buf.f
39 | _mem.usep = math.floor(_mem.inuse / _mem.total * 100)
40 | -- Calculate swap percentage
41 | _mem.swp.inuse = _mem.swp.t - _mem.swp.f
42 | _mem.swp.usep = math.floor(_mem.swp.inuse / _mem.swp.t * 100)
43 |
44 | return { _mem.usep, _mem.inuse, _mem.total, _mem.free, _mem.swp.usep, _mem.swp.inuse, _mem.swp.t, _mem.swp.f, _mem.bcuse }
45 | end
46 | -- }}}
47 |
48 | local mem = wibox.widget({
49 | {
50 | {
51 | {
52 | id = "ram_icon_role",
53 | image = beautiful.memory_icon,
54 | resize = true,
55 | halign = "center",
56 | valign = "center",
57 | forced_width = dpi(6) * 3,
58 | forced_height = dpi(6) * 3,
59 | widget = wibox.widget.imagebox,
60 | },
61 | {
62 | id = "ram_text_role",
63 | halign = "center",
64 | valign = "center",
65 | widget = wibox.widget.textbox,
66 | },
67 | {
68 | id = "swap_icon_role",
69 | image = beautiful.swap_icon,
70 | resize = true,
71 | halign = "center",
72 | valign = "center",
73 | forced_width = dpi(6) * 3,
74 | forced_height = dpi(6) * 3,
75 | widget = wibox.widget.imagebox,
76 | },
77 | {
78 | id = "swap_text_role",
79 | halign = "center",
80 | valign = "center",
81 | widget = wibox.widget.textbox,
82 | },
83 | spacing = dpi(6),
84 | layout = wibox.layout.fixed.horizontal,
85 | },
86 | left = dpi(6),
87 | right = dpi(6),
88 | widget = wibox.container.margin,
89 | },
90 | bg = beautiful.colors.background,
91 | widget = wibox.container.background,
92 | })
93 |
94 | gears.timer({
95 | timeout = 1,
96 | call_now = true,
97 | autostart = true,
98 | callback = function()
99 | local result = get_mem()
100 |
101 | -- RAM
102 | local ram_usep = result[1]
103 | local ram_usep_fg_color = beautiful.colors.low
104 |
105 | if ram_usep > 70 then
106 | ram_usep_fg_color = beautiful.colors.high
107 | elseif 30 <= ram_usep and ram_usep <= 70 then
108 | ram_usep_fg_color = beautiful.colors.medium
109 | end
110 |
111 | mem:get_children_by_id("ram_text_role")[1].markup = pango.span({ ram_usep .. "%", foreground = ram_usep_fg_color })
112 |
113 | -- SWAP
114 | local swap_usep = result[5]
115 | local swap_usep_fg_color = beautiful.colors.low
116 |
117 | if result[7] ~= 0 then
118 | if swap_usep > 70 then
119 | swap_usep_fg_color = beautiful.colors.high
120 | elseif 30 <= swap_usep and swap_usep <= 70 then
121 | swap_usep_fg_color = beautiful.colors.medium
122 | end
123 | mem:get_children_by_id("swap_text_role")[1].markup = pango.span({ swap_usep .. "%", foreground = swap_usep_fg_color })
124 | else
125 | swap_usep_fg_color = beautiful.colors.medium
126 | mem:get_children_by_id("swap_text_role")[1].markup = "N/A"
127 | end
128 | end,
129 | })
130 |
131 | return mem
132 |
--------------------------------------------------------------------------------
/.config/tig/config:
--------------------------------------------------------------------------------
1 | # Colors
2 | # ------
3 |
4 | # The colors in the UI can be customized. In addition to the colors used
5 | # for the UI you can also define new colors to use in the pager, blob,
6 | # diff, and stage views by placing the text to match for in quotes.
7 | #
8 | # Prefix the name of a view to set a color only for that view, e.g.
9 | #
10 | # color grep.file blue default
11 | #
12 | # As an example, this setting will to color Signed-off-by lines with a
13 | # yellow foreground color and use the default background color.
14 | #
15 | # color " Signed-off-by" yellow default
16 | #
17 | # Note the four leading spaces in the string to match. This is because
18 | # Git automatically indents commit messages by four spaces.
19 |
20 | color "---" blue default
21 | color "diff --" yellow default
22 | color "--- " yellow default
23 | color "+++ " yellow default
24 | color "@@" magenta default
25 | color "+" green default
26 | color " +" green default
27 | color "-" red default
28 | color " -" red default
29 | color "index " blue default
30 | color "old file mode " yellow default
31 | color "new file mode " yellow default
32 | color "deleted file mode " yellow default
33 | color "copy from " yellow default
34 | color "copy to " yellow default
35 | color "rename from " yellow default
36 | color "rename to " yellow default
37 | color "similarity " yellow default
38 | color "dissimilarity " yellow default
39 | color "\ No newline at end of file" blue default
40 | color "diff-tree " blue default
41 | color "Author: " cyan default
42 | color "Commit: " magenta default
43 | color "Tagger: " magenta default
44 | color "Merge: " blue default
45 | color "Date: " yellow default
46 | color "AuthorDate: " yellow default
47 | color "CommitDate: " yellow default
48 | color "TaggerDate: " yellow default
49 | color "Refs: " red default
50 | color "Reflog: " red default
51 | color "Reflog message: " yellow default
52 | color "stash@{" magenta default
53 | color "commit " green default
54 | color "parent " blue default
55 | color "tree " blue default
56 | color "author " green default
57 | color "committer " magenta default
58 | color " Signed-off-by:" yellow default
59 | color " Acked-by:" yellow default
60 | color " Reviewed-by:" yellow default
61 | color " Helped-by:" yellow default
62 | color " Reported-by:" yellow default
63 | color " Mentored-by:" yellow default
64 | color " Suggested-by:" yellow default
65 | color " Cc:" yellow default
66 | color " Noticed-by:" yellow default
67 | color " Tested-by:" yellow default
68 | color " Improved-by:" yellow default
69 | color " Thanks-to:" yellow default
70 | color " Based-on-patch-by:" yellow default
71 | color " Contributions-by:" yellow default
72 | color " Co-authored-by:" yellow default
73 | color " Requested-by:" yellow default
74 | color " Original-patch-by:" yellow default
75 | color " Inspired-by:" yellow default
76 | color default default default normal
77 | color cursor black green
78 | color status green default
79 | color delimiter magenta default
80 | color date blue default
81 | color mode cyan default
82 | color id magenta default
83 | color overflow red default
84 | color header yellow default
85 | color section cyan default
86 | color directory yellow default
87 | color file default default
88 | color grep.file blue default
89 | color file-size default default
90 | color line-number cyan default
91 | color title-blur black 8
92 | color title-focus black blue
93 | color main-commit default default
94 | color main-annotated default default bold
95 | color main-tag magenta default bold
96 | color main-local-tag magenta default
97 | color main-remote yellow default
98 | color main-replace cyan default
99 | color main-tracked yellow default bold
100 | color main-ref cyan default
101 | color main-head cyan default bold
102 | color stat-none default default
103 | color stat-staged magenta default
104 | color stat-unstaged magenta default
105 | color stat-untracked magenta default
106 | color help-group blue default
107 | color help-action yellow default
108 | color diff-stat blue default
109 | color diff-add-highlight green default standout
110 | color diff-del-highlight red default standout
111 | color palette-0 magenta default
112 | color palette-1 yellow default
113 | color palette-2 cyan default
114 | color palette-3 green default
115 | color palette-4 default default
116 | color palette-5 white default
117 | color palette-6 red default
118 | color palette-7 magenta default bold
119 | color palette-8 yellow default bold
120 | color palette-9 cyan default bold
121 | color palette-10 green default bold
122 | color palette-11 default default bold
123 | color palette-12 white default bold
124 | color palette-13 red default bold
125 | color graph-commit blue default
126 | color search-result black yellow
127 |
--------------------------------------------------------------------------------
/.config/awesome/ui/dashboard/calendar.lua:
--------------------------------------------------------------------------------
1 | local wibox = require("wibox")
2 | local awful = require("awful")
3 | local beautiful = require("beautiful")
4 | local dpi = require("beautiful.xresources").apply_dpi
5 |
6 | local pango = require("utils").pango
7 |
8 | local width_square = dpi(6) * 5
9 | local height_square = dpi(6) * 5
10 |
11 | -- Content
12 | local function is_weekend(date)
13 | return date.wday == 1 or date.wday == 7
14 | end
15 |
16 | local function decorate_cell(widget, flag, date)
17 | if flag == "normal" then
18 | widget.halign = "center"
19 | widget.valign = "center"
20 | return wibox.widget({
21 | widget,
22 | forced_width = width_square,
23 | forced_height = height_square,
24 | bg = is_weekend(date) and beautiful.colors.secondary_dull,
25 | widget = wibox.container.background,
26 | })
27 | elseif flag == "focus" then
28 | widget.halign = "center"
29 | widget.valign = "center"
30 | return wibox.widget({
31 | widget,
32 | bg = beautiful.colors.primary,
33 | fg = beautiful.colors.background,
34 | widget = wibox.container.background,
35 | })
36 | elseif flag == "weeknumber" then
37 | widget.halign = "center"
38 | widget.valign = "center"
39 | widget.markup = pango.b(pango.span({ foreground = beautiful.colors.secondary, widget.text }))
40 | return widget
41 | elseif flag == "weekday" then
42 | widget.halign = "center"
43 | widget.valign = "center"
44 | widget.markup = pango.i(widget.text)
45 | return wibox.widget({
46 | widget,
47 | bg = beautiful.colors.secondary,
48 | widget = wibox.container.background,
49 | })
50 | elseif flag == "monthheader" or flag == "header" then
51 | widget.markup = pango.b(widget.text)
52 | return widget
53 | elseif flag == "month" then
54 | return widget
55 | else
56 | return widget
57 | end
58 | end
59 |
60 | local cal_content = wibox.widget({
61 | date = os.date("*t"),
62 | fn_embed = decorate_cell,
63 | week_numbers = true,
64 | long_weekdays = false,
65 | start_sunday = false,
66 | spacing = dpi(0),
67 | font = beautiful.font_name .. " " .. 14,
68 | widget = wibox.widget.calendar.month,
69 | })
70 |
71 | -- Contral
72 | local function today()
73 | cal_content:set_date(os.date("*t"))
74 | end
75 |
76 | local function move(direction)
77 | local a = cal_content:get_date()
78 | a.month = a.month + direction
79 | local now = os.date("*t")
80 | if a.year == now.year and a.month == now.month then
81 | today()
82 | else
83 | cal_content:set_date({
84 | year = a.year,
85 | month = a.month,
86 | })
87 | end
88 | end
89 |
90 | local cal_control = wibox.widget({
91 | {
92 | {
93 | image = beautiful.arrow_left_icon,
94 | resize = true,
95 | halign = "center",
96 | valign = "center",
97 | forced_width = width_square,
98 | forced_height = height_square,
99 | widget = wibox.widget.imagebox,
100 | buttons = {
101 | awful.button({}, 1, function()
102 | move(-1)
103 | end),
104 | },
105 | },
106 | halign = "right",
107 | valign = "top",
108 | layout = wibox.container.place,
109 | },
110 | {
111 | {
112 | forced_width = width_square * 6,
113 | forced_height = height_square,
114 | bg = beautiful.colors.secondary_dull,
115 | widget = wibox.container.background,
116 | buttons = {
117 | awful.button({}, 1, function()
118 | today()
119 | end),
120 | },
121 | },
122 | valign = "top",
123 | layout = wibox.container.place,
124 | },
125 | {
126 | {
127 | image = beautiful.arrow_right_icon,
128 | resize = true,
129 | halign = "center",
130 | valign = "center",
131 | forced_width = width_square,
132 | forced_height = height_square,
133 | widget = wibox.widget.imagebox,
134 | buttons = {
135 | awful.button({}, 1, function()
136 | move(1)
137 | end),
138 | },
139 | },
140 | halign = "left",
141 | valign = "top",
142 | layout = wibox.container.place,
143 | },
144 | expand = "none",
145 | layout = wibox.layout.align.horizontal,
146 | })
147 |
148 | local calendar = wibox.widget({
149 | {
150 | {
151 | {
152 | cal_control,
153 | cal_content,
154 | layout = wibox.layout.stack,
155 | },
156 | valign = "top",
157 | widget = wibox.container.place,
158 | },
159 | margins = dpi(6) * 2,
160 | widget = wibox.container.margin,
161 | },
162 | fg = beautiful.colors.foreground,
163 | bg = beautiful.colors.secondary_dark,
164 | widget = wibox.container.background,
165 | })
166 |
167 | return calendar
168 |
--------------------------------------------------------------------------------
/.config/awesome/ui/wibar/gpu.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local gears = require("gears")
3 | local wibox = require("wibox")
4 | local beautiful = require("beautiful")
5 | local dpi = require("beautiful.xresources").apply_dpi
6 |
7 | local pango = require("utils").pango
8 |
9 | local gpu = wibox.widget({
10 | {
11 | {
12 | {
13 | id = "gpu_icon_role",
14 | image = beautiful.gpu_icon,
15 | resize = true,
16 | halign = "center",
17 | valign = "center",
18 | forced_width = dpi(6) * 3,
19 | forced_height = dpi(6) * 3,
20 | widget = wibox.widget.imagebox,
21 | },
22 | {
23 | id = "gpu_utilization_text_role",
24 | halign = "center",
25 | valign = "center",
26 | widget = wibox.widget.textbox,
27 | },
28 | {
29 | id = "gpu_usep_text_role",
30 | halign = "center",
31 | valign = "center",
32 | widget = wibox.widget.textbox,
33 | },
34 | {
35 | id = "gpu_temperature_text_role",
36 | halign = "center",
37 | valign = "center",
38 | widget = wibox.widget.textbox,
39 | },
40 | spacing = dpi(6),
41 | layout = wibox.layout.fixed.horizontal,
42 | },
43 | left = dpi(6),
44 | right = dpi(6),
45 | widget = wibox.container.margin,
46 | },
47 | bg = beautiful.colors.background,
48 | widget = wibox.container.background,
49 | })
50 |
51 | awful.spawn.easy_async("which nvidia-smi", function(stdout, stderr, reason, exit_code)
52 | if exit_code == 0 then
53 | gears.timer({
54 | timeout = 1,
55 | call_now = true,
56 | autostart = true,
57 | callback = function()
58 | awful.spawn.easy_async({ "sh", "-c", "nvidia-smi --query-gpu=utilization.gpu,memory.total,memory.used,temperature.gpu --format=csv,noheader,nounits" }, function(out)
59 | local gpu_utilization, gpu_total, gpu_used, gpu_temperature = string.match(string.gsub(out, "%\n", ""), "^(.-)%, (.-)%, (.-)%, (.-)$")
60 |
61 | -- utilization
62 | if gpu_utilization then
63 | gpu_utilization = tonumber(gpu_utilization)
64 |
65 | local gpu_utilization_fg_color = beautiful.colors.low
66 | if gpu_utilization > 70 then
67 | gpu_utilization_fg_color = beautiful.colors.high
68 | elseif 30 <= gpu_utilization and gpu_utilization <= 70 then
69 | gpu_utilization_fg_color = beautiful.colors.medium
70 | end
71 | gpu:get_children_by_id("gpu_utilization_text_role")[1].markup = pango.span({ gpu_utilization .. "%", foreground = gpu_utilization_fg_color })
72 | else
73 | gpu:get_children_by_id("gpu_utilization_text_role")[1].text = "N/A"
74 | end
75 |
76 | -- used
77 | if gpu_used and gpu_total then
78 | local gpu_usep = math.floor(gpu_used / gpu_total * 100)
79 |
80 | local gpu_usep_fg_color = beautiful.colors.low
81 | if gpu_usep > 70 then
82 | gpu_usep_fg_color = beautiful.colors.high
83 | elseif 30 <= gpu_usep and gpu_usep <= 70 then
84 | gpu_usep_fg_color = beautiful.colors.medium
85 | end
86 | gpu:get_children_by_id("gpu_usep_text_role")[1].markup = pango.span({ gpu_usep .. "%", foreground = gpu_usep_fg_color })
87 | else
88 | gpu:get_children_by_id("gpu_usep_text_role")[1].text = "N/A"
89 | end
90 |
91 | -- temperature
92 | if gpu_temperature then
93 | gpu_temperature = tonumber(gpu_temperature)
94 |
95 | local gpu_temperature_fg_color = beautiful.colors.low
96 | if gpu_temperature > 80 then
97 | gpu_temperature_fg_color = beautiful.colors.high
98 | elseif 60 <= gpu_temperature and gpu_temperature <= 80 then
99 | gpu_temperature_fg_color = beautiful.colors.medium
100 | end
101 | gpu:get_children_by_id("gpu_temperature_text_role")[1].markup = pango.span({ gpu_temperature .. "°C", foreground = gpu_temperature_fg_color })
102 | else
103 | gpu:get_children_by_id("gpu_temperature_text_role")[1].text = "N/A"
104 | end
105 | end)
106 | end,
107 | })
108 | else
109 | gpu:get_children_by_id("gpu_utilization_text_role")[1].text = "N/A"
110 | gpu:get_children_by_id("gpu_usep_text_role")[1].text = "N/A"
111 | gpu:get_children_by_id("gpu_temperature_text_role")[1].text = "N/A"
112 | end
113 | end)
114 |
115 | return gpu
116 |
--------------------------------------------------------------------------------
/.config/awesome/core/rules.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local ruled = require("ruled")
3 | local dpi = require("beautiful.xresources").apply_dpi
4 |
5 | local tag_name = require("config").tags.name
6 |
7 | -- Client
8 | ruled.client.connect_signal("request::rules", function()
9 | -- All clients will match this rule
10 | ruled.client.append_rule({
11 | rule = {},
12 | properties = {
13 | -- border_width = dpi(0),
14 | titlebars_enabled = true,
15 | -- size_hints_honor = false,
16 | raise = true,
17 | focus = awful.client.focus.filter,
18 | screen = awful.screen.preferred,
19 | placement = awful.placement.no_overlap + awful.placement.no_offscreen,
20 | },
21 | })
22 | -- Floating clients
23 | ruled.client.append_rule({
24 | rule_any = {
25 | instance = {
26 | "pavucontrol",
27 | "nvidia-settings",
28 | "lxappearance",
29 | "qt5ct",
30 | "nitrogen",
31 | "viewnior",
32 | "system-config-printer",
33 | "nm-connection-editor",
34 | "nm-applet",
35 | "qalculate-gtk",
36 | "arandr",
37 | "Minecraft",
38 | "gpick",
39 | "blueman",
40 | "FileRoller",
41 | "copyq",
42 | },
43 | name = {},
44 | class = {},
45 | role = {
46 | "pop-up",
47 | },
48 | type = {
49 | "dialog",
50 | },
51 | },
52 | properties = {
53 | floating = true,
54 | placement = awful.placement.centered,
55 | },
56 | })
57 | -- Sticky clients
58 | ruled.client.append_rule({
59 | rule_any = { name = { "Picture in picture" }, instance = { "magnifiqus", "rofi", "onboard" } },
60 | properties = {
61 | floating = true,
62 | ontop = true,
63 | sticky = true,
64 | titlebars_enabled = false,
65 | },
66 | })
67 | -- No border
68 | ruled.client.append_rule({
69 | rule_any = { instance = "conky" },
70 | properties = {
71 | border_width = dpi(0),
72 | },
73 | })
74 | -- No titlebar
75 | ruled.client.append_rule({
76 | rule_any = { instance = { "Telegram", "google-chrome", "steam", "code" } },
77 | properties = {
78 | titlebars_enabled = false,
79 | },
80 | })
81 | -- Move to tag
82 | ruled.client.append_rule({
83 | rule_any = { instance = {} },
84 | properties = { tag = tag_name[1] },
85 | })
86 | ruled.client.append_rule({
87 | rule_any = { instance = { "code" } },
88 | properties = { tag = tag_name[2] },
89 | })
90 | ruled.client.append_rule({
91 | rule_any = { instance = { "google-chrome" } },
92 | properties = { tag = tag_name[3] },
93 | })
94 | ruled.client.append_rule({
95 | rule_any = { instance = { "nemo" } },
96 | properties = { tag = tag_name[4] },
97 | })
98 | ruled.client.append_rule({
99 | rule_any = { instance = { "zathura" } },
100 | properties = { tag = tag_name[5] },
101 | })
102 | ruled.client.append_rule({
103 | rule_any = { instance = {}, class = { "Spotify", "mpv" } },
104 | properties = { tag = tag_name[6] },
105 | })
106 | ruled.client.append_rule({
107 | rule_any = {
108 | instance = {
109 | "postman",
110 | "DBeaver",
111 | "VirtualBox",
112 | "simple-scan",
113 | "gucharmap",
114 | "inkscape",
115 | "gimp",
116 | "qbittorrent",
117 | },
118 | },
119 | properties = { tag = tag_name[7] },
120 | })
121 | ruled.client.append_rule({
122 | rule_any = { instance = { "Telegram", "discord" }, class = { "thunderbird" } },
123 | properties = { tag = tag_name[8] },
124 | })
125 | ruled.client.append_rule({
126 | rule_any = { instance = { "steam" }, class = { "Minecraft.*" } },
127 | properties = { tag = tag_name[9] },
128 | })
129 | ruled.client.append_rule({
130 | rule_any = {
131 | instance = {
132 | "nvidia-settings",
133 | "lxappearance",
134 | "pavucontrol",
135 | "qt5ct",
136 | "nitrogen",
137 | "arandr",
138 | "nm-connection-editor",
139 | "nm-applet",
140 | "blueman",
141 | "lshw",
142 | "seahorse",
143 | "anydesk",
144 | },
145 | },
146 | properties = { tag = tag_name[10] },
147 | })
148 | end)
149 |
150 | -- Notification
151 | ruled.notification.connect_signal("request::rules", function()
152 | ruled.notification.append_rule({
153 | rule = {},
154 | properties = {
155 | screen = awful.screen.preferred,
156 | implicit_timeout = 5,
157 | },
158 | })
159 | ruled.notification.append_rule({
160 | rule = { urgency = "low" },
161 | properties = {
162 | implicit_timeout = 5,
163 | },
164 | })
165 | ruled.notification.append_rule({
166 | rule = { urgency = "normal" },
167 | properties = {
168 | implicit_timeout = 10,
169 | },
170 | })
171 | ruled.notification.append_rule({
172 | rule = { urgency = "critical" },
173 | properties = {
174 | implicit_timeout = 20,
175 | },
176 | })
177 | end)
178 |
--------------------------------------------------------------------------------
/.config/awesome/ui/wibar/net.lua:
--------------------------------------------------------------------------------
1 | local wibox = require("wibox")
2 | local gears = require("gears")
3 | local beautiful = require("beautiful")
4 | local dpi = require("beautiful.xresources").apply_dpi
5 |
6 | -- Source https://github.com/vicious-widgets/vicious
7 |
8 | -- Initialize function tables
9 | local nets = {}
10 | -- Variable definitions
11 | local unit = { ["b"] = 1, ["kb"] = 1024, ["mb"] = 1024 ^ 2, ["gb"] = 1024 ^ 3 }
12 |
13 | -- {{{ Format units to one decimal point
14 | local uformat = function(array, key, value, unit_)
15 | for u, v in pairs(unit_) do
16 | array["{" .. key .. "_" .. u .. "}"] = string.format("%.1f", value / v)
17 | end
18 |
19 | return array
20 | end
21 | -- }}}
22 |
23 | -- {{{ Format a string with args
24 | local format = function(format, args)
25 | for var, val in pairs(args) do
26 | if tonumber(var) == nil then
27 | var = var:gsub("[-+?*]", function(i)
28 | return "%" .. i
29 | end)
30 | end
31 | if type(val) == "string" then
32 | val = val:gsub("%%", "%%%%")
33 | end
34 | format = format:gsub("$" .. var, val)
35 | end
36 | return format
37 | end
38 | -- }}}
39 |
40 | -- {{{ Expose path as a Lua table
41 | local pathtotable = function(dir)
42 | return setmetatable({ _path = dir }, {
43 | __index = function(self, index)
44 | local path = self._path .. "/" .. index
45 | local f = io.open(path)
46 | if f then
47 | local s = f:read("*all")
48 | f:close()
49 | if s then
50 | return s
51 | else
52 | local o = { _path = path }
53 | setmetatable(o, getmetatable(self))
54 | return o
55 | end
56 | end
57 | end,
58 | })
59 | end
60 | -- }}}
61 |
62 | -- {{{ Net widget type
63 | local get_net = function()
64 | local args = {}
65 |
66 | -- Get NET stats
67 | for line in io.lines("/proc/net/dev") do
68 | -- Match wmaster0 as well as rt0 (multiple leading spaces)
69 | local name = string.match(line, "^[%s]?[%s]?[%s]?[%s]?([%w]+):")
70 | if name ~= nil then
71 | -- Received bytes, first value after the name
72 | local recv = tonumber(string.match(line, ":[%s]*([%d]+)"))
73 | -- Transmited bytes, 7 fields from end of the line
74 | local send = tonumber(string.match(line, "([%d]+)%s+%d+%s+%d+%s+%d+%s+%d+%s+%d+%s+%d+%s+%d$"))
75 |
76 | uformat(args, name .. " rx", recv, unit)
77 | uformat(args, name .. " tx", send, unit)
78 |
79 | -- Operational state and carrier detection
80 | local sysnet = pathtotable("/sys/class/net/" .. name)
81 | args["{" .. name .. " carrier}"] = tonumber(sysnet.carrier) or 0
82 |
83 | local now = os.time()
84 | if nets[name] == nil then
85 | -- Default values on the first run
86 | nets[name] = {}
87 | uformat(args, name .. " down", 0, unit)
88 | uformat(args, name .. " up", 0, unit)
89 | else -- Net stats are absolute, substract our last reading
90 | local interval = now - nets[name].time
91 | if interval <= 0 then
92 | interval = 1
93 | end
94 |
95 | local down = (recv - nets[name][1]) / interval
96 | local up = (send - nets[name][2]) / interval
97 |
98 | uformat(args, name .. " down", down, unit)
99 | uformat(args, name .. " up", up, unit)
100 | end
101 |
102 | nets[name].time = now
103 |
104 | -- Store totals
105 | nets[name][1] = recv
106 | nets[name][2] = send
107 | end
108 | end
109 |
110 | return args
111 | end
112 | -- }}}
113 |
114 | local net = wibox.widget({
115 | {
116 | {
117 | {
118 | id = "download_icon_role",
119 | image = beautiful.download_icon,
120 | resize = true,
121 | halign = "center",
122 | valign = "center",
123 | forced_width = dpi(6) * 3,
124 | forced_height = dpi(6) * 3,
125 | widget = wibox.widget.imagebox,
126 | },
127 | {
128 | id = "download_text_role",
129 | halign = "center",
130 | valign = "center",
131 | widget = wibox.widget.textbox,
132 | },
133 | {
134 | id = "upload_icon_role",
135 | image = beautiful.upload_icon,
136 | resize = true,
137 | halign = "center",
138 | valign = "center",
139 | forced_width = dpi(6) * 3,
140 | forced_height = dpi(6) * 3,
141 | widget = wibox.widget.imagebox,
142 | },
143 | {
144 | id = "upload_text_role",
145 | halign = "center",
146 | valign = "center",
147 | widget = wibox.widget.textbox,
148 | },
149 | spacing = dpi(6),
150 | layout = wibox.layout.fixed.horizontal,
151 | },
152 | left = dpi(6),
153 | right = dpi(6),
154 | widget = wibox.container.margin,
155 | },
156 | bg = beautiful.colors.background,
157 | widget = wibox.container.background,
158 | })
159 |
160 | gears.timer({
161 | timeout = 1,
162 | call_now = true,
163 | autostart = true,
164 | callback = function()
165 | local result = get_net()
166 | net:get_children_by_id("download_text_role")[1].text = format("${eno1 down_mb}", result) .. "MB"
167 | net:get_children_by_id("upload_text_role")[1].text = format("${eno1 up_mb}", result) .. "MB"
168 | end,
169 | })
170 |
171 | return net
172 |
--------------------------------------------------------------------------------
/.config/zsh/.zshrc:
--------------------------------------------------------------------------------
1 | # Alias
2 | alias cp='cp --interactive --verbose'
3 | alias mv='mv --interactive --verbose'
4 | alias rm='rm --interactive --verbose'
5 | alias rmdir='rm --interactive=once --recursive'
6 | alias mkdir='mkdir --parents --verbose'
7 | alias ln='ln --verbose'
8 | alias ip='ip -color=auto'
9 | alias grep='grep --color=auto'
10 | alias egrep='egrep --color=auto'
11 | alias fgrep='fgrep --color=auto'
12 |
13 | if [ -f /usr/bin/lsd ]; then
14 | alias ls='lsd --classify'
15 | alias lls='lsd --long --classify'
16 | alias la='lsd --all --classify'
17 | alias lla='lsd --long --all --classify'
18 | else
19 | alias ls='ls --color=auto --classify --human-readable --time-style=long-iso --group-directories-first --sort=time'
20 | alias lls='ls -l'
21 | alias la='ls --all'
22 | alias lla='ls -l --all'
23 | fi
24 |
25 | if [ -f /usr/bin/bat ]; then
26 | alias bat='bat --paging=never --wrap=auto'
27 | fi
28 |
29 | if [ -f /usr/bin/btop ]; then
30 | alias btop='btop --preset 0'
31 | fi
32 |
33 | # Make cache dir
34 | [ ! -d $HOME/.cache/zsh ] && mkdir -v $HOME/.cache/zsh
35 |
36 | # Load directories
37 | eval "$(dircolors ~/.dircolors)"
38 |
39 | # Options
40 | setopt PROMPT_SUBST # Parameter expansion, command substitution and arithmetic expansion are performed in prompts
41 | setopt SHARE_HISTORY # Share history between all sessions
42 | setopt MENU_COMPLETE # Automatically highlight first element of completion menu
43 | setopt GLOB_COMPLETE # Trigger the completion after a glob * instead of expanding it
44 | setopt CORRECT # Spelling correction
45 | setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again
46 | setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file
47 |
48 | # History
49 | HISTSIZE=10000
50 | SAVEHIST=10000
51 | HISTFILE=~/.cache/zsh/.zsh_history
52 |
53 | # Prompt
54 | autoload -Uz vcs_info
55 | precmd () { vcs_info }
56 | zstyle ':vcs_info:*' check-for-changes true
57 | zstyle ':vcs_info:*' formats '%F{blue}[%F{yellow}%s %F{magenta}%b %F{green}%c%F{red}%u%F{blue}]%f '
58 | zstyle ':vcs_info:*' actionformats '%F{blue}[%F{yellow}%s %F{magenta}%b %F{green}%c%F{red}%u%F{cyan}%a%F{blue}]%f '
59 | zstyle ':vcs_info:git*+set-message:*' hooks git-untracked
60 | zstyle ':vcs_info:*' enable git
61 | +vi-git-untracked() {
62 | if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' ]] && \
63 | [[ $(git ls-files --other --directory --exclude-standard | sed q | wc -l | tr -d ' ') == 1 ]] ; then
64 | hook_com[unstaged]+='?'
65 | fi
66 | }
67 | PROMPT=' %F{blue}%c%f '
68 | PROMPT+='${vcs_info_msg_0_}'
69 | PROMPT+='%(?.%F{green}%#%f.%F{red}%? %#%f) '
70 | RPROMPT='%F{white}%*%f'
71 |
72 | # Basic auto/tab complete
73 | autoload -Uz compinit; compinit -d ~/.cache/zsh/.zcompdump
74 | # Include hidden files
75 | _comp_options+=(globdots)
76 | # The completion menu
77 | zstyle ':completion:*' menu select
78 | # Case-insensitive (all), partial-word, and then substring completion
79 | zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
80 | # Fuzzy match mistyped completions
81 | zstyle ':completion:*' completer _extensions _complete _match _approximate
82 | # Required for completion to be in good groups (named after the tags)
83 | zstyle ':completion:*' group-name ''
84 | # Formatting the display
85 | zstyle ':completion:*:corrections' format '%F{yellow}[%d]%f'
86 | zstyle ':completion:*:descriptions' format '%F{blue}[%d]%f'
87 | zstyle ':completion:*:messages' format '%F{magenta}[%d]%f'
88 | zstyle ':completion:*:warnings' format '%F{red}[%d]%f'
89 | # Colors for files and directory
90 | zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
91 |
92 | # Select word like bash
93 | autoload -U select-word-style
94 | select-word-style bash
95 |
96 | # Key bindings
97 | autoload -Uz select-bracketed select-quoted
98 | zle -N select-quoted
99 | zle -N select-bracketed
100 | for km in viopp visual; do
101 | bindkey -M $km -- '-' vi-up-line-or-history
102 | for c in {a,i}${(s..)^:-\'\"\`\|,./:;=+@}; do
103 | bindkey -M $km $c select-quoted
104 | done
105 | for c in {a,i}${(s..)^:-'()[]{}<>bB'}; do
106 | bindkey -M $km $c select-bracketed
107 | done
108 | done
109 |
110 | autoload -Uz surround
111 | zle -N delete-surround surround
112 | zle -N add-surround surround
113 | zle -N change-surround surround
114 | bindkey -M vicmd cs change-surround
115 | bindkey -M vicmd ds delete-surround
116 | bindkey -M vicmd ys add-surround
117 | bindkey -M visual S add-surround
118 |
119 | autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
120 | zle -N up-line-or-beginning-search
121 | zle -N down-line-or-beginning-search
122 | bindkey '^[[1;5A' up-line-or-beginning-search
123 | bindkey '^[[1;5B' down-line-or-beginning-search
124 |
125 | bindkey '^W' backward-kill-word
126 | bindkey '^?' backward-delete-char
127 | bindkey '^[[Z' reverse-menu-complete
128 |
129 | # Plugins
130 | [ -f /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh ] && source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
131 | [ -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ] && source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
132 | [ -f /usr/share/zsh/plugins/zsh-autopair/autopair.zsh ] && source /usr/share/zsh/plugins/zsh-autopair/autopair.zsh
133 |
134 | # FZF
135 | export FZF_DEFAULT_COMMAND="fd --type f --hidden --follow"
136 | export FZF_DEFAULT_OPTS="--multi --highlight-line --no-separator --bind='ctrl-/:toggle-preview' --prompt='SEARCH ' --layout=reverse --border=rounded --info=inline-right --color='fg:white,bg:black,hl:green,current-fg:bright-white,current-bg:black,current-hl:bright-green,query:white,info:yellow,border:bright-black,label:bright-blue,prompt:magenta,pointer:magenta,marker:cyan,spinner:white,header:italic:cyan'"
137 | export FZF_CTRL_T_COMMAND='fd --hidden --follow'
138 | export FZF_CTRL_T_OPTS="--prompt='FILE/DIR ' --preview='(bat --style=numbers --color=always {} || tree -a -C -L 1 --dirsfirst {}) 2> /dev/null'"
139 | export FZF_ALT_C_COMMAND="fd --type d --hidden --follow"
140 | export FZF_ALT_C_OPTS="--prompt='DIRECTORY ' --preview='tree -a -C -L 1 --dirsfirst {}'"
141 | export FZF_CTRL_R_OPTS="--wrap --prompt='HISTORY ' --preview-window=hidden"
142 | _fzf_compgen_path() { fd --hidden --follow . "$1"; }
143 | _fzf_compgen_dir() { fd --type d --hidden --follow . "$1"; }
144 |
145 | # Set up fzf key bindings and fuzzy completion
146 | command -v fzf &> /dev/null && eval "$(fzf --zsh)"
147 |
148 | # Disable ctrl-s to freeze terminal
149 | stty stop undef
150 |
151 | # Set terminal title to last command
152 | preexec() { print -Pn "\e]0;$1\a" }
153 |
154 | # Automatically start tmux
155 | if command -v tmux &> /dev/null && \
156 | [[ ! "$TERM_PROGRAM" == "vscode" ]] && \
157 | [[ ! "$TERM" =~ screen ]] && \
158 | [[ ! "$TERM" =~ tmux ]] && \
159 | [ -n "$PS1" ] && \
160 | [ -z "$TMUX" ]; then
161 | exec tmux new-session
162 | fi
163 |
164 | # Load zoxide
165 | command -v zoxide &> /dev/null && eval "$(zoxide init zsh)"
166 |
--------------------------------------------------------------------------------
/.config/nvim/lua/plugins/coding.lua:
--------------------------------------------------------------------------------
1 | return {
2 | -- Auto completion
3 | {
4 | "hrsh7th/nvim-cmp",
5 | event = "InsertEnter",
6 | dependencies = {
7 | "hrsh7th/cmp-buffer",
8 | "hrsh7th/cmp-path",
9 | "hrsh7th/cmp-cmdline",
10 | "hrsh7th/cmp-nvim-lsp",
11 | "hrsh7th/cmp-nvim-lsp-signature-help",
12 | "saadparwaiz1/cmp_luasnip",
13 | { "L3MON4D3/LuaSnip", build = "make install_jsregexp" },
14 | "rafamadriz/friendly-snippets",
15 | },
16 | config = function()
17 | local cmp = require("cmp")
18 |
19 | local luasnip = require("luasnip")
20 |
21 | require("luasnip.loaders.from_vscode").lazy_load()
22 |
23 | vim.api.nvim_create_user_command("LuaSnipEdit", function()
24 | require("luasnip.loaders").edit_snippet_files()
25 | end, { desc = "Edit snippet file" })
26 |
27 | local has_words_before = function()
28 | unpack = unpack or table.unpack
29 | local line, col = unpack(vim.api.nvim_win_get_cursor(0))
30 | return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
31 | end
32 |
33 | cmp.setup({
34 | snippet = {
35 | expand = function(args)
36 | luasnip.lsp_expand(args.body)
37 | end,
38 | },
39 | mapping = cmp.mapping.preset.insert({
40 | [""] = cmp.mapping.scroll_docs(-4),
41 | [""] = cmp.mapping.scroll_docs(4),
42 | [""] = cmp.mapping.complete(),
43 | [""] = cmp.mapping.abort(),
44 | [""] = cmp.mapping.confirm({ select = true }),
45 | [""] = cmp.mapping(function(fallback)
46 | if luasnip.choice_active() then
47 | luasnip.change_choice(1)
48 | else
49 | fallback()
50 | end
51 | end, { "i", "s" }),
52 | [""] = cmp.mapping(function(fallback)
53 | if cmp.visible() then
54 | cmp.select_next_item()
55 | elseif luasnip.expand_or_jumpable() then
56 | luasnip.expand_or_jump()
57 | elseif has_words_before() then
58 | cmp.complete()
59 | else
60 | fallback()
61 | end
62 | end, { "i", "s" }),
63 | [""] = cmp.mapping(function(fallback)
64 | if cmp.visible() then
65 | cmp.select_prev_item()
66 | elseif luasnip.jumpable(-1) then
67 | luasnip.jump(-1)
68 | else
69 | fallback()
70 | end
71 | end, { "i", "s" }),
72 | }),
73 | formatting = {
74 | expandable_indicator = true,
75 | fields = { "abbr", "kind", "menu" },
76 | format = function(entry, vim_item)
77 | vim_item.abbr = string.sub(vim_item.abbr, 1, 25)
78 | vim_item.menu = ({
79 | buffer = "[Buffer]",
80 | path = "[Path]",
81 | cmdline = "[Cmdline]",
82 | nvim_lsp = "[LSP]",
83 | nvim_lsp_signature_help = "[LSP Signature]",
84 | luasnip = "[LuaSnip]",
85 | })[entry.source.name]
86 | return vim_item
87 | end,
88 | },
89 | sources = cmp.config.sources({
90 | { name = "nvim_lsp" },
91 | { name = "nvim_lsp_signature_help" },
92 | { name = "luasnip" },
93 | { name = "buffer" },
94 | { name = "path" },
95 | }),
96 | cmp.setup.cmdline({ "/", "?" }, {
97 | mapping = cmp.mapping.preset.cmdline(),
98 | sources = cmp.config.sources({
99 | { name = "buffer" },
100 | }),
101 | }),
102 | cmp.setup.cmdline({ ":" }, {
103 | mapping = cmp.mapping.preset.cmdline(),
104 | sources = cmp.config.sources({
105 | { name = "path" },
106 | }, {
107 | { name = "cmdline" },
108 | }),
109 | }),
110 | window = {
111 | documentation = cmp.config.window.bordered(),
112 | },
113 | experimental = {
114 | ghost_text = true, -- this feature conflict with copilot.vim's preview.
115 | },
116 | })
117 | end,
118 | },
119 | -- Fast and feature-rich surround actions
120 | {
121 | "kylechui/nvim-surround",
122 | event = "VeryLazy",
123 | opts = {},
124 | },
125 | -- Comments
126 | {
127 | "folke/ts-comments.nvim",
128 | event = "VeryLazy",
129 | opts = {},
130 | },
131 | -- Auto pairs
132 | {
133 | "echasnovski/mini.pairs",
134 | event = "VeryLazy",
135 | opts = {
136 | modes = { insert = true, command = true, terminal = false },
137 | },
138 | },
139 | -- Better text-objects
140 | {
141 | "echasnovski/mini.ai",
142 | event = "VeryLazy",
143 | opts = function()
144 | local ai = require("mini.ai")
145 | return {
146 | n_lines = 500,
147 | custom_textobjects = {
148 | o = ai.gen_spec.treesitter({
149 | a = { "@block.outer", "@conditional.outer", "@loop.outer" },
150 | i = { "@block.inner", "@conditional.inner", "@loop.inner" },
151 | }, {}),
152 | f = ai.gen_spec.treesitter({
153 | a = "@function.outer",
154 | i = "@function.inner",
155 | }, {}),
156 | c = ai.gen_spec.treesitter({
157 | a = "@class.outer",
158 | i = "@class.inner",
159 | }, {}),
160 | d = { "%f[%d]%d+" }, -- digits
161 | e = { { "%u[%l%d]+%f[^%l%d]", "%f[%S][%l%d]+%f[^%l%d]", "%f[%P][%l%d]+%f[^%l%d]", "^[%l%d]+%f[^%l%d]" }, "^().*()$" }, -- Word with case
162 | },
163 | }
164 | end,
165 | },
166 | }
167 |
--------------------------------------------------------------------------------
/.config/awesome/ui/notification.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local naughty = require("naughty")
3 | local wibox = require("wibox")
4 | local beautiful = require("beautiful")
5 | local dpi = require("beautiful.xresources").apply_dpi
6 | local recolor_image = require("gears.color").recolor_image
7 |
8 | local pango = require("utils").pango
9 |
10 | naughty.notification_list = wibox.widget({
11 | spacing = beautiful.useless_gap * 2,
12 | layout = wibox.layout.fixed.vertical,
13 | })
14 |
15 | local pointer = 0
16 | local min_widgets = 3
17 |
18 | naughty.notification_list:connect_signal("button::press", function(_, _, _, button)
19 | if button == 5 then -- up scrolling
20 | if pointer < #naughty.notification_list.children and ((#naughty.notification_list.children - pointer) >= min_widgets) then
21 | pointer = pointer + 1
22 | naughty.notification_list.children[pointer].visible = false
23 | end
24 | elseif button == 4 then -- down scrolling
25 | if pointer > 0 then
26 | naughty.notification_list.children[pointer].visible = true
27 | pointer = pointer - 1
28 | end
29 | end
30 | end)
31 |
32 | local function notification_item(n)
33 | -- urgency color
34 | local urgency_header_fg = beautiful.colors.foreground
35 | local urgency_header_bg = beautiful.colors.secondary
36 | local urgency_body_bg = beautiful.colors.secondary_dark
37 | local urgency_button_bg = beautiful.colors.secondary_dull
38 | if n.urgency == "normal" then
39 | urgency_header_fg = beautiful.colors.background
40 | urgency_header_bg = beautiful.colors.primary
41 | urgency_body_bg = beautiful.colors.primary_dark
42 | urgency_button_bg = beautiful.colors.primary_dull
43 | elseif n.urgency == "critical" then
44 | urgency_header_fg = beautiful.colors.background
45 | urgency_header_bg = beautiful.colors.high
46 | urgency_body_bg = beautiful.colors.high_dark
47 | urgency_button_bg = beautiful.colors.high_dull
48 | end
49 |
50 | -- app name
51 | local app_name_n = wibox.widget({
52 | markup = pango.b(n.app_name == "" and "Notification" or pango.escape(n.app_name)),
53 | valign = "center",
54 | widget = wibox.widget.textbox,
55 | })
56 |
57 | -- time
58 | local time_n = wibox.widget({
59 | markup = pango.b(os.date("%H:%M:%S ")),
60 | valign = "center",
61 | widget = wibox.widget.textbox,
62 | })
63 |
64 | -- image
65 | local image_n = wibox.widget({
66 | image = n.icon and n.icon or recolor_image(beautiful.notification_icon, urgency_header_bg),
67 | resize = true,
68 | halign = "center",
69 | -- valign = "center",
70 | forced_width = dpi(6) * 10,
71 | forced_height = dpi(6) * 10,
72 | widget = wibox.widget.imagebox,
73 | })
74 |
75 | -- title
76 | local title_n = wibox.widget({
77 | {
78 | markup = pango.b(pango.escape(n.title)),
79 | align = "left",
80 | valign = "center",
81 | widget = wibox.widget.textbox,
82 | },
83 | widget = wibox.container.scroll.horizontal,
84 | })
85 |
86 | -- message
87 | local message_n = wibox.widget({
88 | {
89 | markup = pango.escape(n.message),
90 | align = "left",
91 | valign = "center",
92 | wrap = "char",
93 | widget = wibox.widget.textbox,
94 | },
95 | max_size = 300,
96 | widget = wibox.container.scroll.vertical,
97 | })
98 |
99 | -- actions
100 | local actions_n = wibox.widget({
101 | notification = n,
102 | base_layout = wibox.widget({
103 | spacing = dpi(6) * 2,
104 | layout = wibox.layout.flex.horizontal,
105 | }),
106 | style = {
107 | underline_normal = false,
108 | underline_selected = true,
109 | },
110 | widget = naughty.list.actions,
111 | widget_template = {
112 | {
113 | {
114 | id = "text_role",
115 | align = "center",
116 | valign = "center",
117 | widget = wibox.widget.textbox,
118 | },
119 | margins = dpi(6),
120 | widget = wibox.container.margin,
121 | },
122 | bg = urgency_button_bg,
123 | widget = wibox.container.background,
124 | },
125 | })
126 |
127 | return {
128 | {
129 | {
130 | {
131 | {
132 | time_n,
133 | nil,
134 | app_name_n,
135 | id = "header_role",
136 | layout = wibox.layout.align.horizontal,
137 | },
138 | top = dpi(6),
139 | bottom = dpi(6),
140 | left = dpi(6) * 2,
141 | right = dpi(6) * 2,
142 | widget = wibox.container.margin,
143 | },
144 | bg = urgency_header_bg,
145 | fg = urgency_header_fg,
146 | widget = wibox.container.background,
147 | },
148 | {
149 | {
150 | image_n,
151 | {
152 | title_n,
153 | message_n,
154 | spacing = dpi(6),
155 | layout = wibox.layout.fixed.vertical,
156 | },
157 | spacing = dpi(6) * 2,
158 | layout = wibox.layout.fixed.horizontal,
159 | },
160 | margins = dpi(6) * 2,
161 | widget = wibox.container.margin,
162 | },
163 | #n.actions ~= 0 and {
164 | actions_n,
165 | top = dpi(0),
166 | bottom = dpi(6) * 2,
167 | left = dpi(6) * 2,
168 | right = dpi(6) * 2,
169 | widget = wibox.container.margin,
170 | },
171 | layout = wibox.layout.fixed.vertical,
172 | },
173 | border_width = beautiful.border_width,
174 | border_color = urgency_header_bg,
175 | bg = urgency_body_bg,
176 | widget = wibox.container.background,
177 | }
178 | end
179 |
180 | -- Default
181 | naughty.connect_signal("request::display", function(n)
182 | -- template
183 | local widget_template = notification_item(n)
184 |
185 | -- popup
186 | naughty.layout.box({
187 | type = "notification",
188 | notification = n,
189 | border_width = dpi(0),
190 | minimum_width = dpi(6) * 10 * 6,
191 | maximum_width = dpi(6) * 10 * 6,
192 | widget_template = widget_template,
193 | })
194 |
195 | -- widget
196 | local widget = wibox.widget(widget_template)
197 | widget:get_children_by_id("header_role")[1].buttons = {
198 | awful.button({}, 1, function()
199 | naughty.notification_list:remove_widgets(widget)
200 | end),
201 | }
202 |
203 | naughty.notification_list:insert(1, widget)
204 | end)
205 |
206 | -- Error handling
207 | naughty.connect_signal("request::display_error", function(message, startup)
208 | naughty.notification({
209 | urgency = "critical",
210 | title = "Oops, an error happened" .. (startup and " during startup!" or "!"),
211 | message = message,
212 | })
213 | end)
214 |
--------------------------------------------------------------------------------
/.config/.dircolors:
--------------------------------------------------------------------------------
1 | COLOR tty
2 |
3 | TERM alacritty
4 | TERM ansi
5 | TERM color_xterm
6 | TERM color-xterm
7 | TERM con132x25
8 | TERM con132x30
9 | TERM con132x43
10 | TERM con132x60
11 | TERM con80x25
12 | TERM con80x28
13 | TERM con80x30
14 | TERM con80x43
15 | TERM con80x50
16 | TERM con80x60
17 | TERM cons25
18 | TERM console
19 | TERM cygwin
20 | TERM dtterm
21 | TERM dvtm
22 | TERM dvtm-256color
23 | TERM Eterm
24 | TERM eterm-color
25 | TERM fbterm
26 | TERM gnome
27 | TERM gnome-256color
28 | TERM jfbterm
29 | TERM konsole
30 | TERM konsole-256color
31 | TERM kterm
32 | TERM linux
33 | TERM linux-c
34 | TERM mach-color
35 | TERM mlterm
36 | TERM nxterm
37 | TERM putty
38 | TERM putty-256color
39 | TERM rxvt
40 | TERM rxvt-256color
41 | TERM rxvt-cygwin
42 | TERM rxvt-cygwin-native
43 | TERM rxvt-unicode
44 | TERM rxvt-unicode256
45 | TERM rxvt-unicode-256color
46 | TERM screen
47 | TERM screen-16color
48 | TERM screen-16color-bce
49 | TERM screen-16color-s
50 | TERM screen-16color-bce-s
51 | TERM screen-256color
52 | TERM screen-256color-bce
53 | TERM screen-256color-s
54 | TERM screen-256color-bce-s
55 | TERM screen-256color-italic
56 | TERM screen-bce
57 | TERM screen-w
58 | TERM screen.linux
59 | TERM screen.xterm-256color
60 | TERM screen.xterm-new
61 | TERM st
62 | TERM st-meta
63 | TERM st-256color
64 | TERM st-meta-256color
65 | TERM tmux
66 | TERM tmux-256color
67 | TERM vt100
68 | TERM xterm
69 | TERM xterm-new
70 | TERM xterm-16color
71 | TERM xterm-256color
72 | TERM xterm-256color-italic
73 | TERM xterm-88color
74 | TERM xterm-color
75 | TERM xterm-debian
76 | TERM xterm-kitty
77 | TERM xterm-termite
78 |
79 | # Attribute Text color Background color
80 | # ------------------------------------------------------------------------------
81 | # 00=none 30=black 40=black
82 | # 01=bold 31=red 41=red
83 | # 04=underscore 32=green 42=green
84 | # 05=blink 33=yellow 43=yellow
85 | # 07=reverse 34=blue 44=blue
86 | # 08=concealed 35=magenta 45=magenta
87 | # 36=cyan 46=cyan
88 | # 37=white 47=white
89 |
90 | # Basic file attributes
91 | # ------------------------------------------------------------------------------
92 |
93 | # NORMAL 00 # Generic text
94 | # FILE 00 # Regular file
95 | RESET 00 # Reset to ordinary colours
96 | DIR 34 # Normal directory
97 | LINK 01;36 # Symbolic link
98 | MULTIHARDLINK 36 # Hard link
99 | FIFO 40;33 # Pipe
100 | SOCK 01;35 # Socket
101 | DOOR 01;35 # Door
102 | BLK 33;01 # Block device driver
103 | CHR 33;01 # Character device driver
104 | ORPHAN 31 # Symlink to nonexistent file, or non-stat'able file ...
105 | MISSING 00 # ... and the files they point to
106 | SETUID 30;41 # File that is setuid (u+s)
107 | SETGID 30;43 # File that is setgid (g+s)
108 | CAPABILITY 00 # File with capability (very expensive to lookup)
109 | STICKY_OTHER_WRITABLE 34;07;04 # Dir that is sticky and other-writable (+t,o+w)
110 | OTHER_WRITABLE 34;04 # Dir that is other-writable (o+w) and not sticky
111 | STICKY 34;07 # Dir with the sticky bit set (+t) and not other-writable
112 | EXEC 01;31 # Executable file
113 |
114 | # Extension Pattern
115 | # ------------------------------------------------------------------------------
116 |
117 | # Executables
118 | .cmd 01;31
119 | .exe 01;31
120 | .com 01;31
121 | .bat 01;31
122 | .btm 01;31
123 | .reg 01;31
124 | .app 01;31
125 |
126 | # Text
127 | .txt 32
128 | .org 32
129 | .md 32
130 | .mkd 32
131 |
132 | # Source text
133 | .h 32
134 | .hpp 32
135 | .c 32
136 | .C 32
137 | .cc 32
138 | .cpp 32
139 | .cxx 32
140 | .objc 32
141 | .cl 32
142 | .sh 32
143 | .bash 32
144 | .csh 32
145 | .zsh 32
146 | .el 32
147 | .vim 32
148 | .java 32
149 | .pl 32
150 | .pm 32
151 | .py 32
152 | .rb 32
153 | .hs 32
154 | .php 32
155 | .htm 32
156 | .html 32
157 | .shtml 32
158 | .erb 32
159 | .haml 32
160 | .xml 32
161 | .rdf 32
162 | .css 32
163 | .sass 32
164 | .scss 32
165 | .less 32
166 | .js 32
167 | .coffee 32
168 | .man 32
169 | .0 32
170 | .1 32
171 | .2 32
172 | .3 32
173 | .4 32
174 | .5 32
175 | .6 32
176 | .7 32
177 | .8 32
178 | .9 32
179 | .l 32
180 | .n 32
181 | .p 32
182 | .pod 32
183 | .tex 32
184 | .go 32
185 | .sql 32
186 | .csv 32
187 | .sv 32
188 | .svh 32
189 | .v 32
190 | .vh 32
191 | .vhd 32
192 |
193 | # Image
194 | .bmp 33
195 | .cgm 33
196 | .dl 33
197 | .dvi 33
198 | .emf 33
199 | .eps 33
200 | .gif 33
201 | .jpeg 33
202 | .jpg 33
203 | .JPG 33
204 | .mng 33
205 | .pbm 33
206 | .pcx 33
207 | .pdf 33
208 | .pgm 33
209 | .png 33
210 | .PNG 33
211 | .ppm 33
212 | .pps 33
213 | .ppsx 33
214 | .ps 33
215 | .svg 33
216 | .svgz 33
217 | .tga 33
218 | .tif 33
219 | .tiff 33
220 | .xbm 33
221 | .xcf 33
222 | .xpm 33
223 | .xwd 33
224 | .xwd 33
225 | .yuv 33
226 | .nef 33
227 | .NEF 33
228 |
229 | # Audio
230 | .aac 33
231 | .au 33
232 | .flac 33
233 | .m4a 33
234 | .mid 33
235 | .midi 33
236 | .mka 33
237 | .mp3 33
238 | .mpa 33
239 | .mpeg 33
240 | .mpg 33
241 | .ogg 33
242 | .opus 33
243 | .ra 33
244 | .wav 33
245 |
246 | # Video
247 | .anx 33
248 | .asf 33
249 | .avi 33
250 | .axv 33
251 | .flc 33
252 | .fli 33
253 | .flv 33
254 | .gl 33
255 | .m2v 33
256 | .m4v 33
257 | .mkv 33
258 | .mov 33
259 | .MOV 33
260 | .mp4 33
261 | .mp4v 33
262 | .mpeg 33
263 | .mpg 33
264 | .nuv 33
265 | .ogm 33
266 | .ogv 33
267 | .ogx 33
268 | .qt 33
269 | .rm 33
270 | .rmvb 33
271 | .swf 33
272 | .vob 33
273 | .webm 33
274 | .wmv 33
275 |
276 | # Binary document formats and multimedia source
277 | .doc 31
278 | .docx 31
279 | .rtf 31
280 | .odt 31
281 | .dot 31
282 | .dotx 31
283 | .ott 31
284 | .xls 31
285 | .xlsx 31
286 | .ods 31
287 | .ots 31
288 | .ppt 31
289 | .pptx 31
290 | .odp 31
291 | .otp 31
292 | .fla 31
293 | .psd 31
294 |
295 | # Archives, compressed
296 | .7z 1;35
297 | .apk 1;35
298 | .arj 1;35
299 | .bin 1;35
300 | .bz 1;35
301 | .bz2 1;35
302 | .cab 1;35
303 | .deb 1;35
304 | .dmg 1;35
305 | .gem 1;35
306 | .gz 1;35
307 | .iso 1;35
308 | .jar 1;35
309 | .msi 1;35
310 | .rar 1;35
311 | .rpm 1;35
312 | .tar 1;35
313 | .tbz 1;35
314 | .tbz2 1;35
315 | .tgz 1;35
316 | .tx 1;35
317 | .war 1;35
318 | .xpi 1;35
319 | .xz 1;35
320 | .z 1;35
321 | .Z 1;35
322 | .zip 1;35
323 | .zst 1;35
324 |
325 | # For testing
326 | .ANSI-30-black 30
327 | .ANSI-01;30-brblack 01;30
328 | .ANSI-31-red 31
329 | .ANSI-01;31-brred 01;31
330 | .ANSI-32-green 32
331 | .ANSI-01;32-brgreen 01;32
332 | .ANSI-33-yellow 33
333 | .ANSI-01;33-bryellow 01;33
334 | .ANSI-34-blue 34
335 | .ANSI-01;34-brblue 01;34
336 | .ANSI-35-magenta 35
337 | .ANSI-01;35-brmagenta 01;35
338 | .ANSI-36-cyan 36
339 | .ANSI-01;36-brcyan 01;36
340 | .ANSI-37-white 37
341 | .ANSI-01;37-brwhite 01;37
342 |
--------------------------------------------------------------------------------