From ae78dbbff81196f1d7bc8fabf84d05e6b9f3ca03 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Tue, 28 Apr 2026 15:42:50 +0900 Subject: updates --- fedora/.config/bash/autocomplete.bash | 218 -- fedora/.config/bash/bash_profile | 116 - fedora/.config/bash/bashrc | 180 -- fedora/.config/bash/completions/bat.bash | 249 -- fedora/.config/bash/completions/rg.bash | 783 ----- fedora/.config/bash/completions/ya.bash | 647 ---- fedora/.config/bash/completions/yazi.bash | 66 - fedora/.config/bash/completions/zoxide.bash | 243 -- fedora/.config/bash/git.bash | 7 - fedora/.config/bash/keymaps.bash | 218 -- fedora/.config/bash/packages.bash | 35 - fedora/.config/bash/scripts.bash | 436 --- fedora/.config/htop/htoprc | 53 - fedora/.config/shell/aliasrc | 744 ----- fedora/.config/shell/bm-dirs | 36 - fedora/.config/shell/bm-files | 19 - fedora/.config/shell/profile | 263 -- fedora/.config/tmux/tmux.conf | 91 - fedora/.config/vim/UltiSnips/all.snippets | 30 - fedora/.config/vim/init.vim | 47 - fedora/.config/vim/vimrc | 579 ---- fedora/.config/yazi/flavors/ayu-dark.yazi/LICENSE | 21 - .../yazi/flavors/ayu-dark.yazi/LICENSE-tmtheme | 21 - .../.config/yazi/flavors/ayu-dark.yazi/README.md | 32 - .../.config/yazi/flavors/ayu-dark.yazi/flavor.toml | 137 - .../.config/yazi/flavors/ayu-dark.yazi/preview.png | Bin 316943 -> 0 bytes .../.config/yazi/flavors/ayu-dark.yazi/tmtheme.xml | 1025 ------- .../yazi/flavors/catppuccin-frappe.yazi/LICENSE | 21 - .../flavors/catppuccin-frappe.yazi/LICENSE-tmtheme | 21 - .../yazi/flavors/catppuccin-frappe.yazi/README.md | 36 - .../flavors/catppuccin-frappe.yazi/flavor.toml | 189 -- .../flavors/catppuccin-frappe.yazi/preview.png | Bin 587309 -> 0 bytes .../flavors/catppuccin-frappe.yazi/tmtheme.xml | 2112 ------------- .../yazi/flavors/catppuccin-latte.yazi/LICENSE | 21 - .../flavors/catppuccin-latte.yazi/LICENSE-tmtheme | 21 - .../yazi/flavors/catppuccin-latte.yazi/README.md | 36 - .../yazi/flavors/catppuccin-latte.yazi/flavor.toml | 189 -- .../yazi/flavors/catppuccin-latte.yazi/preview.png | Bin 734865 -> 0 bytes .../yazi/flavors/catppuccin-latte.yazi/tmtheme.xml | 2112 ------------- .../yazi/flavors/catppuccin-macchiato.yazi/LICENSE | 21 - .../catppuccin-macchiato.yazi/LICENSE-tmtheme | 21 - .../flavors/catppuccin-macchiato.yazi/README.md | 36 - .../flavors/catppuccin-macchiato.yazi/flavor.toml | 189 -- .../flavors/catppuccin-macchiato.yazi/preview.png | Bin 690459 -> 0 bytes .../flavors/catppuccin-macchiato.yazi/tmtheme.xml | 2112 ------------- .../yazi/flavors/catppuccin-mocha.yazi/LICENSE | 21 - .../flavors/catppuccin-mocha.yazi/LICENSE-tmtheme | 21 - .../yazi/flavors/catppuccin-mocha.yazi/README.md | 36 - .../yazi/flavors/catppuccin-mocha.yazi/flavor.toml | 189 -- .../yazi/flavors/catppuccin-mocha.yazi/preview.png | Bin 675868 -> 0 bytes .../yazi/flavors/catppuccin-mocha.yazi/tmtheme.xml | 2112 ------------- fedora/.config/yazi/flavors/dracula.yazi/LICENSE | 21 - .../yazi/flavors/dracula.yazi/LICENSE-tmtheme | 21 - fedora/.config/yazi/flavors/dracula.yazi/README.md | 36 - .../.config/yazi/flavors/dracula.yazi/flavor.toml | 189 -- .../.config/yazi/flavors/dracula.yazi/preview.png | Bin 855046 -> 0 bytes .../.config/yazi/flavors/dracula.yazi/tmtheme.xml | 940 ------ .../yazi/flavors/everforest-medium.yazi/LICENSE | 21 - .../flavors/everforest-medium.yazi/LICENSE-tmtheme | 21 - .../yazi/flavors/everforest-medium.yazi/README.md | 45 - .../flavors/everforest-medium.yazi/flavor.toml | 229 -- .../flavors/everforest-medium.yazi/preview.png | Bin 78490 -> 0 bytes .../flavors/everforest-medium.yazi/tmtheme.xml | 3186 -------------------- .../.config/yazi/flavors/gruvbox-dark.yazi/LICENSE | 22 - .../yazi/flavors/gruvbox-dark.yazi/LICENSE-tmtheme | 21 - .../yazi/flavors/gruvbox-dark.yazi/README.md | 32 - .../yazi/flavors/gruvbox-dark.yazi/flavor.toml | 176 -- .../yazi/flavors/gruvbox-dark.yazi/preview.png | Bin 7036575 -> 0 bytes .../yazi/flavors/gruvbox-dark.yazi/tmtheme.xml | 1509 --------- .../yazi/flavors/kanagawa-dragon.yazi/LICENSE | 21 - .../flavors/kanagawa-dragon.yazi/LICENSE-tmtheme | 21 - .../yazi/flavors/kanagawa-dragon.yazi/README.md | 32 - .../yazi/flavors/kanagawa-dragon.yazi/flavor.toml | 137 - .../yazi/flavors/kanagawa-dragon.yazi/preview.png | Bin 1212654 -> 0 bytes .../yazi/flavors/kanagawa-dragon.yazi/tmtheme.xml | 448 --- .../yazi/flavors/kanagawa-lotus.yazi/LICENSE | 21 - .../flavors/kanagawa-lotus.yazi/LICENSE-tmtheme | 21 - .../yazi/flavors/kanagawa-lotus.yazi/README.md | 41 - .../yazi/flavors/kanagawa-lotus.yazi/flavor.toml | 130 - .../yazi/flavors/kanagawa-lotus.yazi/preview.png | Bin 264566 -> 0 bytes .../yazi/flavors/kanagawa-lotus.yazi/tmtheme.xml | 448 --- fedora/.config/yazi/flavors/kanagawa.yazi/LICENSE | 21 - .../yazi/flavors/kanagawa.yazi/LICENSE-tmtheme | 21 - .../.config/yazi/flavors/kanagawa.yazi/README.md | 36 - .../.config/yazi/flavors/kanagawa.yazi/flavor.toml | 140 - .../.config/yazi/flavors/kanagawa.yazi/preview.png | Bin 166757 -> 0 bytes .../.config/yazi/flavors/kanagawa.yazi/tmtheme.xml | 448 --- .../yazi/flavors/rose-pine-dawn.yazi/LICENSE | 21 - .../flavors/rose-pine-dawn.yazi/LICENSE-tmtheme | 21 - .../yazi/flavors/rose-pine-dawn.yazi/README.md | 36 - .../yazi/flavors/rose-pine-dawn.yazi/flavor.toml | 230 -- .../yazi/flavors/rose-pine-dawn.yazi/preview.png | Bin 496676 -> 0 bytes .../yazi/flavors/rose-pine-dawn.yazi/tmtheme.xml | 316 -- .../yazi/flavors/rose-pine-moon.yazi/LICENSE | 21 - .../flavors/rose-pine-moon.yazi/LICENSE-tmtheme | 21 - .../yazi/flavors/rose-pine-moon.yazi/README.md | 36 - .../yazi/flavors/rose-pine-moon.yazi/flavor.toml | 230 -- .../yazi/flavors/rose-pine-moon.yazi/preview.png | Bin 1008743 -> 0 bytes .../yazi/flavors/rose-pine-moon.yazi/tmtheme.xml | 316 -- fedora/.config/yazi/flavors/rose-pine.yazi/LICENSE | 21 - .../yazi/flavors/rose-pine.yazi/LICENSE-tmtheme | 21 - .../.config/yazi/flavors/rose-pine.yazi/README.md | 36 - .../yazi/flavors/rose-pine.yazi/flavor.toml | 230 -- .../yazi/flavors/rose-pine.yazi/preview.png | Bin 983910 -> 0 bytes .../yazi/flavors/rose-pine.yazi/tmtheme.xml | 316 -- fedora/.config/yazi/flavors/scripts/README.md | 36 - fedora/.config/yazi/flavors/scripts/generate.js | 169 -- fedora/.config/yazi/flavors/scripts/template.toml | 189 -- .../.config/yazi/flavors/tokyo-night.yazi/LICENSE | 21 - .../yazi/flavors/tokyo-night.yazi/LICENSE-tmtheme | 21 - .../yazi/flavors/tokyo-night.yazi/README.md | 47 - .../yazi/flavors/tokyo-night.yazi/flavor.toml | 190 -- .../yazi/flavors/tokyo-night.yazi/preview.png | Bin 729541 -> 0 bytes .../yazi/flavors/tokyo-night.yazi/tmtheme.xml | 1329 -------- .../yazi/flavors/vscode-dark-modern.yazi/LICENSE | 21 - .../vscode-dark-modern.yazi/LICENSE-tmtheme | 21 - .../yazi/flavors/vscode-dark-modern.yazi/README.md | 50 - .../flavors/vscode-dark-modern.yazi/flavor.toml | 186 -- .../yazi/flavors/vscode-dark-modern.yazi/img/1.png | Bin 465582 -> 0 bytes .../yazi/flavors/vscode-dark-modern.yazi/img/2.png | Bin 591609 -> 0 bytes .../yazi/flavors/vscode-dark-modern.yazi/img/3.png | Bin 646085 -> 0 bytes .../yazi/flavors/vscode-dark-modern.yazi/img/4.png | Bin 590651 -> 0 bytes .../vscode-dark-modern.yazi/img/preview.png | Bin 474310 -> 0 bytes .../flavors/vscode-dark-modern.yazi/preview.png | Bin 474310 -> 0 bytes .../flavors/vscode-dark-modern.yazi/tmtheme.xml | 250 -- .../yazi/flavors/vscode-dark-plus.yazi/LICENSE | 21 - .../flavors/vscode-dark-plus.yazi/LICENSE-tmtheme | 21 - .../yazi/flavors/vscode-dark-plus.yazi/README.md | 50 - .../yazi/flavors/vscode-dark-plus.yazi/flavor.toml | 186 -- .../yazi/flavors/vscode-dark-plus.yazi/img/1.png | Bin 465477 -> 0 bytes .../yazi/flavors/vscode-dark-plus.yazi/img/2.png | Bin 591518 -> 0 bytes .../yazi/flavors/vscode-dark-plus.yazi/img/3.png | Bin 646158 -> 0 bytes .../yazi/flavors/vscode-dark-plus.yazi/img/4.png | Bin 589782 -> 0 bytes .../flavors/vscode-dark-plus.yazi/img/preview.png | Bin 474215 -> 0 bytes .../yazi/flavors/vscode-dark-plus.yazi/preview.png | Bin 474215 -> 0 bytes .../yazi/flavors/vscode-dark-plus.yazi/tmtheme.xml | 250 -- .../yazi/flavors/vscode-light-modern.yazi/LICENSE | 21 - .../vscode-light-modern.yazi/LICENSE-tmtheme | 21 - .../flavors/vscode-light-modern.yazi/README.md | 50 - .../flavors/vscode-light-modern.yazi/flavor.toml | 186 -- .../flavors/vscode-light-modern.yazi/img/1.png | Bin 451099 -> 0 bytes .../flavors/vscode-light-modern.yazi/img/2.png | Bin 595482 -> 0 bytes .../flavors/vscode-light-modern.yazi/img/3.png | Bin 643205 -> 0 bytes .../flavors/vscode-light-modern.yazi/img/4.png | Bin 568228 -> 0 bytes .../vscode-light-modern.yazi/img/preview.png | Bin 457221 -> 0 bytes .../flavors/vscode-light-modern.yazi/preview.png | Bin 457221 -> 0 bytes .../flavors/vscode-light-modern.yazi/tmtheme.xml | 250 -- .../yazi/flavors/vscode-light-plus.yazi/LICENSE | 21 - .../flavors/vscode-light-plus.yazi/LICENSE-tmtheme | 21 - .../yazi/flavors/vscode-light-plus.yazi/README.md | 50 - .../flavors/vscode-light-plus.yazi/flavor.toml | 186 -- .../yazi/flavors/vscode-light-plus.yazi/img/1.png | Bin 444447 -> 0 bytes .../yazi/flavors/vscode-light-plus.yazi/img/2.png | Bin 581698 -> 0 bytes .../yazi/flavors/vscode-light-plus.yazi/img/3.png | Bin 630738 -> 0 bytes .../yazi/flavors/vscode-light-plus.yazi/img/4.png | Bin 566333 -> 0 bytes .../flavors/vscode-light-plus.yazi/img/preview.png | Bin 447989 -> 0 bytes .../flavors/vscode-light-plus.yazi/preview.png | Bin 447989 -> 0 bytes .../flavors/vscode-light-plus.yazi/tmtheme.xml | 250 -- fedora/.config/yazi/init.lua | 72 - fedora/.config/yazi/keymap-default.toml | 490 --- fedora/.config/yazi/plugins/chmod.yazi/README.md | 28 - fedora/.config/yazi/plugins/chmod.yazi/main.lua | 42 - fedora/.config/yazi/plugins/compress.yazi/LICENSE | 21 - .../.config/yazi/plugins/compress.yazi/README.md | 173 -- fedora/.config/yazi/plugins/compress.yazi/main.lua | 496 --- fedora/.config/yazi/plugins/diff.yazi/README.md | 28 - fedora/.config/yazi/plugins/diff.yazi/main.lua | 41 - .../yazi/plugins/folder-rules.yazi/main.lua | 12 - .../yazi/plugins/full-border.yazi/README.md | 32 - .../.config/yazi/plugins/full-border.yazi/main.lua | 43 - fedora/.config/yazi/plugins/git.yazi/README.md | 78 - fedora/.config/yazi/plugins/git.yazi/main.lua | 261 -- fedora/.config/yazi/plugins/git.yazi/types.lua | 12 - .../yazi/plugins/jump-to-char.yazi/README.md | 28 - .../yazi/plugins/jump-to-char.yazi/main.lua | 32 - fedora/.config/yazi/plugins/lsar.yazi/README.md | 43 - fedora/.config/yazi/plugins/lsar.yazi/main.lua | 43 - fedora/.config/yazi/plugins/mactag.yazi/README.md | 79 - fedora/.config/yazi/plugins/mactag.yazi/main.lua | 105 - .../.config/yazi/plugins/mime-ext.yazi/README.md | 56 - fedora/.config/yazi/plugins/mime-ext.yazi/main.lua | 1126 ------- fedora/.config/yazi/plugins/mount.yazi/README.md | 48 - fedora/.config/yazi/plugins/mount.yazi/main.lua | 304 -- fedora/.config/yazi/plugins/office.yazi/LICENSE | 21 - fedora/.config/yazi/plugins/office.yazi/README.md | 76 - fedora/.config/yazi/plugins/office.yazi/main.lua | 121 - .../yazi/plugins/parent-arrow.yazi/main.lua | 24 - fedora/.config/yazi/plugins/piper.yazi/README.md | 90 - fedora/.config/yazi/plugins/piper.yazi/main.lua | 70 - .../yazi/plugins/smart-enter.yazi/README.md | 40 - .../.config/yazi/plugins/smart-enter.yazi/main.lua | 11 - .../yazi/plugins/smart-filter.yazi/README.md | 28 - .../yazi/plugins/smart-filter.yazi/main.lua | 51 - .../yazi/plugins/smart-paste.yazi/README.md | 26 - .../.config/yazi/plugins/smart-paste.yazi/main.lua | 14 - .../.config/yazi/plugins/sudo-demo.yazi/README.md | 25 - .../.config/yazi/plugins/sudo-demo.yazi/main.lua | 45 - .../yazi/plugins/toggle-pane.yazi/README.md | 78 - .../.config/yazi/plugins/toggle-pane.yazi/main.lua | 45 - fedora/.config/yazi/plugins/zoom.yazi/README.md | 56 - fedora/.config/yazi/plugins/zoom.yazi/main.lua | 119 - fedora/.config/yazi/theme.toml | 278 -- fedora/.config/yazi/yazi.toml | 278 -- fedora/.config/zsh/.zshrc | 141 - fedora/.config/zsh/autocomplete.zsh | 70 - fedora/.config/zsh/git.zsh | 7 - fedora/.config/zsh/keymaps.zsh | 342 --- fedora/.config/zsh/p10k.zsh | 1721 ----------- fedora/.config/zsh/packages.zsh | 23 - fedora/.config/zsh/plugins.zsh | 105 - fedora/.config/zsh/scripts.zsh | 880 ------ fedora/.local/bin/bat | Bin 6910848 -> 0 bytes fedora/.local/bin/bmshortcuts | 93 - fedora/.local/bin/chafa | Bin 7175232 -> 0 bytes fedora/.local/bin/eza | Bin 2491296 -> 0 bytes fedora/.local/bin/fzf | Bin 4411544 -> 0 bytes fedora/.local/bin/fzf-preview.sh | 86 - fedora/.local/bin/fzf-tmux | 257 -- fedora/.local/bin/fzffiles | 51 +- fedora/.local/bin/fzffns | 74 - fedora/.local/bin/fzfpass | 88 - fedora/.local/bin/htop-vim/.editorconfig | 17 - fedora/.local/bin/htop-vim/.gitignore | 56 - fedora/.local/bin/htop-vim/.travis.yml | 16 - fedora/.local/bin/htop-vim/AUTHORS | 11 - fedora/.local/bin/htop-vim/Action.c | 868 ------ fedora/.local/bin/htop-vim/Action.h | 67 - fedora/.local/bin/htop-vim/Affinity.c | 115 - fedora/.local/bin/htop-vim/Affinity.h | 49 - fedora/.local/bin/htop-vim/AffinityPanel.c | 442 --- fedora/.local/bin/htop-vim/AffinityPanel.h | 21 - fedora/.local/bin/htop-vim/AvailableColumnsPanel.c | 122 - fedora/.local/bin/htop-vim/AvailableColumnsPanel.h | 23 - fedora/.local/bin/htop-vim/AvailableMetersPanel.c | 171 -- fedora/.local/bin/htop-vim/AvailableMetersPanel.h | 34 - fedora/.local/bin/htop-vim/BatteryMeter.c | 68 - fedora/.local/bin/htop-vim/BatteryMeter.h | 23 - fedora/.local/bin/htop-vim/CONTRIBUTING.md | 45 - fedora/.local/bin/htop-vim/COPYING | 339 --- fedora/.local/bin/htop-vim/CPUMeter.c | 617 ---- fedora/.local/bin/htop-vim/CPUMeter.h | 53 - fedora/.local/bin/htop-vim/CRT.c | 1228 -------- fedora/.local/bin/htop-vim/CRT.h | 209 -- fedora/.local/bin/htop-vim/CategoriesPanel.c | 177 -- fedora/.local/bin/htop-vim/CategoriesPanel.h | 30 - fedora/.local/bin/htop-vim/ChangeLog | 1095 ------- fedora/.local/bin/htop-vim/ClockMeter.c | 46 - fedora/.local/bin/htop-vim/ClockMeter.h | 15 - fedora/.local/bin/htop-vim/ColorsPanel.c | 106 - fedora/.local/bin/htop-vim/ColorsPanel.h | 24 - fedora/.local/bin/htop-vim/ColumnsPanel.c | 178 -- fedora/.local/bin/htop-vim/ColumnsPanel.h | 32 - fedora/.local/bin/htop-vim/CommandLine.c | 425 --- fedora/.local/bin/htop-vim/CommandLine.h | 19 - fedora/.local/bin/htop-vim/CommandScreen.c | 68 - fedora/.local/bin/htop-vim/CommandScreen.h | 19 - fedora/.local/bin/htop-vim/Compat.c | 156 - fedora/.local/bin/htop-vim/Compat.h | 64 - fedora/.local/bin/htop-vim/DateMeter.c | 52 - fedora/.local/bin/htop-vim/DateMeter.h | 15 - fedora/.local/bin/htop-vim/DateTimeMeter.c | 52 - fedora/.local/bin/htop-vim/DateTimeMeter.h | 15 - fedora/.local/bin/htop-vim/DiskIOMeter.c | 159 - fedora/.local/bin/htop-vim/DiskIOMeter.h | 21 - fedora/.local/bin/htop-vim/DisplayOptionsPanel.c | 160 - fedora/.local/bin/htop-vim/DisplayOptionsPanel.h | 26 - fedora/.local/bin/htop-vim/DynamicColumn.c | 66 - fedora/.local/bin/htop-vim/DynamicColumn.h | 34 - fedora/.local/bin/htop-vim/DynamicMeter.c | 131 - fedora/.local/bin/htop-vim/DynamicMeter.h | 28 - fedora/.local/bin/htop-vim/EnvScreen.c | 58 - fedora/.local/bin/htop-vim/EnvScreen.h | 19 - fedora/.local/bin/htop-vim/FunctionBar.c | 155 - fedora/.local/bin/htop-vim/FunctionBar.h | 40 - fedora/.local/bin/htop-vim/Hashtable.c | 330 -- fedora/.local/bin/htop-vim/Hashtable.h | 42 - fedora/.local/bin/htop-vim/Header.c | 304 -- fedora/.local/bin/htop-vim/Header.h | 48 - fedora/.local/bin/htop-vim/HeaderLayout.h | 78 - fedora/.local/bin/htop-vim/HeaderOptionsPanel.c | 88 - fedora/.local/bin/htop-vim/HeaderOptionsPanel.h | 26 - fedora/.local/bin/htop-vim/HostnameMeter.c | 38 - fedora/.local/bin/htop-vim/HostnameMeter.h | 15 - fedora/.local/bin/htop-vim/IncSet.c | 247 -- fedora/.local/bin/htop-vim/IncSet.h | 65 - fedora/.local/bin/htop-vim/InfoScreen.c | 177 -- fedora/.local/bin/htop-vim/InfoScreen.h | 55 - fedora/.local/bin/htop-vim/ListItem.c | 72 - fedora/.local/bin/htop-vim/ListItem.h | 40 - fedora/.local/bin/htop-vim/LoadAverageMeter.c | 134 - fedora/.local/bin/htop-vim/LoadAverageMeter.h | 17 - fedora/.local/bin/htop-vim/Macros.h | 85 - fedora/.local/bin/htop-vim/MainPanel.c | 236 -- fedora/.local/bin/htop-vim/MainPanel.h | 52 - fedora/.local/bin/htop-vim/Makefile.am | 463 --- fedora/.local/bin/htop-vim/MemoryMeter.c | 96 - fedora/.local/bin/htop-vim/MemoryMeter.h | 23 - fedora/.local/bin/htop-vim/MemorySwapMeter.c | 107 - fedora/.local/bin/htop-vim/MemorySwapMeter.h | 15 - fedora/.local/bin/htop-vim/Meter.c | 487 --- fedora/.local/bin/htop-vim/Meter.h | 162 - fedora/.local/bin/htop-vim/MetersPanel.c | 224 -- fedora/.local/bin/htop-vim/MetersPanel.h | 40 - fedora/.local/bin/htop-vim/NEWS | 4 - fedora/.local/bin/htop-vim/NetworkIOMeter.c | 167 - fedora/.local/bin/htop-vim/NetworkIOMeter.h | 16 - fedora/.local/bin/htop-vim/Object.c | 29 - fedora/.local/bin/htop-vim/Object.h | 59 - fedora/.local/bin/htop-vim/OpenFilesScreen.c | 288 -- fedora/.local/bin/htop-vim/OpenFilesScreen.h | 28 - fedora/.local/bin/htop-vim/OptionItem.c | 215 -- fedora/.local/bin/htop-vim/OptionItem.h | 80 - fedora/.local/bin/htop-vim/Panel.c | 526 ---- fedora/.local/bin/htop-vim/Panel.h | 143 - fedora/.local/bin/htop-vim/Process.c | 1353 --------- fedora/.local/bin/htop-vim/Process.h | 430 --- fedora/.local/bin/htop-vim/ProcessList.c | 511 ---- fedora/.local/bin/htop-vim/ProcessList.h | 127 - fedora/.local/bin/htop-vim/ProcessLocksScreen.c | 106 - fedora/.local/bin/htop-vim/ProcessLocksScreen.h | 52 - fedora/.local/bin/htop-vim/ProvideCurses.h | 34 - fedora/.local/bin/htop-vim/README | 230 -- fedora/.local/bin/htop-vim/README.md | 1 - fedora/.local/bin/htop-vim/RichString.c | 221 -- fedora/.local/bin/htop-vim/RichString.h | 79 - fedora/.local/bin/htop-vim/Scheduling.c | 154 - fedora/.local/bin/htop-vim/Scheduling.h | 49 - fedora/.local/bin/htop-vim/ScreenManager.c | 418 --- fedora/.local/bin/htop-vim/ScreenManager.h | 49 - fedora/.local/bin/htop-vim/ScreensPanel.c | 340 --- fedora/.local/bin/htop-vim/ScreensPanel.h | 53 - fedora/.local/bin/htop-vim/Settings.c | 830 ----- fedora/.local/bin/htop-vim/Settings.h | 136 - fedora/.local/bin/htop-vim/SignalsPanel.c | 48 - fedora/.local/bin/htop-vim/SignalsPanel.h | 28 - fedora/.local/bin/htop-vim/SwapMeter.c | 73 - fedora/.local/bin/htop-vim/SwapMeter.h | 20 - fedora/.local/bin/htop-vim/SysArchMeter.c | 44 - fedora/.local/bin/htop-vim/SysArchMeter.h | 14 - fedora/.local/bin/htop-vim/TESTPLAN | 156 - fedora/.local/bin/htop-vim/TasksMeter.c | 76 - fedora/.local/bin/htop-vim/TasksMeter.h | 15 - fedora/.local/bin/htop-vim/TraceScreen.c | 193 -- fedora/.local/bin/htop-vim/TraceScreen.h | 37 - fedora/.local/bin/htop-vim/UptimeMeter.c | 60 - fedora/.local/bin/htop-vim/UptimeMeter.h | 15 - fedora/.local/bin/htop-vim/UsersTable.c | 46 - fedora/.local/bin/htop-vim/UsersTable.h | 25 - fedora/.local/bin/htop-vim/Vector.c | 407 --- fedora/.local/bin/htop-vim/Vector.h | 99 - fedora/.local/bin/htop-vim/XUtils.c | 338 --- fedora/.local/bin/htop-vim/XUtils.h | 78 - fedora/.local/bin/htop-vim/autogen.sh | 2 - fedora/.local/bin/htop-vim/configure.ac | 779 ----- fedora/.local/bin/htop-vim/darwin/DarwinProcess.c | 478 --- fedora/.local/bin/htop-vim/darwin/DarwinProcess.h | 46 - .../.local/bin/htop-vim/darwin/DarwinProcessList.c | 203 -- .../.local/bin/htop-vim/darwin/DarwinProcessList.h | 39 - fedora/.local/bin/htop-vim/darwin/Platform.c | 437 --- fedora/.local/bin/htop-vim/darwin/Platform.h | 127 - .../.local/bin/htop-vim/darwin/PlatformHelpers.c | 126 - .../.local/bin/htop-vim/darwin/PlatformHelpers.h | 40 - fedora/.local/bin/htop-vim/darwin/ProcessField.h | 18 - .../.local/bin/htop-vim/docs/images/screenshot.png | Bin 46142 -> 0 bytes fedora/.local/bin/htop-vim/docs/styleguide.md | 243 -- .../htop-vim/dragonflybsd/DragonFlyBSDProcess.c | 110 - .../htop-vim/dragonflybsd/DragonFlyBSDProcess.h | 32 - .../dragonflybsd/DragonFlyBSDProcessList.c | 615 ---- .../dragonflybsd/DragonFlyBSDProcessList.h | 64 - fedora/.local/bin/htop-vim/dragonflybsd/Platform.c | 262 -- fedora/.local/bin/htop-vim/dragonflybsd/Platform.h | 120 - .../bin/htop-vim/dragonflybsd/ProcessField.h | 19 - .../.local/bin/htop-vim/freebsd/FreeBSDProcess.c | 122 - .../.local/bin/htop-vim/freebsd/FreeBSDProcess.h | 32 - .../bin/htop-vim/freebsd/FreeBSDProcessList.c | 631 ---- .../bin/htop-vim/freebsd/FreeBSDProcessList.h | 58 - fedora/.local/bin/htop-vim/freebsd/Platform.c | 383 --- fedora/.local/bin/htop-vim/freebsd/Platform.h | 120 - fedora/.local/bin/htop-vim/freebsd/ProcessField.h | 20 - fedora/.local/bin/htop-vim/generic/gettime.c | 61 - fedora/.local/bin/htop-vim/generic/gettime.h | 18 - fedora/.local/bin/htop-vim/generic/hostname.c | 17 - fedora/.local/bin/htop-vim/generic/hostname.h | 15 - .../.local/bin/htop-vim/generic/openzfs_sysctl.c | 104 - .../.local/bin/htop-vim/generic/openzfs_sysctl.h | 17 - fedora/.local/bin/htop-vim/generic/uname.c | 98 - fedora/.local/bin/htop-vim/generic/uname.h | 12 - fedora/.local/bin/htop-vim/htop.1.in | 682 ----- fedora/.local/bin/htop-vim/htop.c | 16 - fedora/.local/bin/htop-vim/htop.desktop | 67 - fedora/.local/bin/htop-vim/htop.png | Bin 2616 -> 0 bytes fedora/.local/bin/htop-vim/htop.svg | 112 - fedora/.local/bin/htop-vim/iwyu/htop.imp | 24 - fedora/.local/bin/htop-vim/iwyu/run_iwyu.sh | 14 - fedora/.local/bin/htop-vim/linux/CGroupUtils.c | 341 --- fedora/.local/bin/htop-vim/linux/CGroupUtils.h | 16 - fedora/.local/bin/htop-vim/linux/HugePageMeter.c | 106 - fedora/.local/bin/htop-vim/linux/HugePageMeter.h | 15 - fedora/.local/bin/htop-vim/linux/IOPriority.h | 36 - fedora/.local/bin/htop-vim/linux/IOPriorityPanel.c | 57 - fedora/.local/bin/htop-vim/linux/IOPriorityPanel.h | 17 - fedora/.local/bin/htop-vim/linux/LibSensors.c | 269 -- fedora/.local/bin/htop-vim/linux/LibSensors.h | 13 - fedora/.local/bin/htop-vim/linux/LinuxProcess.c | 416 --- fedora/.local/bin/htop-vim/linux/LinuxProcess.h | 135 - .../.local/bin/htop-vim/linux/LinuxProcessList.c | 2285 -------------- .../.local/bin/htop-vim/linux/LinuxProcessList.h | 126 - fedora/.local/bin/htop-vim/linux/Platform.c | 1035 ------- fedora/.local/bin/htop-vim/linux/Platform.h | 141 - .../.local/bin/htop-vim/linux/PressureStallMeter.c | 168 -- .../.local/bin/htop-vim/linux/PressureStallMeter.h | 28 - fedora/.local/bin/htop-vim/linux/ProcessField.h | 52 - fedora/.local/bin/htop-vim/linux/SELinuxMeter.c | 93 - fedora/.local/bin/htop-vim/linux/SELinuxMeter.h | 15 - fedora/.local/bin/htop-vim/linux/SystemdMeter.c | 433 --- fedora/.local/bin/htop-vim/linux/SystemdMeter.h | 18 - fedora/.local/bin/htop-vim/linux/ZramMeter.c | 73 - fedora/.local/bin/htop-vim/linux/ZramMeter.h | 9 - fedora/.local/bin/htop-vim/linux/ZramStats.h | 10 - fedora/.local/bin/htop-vim/netbsd/NetBSDProcess.c | 264 -- fedora/.local/bin/htop-vim/netbsd/NetBSDProcess.h | 32 - .../.local/bin/htop-vim/netbsd/NetBSDProcessList.c | 504 ---- .../.local/bin/htop-vim/netbsd/NetBSDProcessList.h | 58 - fedora/.local/bin/htop-vim/netbsd/Platform.c | 509 ---- fedora/.local/bin/htop-vim/netbsd/Platform.h | 124 - fedora/.local/bin/htop-vim/netbsd/ProcessField.h | 15 - fedora/.local/bin/htop-vim/netbsd/README.md | 32 - .../.local/bin/htop-vim/openbsd/OpenBSDProcess.c | 257 -- .../.local/bin/htop-vim/openbsd/OpenBSDProcess.h | 33 - .../bin/htop-vim/openbsd/OpenBSDProcessList.c | 486 --- .../bin/htop-vim/openbsd/OpenBSDProcessList.h | 60 - fedora/.local/bin/htop-vim/openbsd/Platform.c | 371 --- fedora/.local/bin/htop-vim/openbsd/Platform.h | 118 - fedora/.local/bin/htop-vim/openbsd/ProcessField.h | 15 - fedora/.local/bin/htop-vim/pcp-htop.5.in | 237 -- fedora/.local/bin/htop-vim/pcp-htop.c | 26 - fedora/.local/bin/htop-vim/pcp/PCPDynamicColumn.c | 348 --- fedora/.local/bin/htop-vim/pcp/PCPDynamicColumn.h | 35 - fedora/.local/bin/htop-vim/pcp/PCPDynamicMeter.c | 468 --- fedora/.local/bin/htop-vim/pcp/PCPDynamicMeter.h | 44 - fedora/.local/bin/htop-vim/pcp/PCPMetric.c | 180 -- fedora/.local/bin/htop-vim/pcp/PCPMetric.h | 181 -- fedora/.local/bin/htop-vim/pcp/PCPProcess.c | 291 -- fedora/.local/bin/htop-vim/pcp/PCPProcess.h | 102 - fedora/.local/bin/htop-vim/pcp/PCPProcessList.c | 727 ----- fedora/.local/bin/htop-vim/pcp/PCPProcessList.h | 74 - fedora/.local/bin/htop-vim/pcp/Platform.c | 846 ------ fedora/.local/bin/htop-vim/pcp/Platform.h | 156 - fedora/.local/bin/htop-vim/pcp/ProcessField.h | 51 - fedora/.local/bin/htop-vim/pcp/columns/container | 10 - fedora/.local/bin/htop-vim/pcp/columns/delayacct | 10 - fedora/.local/bin/htop-vim/pcp/columns/fdcount | 10 - fedora/.local/bin/htop-vim/pcp/columns/guest | 17 - fedora/.local/bin/htop-vim/pcp/columns/memory | 39 - fedora/.local/bin/htop-vim/pcp/columns/sched | 10 - fedora/.local/bin/htop-vim/pcp/columns/swap | 15 - fedora/.local/bin/htop-vim/pcp/columns/tcp | 31 - fedora/.local/bin/htop-vim/pcp/columns/udp | 31 - fedora/.local/bin/htop-vim/pcp/columns/wchan | 17 - fedora/.local/bin/htop-vim/pcp/meters/entropy | 9 - fedora/.local/bin/htop-vim/pcp/meters/freespace | 11 - fedora/.local/bin/htop-vim/pcp/meters/ipc | 13 - fedora/.local/bin/htop-vim/pcp/meters/locks | 15 - fedora/.local/bin/htop-vim/pcp/meters/memcache | 11 - fedora/.local/bin/htop-vim/pcp/meters/mysql | 71 - fedora/.local/bin/htop-vim/pcp/meters/postfix | 20 - fedora/.local/bin/htop-vim/pcp/meters/redis | 39 - fedora/.local/bin/htop-vim/pcp/meters/tcp | 21 - .../htop-vim/scripts/htop_suppressions.valgrind | 57 - fedora/.local/bin/htop-vim/scripts/run_valgrind.sh | 6 - fedora/.local/bin/htop-vim/solaris/Platform.c | 331 -- fedora/.local/bin/htop-vim/solaris/Platform.h | 159 - fedora/.local/bin/htop-vim/solaris/ProcessField.h | 24 - .../.local/bin/htop-vim/solaris/SolarisProcess.c | 137 - .../.local/bin/htop-vim/solaris/SolarisProcess.h | 49 - .../bin/htop-vim/solaris/SolarisProcessList.c | 560 ---- .../bin/htop-vim/solaris/SolarisProcessList.h | 65 - fedora/.local/bin/htop-vim/test_spec.lua | 687 ----- fedora/.local/bin/htop-vim/unsupported/Platform.c | 158 - fedora/.local/bin/htop-vim/unsupported/Platform.h | 107 - .../.local/bin/htop-vim/unsupported/ProcessField.h | 15 - .../bin/htop-vim/unsupported/UnsupportedProcess.c | 104 - .../bin/htop-vim/unsupported/UnsupportedProcess.h | 28 - .../htop-vim/unsupported/UnsupportedProcessList.c | 100 - .../htop-vim/unsupported/UnsupportedProcessList.h | 21 - fedora/.local/bin/htop-vim/zfs/ZfsArcMeter.c | 98 - fedora/.local/bin/htop-vim/zfs/ZfsArcMeter.h | 19 - fedora/.local/bin/htop-vim/zfs/ZfsArcStats.h | 25 - .../bin/htop-vim/zfs/ZfsCompressedArcMeter.c | 87 - .../bin/htop-vim/zfs/ZfsCompressedArcMeter.h | 19 - fedora/.local/bin/imgcat | 274 -- fedora/.local/bin/lastfiles | 29 +- fedora/.local/bin/opensessions | 37 - fedora/.local/bin/remaps | 69 - fedora/.local/bin/restartvim | 25 - fedora/.local/bin/rg | Bin 5445512 -> 0 bytes fedora/.local/bin/rga | Bin 6772816 -> 0 bytes fedora/.local/bin/rga-fzf | Bin 2425600 -> 0 bytes fedora/.local/bin/rga-fzf-open | Bin 2429728 -> 0 bytes fedora/.local/bin/rga-preproc | Bin 8071664 -> 0 bytes fedora/.local/bin/rgafiles | 108 +- fedora/.local/bin/sesh | Bin 8851145 -> 0 bytes fedora/.local/bin/sessionizer | 36 - fedora/.local/bin/tmuxcreate | 42 - fedora/.local/bin/tmuxcycleborder | 7 - fedora/.local/bin/tmuxopen | 208 -- fedora/.local/bin/tmuxtogglebar | 6 - fedora/.local/bin/tmuxtoggleterm | 11 - fedora/.local/bin/ya | Bin 3306160 -> 0 bytes fedora/.local/bin/yazi | Bin 17066736 -> 0 bytes fedora/.local/bin/zoxide | Bin 1253856 -> 0 bytes fedora/.vimrc | 102 + 512 files changed, 240 insertions(+), 82629 deletions(-) delete mode 100644 fedora/.config/bash/autocomplete.bash delete mode 100644 fedora/.config/bash/bash_profile delete mode 100644 fedora/.config/bash/bashrc delete mode 100644 fedora/.config/bash/completions/bat.bash delete mode 100644 fedora/.config/bash/completions/rg.bash delete mode 100644 fedora/.config/bash/completions/ya.bash delete mode 100644 fedora/.config/bash/completions/yazi.bash delete mode 100644 fedora/.config/bash/completions/zoxide.bash delete mode 100644 fedora/.config/bash/git.bash delete mode 100644 fedora/.config/bash/keymaps.bash delete mode 100644 fedora/.config/bash/packages.bash delete mode 100644 fedora/.config/bash/scripts.bash delete mode 100644 fedora/.config/htop/htoprc delete mode 100644 fedora/.config/shell/aliasrc delete mode 100644 fedora/.config/shell/bm-dirs delete mode 100644 fedora/.config/shell/bm-files delete mode 100644 fedora/.config/shell/profile delete mode 100644 fedora/.config/tmux/tmux.conf delete mode 100644 fedora/.config/vim/UltiSnips/all.snippets delete mode 100644 fedora/.config/vim/init.vim delete mode 100644 fedora/.config/vim/vimrc delete mode 100755 fedora/.config/yazi/flavors/ayu-dark.yazi/LICENSE delete mode 100755 fedora/.config/yazi/flavors/ayu-dark.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/ayu-dark.yazi/README.md delete mode 100755 fedora/.config/yazi/flavors/ayu-dark.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/ayu-dark.yazi/preview.png delete mode 100755 fedora/.config/yazi/flavors/ayu-dark.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/flavors/catppuccin-frappe.yazi/LICENSE delete mode 100644 fedora/.config/yazi/flavors/catppuccin-frappe.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/catppuccin-frappe.yazi/README.md delete mode 100644 fedora/.config/yazi/flavors/catppuccin-frappe.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/catppuccin-frappe.yazi/preview.png delete mode 100644 fedora/.config/yazi/flavors/catppuccin-frappe.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/flavors/catppuccin-latte.yazi/LICENSE delete mode 100644 fedora/.config/yazi/flavors/catppuccin-latte.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/catppuccin-latte.yazi/README.md delete mode 100644 fedora/.config/yazi/flavors/catppuccin-latte.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/catppuccin-latte.yazi/preview.png delete mode 100644 fedora/.config/yazi/flavors/catppuccin-latte.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/LICENSE delete mode 100644 fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/README.md delete mode 100644 fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/preview.png delete mode 100644 fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/flavors/catppuccin-mocha.yazi/LICENSE delete mode 100644 fedora/.config/yazi/flavors/catppuccin-mocha.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/catppuccin-mocha.yazi/README.md delete mode 100644 fedora/.config/yazi/flavors/catppuccin-mocha.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/catppuccin-mocha.yazi/preview.png delete mode 100644 fedora/.config/yazi/flavors/catppuccin-mocha.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/flavors/dracula.yazi/LICENSE delete mode 100644 fedora/.config/yazi/flavors/dracula.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/dracula.yazi/README.md delete mode 100644 fedora/.config/yazi/flavors/dracula.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/dracula.yazi/preview.png delete mode 100644 fedora/.config/yazi/flavors/dracula.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/flavors/everforest-medium.yazi/LICENSE delete mode 100644 fedora/.config/yazi/flavors/everforest-medium.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/everforest-medium.yazi/README.md delete mode 100644 fedora/.config/yazi/flavors/everforest-medium.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/everforest-medium.yazi/preview.png delete mode 100644 fedora/.config/yazi/flavors/everforest-medium.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/flavors/gruvbox-dark.yazi/LICENSE delete mode 100644 fedora/.config/yazi/flavors/gruvbox-dark.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/gruvbox-dark.yazi/README.md delete mode 100644 fedora/.config/yazi/flavors/gruvbox-dark.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/gruvbox-dark.yazi/preview.png delete mode 100644 fedora/.config/yazi/flavors/gruvbox-dark.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/flavors/kanagawa-dragon.yazi/LICENSE delete mode 100644 fedora/.config/yazi/flavors/kanagawa-dragon.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/kanagawa-dragon.yazi/README.md delete mode 100644 fedora/.config/yazi/flavors/kanagawa-dragon.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/kanagawa-dragon.yazi/preview.png delete mode 100644 fedora/.config/yazi/flavors/kanagawa-dragon.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/flavors/kanagawa-lotus.yazi/LICENSE delete mode 100644 fedora/.config/yazi/flavors/kanagawa-lotus.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/kanagawa-lotus.yazi/README.md delete mode 100644 fedora/.config/yazi/flavors/kanagawa-lotus.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/kanagawa-lotus.yazi/preview.png delete mode 100644 fedora/.config/yazi/flavors/kanagawa-lotus.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/flavors/kanagawa.yazi/LICENSE delete mode 100644 fedora/.config/yazi/flavors/kanagawa.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/kanagawa.yazi/README.md delete mode 100644 fedora/.config/yazi/flavors/kanagawa.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/kanagawa.yazi/preview.png delete mode 100644 fedora/.config/yazi/flavors/kanagawa.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/flavors/rose-pine-dawn.yazi/LICENSE delete mode 100644 fedora/.config/yazi/flavors/rose-pine-dawn.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/rose-pine-dawn.yazi/README.md delete mode 100644 fedora/.config/yazi/flavors/rose-pine-dawn.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/rose-pine-dawn.yazi/preview.png delete mode 100644 fedora/.config/yazi/flavors/rose-pine-dawn.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/flavors/rose-pine-moon.yazi/LICENSE delete mode 100644 fedora/.config/yazi/flavors/rose-pine-moon.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/rose-pine-moon.yazi/README.md delete mode 100644 fedora/.config/yazi/flavors/rose-pine-moon.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/rose-pine-moon.yazi/preview.png delete mode 100644 fedora/.config/yazi/flavors/rose-pine-moon.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/flavors/rose-pine.yazi/LICENSE delete mode 100644 fedora/.config/yazi/flavors/rose-pine.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/rose-pine.yazi/README.md delete mode 100644 fedora/.config/yazi/flavors/rose-pine.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/rose-pine.yazi/preview.png delete mode 100644 fedora/.config/yazi/flavors/rose-pine.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/flavors/scripts/README.md delete mode 100644 fedora/.config/yazi/flavors/scripts/generate.js delete mode 100644 fedora/.config/yazi/flavors/scripts/template.toml delete mode 100644 fedora/.config/yazi/flavors/tokyo-night.yazi/LICENSE delete mode 100644 fedora/.config/yazi/flavors/tokyo-night.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/tokyo-night.yazi/README.md delete mode 100644 fedora/.config/yazi/flavors/tokyo-night.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/tokyo-night.yazi/preview.png delete mode 100644 fedora/.config/yazi/flavors/tokyo-night.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-modern.yazi/LICENSE delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-modern.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-modern.yazi/README.md delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-modern.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/1.png delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/2.png delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/3.png delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/4.png delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/preview.png delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-modern.yazi/preview.png delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-modern.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-plus.yazi/LICENSE delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-plus.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-plus.yazi/README.md delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-plus.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/1.png delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/2.png delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/3.png delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/4.png delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/preview.png delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-plus.yazi/preview.png delete mode 100644 fedora/.config/yazi/flavors/vscode-dark-plus.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/flavors/vscode-light-modern.yazi/LICENSE delete mode 100644 fedora/.config/yazi/flavors/vscode-light-modern.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/vscode-light-modern.yazi/README.md delete mode 100644 fedora/.config/yazi/flavors/vscode-light-modern.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/1.png delete mode 100644 fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/2.png delete mode 100644 fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/3.png delete mode 100644 fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/4.png delete mode 100644 fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/preview.png delete mode 100644 fedora/.config/yazi/flavors/vscode-light-modern.yazi/preview.png delete mode 100644 fedora/.config/yazi/flavors/vscode-light-modern.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/flavors/vscode-light-plus.yazi/LICENSE delete mode 100644 fedora/.config/yazi/flavors/vscode-light-plus.yazi/LICENSE-tmtheme delete mode 100644 fedora/.config/yazi/flavors/vscode-light-plus.yazi/README.md delete mode 100644 fedora/.config/yazi/flavors/vscode-light-plus.yazi/flavor.toml delete mode 100644 fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/1.png delete mode 100644 fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/2.png delete mode 100644 fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/3.png delete mode 100644 fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/4.png delete mode 100644 fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/preview.png delete mode 100644 fedora/.config/yazi/flavors/vscode-light-plus.yazi/preview.png delete mode 100644 fedora/.config/yazi/flavors/vscode-light-plus.yazi/tmtheme.xml delete mode 100644 fedora/.config/yazi/init.lua delete mode 100644 fedora/.config/yazi/keymap-default.toml delete mode 100644 fedora/.config/yazi/plugins/chmod.yazi/README.md delete mode 100644 fedora/.config/yazi/plugins/chmod.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/compress.yazi/LICENSE delete mode 100644 fedora/.config/yazi/plugins/compress.yazi/README.md delete mode 100644 fedora/.config/yazi/plugins/compress.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/diff.yazi/README.md delete mode 100644 fedora/.config/yazi/plugins/diff.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/folder-rules.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/full-border.yazi/README.md delete mode 100644 fedora/.config/yazi/plugins/full-border.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/git.yazi/README.md delete mode 100644 fedora/.config/yazi/plugins/git.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/git.yazi/types.lua delete mode 100644 fedora/.config/yazi/plugins/jump-to-char.yazi/README.md delete mode 100644 fedora/.config/yazi/plugins/jump-to-char.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/lsar.yazi/README.md delete mode 100644 fedora/.config/yazi/plugins/lsar.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/mactag.yazi/README.md delete mode 100644 fedora/.config/yazi/plugins/mactag.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/mime-ext.yazi/README.md delete mode 100644 fedora/.config/yazi/plugins/mime-ext.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/mount.yazi/README.md delete mode 100644 fedora/.config/yazi/plugins/mount.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/office.yazi/LICENSE delete mode 100644 fedora/.config/yazi/plugins/office.yazi/README.md delete mode 100644 fedora/.config/yazi/plugins/office.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/parent-arrow.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/piper.yazi/README.md delete mode 100644 fedora/.config/yazi/plugins/piper.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/smart-enter.yazi/README.md delete mode 100644 fedora/.config/yazi/plugins/smart-enter.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/smart-filter.yazi/README.md delete mode 100644 fedora/.config/yazi/plugins/smart-filter.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/smart-paste.yazi/README.md delete mode 100644 fedora/.config/yazi/plugins/smart-paste.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/sudo-demo.yazi/README.md delete mode 100644 fedora/.config/yazi/plugins/sudo-demo.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/toggle-pane.yazi/README.md delete mode 100644 fedora/.config/yazi/plugins/toggle-pane.yazi/main.lua delete mode 100644 fedora/.config/yazi/plugins/zoom.yazi/README.md delete mode 100644 fedora/.config/yazi/plugins/zoom.yazi/main.lua delete mode 100644 fedora/.config/yazi/theme.toml delete mode 100644 fedora/.config/yazi/yazi.toml delete mode 100644 fedora/.config/zsh/.zshrc delete mode 100644 fedora/.config/zsh/autocomplete.zsh delete mode 100644 fedora/.config/zsh/git.zsh delete mode 100644 fedora/.config/zsh/keymaps.zsh delete mode 100644 fedora/.config/zsh/p10k.zsh delete mode 100644 fedora/.config/zsh/packages.zsh delete mode 100644 fedora/.config/zsh/plugins.zsh delete mode 100644 fedora/.config/zsh/scripts.zsh delete mode 100755 fedora/.local/bin/bat delete mode 100755 fedora/.local/bin/bmshortcuts delete mode 100755 fedora/.local/bin/chafa delete mode 100755 fedora/.local/bin/eza delete mode 100755 fedora/.local/bin/fzf delete mode 100755 fedora/.local/bin/fzf-preview.sh delete mode 100755 fedora/.local/bin/fzf-tmux delete mode 100755 fedora/.local/bin/fzffns delete mode 100755 fedora/.local/bin/fzfpass delete mode 100644 fedora/.local/bin/htop-vim/.editorconfig delete mode 100644 fedora/.local/bin/htop-vim/.gitignore delete mode 100644 fedora/.local/bin/htop-vim/.travis.yml delete mode 100644 fedora/.local/bin/htop-vim/AUTHORS delete mode 100644 fedora/.local/bin/htop-vim/Action.c delete mode 100644 fedora/.local/bin/htop-vim/Action.h delete mode 100644 fedora/.local/bin/htop-vim/Affinity.c delete mode 100644 fedora/.local/bin/htop-vim/Affinity.h delete mode 100644 fedora/.local/bin/htop-vim/AffinityPanel.c delete mode 100644 fedora/.local/bin/htop-vim/AffinityPanel.h delete mode 100644 fedora/.local/bin/htop-vim/AvailableColumnsPanel.c delete mode 100644 fedora/.local/bin/htop-vim/AvailableColumnsPanel.h delete mode 100644 fedora/.local/bin/htop-vim/AvailableMetersPanel.c delete mode 100644 fedora/.local/bin/htop-vim/AvailableMetersPanel.h delete mode 100644 fedora/.local/bin/htop-vim/BatteryMeter.c delete mode 100644 fedora/.local/bin/htop-vim/BatteryMeter.h delete mode 100644 fedora/.local/bin/htop-vim/CONTRIBUTING.md delete mode 100644 fedora/.local/bin/htop-vim/COPYING delete mode 100644 fedora/.local/bin/htop-vim/CPUMeter.c delete mode 100644 fedora/.local/bin/htop-vim/CPUMeter.h delete mode 100644 fedora/.local/bin/htop-vim/CRT.c delete mode 100644 fedora/.local/bin/htop-vim/CRT.h delete mode 100644 fedora/.local/bin/htop-vim/CategoriesPanel.c delete mode 100644 fedora/.local/bin/htop-vim/CategoriesPanel.h delete mode 100644 fedora/.local/bin/htop-vim/ChangeLog delete mode 100644 fedora/.local/bin/htop-vim/ClockMeter.c delete mode 100644 fedora/.local/bin/htop-vim/ClockMeter.h delete mode 100644 fedora/.local/bin/htop-vim/ColorsPanel.c delete mode 100644 fedora/.local/bin/htop-vim/ColorsPanel.h delete mode 100644 fedora/.local/bin/htop-vim/ColumnsPanel.c delete mode 100644 fedora/.local/bin/htop-vim/ColumnsPanel.h delete mode 100644 fedora/.local/bin/htop-vim/CommandLine.c delete mode 100644 fedora/.local/bin/htop-vim/CommandLine.h delete mode 100644 fedora/.local/bin/htop-vim/CommandScreen.c delete mode 100644 fedora/.local/bin/htop-vim/CommandScreen.h delete mode 100644 fedora/.local/bin/htop-vim/Compat.c delete mode 100644 fedora/.local/bin/htop-vim/Compat.h delete mode 100644 fedora/.local/bin/htop-vim/DateMeter.c delete mode 100644 fedora/.local/bin/htop-vim/DateMeter.h delete mode 100644 fedora/.local/bin/htop-vim/DateTimeMeter.c delete mode 100644 fedora/.local/bin/htop-vim/DateTimeMeter.h delete mode 100644 fedora/.local/bin/htop-vim/DiskIOMeter.c delete mode 100644 fedora/.local/bin/htop-vim/DiskIOMeter.h delete mode 100644 fedora/.local/bin/htop-vim/DisplayOptionsPanel.c delete mode 100644 fedora/.local/bin/htop-vim/DisplayOptionsPanel.h delete mode 100644 fedora/.local/bin/htop-vim/DynamicColumn.c delete mode 100644 fedora/.local/bin/htop-vim/DynamicColumn.h delete mode 100644 fedora/.local/bin/htop-vim/DynamicMeter.c delete mode 100644 fedora/.local/bin/htop-vim/DynamicMeter.h delete mode 100644 fedora/.local/bin/htop-vim/EnvScreen.c delete mode 100644 fedora/.local/bin/htop-vim/EnvScreen.h delete mode 100644 fedora/.local/bin/htop-vim/FunctionBar.c delete mode 100644 fedora/.local/bin/htop-vim/FunctionBar.h delete mode 100644 fedora/.local/bin/htop-vim/Hashtable.c delete mode 100644 fedora/.local/bin/htop-vim/Hashtable.h delete mode 100644 fedora/.local/bin/htop-vim/Header.c delete mode 100644 fedora/.local/bin/htop-vim/Header.h delete mode 100644 fedora/.local/bin/htop-vim/HeaderLayout.h delete mode 100644 fedora/.local/bin/htop-vim/HeaderOptionsPanel.c delete mode 100644 fedora/.local/bin/htop-vim/HeaderOptionsPanel.h delete mode 100644 fedora/.local/bin/htop-vim/HostnameMeter.c delete mode 100644 fedora/.local/bin/htop-vim/HostnameMeter.h delete mode 100644 fedora/.local/bin/htop-vim/IncSet.c delete mode 100644 fedora/.local/bin/htop-vim/IncSet.h delete mode 100644 fedora/.local/bin/htop-vim/InfoScreen.c delete mode 100644 fedora/.local/bin/htop-vim/InfoScreen.h delete mode 100644 fedora/.local/bin/htop-vim/ListItem.c delete mode 100644 fedora/.local/bin/htop-vim/ListItem.h delete mode 100644 fedora/.local/bin/htop-vim/LoadAverageMeter.c delete mode 100644 fedora/.local/bin/htop-vim/LoadAverageMeter.h delete mode 100644 fedora/.local/bin/htop-vim/Macros.h delete mode 100644 fedora/.local/bin/htop-vim/MainPanel.c delete mode 100644 fedora/.local/bin/htop-vim/MainPanel.h delete mode 100644 fedora/.local/bin/htop-vim/Makefile.am delete mode 100644 fedora/.local/bin/htop-vim/MemoryMeter.c delete mode 100644 fedora/.local/bin/htop-vim/MemoryMeter.h delete mode 100644 fedora/.local/bin/htop-vim/MemorySwapMeter.c delete mode 100644 fedora/.local/bin/htop-vim/MemorySwapMeter.h delete mode 100644 fedora/.local/bin/htop-vim/Meter.c delete mode 100644 fedora/.local/bin/htop-vim/Meter.h delete mode 100644 fedora/.local/bin/htop-vim/MetersPanel.c delete mode 100644 fedora/.local/bin/htop-vim/MetersPanel.h delete mode 100644 fedora/.local/bin/htop-vim/NEWS delete mode 100644 fedora/.local/bin/htop-vim/NetworkIOMeter.c delete mode 100644 fedora/.local/bin/htop-vim/NetworkIOMeter.h delete mode 100644 fedora/.local/bin/htop-vim/Object.c delete mode 100644 fedora/.local/bin/htop-vim/Object.h delete mode 100644 fedora/.local/bin/htop-vim/OpenFilesScreen.c delete mode 100644 fedora/.local/bin/htop-vim/OpenFilesScreen.h delete mode 100644 fedora/.local/bin/htop-vim/OptionItem.c delete mode 100644 fedora/.local/bin/htop-vim/OptionItem.h delete mode 100644 fedora/.local/bin/htop-vim/Panel.c delete mode 100644 fedora/.local/bin/htop-vim/Panel.h delete mode 100644 fedora/.local/bin/htop-vim/Process.c delete mode 100644 fedora/.local/bin/htop-vim/Process.h delete mode 100644 fedora/.local/bin/htop-vim/ProcessList.c delete mode 100644 fedora/.local/bin/htop-vim/ProcessList.h delete mode 100644 fedora/.local/bin/htop-vim/ProcessLocksScreen.c delete mode 100644 fedora/.local/bin/htop-vim/ProcessLocksScreen.h delete mode 100644 fedora/.local/bin/htop-vim/ProvideCurses.h delete mode 100644 fedora/.local/bin/htop-vim/README delete mode 120000 fedora/.local/bin/htop-vim/README.md delete mode 100644 fedora/.local/bin/htop-vim/RichString.c delete mode 100644 fedora/.local/bin/htop-vim/RichString.h delete mode 100644 fedora/.local/bin/htop-vim/Scheduling.c delete mode 100644 fedora/.local/bin/htop-vim/Scheduling.h delete mode 100644 fedora/.local/bin/htop-vim/ScreenManager.c delete mode 100644 fedora/.local/bin/htop-vim/ScreenManager.h delete mode 100644 fedora/.local/bin/htop-vim/ScreensPanel.c delete mode 100644 fedora/.local/bin/htop-vim/ScreensPanel.h delete mode 100644 fedora/.local/bin/htop-vim/Settings.c delete mode 100644 fedora/.local/bin/htop-vim/Settings.h delete mode 100644 fedora/.local/bin/htop-vim/SignalsPanel.c delete mode 100644 fedora/.local/bin/htop-vim/SignalsPanel.h delete mode 100644 fedora/.local/bin/htop-vim/SwapMeter.c delete mode 100644 fedora/.local/bin/htop-vim/SwapMeter.h delete mode 100644 fedora/.local/bin/htop-vim/SysArchMeter.c delete mode 100644 fedora/.local/bin/htop-vim/SysArchMeter.h delete mode 100644 fedora/.local/bin/htop-vim/TESTPLAN delete mode 100644 fedora/.local/bin/htop-vim/TasksMeter.c delete mode 100644 fedora/.local/bin/htop-vim/TasksMeter.h delete mode 100644 fedora/.local/bin/htop-vim/TraceScreen.c delete mode 100644 fedora/.local/bin/htop-vim/TraceScreen.h delete mode 100644 fedora/.local/bin/htop-vim/UptimeMeter.c delete mode 100644 fedora/.local/bin/htop-vim/UptimeMeter.h delete mode 100644 fedora/.local/bin/htop-vim/UsersTable.c delete mode 100644 fedora/.local/bin/htop-vim/UsersTable.h delete mode 100644 fedora/.local/bin/htop-vim/Vector.c delete mode 100644 fedora/.local/bin/htop-vim/Vector.h delete mode 100644 fedora/.local/bin/htop-vim/XUtils.c delete mode 100644 fedora/.local/bin/htop-vim/XUtils.h delete mode 100755 fedora/.local/bin/htop-vim/autogen.sh delete mode 100644 fedora/.local/bin/htop-vim/configure.ac delete mode 100644 fedora/.local/bin/htop-vim/darwin/DarwinProcess.c delete mode 100644 fedora/.local/bin/htop-vim/darwin/DarwinProcess.h delete mode 100644 fedora/.local/bin/htop-vim/darwin/DarwinProcessList.c delete mode 100644 fedora/.local/bin/htop-vim/darwin/DarwinProcessList.h delete mode 100644 fedora/.local/bin/htop-vim/darwin/Platform.c delete mode 100644 fedora/.local/bin/htop-vim/darwin/Platform.h delete mode 100644 fedora/.local/bin/htop-vim/darwin/PlatformHelpers.c delete mode 100644 fedora/.local/bin/htop-vim/darwin/PlatformHelpers.h delete mode 100644 fedora/.local/bin/htop-vim/darwin/ProcessField.h delete mode 100644 fedora/.local/bin/htop-vim/docs/images/screenshot.png delete mode 100644 fedora/.local/bin/htop-vim/docs/styleguide.md delete mode 100644 fedora/.local/bin/htop-vim/dragonflybsd/DragonFlyBSDProcess.c delete mode 100644 fedora/.local/bin/htop-vim/dragonflybsd/DragonFlyBSDProcess.h delete mode 100644 fedora/.local/bin/htop-vim/dragonflybsd/DragonFlyBSDProcessList.c delete mode 100644 fedora/.local/bin/htop-vim/dragonflybsd/DragonFlyBSDProcessList.h delete mode 100644 fedora/.local/bin/htop-vim/dragonflybsd/Platform.c delete mode 100644 fedora/.local/bin/htop-vim/dragonflybsd/Platform.h delete mode 100644 fedora/.local/bin/htop-vim/dragonflybsd/ProcessField.h delete mode 100644 fedora/.local/bin/htop-vim/freebsd/FreeBSDProcess.c delete mode 100644 fedora/.local/bin/htop-vim/freebsd/FreeBSDProcess.h delete mode 100644 fedora/.local/bin/htop-vim/freebsd/FreeBSDProcessList.c delete mode 100644 fedora/.local/bin/htop-vim/freebsd/FreeBSDProcessList.h delete mode 100644 fedora/.local/bin/htop-vim/freebsd/Platform.c delete mode 100644 fedora/.local/bin/htop-vim/freebsd/Platform.h delete mode 100644 fedora/.local/bin/htop-vim/freebsd/ProcessField.h delete mode 100644 fedora/.local/bin/htop-vim/generic/gettime.c delete mode 100644 fedora/.local/bin/htop-vim/generic/gettime.h delete mode 100644 fedora/.local/bin/htop-vim/generic/hostname.c delete mode 100644 fedora/.local/bin/htop-vim/generic/hostname.h delete mode 100644 fedora/.local/bin/htop-vim/generic/openzfs_sysctl.c delete mode 100644 fedora/.local/bin/htop-vim/generic/openzfs_sysctl.h delete mode 100644 fedora/.local/bin/htop-vim/generic/uname.c delete mode 100644 fedora/.local/bin/htop-vim/generic/uname.h delete mode 100644 fedora/.local/bin/htop-vim/htop.1.in delete mode 100644 fedora/.local/bin/htop-vim/htop.c delete mode 100644 fedora/.local/bin/htop-vim/htop.desktop delete mode 100644 fedora/.local/bin/htop-vim/htop.png delete mode 100644 fedora/.local/bin/htop-vim/htop.svg delete mode 100644 fedora/.local/bin/htop-vim/iwyu/htop.imp delete mode 100755 fedora/.local/bin/htop-vim/iwyu/run_iwyu.sh delete mode 100644 fedora/.local/bin/htop-vim/linux/CGroupUtils.c delete mode 100644 fedora/.local/bin/htop-vim/linux/CGroupUtils.h delete mode 100644 fedora/.local/bin/htop-vim/linux/HugePageMeter.c delete mode 100644 fedora/.local/bin/htop-vim/linux/HugePageMeter.h delete mode 100644 fedora/.local/bin/htop-vim/linux/IOPriority.h delete mode 100644 fedora/.local/bin/htop-vim/linux/IOPriorityPanel.c delete mode 100644 fedora/.local/bin/htop-vim/linux/IOPriorityPanel.h delete mode 100644 fedora/.local/bin/htop-vim/linux/LibSensors.c delete mode 100644 fedora/.local/bin/htop-vim/linux/LibSensors.h delete mode 100644 fedora/.local/bin/htop-vim/linux/LinuxProcess.c delete mode 100644 fedora/.local/bin/htop-vim/linux/LinuxProcess.h delete mode 100644 fedora/.local/bin/htop-vim/linux/LinuxProcessList.c delete mode 100644 fedora/.local/bin/htop-vim/linux/LinuxProcessList.h delete mode 100644 fedora/.local/bin/htop-vim/linux/Platform.c delete mode 100644 fedora/.local/bin/htop-vim/linux/Platform.h delete mode 100644 fedora/.local/bin/htop-vim/linux/PressureStallMeter.c delete mode 100644 fedora/.local/bin/htop-vim/linux/PressureStallMeter.h delete mode 100644 fedora/.local/bin/htop-vim/linux/ProcessField.h delete mode 100644 fedora/.local/bin/htop-vim/linux/SELinuxMeter.c delete mode 100644 fedora/.local/bin/htop-vim/linux/SELinuxMeter.h delete mode 100644 fedora/.local/bin/htop-vim/linux/SystemdMeter.c delete mode 100644 fedora/.local/bin/htop-vim/linux/SystemdMeter.h delete mode 100644 fedora/.local/bin/htop-vim/linux/ZramMeter.c delete mode 100644 fedora/.local/bin/htop-vim/linux/ZramMeter.h delete mode 100644 fedora/.local/bin/htop-vim/linux/ZramStats.h delete mode 100644 fedora/.local/bin/htop-vim/netbsd/NetBSDProcess.c delete mode 100644 fedora/.local/bin/htop-vim/netbsd/NetBSDProcess.h delete mode 100644 fedora/.local/bin/htop-vim/netbsd/NetBSDProcessList.c delete mode 100644 fedora/.local/bin/htop-vim/netbsd/NetBSDProcessList.h delete mode 100644 fedora/.local/bin/htop-vim/netbsd/Platform.c delete mode 100644 fedora/.local/bin/htop-vim/netbsd/Platform.h delete mode 100644 fedora/.local/bin/htop-vim/netbsd/ProcessField.h delete mode 100644 fedora/.local/bin/htop-vim/netbsd/README.md delete mode 100644 fedora/.local/bin/htop-vim/openbsd/OpenBSDProcess.c delete mode 100644 fedora/.local/bin/htop-vim/openbsd/OpenBSDProcess.h delete mode 100644 fedora/.local/bin/htop-vim/openbsd/OpenBSDProcessList.c delete mode 100644 fedora/.local/bin/htop-vim/openbsd/OpenBSDProcessList.h delete mode 100644 fedora/.local/bin/htop-vim/openbsd/Platform.c delete mode 100644 fedora/.local/bin/htop-vim/openbsd/Platform.h delete mode 100644 fedora/.local/bin/htop-vim/openbsd/ProcessField.h delete mode 100644 fedora/.local/bin/htop-vim/pcp-htop.5.in delete mode 100644 fedora/.local/bin/htop-vim/pcp-htop.c delete mode 100644 fedora/.local/bin/htop-vim/pcp/PCPDynamicColumn.c delete mode 100644 fedora/.local/bin/htop-vim/pcp/PCPDynamicColumn.h delete mode 100644 fedora/.local/bin/htop-vim/pcp/PCPDynamicMeter.c delete mode 100644 fedora/.local/bin/htop-vim/pcp/PCPDynamicMeter.h delete mode 100644 fedora/.local/bin/htop-vim/pcp/PCPMetric.c delete mode 100644 fedora/.local/bin/htop-vim/pcp/PCPMetric.h delete mode 100644 fedora/.local/bin/htop-vim/pcp/PCPProcess.c delete mode 100644 fedora/.local/bin/htop-vim/pcp/PCPProcess.h delete mode 100644 fedora/.local/bin/htop-vim/pcp/PCPProcessList.c delete mode 100644 fedora/.local/bin/htop-vim/pcp/PCPProcessList.h delete mode 100644 fedora/.local/bin/htop-vim/pcp/Platform.c delete mode 100644 fedora/.local/bin/htop-vim/pcp/Platform.h delete mode 100644 fedora/.local/bin/htop-vim/pcp/ProcessField.h delete mode 100644 fedora/.local/bin/htop-vim/pcp/columns/container delete mode 100644 fedora/.local/bin/htop-vim/pcp/columns/delayacct delete mode 100644 fedora/.local/bin/htop-vim/pcp/columns/fdcount delete mode 100644 fedora/.local/bin/htop-vim/pcp/columns/guest delete mode 100644 fedora/.local/bin/htop-vim/pcp/columns/memory delete mode 100644 fedora/.local/bin/htop-vim/pcp/columns/sched delete mode 100644 fedora/.local/bin/htop-vim/pcp/columns/swap delete mode 100644 fedora/.local/bin/htop-vim/pcp/columns/tcp delete mode 100644 fedora/.local/bin/htop-vim/pcp/columns/udp delete mode 100644 fedora/.local/bin/htop-vim/pcp/columns/wchan delete mode 100644 fedora/.local/bin/htop-vim/pcp/meters/entropy delete mode 100644 fedora/.local/bin/htop-vim/pcp/meters/freespace delete mode 100644 fedora/.local/bin/htop-vim/pcp/meters/ipc delete mode 100644 fedora/.local/bin/htop-vim/pcp/meters/locks delete mode 100644 fedora/.local/bin/htop-vim/pcp/meters/memcache delete mode 100644 fedora/.local/bin/htop-vim/pcp/meters/mysql delete mode 100644 fedora/.local/bin/htop-vim/pcp/meters/postfix delete mode 100644 fedora/.local/bin/htop-vim/pcp/meters/redis delete mode 100644 fedora/.local/bin/htop-vim/pcp/meters/tcp delete mode 100644 fedora/.local/bin/htop-vim/scripts/htop_suppressions.valgrind delete mode 100755 fedora/.local/bin/htop-vim/scripts/run_valgrind.sh delete mode 100644 fedora/.local/bin/htop-vim/solaris/Platform.c delete mode 100644 fedora/.local/bin/htop-vim/solaris/Platform.h delete mode 100644 fedora/.local/bin/htop-vim/solaris/ProcessField.h delete mode 100644 fedora/.local/bin/htop-vim/solaris/SolarisProcess.c delete mode 100644 fedora/.local/bin/htop-vim/solaris/SolarisProcess.h delete mode 100644 fedora/.local/bin/htop-vim/solaris/SolarisProcessList.c delete mode 100644 fedora/.local/bin/htop-vim/solaris/SolarisProcessList.h delete mode 100755 fedora/.local/bin/htop-vim/test_spec.lua delete mode 100644 fedora/.local/bin/htop-vim/unsupported/Platform.c delete mode 100644 fedora/.local/bin/htop-vim/unsupported/Platform.h delete mode 100644 fedora/.local/bin/htop-vim/unsupported/ProcessField.h delete mode 100644 fedora/.local/bin/htop-vim/unsupported/UnsupportedProcess.c delete mode 100644 fedora/.local/bin/htop-vim/unsupported/UnsupportedProcess.h delete mode 100644 fedora/.local/bin/htop-vim/unsupported/UnsupportedProcessList.c delete mode 100644 fedora/.local/bin/htop-vim/unsupported/UnsupportedProcessList.h delete mode 100644 fedora/.local/bin/htop-vim/zfs/ZfsArcMeter.c delete mode 100644 fedora/.local/bin/htop-vim/zfs/ZfsArcMeter.h delete mode 100644 fedora/.local/bin/htop-vim/zfs/ZfsArcStats.h delete mode 100644 fedora/.local/bin/htop-vim/zfs/ZfsCompressedArcMeter.c delete mode 100644 fedora/.local/bin/htop-vim/zfs/ZfsCompressedArcMeter.h delete mode 100755 fedora/.local/bin/imgcat delete mode 100755 fedora/.local/bin/opensessions delete mode 100755 fedora/.local/bin/remaps delete mode 100755 fedora/.local/bin/restartvim delete mode 100755 fedora/.local/bin/rg delete mode 100755 fedora/.local/bin/rga delete mode 100755 fedora/.local/bin/rga-fzf delete mode 100755 fedora/.local/bin/rga-fzf-open delete mode 100755 fedora/.local/bin/rga-preproc delete mode 100755 fedora/.local/bin/sesh delete mode 100755 fedora/.local/bin/sessionizer delete mode 100755 fedora/.local/bin/tmuxcreate delete mode 100755 fedora/.local/bin/tmuxcycleborder delete mode 100755 fedora/.local/bin/tmuxopen delete mode 100755 fedora/.local/bin/tmuxtogglebar delete mode 100755 fedora/.local/bin/tmuxtoggleterm delete mode 100755 fedora/.local/bin/ya delete mode 100755 fedora/.local/bin/yazi delete mode 100755 fedora/.local/bin/zoxide create mode 100644 fedora/.vimrc diff --git a/fedora/.config/bash/autocomplete.bash b/fedora/.config/bash/autocomplete.bash deleted file mode 100644 index 3ee6183..0000000 --- a/fedora/.config/bash/autocomplete.bash +++ /dev/null @@ -1,218 +0,0 @@ -#!/bin/bash - -### --- Auto-completes aliases --- ### -# alias - normal aliases (completed with trailing space) -# balias - blank aliases (completed without space) -# ialias - ignored aliases (not completed) - -ialiases=() -ialias() { - # usage: ialias name='value' (same as alias builtin) - alias "$@" - # extract name (everything before first '=' or first space) - local args="$1" - args=${args%%=*} - args=${args%% *} - ialiases+=("$args") -} - -baliases=() -balias() { - alias "$@" - local args="$1" - args=${args%%=*} - args=${args%% *} - baliases+=("$args") -} - -# ---------- helper: get alias value ---------- -# returns alias expansion text for a name, or empty if none -_get_alias_value() { - local name="$1" - # alias output: alias ll='ls -la' - local a - a=$(alias "$name" 2>/dev/null) || return 1 - # strip "alias name='...'" - # use parameter expansion / sed safe parsing - # get first occurrence of =', then strip quotes - a=${a#*=} - # remove leading quote if present - a=${a#\'} - a=${a%\'} - printf "%s" "$a" - return 0 -} - -# ---------- helper: membership check ---------- -_in_array() { - local item="$1" - shift - local elem - for elem in "$@"; do - if [[ "$elem" == "$item" ]]; then - return 0 - fi - done - return 1 -} - -# ---------- expand alias at cursor and optionally insert space ---------- -# This function is executed via bind -x, so it can read/modify: -# READLINE_LINE - current full line buffer -# READLINE_POINT - current cursor index (0..len) -expand_alias_space() { - # READLINE_LINE and READLINE_POINT are provided by readline when bind -x is used. - # If not present (if invoked directly), fallback to no-op - if [[ -z "${READLINE_LINE+set}" ]]; then - # fallback: just insert a space - printf " " - return 0 - fi - - local line=${READLINE_LINE} - local point=${READLINE_POINT} - - # left substring up to cursor - local left=${line:0:point} - # right substring after cursor - local right=${line:point} - - # find the last "word" before the cursor (split on whitespace) - # If left ends with whitespace, current word is empty - local lastword - if [[ "$left" =~ [[:space:]]$ ]]; then - lastword="" - else - # remove everything up to last whitespace - lastword=${left##*['$'\t\n' ']} - fi - - # if lastword is empty -> just insert a space - if [[ -z "$lastword" ]]; then - READLINE_LINE="${left} ${right}" - READLINE_POINT=$((point + 1)) - return 0 - fi - - # check if lastword is in ignored aliases -> do not expand, just insert space - if _in_array "$lastword" "${ialiases[@]}"; then - READLINE_LINE="${left} ${right}" - READLINE_POINT=$((point + 1)) - return 0 - fi - - # try to get alias expansion - local expansion - if expansion=$(_get_alias_value "$lastword"); then - # Replace the lastword in left with expansion - # compute left_without_word - local left_without="${left%${lastword}}" - - # If balias: expansion but DO NOT add trailing space - if _in_array "$lastword" "${baliases[@]}"; then - READLINE_LINE="${left_without}${expansion}${right}" - # place cursor right after the expansion - READLINE_POINT=$((${#left_without} + ${#expansion})) - return 0 - else - # Normal alias: expansion and add a space after it - READLINE_LINE="${left_without}${expansion} ${right}" - READLINE_POINT=$((${#left_without} + ${#expansion} + 1)) - return 0 - fi - else - # no alias found: just insert space - READLINE_LINE="${left} ${right}" - READLINE_POINT=$((point + 1)) - return 0 - fi -} - -# ---------- accept-line that expands alias before executing ---------- -# Bind Enter to this function via bind -x; it will expand alias (if needed) then -# simulate Enter by setting READLINE_LINE and returning - readline will accept it. -expand_alias_and_accept_line() { - # Expand at cursor (use current READLINE_LINE/POINT) - expand_alias_space - # After expansion, we want to accept the line as if Enter was pressed. - # To do so in bind -x handler, we can set a marker and then use 'builtin bind -x' hack: - # Simpler approach: write the line to a temp file, then use 'kill -SIGWINCH' ??? Too complex. - # Luckily, when a bind -x handler returns, readline continues; we want to end editing. - # There's no direct way to programmatically press enter. Instead, rely on binding Enter to a wrapper that: - # - modifies READLINE_LINE (done) and then sets a special variable so readline knows to accept. - : -} - -# ---------- key bindings ---------- -# Bind Space to our function so pressing space triggers alias-expansion behavior. -# Use bind -x to call expand_alias_space (it will both expand and insert space when appropriate). -# WARNING: this overrides normal space key behavior; our function handles insertion. -# bind -x '" "':expand_alias_space - -# optional: bind Ctrl-Space to the same (a bypass key like zsh had) -# Many terminals send "\C-@" for ctrl-space; try both common sequences: -bind -x '"\C-@":expand_alias_space' 2>/dev/null || true -bind -x '"\C- ":expand_alias_space' 2>/dev/null || true - -# Bind Enter (Return) to expand alias before accepting the line. -# We implement this by expanding then forcing a newline insertion. -# Using bind -x for Enter: when this function returns, readline will NOT automatically accept the line, -# but we can emulate acceptance by printing a newline and forcing input. Simpler: call 'return 0' from this hook -# and then send a newline. However, behavior varies between shells/terminals โ€” so we will bind Enter to a function -# that expands and then uses 'READLINE_LINE' trick to set the expanded line and then call 'builtin bind' to -# temporarily restore Enter to default and re-invoke it. -_bash_accept_line() { - expand_alias_space - # After expanding, we want readline to accept the line. A workaround: - # write the expanded line into the current tty so that it becomes input for the shell. - # But this is messy. Instead, we simply move the cursor to the end and let the user press Enter again. - # (This is a conservative behavior to avoid interfering unexpectedly.) - return 0 -} -#bind -x '"\C-m":_bash_accept_line' - -# ---------- helper: background starter ---------- -background() { - # start multiple args as programs in background - # usage: background cmd arg1 arg2 ... - # runs: cmd arg1 & cmd arg2 & ... - local cmd="$1" - shift || return 0 - for arg in "$@"; do - "$cmd" "$arg" &>/dev/null & - done -} - -# ---------- notes ---------- -# - After placing this into ~/.bashrc, run: source ~/.bashrc -# - Test aliases: -# balias ll='ls -la' -# alias g='git status' -# ialias X='something' -# - Then type `ll` followed by Space -> will expand to `ls -la` WITHOUT appending a space (blank alias). -# - Type `g` then Space -> will expand to `git status ` with a trailing space. -# - Type `X` then Space -> will NOT expand, just insert space. -# -# Limitations / caveats: -# - readline/bind -x behavior differs slightly across environments and terminals. -# - Completely emulating zsh's zle widgets (especially auto-accept behaviors) is tricky in bash. -# - Binding Enter to fully accept-after-expansion programmatically is not perfectly portable; -# the conservative implementation above expands first and leaves acceptance to the user (press Enter again). -# -# If you want a stronger behavior (auto-accept after expansion), tell me and I'll provide a -# more aggressive implementation that works on most terminals (but with more invasive tricks). - -# ---------- file completion patterns ---------- -_vim_complete() { - local cur="${COMP_WORDS[COMP_CWORD]}" - COMPREPLY=($(compgen -f -X '!*.@(pdf|odt|ods|doc|docx|xls|xlsx|odp|ppt|pptx|mp4|mkv|aux)' -- "$cur")) -} -shopt -s extglob -complete -F _vim_complete vim - -_build_mom_complete() { - local cur="${COMP_WORDS[COMP_CWORD]}" - COMPREPLY=($(compgen -f -X '!*.mom' -- "$cur")) -} -complete -F _build_mom_complete build-workshop -complete -F _build_mom_complete build-document diff --git a/fedora/.config/bash/bash_profile b/fedora/.config/bash/bash_profile deleted file mode 100644 index d74e372..0000000 --- a/fedora/.config/bash/bash_profile +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash - -umask 022 - -################################################### -### --- DEFAULT PROGRAMS --- ### -################################################### -if command -v nvim >/dev/null 2>&1; then - export EDITOR="nvim" -elif command -v vim >/dev/null 2>&1; then - export EDITOR="vim" -else - export EDITOR="vi" -fi -# export FILE_MANAGER="lf $(lf -version)" -export KEYTIMEOUT=10 -export SUDO_EDITOR=$EDITOR -export TERM="xterm-256color" -export VISUAL=$EDITOR -export TERM="xterm-256color" - -################################################### -### --- XDG ENV PATHES --- ### -################################################### -### --- XDG DEFAULT --- ### -export XDG_CACHE_HOME="$HOME/.cache" -export XDG_CONFIG_HOME="$HOME/.config" -export XDG_DATA_HOME="$HOME/.local/share" -export XDG_STATE_HOME="$HOME/.local/state" - -### --- XDG CUSTOMS --- ### -export XDG_DOTFILES_DIR="$HOME/.dotfiles" -export XDG_SCRIPTS_HOME="$HOME/.local/bin" -export XDG_SOURCES_HOME="$HOME/.local/src" -export XDG_DESKTOP_DIR="$HOME/Desktop" -export XDG_DOCUMENTS_DIR="$HOME/Documents" -export XDG_DOWNLOAD_DIR="$HOME/Downloads" -export XDG_MUSIC_DIR="$HOME/Music" -export XDG_PICTURES_DIR="$HOME/Pictures" -export XDG_PUBLICSHARE_DIR="$HOME/Public" -export XDG_TEMPLATES_DIR="$HOME/Templates" -export XDG_VIDEOS_DIR="$HOME/Videos" - -####################################################### -# EXPORTS -####################################################### - -export CLICOLOR=1 -export HISTFILE="${XDG_DATA_HOME:-${HOME}/.local/share}/history/sh_history" -export INPUTRC="${XDG_CONFIG_HOME:-${HOME}/.config}/shell/inputrc" - -### --- MANPAGER --- ### -([ -x "$(command -v batcat)" ] || [ -x "$(command -v batman)" ]) && { - export MANPAGER="sh -c 'col -bx | bat -l man -p'" - export MANROFFOPT="-c" -} || { - export MANPAGER='less -s' - export LESS="R" - export LESS_TERMCAP_mb="$(printf '%b' '')" - export LESS_TERMCAP_md="$(printf '%b' '')" - export LESS_TERMCAP_me="$(printf '%b' '')" - export LESS_TERMCAP_so="$(printf '%b' '')" - export LESS_TERMCAP_se="$(printf '%b' '')" - export LESS_TERMCAP_us="$(printf '%b' '')" - export LESS_TERMCAP_ue="$(printf '%b' '')" - export LESSOPEN="| lesspipe.sh %s" -} - -export LS_COLORS="no=00:fi=00:di=00;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:*.xml=00;31:" -export LS_OPTIONS="--color=auto" - -### --- PASSWORD STORE --- ### -export PASSWORD_STORE_DIR="$XDG_DATA_HOME/.password-store" -export PASSWORD_STORE_CLIP_TIME=180 # Specifies the number of seconds to wait before restoring the clipboard, by default 45 seconds. -# export PASSWORD_STORE_GENERATED_LENGTH=18 # by default 25. -# export PASSWORD_STORE_CHARACTER_SET='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+[]{};:,.<>?' -# export PASSWORD_STORE_CHARACTER_SET_NO_SYMBOLS='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+[]{};:,.<>?' -export PASSWORD_STORE_ENABLE_EXTENSIONS="true" -# export PASSWORD_STORE_EXTENSIONS_DIR="$PASSWORD_STORE_DIR/.extensions" -# export BASH_COMPLETION_USER_DIR=$XDG_DATA_HOME/bash-completion/completions - -### --- TMUX --- ### -export TMUX_TMPDIR="$XDG_RUNTIME_DIR" - -### --- VIM --- ### -# export GVIMINIT='let $MYGVIMRC = !has("nvim") ? "$XDG_CONFIG_HOME/vim/gvimrc" : "$XDG_CONFIG_HOME/nvim/init.lua" | so $MYGVIMRC' -# export VIMINIT='let $MYVIMRC = !has("nvim") ? "$XDG_CONFIG_HOME/vim/vimrc" : "$XDG_CONFIG_HOME/nvim/init.lua" | so $MYVIMRC' - -### --- ZSH --- ### -export ZDOTDIR="$XDG_CONFIG_HOME/zsh" -export ZPLUGINDIR="$XDG_SCRIPTS_HOME/zsh" - -################################################### -### --- ENV PATH --- ### -################################################### -# Add all directories in each subdirectory to $PATH -[ -d ~/.local/bin ] && export PATH="$(find ~/.local/bin -path '*/.git*' -prune -o \( -type f -o -type l \) -perm -u=x -exec dirname {} \; | sort -u | paste -sd ':' -):$PATH" -[ -d ~/.local/share/.password-store ] && export PATH="$(find ~/.local/share/.password-store -type d -name '.extensions' | paste -sd ':' -):$PATH" -export PATH="$ASDF_DATA_DIR/shims:$PATH" -command -v asdf >/dev/null 2>&1 && export PATH="$(find -L ~/.local/share/asdf/installs -name bin -type d -print 2>/dev/null | sort -u | paste -s -d ':' -):$PATH" -command -v npm >/dev/null 2>&1 && export PATH="$(find -L ~/.local/share/npm -name bin -type d -print 2>/dev/null | sort -u | paste -s -d ':' -):$PATH" - -unsetopt PROMPT_SP 2>/dev/null - -####################################################### -# Source global/local definitions -####################################################### - -[ -f /etc/bash_completion ] && . /etc/bash_completion -[ -f /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion -[ -f /etc/bash/bashrc ] && . /etc/bash/bashrc -[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/bash/bashrc" ] && . "${XDG_CONFIG_HOME:-${HOME}/.config}/bash/bashrc" -for file in "${XDG_CONFIG_HOME:-${HOME}/.config}/bash/completions"/*.bash; do - [ -f "$file" ] && . "$file" -done -[ ! -f "$XDG_CONFIG_HOME/shell/shortcutrc" ] && setsid -f bmshortcuts >/dev/null 2>&1 diff --git a/fedora/.config/bash/bashrc b/fedora/.config/bash/bashrc deleted file mode 100644 index ec1cc46..0000000 --- a/fedora/.config/bash/bashrc +++ /dev/null @@ -1,180 +0,0 @@ -#!/bin/bash - -[[ $- != *i* ]] && return - -####################################################### -# SET OPTIONS -####################################################### -# history -HISTCONTROL=erasedups:ignoredups:ignorespace -HISTFILESIZE=10000 -HISTSIZE=500 - -# Allow ctrl-S for history navigation (with ctrl-R) -stty -ixon -PROMPT_COMMAND="history -a" -unset GREP_OPTIONS - -set -o vi -shopt -s autocd # goto without cd -shopt -s direxpand # expend directory name -shopt -s cdspell # ignore case cd -shopt -s checkwinsize # Check the window size after each command and, if necessary, update the values of LINES and COLUMNS -shopt -s histappend # Causes bash to append to history instead of overwriting it so if you start a new terminal, you have old session history - -# Completion settings -# Ignore case on auto-completion -# Note: bind used instead of sticking these in .inputrc -bind "set completion-ignore-case on" -# Show auto-completion list automatically, without double tab -bind "set show-all-if-ambiguous on" - -####################################################### -# Set command prompt -####################################################### -function __setprompt { - local LAST_COMMAND=$? # Must come first! - - # Define colors - local LIGHTGRAY="\033[0;37m" - local WHITE="\033[1;37m" - local BLACK="\033[0;30m" - local DARKGRAY="\033[1;30m" - local RED="\033[0;31m" - local LIGHTRED="\033[1;31m" - local GREEN="\033[0;32m" - local LIGHTGREEN="\033[1;32m" - local BROWN="\033[0;33m" - local YELLOW="\033[1;33m" - local BLUE="\033[0;34m" - local LIGHTBLUE="\033[1;34m" - local MAGENTA="\033[0;35m" - local LIGHTMAGENTA="\033[1;35m" - local CYAN="\033[0;36m" - local LIGHTCYAN="\033[1;36m" - local NOCOLOR="\033[0m" - - # Show error exit code if there is one - if [[ $LAST_COMMAND != 0 ]]; then - # PS1="\[${RED}\](\[${LIGHTRED}\]ERROR\[${RED}\])-(\[${LIGHTRED}\]Exit Code \[${WHITE}\]${LAST_COMMAND}\[${RED}\])-(\[${LIGHTRED}\]" - PS1="\[${DARKGRAY}\](\[${LIGHTRED}\]ERROR\[${DARKGRAY}\])-(\[${RED}\]Exit Code \[${LIGHTRED}\]${LAST_COMMAND}\[${DARKGRAY}\])-(\[${RED}\]" - if [[ $LAST_COMMAND == 1 ]]; then - PS1+="General error" - elif [ $LAST_COMMAND == 2 ]; then - PS1+="Missing keyword, command, or permission problem" - elif [ $LAST_COMMAND == 126 ]; then - PS1+="Permission problem or command is not an executable" - elif [ $LAST_COMMAND == 127 ]; then - PS1+="Command not found" - elif [ $LAST_COMMAND == 128 ]; then - PS1+="Invalid argument to exit" - elif [ $LAST_COMMAND == 129 ]; then - PS1+="Fatal error signal 1" - elif [ $LAST_COMMAND == 130 ]; then - PS1+="Script terminated by Control-C" - elif [ $LAST_COMMAND == 131 ]; then - PS1+="Fatal error signal 3" - elif [ $LAST_COMMAND == 132 ]; then - PS1+="Fatal error signal 4" - elif [ $LAST_COMMAND == 133 ]; then - PS1+="Fatal error signal 5" - elif [ $LAST_COMMAND == 134 ]; then - PS1+="Fatal error signal 6" - elif [ $LAST_COMMAND == 135 ]; then - PS1+="Fatal error signal 7" - elif [ $LAST_COMMAND == 136 ]; then - PS1+="Fatal error signal 8" - elif [ $LAST_COMMAND == 137 ]; then - PS1+="Fatal error signal 9" - elif [ $LAST_COMMAND -gt 255 ]; then - PS1+="Exit status out of range" - else - PS1+="Unknown error code" - fi - PS1+="\[${DARKGRAY}\])\[${NOCOLOR}\]\n" - else - PS1="" - fi - - # Date - PS1+="\[${DARKGRAY}\](\[${CYAN}\]\$(date +%a) $(date +%b-'%-m')" # Date - PS1+="${BLUE} $(date +'%-I':%M:%S%P)\[${DARKGRAY}\])-" # Time - - # CPU - PS1+="(\[${MAGENTA}\]CPU $(cpu)%" - - # Jobs - PS1+="\[${DARKGRAY}\]:\[${MAGENTA}\]\j" - - # Network Connections (for a server - comment out for non-server) - PS1+="\[${DARKGRAY}\]:\[${MAGENTA}\]Net $(awk 'END {print NR}' /proc/net/tcp)" - - PS1+="\[${DARKGRAY}\])-" - - # User and server - local SSH_IP=$(echo $SSH_CLIENT | awk '{ print $1 }') - local SSH2_IP=$(echo $SSH2_CLIENT | awk '{ print $1 }') - if [ $SSH2_IP ] || [ $SSH_IP ]; then - PS1+="(\[${RED}\]\u@\h" - else - PS1+="(\[${RED}\]\u" - fi - - # Current directory - PS1+="\[${DARKGRAY}\]:\[${BROWN}\]\w\[${DARKGRAY}\])-" - - # Total size of files in current directory - PS1+="(\[${GREEN}\]$(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed 's/total //')\[${DARKGRAY}\]:" - - # Number of files - PS1+="\[${GREEN}\]\$(/bin/ls -A -1 | /usr/bin/wc -l)\[${DARKGRAY}\])" - - # Skip to the next line - PS1+="\n" - - if [[ $EUID -ne 0 ]]; then - PS1+="\[${GREEN}\]>\[${NOCOLOR}\] " # Normal user - else - PS1+="\[${RED}\]>\[${NOCOLOR}\] " # Root user - fi - - # PS2 is used to continue a command using the \ character - PS2="\[${DARKGRAY}\]>\[${NOCOLOR}\] " - - # PS3 is used to enter a number choice in a script - PS3='Please enter a number from above list: ' - - # PS4 is used for tracing a script in debug mode - PS4='\[${DARKGRAY}\]+\[${NOCOLOR}\] ' -} -# PROMPT_COMMAND='__setprompt' -PS1="\[\e[1m\]\[\e[31m\][\[\e[33m\]\u\[\e[32m\]@\[\e[34m\]\h \[\e[35m\]\W\[\e[31m\]]\[\e[37m\]\\$ \[\e[0m\]" - -####################################################### -# KEY BINDING -####################################################### - -bind '"\C-l":clear-screen' -bind '"\C-g":"lfcd\n"' - -####################################################### -# SOURCE -####################################################### - -eval "$(dircolors)" - -[ -f "$HOME/.config/bash/git.bash" ] && . "$HOME/.config/bash/git.bash" -[ -f "$HOME/.config/bash/p10k.bash" ] && . "$HOME/.config/bash/p10k.bash" -[ -f "$HOME/.config/bash/autocomplete.bash" ] && . "$HOME/.config/bash/autocomplete.bash" -[ -f "$HOME/.config/bash/scripts.bash" ] && . "$HOME/.config/bash/scripts.bash" -[ -f "$HOME/.config/bash/keymaps.bash" ] && . "$HOME/.config/bash/keymaps.bash" -[ -f "$HOME/.config/bash/plugins.bash" ] && . "$HOME/.config/bash/plugins.bash" -[ -f "$HOME/.config/bash/packages.bash" ] && . "$HOME/.config/bash/packages.bash" -[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc" ] && . "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc" -[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/git-aliasrc" ] && . "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/git-aliasrc" -[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc" ] && . "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc" -[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutenvrc" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc" -[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc" ] && . "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc" -[ -f "${XDG_SCRIPTS_HOME:-${HOME}/.local/bin}/bash-preexec" ] && . "${XDG_SCRIPTS_HOME:-${HOME}/.local/bin}/bash-preexec" -[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/rootshortcutrc" ] && . "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/rootshortcutrc" -[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/rootzshnameddirrc" ] && . "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/rootzshnameddirrc" diff --git a/fedora/.config/bash/completions/bat.bash b/fedora/.config/bash/completions/bat.bash deleted file mode 100644 index fa0f712..0000000 --- a/fedora/.config/bash/completions/bat.bash +++ /dev/null @@ -1,249 +0,0 @@ -# shellcheck disable=SC2207 - -# Requires https://github.com/scop/bash-completion - -# Macs have bash3 for which the bash-completion package doesn't include -# _init_completion. This is a minimal version of that function. -__bat_init_completion() -{ - COMPREPLY=() - _get_comp_words_by_ref "$@" cur prev words cword -} - -__bat_escape_completions() -{ - # Do not escape if completing a quoted value. - [[ $cur == [\"\']* ]] && return 0 - if (( - BASH_VERSINFO[0] > 5 || \ - BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >= 3 - )); then - # bash >= 5.3 has "compopt -o fullquote", which exactly does - # what this function tries to do. - compopt -o fullquote - elif (( - BASH_VERSINFO[0] > 4 || \ - BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] > 0 - )); then - # printf -v to an array index is available in bash >= 4.1. - # Use it if available, as -o filenames is semantically - # incorrect if we are not actually completing filenames, and it - # has side effects (e.g. adds trailing slash to candidates - # matching present dirs). - local i - for i in ${!COMPREPLY[*]}; do - printf -v "COMPREPLY[i]" %q "${COMPREPLY[i]}" - done - - # We can use "compopt -o noquote" available in bash >= 4.3 to - # prevent further quoting by the shell, which would be - # unexpectedly applied when a quoted result matches a filename. - if (( - BASH_VERSINFO[0] > 4 || \ - BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] >= 3 - )); then - compopt -o noquote - fi - else - compopt -o filenames - fi -} - -_bat() { - local cur prev words split=false - if declare -F _init_completion >/dev/null 2>&1; then - _init_completion -s || return 0 - else - __bat_init_completion -n "=" || return 0 - _split_longopt && split=true - fi - - if [[ ${words[1]-} == cache ]]; then - case $prev in - --source | --target) - _filedir -d - return 0 - ;; - esac - COMPREPLY=($(compgen -W " - --build - --clear - --source - --target - --blank - --help - " -- "$cur")) - return 0 - fi - - case $prev in - -l | --language) - local IFS=$'\n' - COMPREPLY=($(compgen -W "$( - "$1" --list-languages | while IFS=: read -r lang _; do - printf "%s\n" "$lang" - done - )" -- "$cur")) - __bat_escape_completions - return 0 - ;; - -H | --highlight-line | \ - --diff-context | \ - --tabs | \ - --terminal-width | \ - -m | --map-syntax | \ - --ignored-suffix | \ - --list-themes | \ - --squeeze-limit | \ - --line-range | \ - -L | --list-languages | \ - --lessopen | \ - --no-paging | \ - --diagnostic | \ - --acknowledgements | \ - -h | --help | \ - -V | --version | \ - --cache-dir | \ - --config-dir | \ - --config-file | \ - --generate-config-file) - # argument required but no completion available, or option - # causes an exit - return 0 - ;; - --file-name) - _filedir - return 0 - ;; - --wrap) - COMPREPLY=($(compgen -W "auto never character" -- "$cur")) - return 0 - ;; - --binary) - COMPREPLY=($(compgen -W "no-printing as-text" -- "$cur")) - return 0 - ;; - --nonprintable-notation) - COMPREPLY=($(compgen -W "unicode caret" -- "$cur")) - return 0 - ;; - --strip-ansi) - COMPREPLY=($(compgen -W "auto never always" -- "$cur")) - return 0 - ;; - --completion) - COMPREPLY=($(compgen -W "bash fish zsh ps1" -- "$cur")) - return 0 - ;; - --color | --decorations | --paging) - COMPREPLY=($(compgen -W "auto never always" -- "$cur")) - return 0 - ;; - --italic-text) - COMPREPLY=($(compgen -W "always never" -- "$cur")) - return 0 - ;; - --pager) - COMPREPLY=($(compgen -c -- "$cur")) - return 0 - ;; - --theme) - local IFS=$'\n' - COMPREPLY=($(compgen -W "auto${IFS}auto:always${IFS}auto:system${IFS}dark${IFS}light${IFS}$("$1" --list-themes)" -- "$cur")) - __bat_escape_completions - return 0 - ;; - --theme-dark | \ - --theme-light) - local IFS=$'\n' - COMPREPLY=($(compgen -W "$("$1" --list-themes)" -- "$cur")) - __bat_escape_completions - return 0 - ;; - --style) - # shellcheck disable=SC2034 - local -a styles=( - default - full - auto - plain - changes - header - header-filename - header-filesize - grid - rule - numbers - snip - ) - # shellcheck disable=SC2016 - if declare -F _comp_delimited >/dev/null 2>&1; then - # bash-completion > 2.11 - _comp_delimited , -W '"${styles[@]}"' - else - COMPREPLY=($(compgen -W '${styles[@]}' -- "$cur")) - fi - return 0 - esac - - $split && return 0 - - if [[ $cur == -* ]]; then - # --unbuffered excluded intentionally (no-op) - COMPREPLY=($(compgen -W " - --show-all - --nonprintable-notation - --binary - --plain - --language - --highlight-line - --file-name - --diff - --diff-context - --tabs - --wrap - --chop-long-lines - --terminal-width - --number - --color - --italic-text - --decorations - --force-colorization - --paging - --no-paging - --pager - --map-syntax - --ignored-suffix - --theme - --theme-dark - --theme-light - --list-themes - --squeeze-blank - --squeeze-limit - --strip-ansi - --style - --line-range - --list-languages - --lessopen - --completion - --diagnostic - --acknowledgements - --set-terminal-title - --help - --version - --cache-dir - --config-dir - --config-file - --generate-config-file - --no-config - --no-custom-assets - --no-lessopen - " -- "$cur")) - return 0 - fi - - _filedir - - ## Completion of the 'cache' command itself is removed for better UX - ## See https://github.com/sharkdp/bat/issues/2085#issuecomment-1271646802 -} && complete -F _bat bat diff --git a/fedora/.config/bash/completions/rg.bash b/fedora/.config/bash/completions/rg.bash deleted file mode 100644 index 12d1039..0000000 --- a/fedora/.config/bash/completions/rg.bash +++ /dev/null @@ -1,783 +0,0 @@ -_rg() { - local i cur prev opts cmds - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - cmd="" - opts="" - - for i in ${COMP_WORDS[@]}; do - case "${i}" in - rg) - cmd="rg" - ;; - *) - ;; - esac - done - - case "${cmd}" in - rg) - opts="--regexp -e --file -f --after-context -A --before-context -B --binary --no-binary --block-buffered --no-block-buffered --byte-offset -b --no-byte-offset --case-sensitive -s --color --colors --column --no-column --context -C --context-separator --no-context-separator --count -c --count-matches --crlf --no-crlf --debug --dfa-size-limit --encoding -E --no-encoding --engine --field-context-separator --field-match-separator --files --files-with-matches -l --files-without-match --fixed-strings -F --no-fixed-strings --follow -L --no-follow --generate --glob -g --glob-case-insensitive --no-glob-case-insensitive --heading --no-heading --help -h --hidden -. --no-hidden --hostname-bin --hyperlink-format --iglob --ignore-case -i --ignore-file --ignore-file-case-insensitive --no-ignore-file-case-insensitive --include-zero --no-include-zero --invert-match -v --no-invert-match --json --no-json --line-buffered --no-line-buffered --line-number -n --no-line-number -N --line-regexp -x --max-columns -M --max-columns-preview --no-max-columns-preview --max-count -m --max-depth -d --max-filesize --mmap --no-mmap --multiline -U --no-multiline --multiline-dotall --no-multiline-dotall --no-config --no-ignore --ignore --no-ignore-dot --ignore-dot --no-ignore-exclude --ignore-exclude --no-ignore-files --ignore-files --no-ignore-global --ignore-global --no-ignore-messages --ignore-messages --no-ignore-parent --ignore-parent --no-ignore-vcs --ignore-vcs --no-messages --messages --no-require-git --require-git --no-unicode --unicode --null -0 --null-data --one-file-system --no-one-file-system --only-matching -o --path-separator --passthru --pcre2 -P --no-pcre2 --pcre2-version --pre --no-pre --pre-glob --pretty -p --quiet -q --regex-size-limit --replace -r --search-zip -z --no-search-zip --smart-case -S --sort --sortr --stats --no-stats --stop-on-nonmatch --text -a --no-text --threads -j --trace --trim --no-trim --type -t --type-not -T --type-add --type-clear --type-list --unrestricted -u --version -V --vimgrep --with-filename -H --no-filename -I --word-regexp -w --auto-hybrid-regex --no-auto-hybrid-regex --no-pcre2-unicode --pcre2-unicode --sort-files --no-sort-files ..." - if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then - COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) - return 0 - fi - case "${prev}" in - - --regexp) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -e) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --file) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -f) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --after-context) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -A) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --before-context) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -B) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --binary) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-binary) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --block-buffered) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-block-buffered) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --byte-offset) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -b) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-byte-offset) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --case-sensitive) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -s) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --color) - COMPREPLY=($(compgen -W "never auto always ansi" -- "${cur}")) - return 0 - ;; - --colors) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --column) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-column) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --context) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -C) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --context-separator) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-context-separator) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --count) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -c) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --count-matches) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --crlf) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-crlf) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --debug) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --dfa-size-limit) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --encoding) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -E) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-encoding) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --engine) - COMPREPLY=($(compgen -W "default pcre2 auto" -- "${cur}")) - return 0 - ;; - --field-context-separator) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --field-match-separator) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --files) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --files-with-matches) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -l) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --files-without-match) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --fixed-strings) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -F) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-fixed-strings) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --follow) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -L) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-follow) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --generate) - COMPREPLY=($(compgen -W "man complete-bash complete-zsh complete-fish complete-powershell" -- "${cur}")) - return 0 - ;; - --glob) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -g) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --glob-case-insensitive) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-glob-case-insensitive) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --heading) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-heading) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --help) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -h) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --hidden) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -.) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-hidden) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --hostname-bin) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --hyperlink-format) - COMPREPLY=($(compgen -W "default none cursor file grep+ kitty macvim textmate vscode vscode-insiders vscodium" -- "${cur}")) - return 0 - ;; - --iglob) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --ignore-case) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -i) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --ignore-file) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --ignore-file-case-insensitive) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-ignore-file-case-insensitive) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --include-zero) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-include-zero) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --invert-match) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -v) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-invert-match) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --json) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-json) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --line-buffered) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-line-buffered) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --line-number) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -n) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-line-number) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -N) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --line-regexp) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -x) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --max-columns) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -M) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --max-columns-preview) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-max-columns-preview) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --max-count) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -m) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --max-depth) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -d) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --max-filesize) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --mmap) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-mmap) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --multiline) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -U) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-multiline) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --multiline-dotall) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-multiline-dotall) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-config) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-ignore) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --ignore) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-ignore-dot) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --ignore-dot) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-ignore-exclude) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --ignore-exclude) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-ignore-files) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --ignore-files) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-ignore-global) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --ignore-global) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-ignore-messages) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --ignore-messages) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-ignore-parent) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --ignore-parent) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-ignore-vcs) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --ignore-vcs) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-messages) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --messages) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-require-git) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --require-git) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-unicode) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --unicode) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --null) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -0) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --null-data) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --one-file-system) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-one-file-system) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --only-matching) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -o) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --path-separator) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --passthru) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --pcre2) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -P) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-pcre2) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --pcre2-version) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --pre) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-pre) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --pre-glob) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --pretty) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -p) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --quiet) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -q) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --regex-size-limit) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --replace) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -r) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --search-zip) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -z) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-search-zip) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --smart-case) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -S) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --sort) - COMPREPLY=($(compgen -W "none path modified accessed created" -- "${cur}")) - return 0 - ;; - --sortr) - COMPREPLY=($(compgen -W "none path modified accessed created" -- "${cur}")) - return 0 - ;; - --stats) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-stats) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --stop-on-nonmatch) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --text) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -a) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-text) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --threads) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -j) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --trace) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --trim) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-trim) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --type) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -t) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --type-not) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -T) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --type-add) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --type-clear) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --type-list) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --unrestricted) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -u) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --version) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -V) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --vimgrep) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --with-filename) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -H) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-filename) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -I) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --word-regexp) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -w) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --auto-hybrid-regex) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-auto-hybrid-regex) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-pcre2-unicode) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --pcre2-unicode) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --sort-files) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --no-sort-files) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - esac - COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) - return 0 - ;; - esac -} - -complete -F _rg -o bashdefault -o default rg diff --git a/fedora/.config/bash/completions/ya.bash b/fedora/.config/bash/completions/ya.bash deleted file mode 100644 index b24e3e5..0000000 --- a/fedora/.config/bash/completions/ya.bash +++ /dev/null @@ -1,647 +0,0 @@ -_ya() { - local i cur prev opts cmd - COMPREPLY=() - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - cur="$2" - else - cur="${COMP_WORDS[COMP_CWORD]}" - fi - prev="$3" - cmd="" - opts="" - - for i in "${COMP_WORDS[@]:0:COMP_CWORD}" - do - case "${cmd},${i}" in - ",$1") - cmd="ya" - ;; - ya,emit) - cmd="ya__emit" - ;; - ya,emit-to) - cmd="ya__emit__to" - ;; - ya,help) - cmd="ya__help" - ;; - ya,pack) - cmd="ya__pack" - ;; - ya,pkg) - cmd="ya__pkg" - ;; - ya,pub) - cmd="ya__pub" - ;; - ya,pub-to) - cmd="ya__pub__to" - ;; - ya,sub) - cmd="ya__sub" - ;; - ya__help,emit) - cmd="ya__help__emit" - ;; - ya__help,emit-to) - cmd="ya__help__emit__to" - ;; - ya__help,help) - cmd="ya__help__help" - ;; - ya__help,pack) - cmd="ya__help__pack" - ;; - ya__help,pkg) - cmd="ya__help__pkg" - ;; - ya__help,pub) - cmd="ya__help__pub" - ;; - ya__help,pub-to) - cmd="ya__help__pub__to" - ;; - ya__help,sub) - cmd="ya__help__sub" - ;; - ya__help__pkg,add) - cmd="ya__help__pkg__add" - ;; - ya__help__pkg,delete) - cmd="ya__help__pkg__delete" - ;; - ya__help__pkg,install) - cmd="ya__help__pkg__install" - ;; - ya__help__pkg,list) - cmd="ya__help__pkg__list" - ;; - ya__help__pkg,upgrade) - cmd="ya__help__pkg__upgrade" - ;; - ya__pkg,add) - cmd="ya__pkg__add" - ;; - ya__pkg,delete) - cmd="ya__pkg__delete" - ;; - ya__pkg,help) - cmd="ya__pkg__help" - ;; - ya__pkg,install) - cmd="ya__pkg__install" - ;; - ya__pkg,list) - cmd="ya__pkg__list" - ;; - ya__pkg,upgrade) - cmd="ya__pkg__upgrade" - ;; - ya__pkg__help,add) - cmd="ya__pkg__help__add" - ;; - ya__pkg__help,delete) - cmd="ya__pkg__help__delete" - ;; - ya__pkg__help,help) - cmd="ya__pkg__help__help" - ;; - ya__pkg__help,install) - cmd="ya__pkg__help__install" - ;; - ya__pkg__help,list) - cmd="ya__pkg__help__list" - ;; - ya__pkg__help,upgrade) - cmd="ya__pkg__help__upgrade" - ;; - *) - ;; - esac - done - - case "${cmd}" in - ya) - opts="-V -h --version --help emit emit-to pkg pack pub pub-to sub help" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__emit) - opts="-h --help [ARGS]..." - if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__emit__to) - opts="-h --help [ARGS]..." - if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__help) - opts="emit emit-to pkg pack pub pub-to sub help" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__help__emit) - opts="" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__help__emit__to) - opts="" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__help__help) - opts="" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__help__pack) - opts="" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__help__pkg) - opts="add delete install list upgrade" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__help__pkg__add) - opts="" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__help__pkg__delete) - opts="" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__help__pkg__install) - opts="" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__help__pkg__list) - opts="" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__help__pkg__upgrade) - opts="" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__help__pub) - opts="" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__help__pub__to) - opts="" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__help__sub) - opts="" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__pack) - opts="-a -d -i -l -u -h --add --delete --install --list --upgrade --help" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - --add) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -a) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --delete) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -d) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__pkg) - opts="-h --help add delete install list upgrade help" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__pkg__add) - opts="-h --help [IDS]..." - if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__pkg__delete) - opts="-h --help [IDS]..." - if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__pkg__help) - opts="add delete install list upgrade help" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__pkg__help__add) - opts="" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__pkg__help__delete) - opts="" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__pkg__help__help) - opts="" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__pkg__help__install) - opts="" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__pkg__help__list) - opts="" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__pkg__help__upgrade) - opts="" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__pkg__install) - opts="-h --help" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__pkg__list) - opts="-h --help" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__pkg__upgrade) - opts="-h --help" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__pub) - opts="-h --str --json --list --help " - if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - --str) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --json) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --list) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__pub__to) - opts="-h --str --json --list --help " - if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - --str) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --json) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --list) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - ya__sub) - opts="-h --help " - if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - esac -} - -if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then - complete -F _ya -o nosort -o bashdefault -o default ya -else - complete -F _ya -o bashdefault -o default ya -fi diff --git a/fedora/.config/bash/completions/yazi.bash b/fedora/.config/bash/completions/yazi.bash deleted file mode 100644 index ae2d3a1..0000000 --- a/fedora/.config/bash/completions/yazi.bash +++ /dev/null @@ -1,66 +0,0 @@ -_yazi() { - local i cur prev opts cmd - COMPREPLY=() - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - cur="$2" - else - cur="${COMP_WORDS[COMP_CWORD]}" - fi - prev="$3" - cmd="" - opts="" - - for i in "${COMP_WORDS[@]:0:COMP_CWORD}" - do - case "${cmd},${i}" in - ",$1") - cmd="yazi" - ;; - *) - ;; - esac - done - - case "${cmd}" in - yazi) - opts="-V -h --cwd-file --chooser-file --clear-cache --client-id --local-events --remote-events --debug --version --help [ENTRIES]..." - if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - --cwd-file) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --chooser-file) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --client-id) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --local-events) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --remote-events) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - esac -} - -if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then - complete -F _yazi -o nosort -o bashdefault -o default yazi -else - complete -F _yazi -o bashdefault -o default yazi -fi diff --git a/fedora/.config/bash/completions/zoxide.bash b/fedora/.config/bash/completions/zoxide.bash deleted file mode 100644 index 1c2ed84..0000000 --- a/fedora/.config/bash/completions/zoxide.bash +++ /dev/null @@ -1,243 +0,0 @@ -_zoxide() { - local i cur prev opts cmd - COMPREPLY=() - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - cur="$2" - else - cur="${COMP_WORDS[COMP_CWORD]}" - fi - prev="$3" - cmd="" - opts="" - - for i in "${COMP_WORDS[@]:0:COMP_CWORD}" - do - case "${cmd},${i}" in - ",$1") - cmd="zoxide" - ;; - zoxide,add) - cmd="zoxide__add" - ;; - zoxide,edit) - cmd="zoxide__edit" - ;; - zoxide,import) - cmd="zoxide__import" - ;; - zoxide,init) - cmd="zoxide__init" - ;; - zoxide,query) - cmd="zoxide__query" - ;; - zoxide,remove) - cmd="zoxide__remove" - ;; - zoxide__edit,decrement) - cmd="zoxide__edit__decrement" - ;; - zoxide__edit,delete) - cmd="zoxide__edit__delete" - ;; - zoxide__edit,increment) - cmd="zoxide__edit__increment" - ;; - zoxide__edit,reload) - cmd="zoxide__edit__reload" - ;; - *) - ;; - esac - done - - case "${cmd}" in - zoxide) - opts="-h -V --help --version add edit import init query remove" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - zoxide__add) - opts="-s -h -V --score --help --version ..." - if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - --score) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -s) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - zoxide__edit) - opts="-h -V --help --version decrement delete increment reload" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - zoxide__edit__decrement) - opts="-h -V --help --version " - if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - zoxide__edit__delete) - opts="-h -V --help --version " - if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - zoxide__edit__increment) - opts="-h -V --help --version " - if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - zoxide__edit__reload) - opts="-h -V --help --version" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - zoxide__import) - opts="-h -V --from --merge --help --version " - if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - --from) - COMPREPLY=($(compgen -W "autojump z" -- "${cur}")) - return 0 - ;; - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - zoxide__init) - opts="-h -V --no-cmd --cmd --hook --help --version bash elvish fish nushell posix powershell tcsh xonsh zsh" - if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - --cmd) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --hook) - COMPREPLY=($(compgen -W "none prompt pwd" -- "${cur}")) - return 0 - ;; - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - zoxide__query) - opts="-a -i -l -s -h -V --all --interactive --list --score --exclude --help --version [KEYWORDS]..." - if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - --exclude) - COMPREPLY=() - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o plusdirs - fi - return 0 - ;; - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - zoxide__remove) - opts="-h -V --help --version [PATHS]..." - if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; - esac -} - -if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then - complete -F _zoxide -o nosort -o bashdefault -o default zoxide -else - complete -F _zoxide -o bashdefault -o default zoxide -fi diff --git a/fedora/.config/bash/git.bash b/fedora/.config/bash/git.bash deleted file mode 100644 index 8fe7382..0000000 --- a/fedora/.config/bash/git.bash +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# Speed up git completion -# http://talkings.org/post/5236392664/zsh-and-slow-git-completion -__git_files() { - _wanted files expl 'local files' _files -} diff --git a/fedora/.config/bash/keymaps.bash b/fedora/.config/bash/keymaps.bash deleted file mode 100644 index 15bd7e2..0000000 --- a/fedora/.config/bash/keymaps.bash +++ /dev/null @@ -1,218 +0,0 @@ -#!/bin/bash - -# --------- Bash port (u-prefix removed) --------- -# Put this into ~/.bashrc and run: source ~/.bashrc - -# enable vi editing mode -set -o vi - -# Try to set beam cursor at prompt (best-effort) -PROMPT_COMMAND='echo -ne "\e[5 q"' - -# ---------- helper: pre_cmd ---------- -pre_cmd() { - local last_cmd - last_cmd=$(history 1 | sed 's/^[ ]*[0-9]*[ ]*//') - - if [[ $last_cmd != sudo* ]]; then - READLINE_LINE="sudo $last_cmd" - READLINE_POINT=${#READLINE_LINE} - fi -} - -# ---------- Clipboard detection ---------- -_detect_clipboard_setup() { - if command -v pbcopy >/dev/null 2>&1 && command -v pbpaste >/dev/null 2>&1; then - clipcopy() { cat "${1:-/dev/stdin}" | pbcopy; } - clippaste() { pbaste; } - return 0 - fi - if command -v wl-copy >/dev/null 2>&1 && command -v wl-paste >/dev/null 2>&1; then - clipcopy() { cat "${1:-/dev/stdin}" | wl-copy; } - clippaste() { wl-paste --no-newline; } - return 0 - fi - if command -v xclip >/dev/null 2>&1; then - clipcopy() { cat "${1:-/dev/stdin}" | xclip -selection clipboard; } - clippaste() { xclip -selection clipboard -out; } - return 0 - fi - if command -v xsel >/dev/null 2>&1; then - clipcopy() { cat "${1:-/dev/stdin}" | xsel --clipboard --input; } - clippaste() { xsel --clipboard --output; } - return 0 - fi - if command -v clip.exe >/dev/null 2>&1; then - clipcopy() { cat "${1:-/dev/stdin}" | clip.exe; } - clippaste() { powershell.exe -noprofile -command Get-Clipboard 2>/dev/null; } - return 0 - fi - if command -v tmux >/dev/null 2>&1 && [ -n "${TMUX:-}" ]; then - clipcopy() { tmux load-buffer -; } - clippaste() { tmux save-buffer -; } - return 0 - fi - return 1 -} -_detect_clipboard_setup || true - -paste_clipboard_to_readline() { - if ! command -v clippaste >/dev/null 2>&1; then - _detect_clipboard_setup || { - printf 'No clipboard helper found\n' >&2 - return 1 - } - fi - local clip - clip=$(clippaste 2>/dev/null) || return 1 - clip="${clip%$'\n'}" - if [[ -z "${READLINE_LINE+set}" ]]; then - printf '%s' "$clip" - return - fi - local left=${READLINE_LINE:0:READLINE_POINT} - local right=${READLINE_LINE:READLINE_POINT} - READLINE_LINE="${left}${clip}${right}" - READLINE_POINT=$((READLINE_POINT + ${#clip})) -} - -copy_readline_to_clipboard() { - if [[ -z "${READLINE_LINE+set}" ]]; then - printf 'No current line to copy\n' >&2 - return 1 - fi - if ! command -v clipcopy >/dev/null 2>&1; then - _detect_clipboard_setup || { - printf 'No clipboard helper found\n' >&2 - return 1 - } - fi - printf '%s' "${READLINE_LINE}" | clipcopy -} - -# ---------- basic utilities ---------- -clear_tree_2() { - clear - tree -L 2 2>/dev/null || true -} -clear_tree_3() { - clear - tree -L 3 2>/dev/null || true -} -insert_current_date() { - local txt="$(date -I)" - if [[ -z "${READLINE_LINE+set}" ]]; then - printf '%s' "$txt" - return - fi - local left=${READLINE_LINE:0:READLINE_POINT} - local right=${READLINE_LINE:READLINE_POINT} - READLINE_LINE="${left}${txt}${right}" - READLINE_POINT=$((READLINE_POINT + ${#txt})) -} -insert_unix_timestamp() { - local txt="$(date +%s)" - if [[ -z "${READLINE_LINE+set}" ]]; then - printf '%s' "$txt" - return - fi - local left=${READLINE_LINE:0:READLINE_POINT} - local right=${READLINE_LINE:READLINE_POINT} - READLINE_LINE="${left}${txt}${right}" - READLINE_POINT=$((READLINE_POINT + ${#txt})) -} -git_status_clear() { - clear - git status 2>/dev/null || git status --short 2>/dev/null || true -} -tmux_left_pane() { - tmux select-pane -L 2>/dev/null || true - tmux resize-pane -Z 2>/dev/null || true -} -vi_append_clip_selection() { paste_clipboard_to_readline; } -copybuffer() { copy_readline_to_clipboard; } -background_start() { - local cmd="$1" - shift || return 0 - for arg in "$@"; do "$cmd" "$arg" &>/dev/null & done -} - -# ---------- pre_cmd widgets ---------- -man_command_line() { pre_cmd "man"; } -sudo_command_line() { pre_cmd "sudo"; } - -# ---------- wrappers (u-prefix REMOVED) ---------- -bc() { command -v bc >/dev/null 2>&1 && /usr/bin/env bc "$@" || printf 'bc: not found\n' >&2; } -cdi() { command -v cdi >/dev/null 2>&1 && cdi "$@" || printf 'cdi: not found\n' >&2; } -lastfiles() { command -v lastfiles >/dev/null 2>&1 && lastfiles "$@" || printf 'lastfiles: not found\n' >&2; } -htop() { command -v htop >/dev/null 2>&1 && htop "$@" || printf 'htop: not found\n' >&2; } -sessionizer() { command -v sessionizer >/dev/null 2>&1 && sessionizer "$@" || printf 'sessionizer: not found\n' >&2; } -upd() { command -v upd >/dev/null 2>&1 && upd "$@" || printf 'upd: not found\n' >&2; } -cht() { command -v cht >/dev/null 2>&1 && cht "$@" || printf 'cht: not found\n' >&2; } # from '^ucht' -> 'cht' -ali() { command -v ali >/dev/null 2>&1 && ali "$@" || printf 'ali: not found\n' >&2; } -fD() { command -v fD >/dev/null 2>&1 && fD "$@" || printf 'fD: not found\n' >&2; } -lastfiles_l() { command -v lastfiles >/dev/null 2>&1 && lastfiles -l || printf 'lastfiles: not found\n' >&2; } - -# ---------- Readline key bindings (bind -x) ---------- -# basic movement -bind '"\C-a": beginning-of-line' -bind '"\C-e": end-of-line' - -# function key bindings (map to bash functions above) -bind -x '"\C-x\C-e":clear_tree_2' -bind -x '"\C-x\C-w":clear_tree_3' -bind -x '"\C-x\C-s":git_status_clear' -bind -x '"\C-x\C-x\C-t":insert_current_date' # ^X^X^T (alternate: C-x C-t) -bind -x '"\C-x\C-t":insert_current_date' -bind -x '"\C-x\C-x\C-u":insert_unix_timestamp' # ^X^X^U -bind -x '"\C-x\C-u":insert_unix_timestamp' - -# clipboard binds -bind -x '"\C-x\C-p":paste_clipboard_to_readline' # ^X^P -bind -x '"\C-x\C-y":copy_readline_to_clipboard' # ^X^Y - -# edit in editor -edit_command_line() { - local tmp content - tmp=$(mktemp /tmp/bash-edit.XXXXXX) || return - printf '%s' "${READLINE_LINE:-}" >"$tmp" - "${EDITOR:-vim}" "$tmp" - content=$(<"$tmp") - READLINE_LINE="$content" - READLINE_POINT=${#content} - rm -f "$tmp" -} -bind -x '"\C-x\C-v":edit_command_line' # ^X^V - -# man & sudo insertion -bind -x '"\C-x\C-m":man_command_line' # ^X^M -stty -ixon 2>/dev/null || true -bind -x '"\C-s":sudo_command_line' # ^S (stty -ixon to avoid flow control) - -# tmux left pane (bind ESC + backslash) -#bind -x '\e\\':tmux_left_pane - -# ---------- mappings of the original bindkey -s lines (u removed) ---------- -bind -x '"\C-b":__bc' # will call function __bc below -__bc() { bc -lq "$@"; } - -bind -x '"\C-d":cdi' -bind -x '"\C-f":fzffiles' -bind -x '"\C-n":lastfiles' -bind -x '"\C-o":tmo' -bind -x '"\C-p":fzfpass' -bind -x '"\C-q":htop' -bind -x '"\C-t":sessionizer' -bind -x '"\C-z":pd' -# ^_ (Ctrl-_) mapped to cht (from '^ucht' -> 'cht') -bind -x $'"\C-_":cht' - -# ^X^... sequences (Ctrl-X then key) -bind -x '"\C-x\C-a":ali' -bind -x '"\C-x\C-d":fD' -bind -x '"\C-x\C-f":gitfiles' -bind -x '"\C-x\C-g":rgafiles' -bind -x '"\C-x\C-l":gloac' -bind -x '"\C-x\C-n":lastfiles_l' -bind -x '"\C-x\C-q":fpkill' -bind -x '"\C-x\C-_":fzffns' # ^X^_ diff --git a/fedora/.config/bash/packages.bash b/fedora/.config/bash/packages.bash deleted file mode 100644 index 27d396e..0000000 --- a/fedora/.config/bash/packages.bash +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# --- Packages (bash version) --- -declare -A packages=( - # [zoxide]="--cmd cd --hook prompt" -) - -eval_packages() { - local package output - for package in "${!packages[@]}"; do - if command -v "$package" >/dev/null 2>&1; then - # split args by space into array (preserve empty => zero args) - local -a args=() - if [[ -n "${packages[$package]}" ]]; then - # Use builtin read to split on spaces (simple split) - IFS=' ' read -r -a args <<<"${packages[$package]}" - fi - - # Prefer initializing for bash (change to "zsh" if you really want zsh-init) - if ((${#args[@]})); then - output="$("$package" init bash "${args[@]}" 2>/dev/null)" - else - output="$("$package" init bash 2>/dev/null)" - fi - - # If the command produced output, evaluate it in current shell - if [[ -n "$output" ]]; then - eval "$output" - fi - fi - done -} - -# run initialization -eval_packages diff --git a/fedora/.config/bash/scripts.bash b/fedora/.config/bash/scripts.bash deleted file mode 100644 index 400265d..0000000 --- a/fedora/.config/bash/scripts.bash +++ /dev/null @@ -1,436 +0,0 @@ -#!/bin/bash - -########################################################################################### -########################################################################################### -### --- APACHE --- ### -# View Apache logs -apachelog() { - if [ -f /etc/httpd/conf/httpd.conf ]; then - cd /var/log/httpd && ls -xAh && multitail --no-repeat -c -s 2 /var/log/httpd/*_log - else - cd /var/log/apache2 && ls -xAh && multitail --no-repeat -c -s 2 /var/log/apache2/*.log - fi -} - -# Edit the Apache configuration -apacheconfig() { - if [ -f /etc/httpd/conf/httpd.conf ]; then - sedit /etc/httpd/conf/httpd.conf - elif [ -f /etc/apache2/apache2.conf ]; then - sedit /etc/apache2/apache2.conf - else - echo "Error: Apache config file could not be found." - echo "Searching for possible locations:" - sudo updatedb && locate httpd.conf && locate apache2.conf - fi -} - -########################################################################################### -########################################################################################### -### --- BASH --- ### -# Automatically install the needed support files for this .bashrc file -install_bashrc_support() { - local dtype - dtype=$(distribution) - - if [ $dtype == "redhat" ]; then - sudo yum install multitail tree joe - elif [ $dtype == "suse" ]; then - sudo zypper install multitail - sudo zypper install tree - sudo zypper install joe - elif [ $dtype == "debian" ]; then - sudo apt-get install multitail tree joe - elif [ $dtype == "gentoo" ]; then - sudo emerge multitail - sudo emerge tree - sudo emerge joe - elif [ $dtype == "mandriva" ]; then - sudo urpmi multitail - sudo urpmi tree - sudo urpmi joe - elif [ $dtype == "slackware" ]; then - echo "No install support for Slackware" - else - echo "Unknown distribution" - fi -} - -########################################################################################### -########################################################################################### -### --- CD --- ### -# Move and go to the directory -mvg() { - if [ -d "$2" ]; then - mv $1 $2 && cd $2 - else - mv $1 $2 - fi -} - -# Create and go to the directory -mc() { - mkdir -p $1 && cd $1 -} - -# Go up a specified number of directories (i.e. up 4) -up() { - local d="" - limit=$1 - for ((i = 1; i <= limit; i++)); do - d=$d/.. - done - d=$(echo $d | sed 's/^\///') - if [ -z "$d" ]; then - d=.. - fi - cd $d -} - -#Automatically do an ls after each cd -# cd () { -# if [ -n "$1" ]; then -# builtin cd "$@" && ls -# else -# builtin cd ~ && ls -# fi -# } - -# Returns the last 2 fields of the working directory -pwdtail() { - pwd | awk -F/ '{nlast = NF -1;print $nlast"/"$NF}' -} - -########################################################################################### -########################################################################################### -### --- COMMAND OUTPUT --- ### -alias ilco=insert_last_command_output -insert_last_command_output() { - local last_cmd - last_cmd=$(history | tail -n 2 | head -n 1 | sed 's/^[ ]*[0-9]\+[ ]*//') - eval "$last_cmd" -} - -########################################################################################### -########################################################################################### -### --- COPY --- ### -# Copy file with a progress bar -cpf() { - set -e - strace -q -ewrite cp -- "${1}" "${2}" 2>&1 | - awk '{ - count += $NF - if (count % 10 == 0) { - percent = count / total_size * 100 - printf "%3d%% [", percent - for (i=0;i<=percent;i++) - printf "=" - printf ">" - for (i=percent;i<100;i++) - printf " " - printf "]\r" - } - } - END { print "" }' total_size=$(stat -c '%s' "${1}") count=0 -} - -# Copy and go to the directory -cpg() { - if [ -d "$2" ]; then - cp $1 $2 && cd $2 - else - cp $1 $2 - fi -} - -########################################################################################### -########################################################################################### -### --- CREATE --- ### -alias mc=mkcd -mkcd() { mkdir -p "$1" && cd "$1" || return; } - -mkdt() { - mkdir -p "${1:+$1/}$(date +%F)" -} - -########################################################################################### -########################################################################################### -### --- CURSOR --- ### -# vi-mode cursor change -function update_cursor { - if [[ $READLINE_LINE == * ]]; then - if [[ $READLINE_POINT -eq 0 ]]; then - echo -ne '\e[6 q' # insert mode - else - echo -ne '\e[2 q' # command mode - fi - fi -} - -# vi-command, vi-insert ๋ชจ๋“œ hook ๋“ฑ๋ก -bind -m vi-insert '":": "\C-o update_cursor"' -bind -m vi-command '":": "\C-o update_cursor"' - -########################################################################################### -########################################################################################### -### --- DISTRIBUTION --- ### -# Show the current distribution -distribution() { - local dtype - # Assume unknown - dtype="unknown" - - # First test against Fedora / RHEL / CentOS / generic Redhat derivative - if [ -r /etc/rc.d/init.d/functions ]; then - source /etc/rc.d/init.d/functions - [ zz$(type -t passed 2>/dev/null) == "zzfunction" ] && dtype="redhat" - - # Then test against SUSE (must be after Redhat, - # I've seen rc.status on Ubuntu I think? TODO: Recheck that) - elif [ -r /etc/rc.status ]; then - source /etc/rc.status - [ zz$(type -t rc_reset 2>/dev/null) == "zzfunction" ] && dtype="suse" - - # Then test against Debian, Ubuntu and friends - elif [ -r /lib/lsb/init-functions ]; then - source /lib/lsb/init-functions - [ zz$(type -t log_begin_msg 2>/dev/null) == "zzfunction" ] && dtype="debian" - - # Then test against Gentoo - elif [ -r /etc/init.d/functions.sh ]; then - source /etc/init.d/functions.sh - [ zz$(type -t ebegin 2>/dev/null) == "zzfunction" ] && dtype="gentoo" - - # For Mandriva we currently just test if /etc/mandriva-release exists - # and isn't empty (TODO: Find a better way :) - elif [ -s /etc/mandriva-release ]; then - dtype="mandriva" - - # For Slackware we currently just test if /etc/slackware-version exists - elif [ -s /etc/slackware-version ]; then - dtype="slackware" - - fi - echo $dtype -} - -# Show the current version of the operating system -ver() { - local dtype - dtype=$(distribution) - - if [ $dtype == "redhat" ]; then - if [ -s /etc/redhat-release ]; then - cat /etc/redhat-release && uname -a - else - cat /etc/issue && uname -a - fi - elif [ $dtype == "suse" ]; then - cat /etc/SuSE-release - elif [ $dtype == "debian" ]; then - lsb_release -a - # sudo cat /etc/issue && sudo cat /etc/issue.net && sudo cat /etc/lsb_release && sudo cat /etc/os-release # Linux Mint option 2 - elif [ $dtype == "gentoo" ]; then - cat /etc/gentoo-release - elif [ $dtype == "mandriva" ]; then - cat /etc/mandriva-release - elif [ $dtype == "slackware" ]; then - cat /etc/slackware-version - else - if [ -s /etc/issue ]; then - cat /etc/issue - else - echo "Error: Unknown distribution" - exit 1 - fi - fi -} - -########################################################################################### -########################################################################################### -### --- EDIT --- ### -edit() { - if [ "$(type -t jpico)" = "file" ]; then - # Use JOE text editor http://joe-editor.sourceforge.net/ - jpico -nonotice -linums -nobackups "$@" - elif [ "$(type -t nano)" = "file" ]; then - nano -c "$@" - elif [ "$(type -t pico)" = "file" ]; then - pico "$@" - else - vim "$@" - fi -} - -sedit() { - if [ "$(type -t jpico)" = "file" ]; then - # Use JOE text editor http://joe-editor.sourceforge.net/ - sudo jpico -nonotice -linums -nobackups "$@" - elif [ "$(type -t nano)" = "file" ]; then - sudo nano -c "$@" - elif [ "$(type -t pico)" = "file" ]; then - sudo pico "$@" - else - sudo vim "$@" - fi -} - -########################################################################################### -########################################################################################### -### --- EXTRACT --- ### -extract() { - for archive in $*; do - if [ -f $archive ]; then - case $archive in - *.tar.bz2) tar xvjf $archive ;; - *.tar.gz) tar xvzf $archive ;; - *.bz2) bunzip2 $archive ;; - *.rar) rar x $archive ;; - *.gz) gunzip $archive ;; - *.tar) tar xvf $archive ;; - *.tbz2) tar xvjf $archive ;; - *.tgz) tar xvzf $archive ;; - *.zip) unzip $archive ;; - *.Z) uncompress $archive ;; - *.7z) 7z x $archive ;; - *) echo "don't know how to extract '$archive'..." ;; - esac - else - echo "'$archive' is not a valid file!" - fi - done -} - -########################################################################################### -########################################################################################### -### --- NETWORK --- ### -# Show current network information -netinfo() { - echo "--------------- Network Information ---------------" - /sbin/ifconfig | awk /'inet addr/ {print $2}' - echo "" - /sbin/ifconfig | awk /'Bcast/ {print $3}' - echo "" - /sbin/ifconfig | awk /'inet addr/ {print $4}' - - /sbin/ifconfig | awk /'HWaddr/ {print $4,$5}' - echo "---------------------------------------------------" -} - -# IP address lookup -alias whatismyip="whatsmyip" -function whatsmyip() { - # Dumps a list of all IP addresses for every device - # /sbin/ifconfig |grep -B1 "inet addr" |awk '{ if ( $1 == "inet" ) { print $2 } else if ( $2 == "Link" ) { printf "%s:" ,$1 } }' |awk -F: '{ print $1 ": " $3 }'; - - # Internal IP Lookup - echo -n "Internal IP: " - /sbin/ifconfig eth0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}' - - # External IP Lookup - echo -n "External IP: " - wget http://smart-ip.net/myip -O - -q -} - -########################################################################################### -########################################################################################### -### --- PASS --- ### -pass_otp() { pass otp uri -q "$1"; } -pass_otp_insert() { pass otp insert "$1"; } - -alias cpqr=pass_qr -pass_qr() { qrencode -o "$1.png" -t png -Sv 40 <"$1.pgp"; } - -########################################################################################### -########################################################################################### -### --- PHP --- ### -# Edit the PHP configuration file -phpconfig() { - if [ -f /etc/php.ini ]; then - sedit /etc/php.ini - elif [ -f /etc/php/php.ini ]; then - sedit /etc/php/php.ini - elif [ -f /etc/php5/php.ini ]; then - sedit /etc/php5/php.ini - elif [ -f /usr/bin/php5/bin/php.ini ]; then - sedit /usr/bin/php5/bin/php.ini - elif [ -f /etc/php5/apache2/php.ini ]; then - sedit /etc/php5/apache2/php.ini - else - echo "Error: php.ini file could not be found." - echo "Searching for possible locations:" - sudo updatedb && locate php.ini - fi -} - -########################################################################################### -########################################################################################### -### --- SEARCH --- ### -ftext() { - # -i case-insensitive - # -I ignore binary files - # -H causes filename to be printed - # -r recursive search - # -n causes line number to be printed - # optional: -F treat search term as a literal, not a regular expression - # optional: -l only print filenames and not the matching lines ex. grep -irl "$1" * - grep -iIHrn --color=always "$1" . | less -r -} - -########################################################################################### -########################################################################################### -### --- SQL --- ### -# Edit the MySQL configuration file -mysqlconfig() { - if [ -f /etc/my.cnf ]; then - sedit /etc/my.cnf - elif [ -f /etc/mysql/my.cnf ]; then - sedit /etc/mysql/my.cnf - elif [ -f /usr/local/etc/my.cnf ]; then - sedit /usr/local/etc/my.cnf - elif [ -f /usr/bin/mysql/my.cnf ]; then - sedit /usr/bin/mysql/my.cnf - elif [ -f ~/my.cnf ]; then - sedit ~/my.cnf - elif [ -f ~/.my.cnf ]; then - sedit ~/.my.cnf - else - echo "Error: my.cnf file could not be found." - echo "Searching for possible locations:" - sudo updatedb && locate my.cnf - fi -} - -########################################################################################### -########################################################################################### -### --- STOW --- ### -alias dstw=dotfiles_stw -dotfiles_stw() { - "${XDG_DOTFILES_DIR:-${HOME}/.dotfiles}/$(whereami)/.local/bin/stw" -} - -########################################################################################### -########################################################################################### -### --- SUDO --- ### -pre_cmd() { - local prepend_command="$1" - local buffer="${READLINE_LINE:-}" - - if [ -z "$buffer" ]; then - buffer=$(history | tail -n 2 | head -n 1 | sed 's/^[ ]*[0-9]\+[ ]*//') - fi - - READLINE_LINE="$prepend_command $buffer" - READLINE_POINT=${#READLINE_LINE} -} -bind -x '"\es":pre_cmd sudo' - -########################################################################################### -########################################################################################### -### --- TRIM --- ### -trim() { - local var=$@ - var='${var#"${var%%[![:space:]]*}"}' # remove leading whitespace characters - var='${var%"${var##*[![:space:]]}"}' # remove trailing whitespace characters - echo -n "$var" -} diff --git a/fedora/.config/htop/htoprc b/fedora/.config/htop/htoprc deleted file mode 100644 index 8666417..0000000 --- a/fedora/.config/htop/htoprc +++ /dev/null @@ -1,53 +0,0 @@ -# Beware! This file is rewritten by htop when settings are changed in the interface. -# The parser is also very primitive, and not human-friendly. -.all_branches_collapsed=0 -.sort_direction=-1 -.sort_key=PERCENT_CPU -.tree_sort_direction=1 -.tree_sort_key=PID -.tree_view=0 -.tree_view_always_by_pid=0 -account_guest_in_cpu_meter=0 -all_branches_collapsed=0 -color_scheme=5 -column_meter_modes_0=1 1 1 2 2 2 1 -column_meter_modes_1= -column_meters_0=LeftCPUs Memory Swap Uptime LoadAverage Tasks RightCPUs -column_meters_1= -config_reader_min_version=3 -cpu_count_from_one=0 -delay=15 -detailed_cpu_time=0 -enable_mouse=1 -fields=0 48 17 18 38 39 2 46 46 47 49 1 -find_comm_in_cmdline=1 -header_layout=two_50_50 -header_margin=1 -hide_function_bar=0 -hide_kernel_threads=1 -hide_running_in_container=0 -hide_userland_threads=0 -highlight_base_name=1 -highlight_changes=1 -highlight_changes_delay_secs=1 -highlight_deleted_exe=1 -highlight_megabytes=1 -highlight_threads=1 -htop_version=3.3.0-dev -screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT STATE PERCENT_CPU PERCENT_MEM TIME Command -screen_tabs=1 -shadow_distribution_path_prefix=0 -shadow_other_users=1 -show_cpu_frequency=1 -show_cpu_usage=1 -show_merged_command=0 -show_program_path=1 -show_thread_names=0 -sort_direction=-1 -sort_key=46 -strip_exe_from_cmdline=1 -tree_sort_direction=1 -tree_sort_key=0 -tree_view=0 -tree_view_always_by_pid=0 -update_process_names=0 diff --git a/fedora/.config/shell/aliasrc b/fedora/.config/shell/aliasrc deleted file mode 100644 index 689699d..0000000 --- a/fedora/.config/shell/aliasrc +++ /dev/null @@ -1,744 +0,0 @@ -# alias - normal aliases (completed with trailing space) -# balias - blank aliases (completed without space) -# ialias - ignored aliases (not completed) - -if [ -n "$BASH_VERSION" ]; then - # ------------------------------ - # BASH-compatible aliases & functions - # ------------------------------ - - # helper: safe alias creation - _a() { alias "$1"="$2"; } - - # sudo not required for some system commands - for command in blkid lsblk mount umount dnf poweroff reboot shutdown su updatedb; do - alias "$command"="sudo $command" - done - - # systemd checks (keep as in original) - case "$(readlink -f /sbin/init)" in - *systemd*) - # journal-like commands as functions (replaces zsh global aliases) - jctl() { journalctl -xe "$@"; } - jctlou() { sudo journalctl -b -n 200 -f "$@"; } - rpi() { systemctl --user restart wireplumber pipewire pipewire-pulse pipewire-jack "$@"; } - - # systemctl helpers - sctl() { systemctl "$@"; } # general wrapper - sctlss() { systemctl status "$@"; } - sctle() { systemctl enable "$@"; } - sctld() { systemctl disable "$@"; } - sctlr() { systemctl restart "$@"; } - sctls() { systemctl start "$@"; } - sctlt() { systemctl stop "$@"; } - sctldr() { systemctl daemon-reload "$@"; } - - tctl() { timedatectl "$@"; } - ;; - esac - - # navigation - alias ...='../..' - alias ....='../../..' - alias .....='../../../..' - - # bash profile helpers - alias sbp="source ~/.config/bash/bash_profile" - alias sbs="source ~/.config/bash/bashrc" - - # cd helpers - cf() { cd "$(dirname "$(readlink -f health.lua)")" || return; } - alias pd='cd -' - - # chmod helpers (keep behavior) - alias che='find . -type f -exec chmod +x {} \;' - # chfd: set directories 755, files 644 (safe implementation) - chfd() { find . -type d -exec chmod 755 {} \; -o -type f -exec chmod 644 {} \;; } - alias cx='chmod a+x' - alias 000='chmod -R 000' - alias 600='chmod -R 600' - alias 644='chmod -R 644' - alias 666='chmod -R 666' - alias 755='chmod -R 755' - alias 777='chmod -R 777' - - # copy / clipboard - # last command copy (approx): copy last history entry to clipboard - CC() { eval "$(fc -ln -1)" | xclip -selection clipboard; } - alias cp='cp -iv' - alias pwdc='pwd | xclip -selection clipboard' - - # count files/links/dirs - alias countfiles='for t in files links directories; do echo "$(find . -type ${t:0:1} | wc -l) $t"; done 2>/dev/null' - - # cpu usage - cpu() { awk '/^cpu /{usage=($2+$4)*100/($2+$4+$5)} END{printf "%.1f\n",usage}' /proc/stat; } - - # curl - alias curl='curl --silent --show-error' - alias clh='curl localhost:' - alias clh8='curl localhost:8080' - alias clh9='curl localhost:9080' - alias c100='curl 192.168.99.100:' - - # date - alias da="date '+%Y-%m-%d %A %T %Z'" - - # delete helpers - alias _fd='find . -type f -name "._*" -print0 | xargs -0 rm -f' - alias _fp='find . -type f -name "._*" -print' - - # diff - alias diff='diff --color' - - # disk - alias diskspace="du -S | sort -n -r | more" - alias folders="du -h --max-depth=1" - alias folderssort="find . -maxdepth 1 -type d -print0 | xargs -0 du -sk | sort -rn" - alias tree="tree -CAhF --dirsfirst" - alias treed="tree -CAFd" - alias mountedinfo="df -hT" - - # docker - alias dk='docker' - alias dkp='docker ps' - alias dkpa='docker ps -a' - alias dkpaq='docker ps -a -q' - alias dkb='docker build -t' - alias dkbnc='docker build --no-cache -t' - alias dkr='docker run --rm' - alias dkrti='docker run --rm -ti' - alias dkrd='docker run -d' - alias dkrp8='docker run --rm -p 8080:8080' - alias dkrp9='docker run --rm -p 9080:9080' - alias dks='docker start' - alias dkt='docker stop' - alias dktt='docker stop $(docker ps -q)' - alias dkk='docker kill' - alias dkkk='docker kill $(docker ps -q)' - alias dkrm='docker rm' - alias dkri='docker rmi' - alias dke='docker exec -ti' - alias dkl='docker logs -f' - alias dki='docker images' - alias dkpu='docker pull' - alias dkph='docker push' - alias dkin='docker inspect' - alias dkn='docker network' - alias dkc='docker-compose' - alias dkcu='docker-compose up' - alias dkclean='docker ps -q -a -f status=exited | xargs -r docker rm && docker images -q -f dangling=true | xargs -r docker rmi' - - # find - alias fdn='find . -name "' - f() { find . | grep "$*"; } - - # grep: replace zsh global and colored exclude - alias grep='grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn}' - alias grepi='grep -i' - alias grepr='grep -r' - alias grepri='grep -ri' - alias grepw='grep -R -i --include="*"' - alias grepb='grep -R -i --include="*" --exclude-dir="zsh"' - # global-like helpers implemented as functions that read stdin: - Gg() { grep "$@"; } # usage: somecommand | Gg pattern - Gi() { grep -i "$@"; } - GH() { grep -i "HTTP" "$@"; } - - # hash - alias h='hash -r' - - # hexdump - alias hx='hexdump -C' - - # history - Hgrep() { history | grep "$*"; } # note: alias h was used earlier; avoid conflict - - # ip - alias ip='ip -color=auto' - alias whatsmyip='curl -s ifconfig.me | xargs' - ipview() { netstat -anpl | grep :80 | awk '{print $5}' | cut -d':' -f1 | sort | uniq -c | sort -n | sed -e 's/^ *//' -e 's/ *$//'; } - - # killall - alias ka='killall' - alias k9='kill -9' - alias k15='kill -15' - - # logs - logs() { sudo find /var/log -type f -exec file {} \; | grep 'text' | cut -d' ' -f1 | sed -e 's/:$//g' | grep -v '[0-9]$' | xargs tail -f; } - - # ls: use eza if available else fallback to ls - if command -v eza >/dev/null 2>&1; then - alias l='eza --icons --group-directories-first' - alias la='eza --icons -aa --group-directories-first' - alias lh='eza --icons -aa --group-directories-first' - alias ll='eza -gl --icons --group-directories-first' - alias lla='eza -glaa --icons --group-directories-first' - alias lm='eza -glA --group-directories-first | more' - alias lr='eza --icons -R --group-directories-first' - alias ls='eza --icons -A --group-directories-first' - else - alias l='/usr/bin/ls -h --color=always --group-directories-first' - alias la='/usr/bin/ls -alh --color=always --group-directories-first' - alias ll='/usr/bin/ls -lh --color=always --group-directories-first' - alias lla='/usr/bin/ls -aFls --color=always --group-directories-first' - alias llf='/usr/bin/ls -Fls --color=always --group-directories-first' - alias lm='/usr/bin/ls -alh --color=always --group-directories-first | more' - alias lr='/usr/bin/ls -hlR --color=always --group-directories-first' - alias ls='/usr/bin/ls -AFh --color=always --group-directories-first' - fi - - # mime - alias mimereset='update-desktop-database ${XDG_DATA_HOME:-${HOME}/.local/share}/applications' - - # mkdir - alias mkdir='mkdir -pv' - function mkdir() { command mkdir -pv "$@"; } - - # modified commands (keep cautious variants) - alias grep="/usr/bin/grep $GREP_OPTIONS" - alias freshclam="sudo freshclam" - alias less="less -R" - alias multitail="multitail --no-repeat -c" - alias mv="mv -i" - alias ping="ping -c 10" - alias ps="ps auxf" - alias rm="rm -iv" - - # move - alias mv='mv -iv' - - # nginx - alias ngx="cd /etc/nginx" - - # vim helpers - alias v="$EDITOR" - alias 'v.'="$EDITOR ." - alias ve="$EDITOR -c enew" - vis() { $EDITOR '+set si' "$@"; } - vll() { lastfiles -l "$@"; } - vln() { $EDITOR -c "execute 'edit ' . v:oldfiles[0] | normal '0'" "$@"; } - - # ports - alias openports="netstat -nape --inet" - - # ps - alias ps='ps auxf' - alias psj='ps aux | grep "[j]ava"' - psg() { ps auxf | grep "$*"; } - alias topcpu='/bin/ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10' - - # python - alias py='python3' - - # realpath - alias rp='realpath' - - # remove - alias rm='rm -vI' - - # rsync - alias rsc='rsync -vrazPlu' - alias rscd='rsync -vrazPlu --delete' - alias rscr='rsync -vrazPlu --remove-source-files' - - # rules - alias rrr='sudo udevadm control --reload-rules' - - # scp - alias scp='scp -r' - - # sha1 - alias sha1='openssl sha1' - - # shell switching helpers (need sudo) - alias tobash="sudo chsh $USER -s /bin/bash && echo 'Now log out.'" - alias tozsh="sudo chsh $USER -s /bin/zsh && echo 'Now log out.'" - alias tofish="sudo chsh $USER -s /bin/fish && echo 'Now log out.'" - - # shellcheck - alias shck='shellcheck --color=always' - - # ref/shortcut loader (keep as in original) - ref() { bmshortcuts >/dev/null; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutenvrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc; } - - # sudo helpers - alias su='sudo su -l root' - sm() { rm -rf -- *.rej *.orig >/dev/null 2>&1 || true; } - smi() { rm -rf -- *.rej *.orig >/dev/null 2>&1; sudo make clean install; rm -f config.h; } - - # -------- suffix alias replacement: provide 'open' function ---------- - # zsh's "alias -s ext='cmd'" doesn't exist in bash. - # Use `open` (or 'of') to open files by extension: - openf() { - for f in "$@"; do - case "${f##*.}" in - pdf|PDF) mupdf "$f" & ;; - jpg|JPG|png|PNG) gpicview "$f" & ;; - ods|ODS|odt|ODT|odp|ODP|doc|DOC|docx|DOCX|xls|XLS|xlsx|XLSX|xlsm|XLSM|ppt|PPT|pptx|PPTX|csv|CSV) - libreoffice "$f" & ;; - html|HTML) chromium "$f" & ;; - mp4|MP4|mov|MOV|mkv|MKV) vlc "$f" & ;; - zip|ZIP|war|WAR) unzip -l "$f" ;; - jar|JAR) java -jar "$f" ;; - gz) tar -tf "$f" ;; - tgz|TGZ) tar -tf "$f" ;; - *) ${EDITOR:-vi} "$f" ;; - esac - done - } - alias of='openf' - alias open='openf' - - # tarring helpers - alias txf='tar -xf' - alias ttf='tar -tf' - alias mktar="tar -cvf" - alias mkbz2="tar -cvjf" - alias mkgz="tar -cvzf" - alias untar="tar -xvf" - alias unbz2="tar -xvjf" - alias ungz="tar -xvzf" - - # tmux - alias sts='tmux source $XDG_CONFIG_HOME/tmux/tmux.conf' - alias ta='tmux a' - alias tmc='tmuxcreate' - alias tmka='tmux kill-session -a' - alias tmls='tmux ls' - alias tmo='tmuxopen' - alias tmpk='command pkill tmux' - tm_new() { tmux new -s "$(basename "$PWD")"; } - alias tm.='tm_new' - - # trash - alias trd='trash-rm' - alias tre='trash-empty' - alias trl='trash-list' - alias trp='trash-put' - alias trr='trash-restore' - - # tree - alias tree='tree -a -I ".svn|.git|.hg|.idea"' - alias tree2='tree -L 2' - alias tree3='tree -L 3' - - # small unix helpers (converted global aliases -> functions) - md() { mkdir -p "$@"; } - wh() { which "$@"; } - wt() { while true; do "$@"; done } # usage differs from zsh's global alias - s1() { sleep 1; } - s2() { sleep 2; } - s01() { sleep 0.1; } - s05() { sleep 0.5; } - A1() { awk '{print $1}' "$@"; } - L() { less "$@"; } - H() { head "$@"; } - H2() { head -n 20 "$@"; } - X() { xargs -I@ "$@"; } # limited replacement - C() { xclip -selection clipboard "$@"; } - Fj() { jq . "$@"; } - Fy() { yq . "$@"; } - Fx() { xmllint --format "$@"; } - V() { vim - "$@"; } - - # unzip - alias uz='unzip' - alias uzl='unzip -l' - - # vim - alias vi='vim' - alias 'vi.'='vim .' - - # watch - alias w1='watch -n 1' - - # wget - # keep hsts path variable - alias wget="wget --hsts-file='${XDG_CACHE_HOME:-${HOME}/.cache}/wget-hsts'" - - # xprop helper - progn() { xprop | awk '/^WM_CLASS/{sub(/.* = /, "instance:"); sub(/, /, "\nclass:"); print} /^WM_NAME/{sub(/.* = /, "title:"); print}'; } - - # zsh sourcing helpers (just source config) - sps() { source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile; } - szs() { source ${XDG_CONFIG_HOME:-${HOME}/.config}/zsh/.zshrc; } -else - # ------------------------------ - # ZSH-compatible aliases & functions - # ------------------------------ - # sudo not required for some system commands - for command in blkid lsblk mount umount dnf poweroff reboot shutdown su updatedb; do - alias $command="sudo $command" - done - unset command - - case "$(readlink -f /sbin/init)" in - *systemd*) - # journal - alias -g jctl='journalctl -xe' - alias -g jctlou='sudo journalctl -b -n 200 -f' - alias -g rpi='systemctl --user restart wireplumber pipewire pipewire-pulse pipewire-jack' - alias -g sctl='systemctl' - alias -g sctlss='systemctl status' - alias -g sctle='systemctl enable' - alias -g sctld='systemctl disable' - alias -g sctlr='systemctl restart' - alias -g sctls='systemctl start' - alias -g sctlt='systemctl stop' - alias -g sctldr='systemctl daemon-reload' - alias -g tctl='timedatectl' - ;; - esac - - # Go back - alias ...='../..' - alias ....='../../..' - alias .....='../../../..' - - # bash - alias sbp="source ~/.config/bash/bash_profile" - alias sbs="source ~/.config/bash/bashrc" - - # cd - alias cf='cd "$(dirname "$(readlink -f health.lua)")"' - alias pd='cd -' - - # chmod - alias che='find . -type f -exec chmod +x {};' - alias chfd='find . -type d -exec chmod 755 {}; -o -type f -exec chmod 644 {};' - alias cx='chmod a+x' - alias 000='chmod -R 000' - alias 600='chmod -R 600' - alias 644='chmod -R 644' - alias 666='chmod -R 666' - alias 755='chmod -R 755' - alias 777='chmod -R 777' - - # copy - alias CC='$(fc -l -n -1) | xclip -selection clipboard' - ialias cp='cp -iv' - alias pwdc='pwd | xclip -selection clipboard' - - # count - alias countfiles="for t in files links directories; do echo \`find . -type \${t:0:1} | wc -l\` \$t; done 2> /dev/null" - - # cpu - alias cpu="grep 'cpu ' /proc/stat | awk '{usage=(\$2+\$4)*100/(\$2+\$4+\$5)} END {print usage}' | awk '{printf(\"%.1f\n\", \$1)}'" - - # curl - ialias curl='curl --silent --show-error' - balias clh='curl localhost:' - balias clh8='curl localhost:8080' - balias clh9='curl localhost:9080' - balias c100='curl 192.168.99.100:' - - # date - alias da="date '+%Y-%m-%d %A %T %Z'" - - # delete - alias _fd='find . -type f -name "._*" -print0 | xargs -0 rm -f' - alias _fp='find . -type f -name "._*" -print' - - # diff - ialias diff='diff --color' - - # disk - alias diskspace="du -S | sort -n -r |more" - alias folders="du -h --max-depth=1" - alias folderssort="find . -maxdepth 1 -type d -print0 | xargs -0 du -sk | sort -rn" - alias tree="tree -CAhF --dirsfirst" - alias treed="tree -CAFd" - alias mountedinfo="df -hT" - - # docker - alias dk='docker' - alias dkp='docker ps' - alias dkpa='docker ps -a' - alias dkpaq='docker ps -a -q' - alias dkb='docker build -t' - alias dkbnc='docker build --no-cache -t' - alias dkr='docker run --rm' - alias dkrti='docker run --rm -ti' - alias dkrd='docker run -d' - alias dkrp8='docker run --rm -p 8080:8080' - alias dkrp9='docker run --rm -p 9080:9080' - alias dks='docker start' - alias dkt='docker stop' - alias dktt='docker stop $(docker ps -q)' - alias dkk='docker kill' - alias dkkk='docker kill $(docker ps -q)' - alias dkrm='docker rm' - alias dkri='docker rmi' - alias dke='docker exec -ti' - alias dkl='docker logs -f' - alias dki='docker images' - alias dkpu='docker pull' - alias dkph='docker push' - alias dkin='docker inspect' - alias dkn='docker network' - alias dkc='docker-compose' - alias dkcu='docker-compose up' - alias dkclean='docker ps -q -a -f status=exited | xargs -r docker rm && docker images -q -f dangling=true | xargs -r docker rmi' - - # find - balias fdn='find . -name "' - alias f="find . | grep " - - # grep - ialias -g grep='grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn}' - alias grepi='grep -i' - alias grepr='grep -r' - alias grepri='grep -ri' - alias grepw='grep -R -i --include="*"' - alias grepb='grep -R -i --include="*" --exclude-dir="zsh"' - alias -g Gg='| grep' - alias -g Gi='| grep -i' - alias -g GH='| grep HTTP' - - # hash - alias h='hash -rf' - - # hexdump - alias hx='hexdump -C' - - # history - alias h="history | grep " - - # ip - ialias ip='ip -color=auto' - alias whatsmyip='curl -s ifconfig.me | xargs' - alias ipview="netstat -anpl | grep :80 | awk '{print $5}' | cut -d':' -f1 | sort | uniq -c | sort -n | sed -e 's/^ *//' -e 's/ *$//'" - - # killall - alias ka='killall' - alias k9='kill -9' - alias k15='kill -15' - - # logs - alias logs="sudo find /var/log -type f -exec file {} \; | grep 'text' | cut -d' ' -f1 | sed -e's/:$//g' | grep -v '[0-9]$' | xargs tail -f" - - # ls: eza or built-in - [ -x "$(command -v eza)" ] && { - ialias l='eza --icons --group-directories-first' - ialias la='eza --icons -aa --group-directories-first' - ialias lh='eza --icons -aa --group-directories-first' - ialias ll='eza -gl --icons --group-directories-first' - ialias lla='eza -glaa --icons --group-directories-first' - ialias lm='eza -glA --group-directories-first | more' - ialias lr='eza --icons -R --group-directories-first' - ialias ls='eza --icons -A --group-directories-first' - ialias lsb='eza --icons -b --group-directories-first' - ialias lsby='eza --icons -B --group-directories-first' - ialias lld='eza --icons -Dl --group-directories-first' - ialias llda='eza --icons -aaDl --group-directories-first' - ialias llf='eza --icons -fl' - ialias llfa='eza --icons -aafl' - ialias llsa='eza --icons -l -s=accessed' - ialias llsaa='eza --icons -aal -s=accessed' - ialias llsc='eza --icons -l -s=created' - ialias llsca='eza --icons -aal -s=created' - ialias llse='eza --icons -l -s=extension' - ialias llsea='eza --icons -aal -s=extension' - ialias llsm='eza --icons -l -s=modified' - ialias llsma='eza --icons -aal -s=modified' - ialias llsn='eza --icons -l -s=name' - ialias llsna='eza --icons -aal -s=name' - ialias llss='eza --icons -l -s=size' - ialias llssa='eza --icons -aal -s=size' - ialias llst='eza --icons -l -s=type' - ialias llsta='eza --icons -aal -s=type' - ialias lt='eza --icons -T -L' - ialias ltd='eza --icons -TD -L' - ialias ltdr='eza --icons -TDr -L' - ialias ltr='eza --icons -Tr -L' - } || { - ialias l='/usr/bin/ls -h --color=always --group-directories-first' - ialias la='/usr/bin/ls -alh --color=always --group-directories-first' - ialias ll='/usr/bin/ls -lh --color=always --group-directories-first' - ialias lla='/usr/bin/ls -aFls --color=always --group-directories-first' - ialias llf='/usr/bin/ls -Fls --color=always --group-directories-first' - ialias lm='/usr/bin/ls -alh --color=always --group-directories-first | more' - ialias lr='/usr/bin/ls -hlR --color=always --group-directories-first' - ialias lra='/usr/bin/ls -ahlR --color=always --group-directories-first' - ialias ls='/usr/bin/ls -AFh --color=always --group-directories-first' - ialias llsa='/usr/bin/ls -hlru --color=always --group-directories-first' - ialias llsc='/usr/bin/ls -hclr --color=always --group-directories-first' - ialias lld='/usr/bin/ls -l --color=always | grep "^d"' - ialias llda='/usr/bin/ls -la --color=always | grep "^d"' - ialias llse='/usr/bin/ls -BhlX --color=always --group-directories-first' - ialias llsf='/usr/bin/ls -l --color=always | grep -v "^d"' - ialias llsfa='/usr/bin/ls -la --color=always | grep -v "^d"' - ialias llsm='/usr/bin/ls -hlr --time=ctime --color=always --group-directories-first' - ialias llsn='/usr/bin/ls -alp --color=always --group-directories-first' - ialias llss='/usr/bin/ls -hlrS --color=always --group-directories-first' - ialias llst='/usr/bin/ls -hlrt --color=always --group-directories-first' - ialias lw='/usr/bin/ls -Ahx --color=always --group-directories-first' - } - - # mime - alias mimereset="update-desktop-database ${XDG_DATA_HOME:-${HOME}/.local/share}/applications" - - # mkdir - ialias mkdir='mkdir -pv' - - # modified commands - alias grep="/usr/bin/grep $GREP_OPTIONS" - alias cp="cp -i" - alias freshclam="sudo freshclam" - alias less="less -R" - alias mkdir="mkdir -p" - alias multitail="multitail --no-repeat -c" - alias mv="mv -i" - alias ping="ping -c 10" - alias ps="ps auxf" - alias rm="rm -iv" - - # move - ialias mv='mv -iv' - - # nginx - alias ngx="cd /etc/nginx" - - # vim - alias v='$EDITOR' - alias v.='$EDITOR .' - alias ve='$EDITOR -c enew' - alias vis="$EDITOR '+set si'" - alias vll='lastfiles -l' - alias vln='$EDITOR -c '\''execute "edit " . v:oldfiles[0] | normal ''0'\' - - # ports - alias openports="netstat -nape --inet" - - # ps - ialias ps='ps auxf' - alias psj='ps aux | grep "[j]ava"' - balias psg='ps auxf | grep' - alias topcpu='/bin/ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10' - - # python - alias py='python3' - - # realpath - alias rp='realpath' - - # remove - ialias rm='rm -vI' - - # rsync - alias rsc='rsync -vrazPlu' - alias rscd='rsync -vrazPlu --delete' - alias rscr='rsync -vrazPlu --remove-source-files' - - # rules - alias rrr='sudo udevadm control --reload-rules' - - # scp - ialias scp='scp -r' - - # sha1 - alias sha1='openssl sha1' - - # shell - alias tobash="sudo chsh $USER -s /bin/bash && 'Now log out.'" - alias tozsh="sudo chsh $USER -s /bin/zsh && 'Now log out.'" - alias tofish="sudo chsh $USER -s /bin/fish && 'Now log out.'" - - # shellcheck - alias shck='shellcheck --color=always' - - # shortcut - alias ref='bmshortcuts >/dev/null; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutenvrc; source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc' - - # sudo - alias su='sudo su -l root' - alias sm='setopt no_nomatch && rm -rf *.rej *.orig >/dev/null 2>&1' - alias smi='setopt no_nomatch && rm -rf *.rej *.orig >/dev/null 2>&1 && unsetopt no_nomatch; sudo make clean install; rm -f config.h' - - # suffix - alias -s {pdf,PDF}='background mupdf' - alias -s {jpg,JPG,png,PNG}='background gpicview' - alias -s {ods,ODS,odt,ODT,odp,ODP,doc,DOC,docx,DOCX,xls,XLS,xlsx,XLSX,xlsm,XLSM,ppt,PPT,pptx,PPTX,csv,CSV}='background libreoffice' - alias -s {html,HTML}='background chromium' - alias -s {mp4,MP4,mov,MOV,mkv,MKV}='background vlc' - alias -s {zip,ZIP,war,WAR}="unzip -l" - alias -s {jar,JAR}="java -jar" - alias -s gz="tar -tf" - alias -s {tgz,TGZ}="tar -tf" - - # tar - alias txf='tar -xf' - alias ttf='tar -tf' - alias mktar="tar -cvf" - alias mkbz2="tar -cvjf" - alias mkgz="tar -cvzf" - alias untar="tar -xvf" - alias unbz2="tar -xvjf" - alias ungz="tar -xvzf" - - # tmux - alias sts='tmux source $XDG_CONFIG_HOME/tmux/tmux.conf' - alias ta='tmux a' - alias tmc='tmuxcreate' - alias tmka='tmux kill-session -a' - alias tmls='tmux ls' - alias tmo='tmuxopen' - alias tmpk='command pkill tmux' - alias tm.='tmux new -s "$(basename $PWD)"' - - # tor - alias torh="cat /var/lib/tor/hidden_service/hostname" - - # trash - alias trd='trash-rm' - alias tre='trash-empty' - alias trl='trash-list' - alias trp='trash-put' - alias trr='trash-restore' - - # tree - ialias tree='tree -a -I ".svn|.git|.hg|.idea"' - alias tree2='tree -L 2' - alias tree3='tree -L 3' - - # unix - alias -g md='mkdir -p' - alias -g wh='which' - alias -g wt='while true; do' - alias -g s1='sleep 1' - alias -g s2='sleep 2' - alias -g s01='sleep 0.1' - alias -g s05='sleep 0.5' - alias -g A1="| awk '{print \$1}'" - alias -g L='| less' - alias -g H='| head' - alias -g H2='| head -n 20' - alias -g X='| xargs -I@' - alias -g C='| xclip -selection clipboard' - alias -g Fj='| jq .' - alias -g Fy='| yq .' - alias -g Fx='| xmllint --format -' - alias -g V='| vim -' - - # unzip - alias uz='unzip' - alias uzl='unzip -l' - - # vim - alias vi='vim' - alias vi.='vim .' - - # watch - alias w1='watch -n 1' - - # wget - ialias wget --hsts-file="${XDG_CACHE_HOME:-${HOME}/.cache}/wget-hsts" - - # xprog - alias progn='xprop | awk '\''/^WM_CLASS/{sub(/.* = /, "instance:"); sub(/, /, "\nclass:"); print} /^WM_NAME/{sub(/.* = /, "title:"); print}'\''' - - # zsh - alias sps="source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile" - alias szs="source ${XDG_CONFIG_HOME:-${HOME}/.config}/zsh/.zshrc" -fi diff --git a/fedora/.config/shell/bm-dirs b/fedora/.config/shell/bm-dirs deleted file mode 100644 index 72558e9..0000000 --- a/fedora/.config/shell/bm-dirs +++ /dev/null @@ -1,36 +0,0 @@ -# Keys Filename -bb ${XDG_SCRIPTS_HOME:-${HOME}/.local/bin} -btp ${XDG_SCRIPTS_HOME:-${HOME}/.local/bin}/tmux -bz ${XDG_SCRIPTS_HOME:-${HOME}/.local/bin}/zsh -cac ${XDG_CACHE_HOME:-${HOME}/.cache} -cbc ${XDG_CONFIG_HOME:-${HOME}/.config}/bash -cfg ${XDG_CONFIG_HOME:-${HOME}/.config} -cgc ${XDG_CONFIG_HOME:-${HOME}/.config}/git -csh ${XDG_CONFIG_HOME:-${HOME}/.config}/shell -ctm ${XDG_CONFIG_HOME:-${HOME}/.config}/tmux -cts ${XDG_CONFIG_HOME:-${HOME}/.config}/TheSiahxyz -cvc ${XDG_CONFIG_HOME:-${HOME}/.config}/vim -czc ${XDG_CONFIG_HOME:-${HOME}/.config}/zsh -Esm /etc/samba -gdc ${XDG_DOCUMENTS_DIR:-${HOME}/Documents} -gdk ${XDG_DESKTOP_DIR:-${HOME}/Desktop} -gdn ${XDG_DOWNLOAD_DIR:-${HOME}/Downloads} -gdo ${XDG_DOTFILES_DIR:-${HOME}/.dotfiles} -gmu ${XDG_MUSIC_DIR:-${HOME}/Music} -gpb ${XDG_PUBLICSHARE_DIR:-${HOME}/Public} -gpp ${XDG_PICTURES_DIR:-${HOME}/Pictures} -gpv $HOME/Private -grr ${XDG_PICTURES_DIR:-${HOME}/Pictures}/resources -gss ${XDG_PICTURES_DIR:-${HOME}/Pictures}/screenshots -gvv ${XDG_VIDEOS_DIR:-${HOME}/Videos} -Hme /media/$USER -Hmt /mnt -pae ${PASSWORD_STORE_DIR:-$XDG_DATA_HOME/.password-store}/exported_keys -pah ${PASSWORD_STORE_DIR:-$XDG_DATA_HOME/.password-store}/ssh -pas ${PASSWORD_STORE_DIR:-$XDG_DATA_HOME/.password-store} -shh ${XDG_DATA_HOME:-${HOME}/.local/share}/history -shr ${XDG_DATA_HOME:-${HOME}/.local/share} -shv ${XDG_DATA_HOME:-${HOME}/.local/share}/venvs -sr ${XDG_SOURCES_HOME:-${HOME}/.local/src} -trs ${XDG_DATA_HOME:-${HOME}/.local/share}/Trash/files -tt ${XDG_STATE_HOME:-${HOME}/.local/state} diff --git a/fedora/.config/shell/bm-files b/fedora/.config/shell/bm-files deleted file mode 100644 index a7ee21d..0000000 --- a/fedora/.config/shell/bm-files +++ /dev/null @@ -1,19 +0,0 @@ -# Keys Filename Description -vbc ${XDG_CONFIG_HOME:-${HOME}/.config}/bash/bashrc # Bash (shell) config -vbd ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/bm-dirs # A list of bookmarked directories similar to this file -vbf ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/bm-files # This file, a list of bookmarked files -vbi ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/inputrc # This file is for gnu readline -vbp ${XDG_CONFIG_HOME:-${HOME}/.config}/bash/bash_profile # Bash profile -vga ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/git-aliasrc # Git aliases -vgc ${XDG_CONFIG_HOME:-${HOME}/.config}/git/config # Git config -vgi ${XDG_CONFIG_HOME:-${HOME}/.config}/git/ignore # Git ignore -Vsm /etc/samba/smb.conf # Samba config -vsa ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc # Aliases used by shell (and potentially other shells) -vsp ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile # Shell profile used for system -vtm ${XDG_CONFIG_HOME:-${HOME}/.config}/tmux/tmux.conf # Tmux config -vvc ${XDG_CONFIG_HOME:-${HOME}/.config}/vim/vimrc # Vim config -vvi ${XDG_CONFIG_HOME:-${HOME}/.config}/vim/init.vim # Vim init -vvp ${XDG_CONFIG_HOME:-${HOME}/.config}/vim/plugins.vim # Vim plugins -vzc ${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/.zshrc # Zsh config -vzk ${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/keymaps.zsh # Zsh keymaps -vzs ${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/scripts.zsh # Zsh scripts diff --git a/fedora/.config/shell/profile b/fedora/.config/shell/profile deleted file mode 100644 index a8603e8..0000000 --- a/fedora/.config/shell/profile +++ /dev/null @@ -1,263 +0,0 @@ -################################################### -### --- PROFILE --- ### -################################################### -[ "$(tty)" = "/dev/tty1" ] && set -e # Exit immediately if a command exits with a non-zero status. - -################################################### -### --- ENV PATH --- ### -################################################### -# Add all directories in each subdirectory to $PATH -export PATH="$(find ~/.local/bin -path '*/.git*' -prune -o \( -type f -o -type l \) -perm -u=x -exec dirname {} \; | sort -u | paste -sd ':' -):$PATH" -export PATH="$(find ~/.local/share/.password-store -type d -name '.extensions' | paste -sd ':' -):$PATH" -command -v asdf >/dev/null 2>&1 && export PATH="$(find -L ~/.local/share/asdf/installs -name bin -type d -print 2>/dev/null | sort -u | paste -s -d ':' -):$PATH" -command -v npm >/dev/null 2>&1 && export PATH="$(find -L ~/.local/share/npm -name bin -type d -print 2>/dev/null | sort -u | paste -s -d ':' -):$PATH" - -unsetopt PROMPT_SP 2>/dev/null - -################################################### -### --- DEFAULT PROGRAMS --- ### -################################################### -export BROWSER=$(command -v librewolf || command -v firefox || command -v qutebrowser) -export EDITOR="nvim" -export EDITOR2="vim" -# export FILE_MANAGER="lf $(lf -version)" -export FILE_MANAGER="yazi $(yazi --version)" -export KEYTIMEOUT=10 -export SUDO_EDITOR=$EDITOR -export SUDO_ASKPASS="$HOME/.local/bin/dmenupass" -export TERM="xterm-256color" -export TERMINAL="st" -export TERMINAL_PROG="st" -export VISUAL=$EDITOR - -################################################### -### --- XDG ENV PATHES --- ### -################################################### -### --- XDG DEFAULT --- ### -export XDG_CACHE_HOME="$HOME/.cache" -export XDG_CONFIG_HOME="$HOME/.config" -export XDG_DATA_HOME="$HOME/.local/share" -export XDG_STATE_HOME="$HOME/.local/state" - -### --- XDG CUSTOMS --- ### -export XDG_DOTFILES_DIR="$HOME/.dotfiles" -export XDG_SCRIPTS_HOME="$HOME/.local/bin" -export XDG_SOURCES_HOME="$HOME/.local/src" -export XDG_DESKTOP_DIR="$HOME/Desktop" -export XDG_DOCUMENTS_DIR="$HOME/Documents" -export XDG_DOWNLOAD_DIR="$HOME/Downloads" -export XDG_MUSIC_DIR="$HOME/Music" -export XDG_PICTURES_DIR="$HOME/Pictures" -export XDG_PUBLICSHARE_DIR="$HOME/Public" -export XDG_TEMPLATES_DIR="$HOME/Templates" -export XDG_VIDEOS_DIR="$HOME/Videos" - -################################################### -### --- DEFAULT ENV PATHES FOR ALL PROGRAMS --- ### -################################################### -### --- ANDROID --- ### -export ANDROID_SDK_HOME="$XDG_CONFIG_HOME/android" - -### --- ANSIBLE --- ### -export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible/ansible.cfg" - -### --- BAT --- ### -export BAT_CONFIG_PATH="$XDG_CONFIG_HOME/bat/config" - -### --- CARGO --- ### -export CARGO_HOME="$XDG_DATA_HOME/cargo" - -### --- DICS --- ### -export DICS="/usr/share/stardict/dic/" - -### --- ELECTRUM --- ### -export ELECTRUMDIR="$XDG_DATA_HOME/electrum" - -### --- FCITX5 --- ### -export GTK_IM_MODULE=fcitx -export QT_IM_MODULE=fcitx -export XMODIFIERS=@im=fcitx - -### --- FZF --- ### -export FZF_ALT_C_COMMAND="fd --type d . --color=never --hidden" -export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -50'" -export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" -export FZF_CTRL_T_OPTS="--preview 'bat --color=always --line-range :50 {}' --preview-window 'right:45%'" -# export FZF_DEFAULT_OPTS="--no-height --color=bg+:#343d46,gutter:-1,pointer:#ff3c3c,info:#0dbc79,hl:#0dbc79,hl+:#23d18b" -export FZF_DEFAULT_OPTS="--reverse --height 60% --color=bg+:#343d46,gutter:-1,pointer:#ff3c3c,info:#0dbc79,hl:#0dbc79,hl+:#23d18b" - -### --- FORGIT --- ### -export FORGIT_CHECKOUT_BRANCH_BRANCH_GIT_OPTS='--sort=-committerdate' -export FORGIT_COPY_CMD='xclip -selection clipboard' - -### --- GEM --- ### -export GEMRC="$HOME/.config/gem/gemrc" -export GEM_HOME="$XDG_DATA_HOME/gem" -export GEM_PATH="$GEM_HOME" - -### --- GO --- ### -export GOMODCACHE="$XDG_CACHE_HOME/go/mod" -export GOPATH="$XDG_SCRIPTS_HOME/go" - -### --- GTK --- ### -export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0":"$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0.mine" - -### --- HISTORY --- ### -export HISTFILE="$XDG_DATA_HOME/history/sh_history" - -### --- INPUTRC --- ### -export INPUTRC="$XDG_CONFIG_HOME/shell/inputrc" - -### --- JAVA --- ### -export AWT_TOOLKIT="MToolkit wmname LG3D" # May have to install wmname -export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm - -### --- Jupyter --- ### -export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME/jupyter" -export JUPYTER_PLATFORM_DIRS="1" - -### --- KODI --- ### -export KODI_DATA="$XDG_DATA_HOME/kodi" - -### --- LYNX --- ### -export LYNX_CFG="$HOME/.config/lynx/lynx.cfg" -export LYNX_LSS="$HOME/.config/lynx/lynx.lss" -export LYNX_CFG_PATH="$XDG_CONFIG_HOME/lynx" - -### --- MANPAGER --- ### -([ -x "$(command -v batcat)" ] || [ -x "$(command -v batman)" ]) && { - export MANPAGER="sh -c 'col -bx | bat -l man -p'" - export MANROFFOPT="-c" -} || { - export MANPAGER='less -s' - export LESS="R" - export LESS_TERMCAP_mb="$(printf '%b' '')" - export LESS_TERMCAP_md="$(printf '%b' '')" - export LESS_TERMCAP_me="$(printf '%b' '')" - export LESS_TERMCAP_so="$(printf '%b' '')" - export LESS_TERMCAP_se="$(printf '%b' '')" - export LESS_TERMCAP_us="$(printf '%b' '')" - export LESS_TERMCAP_ue="$(printf '%b' '')" - export LESSOPEN="| lesspipe.sh %s" -} - -### --- MBSYNC --- ### -export MBSYNCRC="$XDG_CONFIG_HOME/mbsync/config" - -### --- MOZILLA --- ### -export MOZ_USE_XINPUT2=1 # Mozilla smooth scrolling/touchpads. - -### --- MYSQL --- ### -export MYSQL_HISTFILE="$XDG_DATA_HOME/history/mysql_history" - -### --- NODE.JS --- ### -export NODE_REPL_HISTORY="$XDG_DATA_HOME/history/node_repl_history" - -### --- NOTMUCH --- ### -export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch/config" - -### --- NPM --- ### -export NPM_CONFIG_USERCONFIG="~/.config/npm/.npmrc" - -### --- NVM --- ### -export NVM_DIR="$XDG_CONFIG_HOME/nvm" - -### --- PAM GNUPG --- ### -# export GNUPGHOME="$XDG_DATA_HOME/gnupg" - -### --- PASSWORD STORE --- ### -export PASSWORD_STORE_DIR="$XDG_DATA_HOME/.password-store" -export PASSWORD_STORE_CLIP_TIME=180 # Specifies the number of seconds to wait before restoring the clipboard, by default 45 seconds. -# export PASSWORD_STORE_GENERATED_LENGTH=18 # by default 25. -# export PASSWORD_STORE_CHARACTER_SET='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+[]{};:,.<>?' -# export PASSWORD_STORE_CHARACTER_SET_NO_SYMBOLS='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+[]{};:,.<>?' -export PASSWORD_STORE_ENABLE_EXTENSIONS="true" -# export PASSWORD_STORE_EXTENSIONS_DIR="$PASSWORD_STORE_DIR/.extensions" -# export BASH_COMPLETION_USER_DIR=$XDG_DATA_HOME/bash-completion/completions - -### --- PHP --- ### -export PHP_HISTFILE="$XDG_STATE_HOME/history/php_history" - -### --- POSTGRESQL --- ### -export PSQLRC="$XDG_CONFIG_HOME/pg/psqlrc" -export PSQL_HISTORY="$XDG_STATE_HOME/history/psql_history" -export PGPASSFILE="$XDG_CONFIG_HOME/pg/pgpass" -export PGSERVICEFILE="$XDG_CONFIG_HOME/pg/pg_service.conf" - -### --- POWERLEVEL10K --- ### -export POWERLEVEL9K_INSTALLATION_DIR="/usr/share/zsh-theme-powerlevel10k" - -### --- PYTHON --- ### -export PYTHON_HISTORY="$XDG_DATA_HOME/history/python_history" -export PYTHONPYCACHEPREFIX="$XDG_CACHE_HOME/python" -export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/pythonrc" -export PIPX_BIN_DIR="$XDG_SCRIPTS_HOME" -export PIPX_MAN_DIR="$XDG_DATA_HOME/man" - -### --- QT --- ### -export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme. - -### --- RUST --- ### -export RUSTUP_HOME="$XDG_DATA_HOME/rustup" - -### --- SERVER --- ### -export THESIAH="thesiah.xyz" -export THESIAH_GIT="git@$THESIAH" -export THESIAH_SERVER="root@$THESIAH" -export THESIAH_VPN="${THESIAH%%.*}" -export THESIAH_WWW="$HOME/Private/repos/THESIAH" - -### --- SQLITE --- ### -export SQLITE_HISTORY="$XDG_DATA_HOME/history/sqlite_history" - -### --- STARSHIP --- ### -export STARSHIP_CONFIG="$XDG_CONFIG_HOME/starship/starship.toml" - -### --- TMUX --- ### -export TMUX_TMPDIR="$XDG_RUNTIME_DIR" - -### --- UNISON --- ### -export UNISON="$XDG_DATA_HOME/unison" - -### --- VIM --- ### -# export GVIMINIT='let $MYGVIMRC = !has("nvim") ? "$XDG_CONFIG_HOME/vim/gvimrc" : "$XDG_CONFIG_HOME/nvim/init.lua" | so $MYGVIMRC' -# export VIMINIT='let $MYVIMRC = !has("nvim") ? "$XDG_CONFIG_HOME/vim/vimrc" : "$XDG_CONFIG_HOME/nvim/init.lua" | so $MYVIMRC' - -### --- VIRTUAL ENVIRONMENT --- ### -export WORKON_HOME="$XDG_DATA_HOME/venvs" - -### --- VISUAL STUDIO CODE --- ### -export VSCODE_PORTABLE="$XDG_DATA_HOME/vscode" - -### --- WEBKIT --- ### -export WEBKIT_DISABLE_COMPOSITING_MODE=1 - -### --- WINE --- ### -export WINEPREFIX="$XDG_DATA_HOME/wine" -export WINEDLLOVERRIDES="winemenubuilder.exe=d" - -### --- WGET --- ### -export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc" - -### --- W3M --- ### -export W3M_DIR="$XDG_STATE_HOME/w3m" - -### --- X11 --- ### -export XINITRC="$XDG_CONFIG_HOME/x11/xinitrc" -export XSERVERRC="$XDG_CONFIG_HOME/X11/xserverrc" - -### --- XAUTH --- ### -export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs. - -### --- ZSH --- ### -export ZDOTDIR="$XDG_CONFIG_HOME/zsh" -export ZPLUGINDIR="$XDG_SCRIPTS_HOME/zsh" - -### --- SDCV --- ### -export STARDICT_DATA_DIR="$XDG_DATA_HOME/dic" -export STARDICT_HISTFILE="$XDG_DATA_HOME/history/dic" -export SDCV_PAGER='less --quit-if-one-screen -RX' - -### --- SHORTCUTS --- ### -[ ! -f "$XDG_CONFIG_HOME/shell/shortcutrc" ] && setsid -f shortcuts >/dev/null 2>&1 - diff --git a/fedora/.config/tmux/tmux.conf b/fedora/.config/tmux/tmux.conf deleted file mode 100644 index 3b78628..0000000 --- a/fedora/.config/tmux/tmux.conf +++ /dev/null @@ -1,91 +0,0 @@ -### --- Settings --- ### -# general -set -as terminal-features 'xterm*:extkeys' -set -g base-index 1 -set -g pane-base-index 1 -set -g default-shell /bin/bash -set -g detach-on-destroy off -set -s extended-keys on -set -g focus-events on -set -g history-limit 1000000 -set -g mouse on -set -g renumber-windows on -set -g set-clipboard on -set -g xterm-keys on -set -gq allow-passthrough on -set -ga update-environment TERM -set -ga update-environment TERM_PROGRAM -set -sg escape-time 0 -setw -g mode-keys vi -setw -g aggressive-resize on - -# activity -set -g monitor-activity on -set -g visual-activity off - -# color -set -g default-terminal "xterm-256color" -set -ga terminal-overrides ',xterm-256color:Tc' -set -sa terminal-features ',xterm-256color:RGB' - -# status -set -g status-interval 1 -set -g status-justify absolute-centre -set -g status-left "" -set -g status-left-length 10 -set -g status-position top -set -g status-right "" -set -g status-style "bg=default" - - -### --- Key Bindings --- ### -# clear -bind 'l' "send-keys C-l; send-keys -R; clear-history" - -# copy-mode -bind 'v' copy-mode - -# pane -bind '%' split-window -h -c '#{pane_current_path}' -bind '"' split-window -v -c '#{pane_current_path}' -bind '|' split-window -h -bind '-' split-window -v -bind -r 'C-down' resize-pane -D 5 -bind -r 'C-up' resize-pane -U 5 -bind -r 'C-left' resize-pane -L 5 -bind -r 'C-right' resize-pane -R 5 -bind '@' choose-window 'join-pane -h -s "%%"' -bind '#' choose-window 'join-pane -s "%%"' -bind 'x' kill-pane -bind 'a' kill-pane -a -bind 'X' kill-window -bind 'A' kill-window -a -bind -n 'M-k' move-pane -h -t '.{up-of}' -bind -n 'M-l' move-pane -t '.{right-of}' -bind -n 'M-h' move-pane -t '.{left-of}' -bind -n 'M-j' move-pane -h -t '.{down-of}' - -# prefix -unbind 'C-b' -set -g prefix 'C-Space' -bind 'C-Space' send-prefix - -# reload -unbind 'r' -bind 'r' source-file "~/.config/tmux/tmux.conf" - -# session -bind -r '(' switch-client -p \; refresh-client -S -bind -r ')' switch-client -n \; refresh-client -S -bind -nr 'M-<' switch-client -p \; refresh-client -S -bind -nr 'M->' switch-client -n \; refresh-client -S -bind "'" switch-client -t'{marked}' -bind -r 'BSpace' switch-client -l - -# window -bind -r '<' swap-window -d -t -1 -bind -r '>' swap-window -d -t +1 -bind -nr 'M-,' previous-window \; refresh-client -S -bind -nr 'M-.' next-window \; refresh-client -S -bind 'c' new-window -c "#{pane_current_path}" -bind -nr 'M-BSpace' last-window diff --git a/fedora/.config/vim/UltiSnips/all.snippets b/fedora/.config/vim/UltiSnips/all.snippets deleted file mode 100644 index cf55536..0000000 --- a/fedora/.config/vim/UltiSnips/all.snippets +++ /dev/null @@ -1,30 +0,0 @@ -# place your snippets# symbols -snippet .- "โ€ข " w -โ€ข -endsnippet - -snippet .v "โœ“" w -โœ“ -endsnippet - - -# functions -snippet datek "Date (Korean format)" w -`!v strftime("%Y.%m.%d")` -endsnippet - -snippet datea "Date (American format)" w -`!v strftime("%m.%d.%Y")` -endsnippet - -snippet unix "Unix timestamp" w -`date +%s` -endsnippet - -snippet file "file name" w -`!v expand('%:t')` -endsnippet - -snippet path "absolute file path" w -`!v expand('%:p')` -endsnippet diff --git a/fedora/.config/vim/init.vim b/fedora/.config/vim/init.vim deleted file mode 100644 index 4104ba3..0000000 --- a/fedora/.config/vim/init.vim +++ /dev/null @@ -1,47 +0,0 @@ -" AUTOCMD ---------------------------------------------------------------- {{{ - -" Close with q -autocmd FileType checkhealth,help,lspinfo,neotest-output,neotest-output-panel,neotest-summary,netrw,notify,qf,query,spectre_panel,startuptime,terminal,tsplayground noremap q :bd - -" Disables automatic commenting on newline: -autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o - -" Nerd tree -autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif - -" Text files -autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff -autocmd BufRead,BufNewFile *.tex set filetype=tex - -" Automatically deletes all trailing whitespace and newlines at end of file on save. & reset cursor position -autocmd BufWritePre * let currPos = getpos(".") -autocmd BufWritePre * %s/\s\+$//e -autocmd BufWritePre * %s/\n\+\%$//e -autocmd BufWritePre *.[ch] %s/\%$/\r/e " add trailing newline for ANSI C standard -autocmd BufWritePre *neomutt* %s/^--$/-- /e " dash-dash-space signature delimiter in emails -autocmd BufWritePre * cal cursor(currPos[1], currPos[2]) - -" When shortcut files are updated, renew bash and ranger configs with new material: -autocmd BufWritePost bm-files,bm-dirs !bmshortcuts - -" }}} - - -" BACKUP ----------------------------------------------------------------- {{{ - -if version >= 703 - set undodir=${XDG_CONFIG_HOME:-$HOME/.config}/vim/undodir - set undofile - set undoreload=10000 -endif - -" }}} - - -" SHORTCUTS ---------------------------------------------------------------- {{{ - -if filereadable(expand("${XDG_CONFIG_HOME:-$HOME/.config}/vim/shortcuts.vim")) - silent! source ${XDG_CONFIG_HOME:-$HOME/.config}/vim/shortcuts.vim -endif - -" }}} diff --git a/fedora/.config/vim/vimrc b/fedora/.config/vim/vimrc deleted file mode 100644 index a782a14..0000000 --- a/fedora/.config/vim/vimrc +++ /dev/null @@ -1,579 +0,0 @@ - -" VIM ENV --------------------------------------------------------------- {{{ - -if $USER != "root" - set runtimepath^=$XDG_CONFIG_HOME/vim - set runtimepath+=$XDG_DATA_HOME/vim - set runtimepath+=$XDG_CONFIG_HOME/vim/after - set viminfofile=$XDG_DATA_HOME/vim/.viminfo - - set packpath^=$XDG_DATA_HOME/vim,$XDG_CONFIG_HOME/vim - set packpath+=$XDG_CONFIG_HOME/vim/after,$XDG_DATA_HOME/vim/after - let g:netrw_home = $XDG_DATA_HOME."/vim" - call mkdir($XDG_DATA_HOME."/vim/spell", 'p') - - set backupdir=$XDG_CONFIG_HOME/vim/backup | call mkdir(&backupdir, 'p') - set directory=$XDG_CONFIG_HOME/vim/swap | call mkdir(&directory, 'p') - set undodir=$XDG_DATA_HOME/history/vim_history | call mkdir(&undodir, 'p') - set viewdir=$XDG_CONFIG_HOME/vim/view | call mkdir(&viewdir, 'p') -else - set runtimepath^=/root/.config/vim - set runtimepath+=/root/.local/share/vim - set runtimepath+=/root/.config/vim/after - set viminfofile=/root/.local/share/vim/.viminfo - - set packpath^=/root/.local/share/vim,/root/.config/vim - set packpath+=/root/.config/vim/after,/root/.local/share/vim/after - - let g:netrw_home = "/root/.local/share/vim" - call mkdir("/root/.local/share/vim/spell", 'p') - - set backupdir=/root/.config/vim/backup | call mkdir(&backupdir, 'p') - set directory=/root/.config/vim/swap | call mkdir(&directory, 'p') - set undodir=/root/.local/share/history/vim_history | call mkdir(&undodir, 'p') - set viewdir=/root/.config/vim/view | call mkdir(&viewdir, 'p') -endif - -" }}} - - -" AUTOCMD ---------------------------------------------------------------- {{{ - -autocmd VimEnter * silent execute '!echo -ne "\e[2 q"' - -" }}} - - -" Hex_Toggle_Functions --------------------------------------------------- {{{ - -function! DoHex() - " Get the current buffer name - let current_file = expand('%') - - " New file name - let new_file = current_file . '.hex' - - " Save the current buffer as a hex file - execute 'w !xxd > ' . new_file - - echo "Hex file created and saved as " . new_file -endfunction - -function! UndoHex() - " Get the current buffer name - let current_file = expand('%') - - " Name stage 1: Remove the .hex extension if it exists - let new_file_stage1 = substitute(current_file, '\.hex$', '', '') - - " Get the file name without extension - let file_name = substitute(new_file_stage1, '\(.*\)\.\(\w\+\)$', '\1', '') - - " Get the file extension - let file_extension = substitute(new_file_stage1, '\(.*\)\.\(\w\+\)$', '\2', '') - - " Add 'M' before the extension(M = Modded) - let new_file = file_name . 'M.' . file_extension - - " Save the current buffer as a reversed hex file - execute 'w !xxd -r > ' . new_file - - echo "Reversed Hex file created and saved as " . new_file -endfunction - -" Function to toggle between hex and original states -function! HexState() - " Get user input to choose the operation (0 for DoHex, 1 for UndoHex) - let operation = input("Choose operation (0 for DoHex, 1 for UndoHex): ") - - if operation == 0 - " Execute the DoHex function - call DoHex() - elseif operation == 1 - " Execute the UndoHex function - call UndoHex() - else - echo "Invalid choice. Aborting." - endif -endfunction - -" }}} - - -" GVIM - GUI VERSION ----------------------------------------------------- {{{ - -if has('gui_running') - - " Font - if has("macvim") - set guifont=Menlo\ Regular:h14 - elseif has("win32") - set guifont=Consolas\ 14 - else - set guifont=Consolas\ 18 - endif - - " Hide the toolbar. - set guioptions-=T - - " Hide the right-side scroll bar. - set guioptions-=r - - " Start Lex Tree and put the cursor back in the other window. - autocmd VimEnter * :Lexplore | wincmd p - -endif - -" }}} - - -" MAPPINGS --------------------------------------------------------------- {{{ - -" Set the space as the leader key. -let mapleader = " " -let maplocalleader = "\\" - -" Diable -nnoremap Q - -" Cmd & Esc -nnoremap : -inoremap : - -" Spell-check on\off to o, 'o' for 'orthography': -map og :setlocal spell! spelllang=en_us - -" Type jk to exit insert mode quickly. -inoremap jk - -" Format a paragraph into lines -map cf gq - -" Select all the text -nnoremap a ggVG - -" Opening a file explore -map le :Lex - -" Opening a file from explorer -map e :Explore - -" Opening a terminal window -map :ter - -" Closing the terminal window -tnoremap exit - -" Buffer -nnoremap H :bprev -nnoremap L :bnext - -" CTRL+I OR Esc to make the terminal scrollable and I to input mode -tnoremap -tnoremap - -" You can split the window in Vim. y - in the y access , x - in the x access -map w\- :split -map w\| :vsplit - -" Better move -nnoremap 11kzz -nnoremap 11jzz -nnoremap n nzzzv -nnoremap N Nzzzv - -" Navigate the split view easier by pressing CTRL+j, CTRL+k, CTRL+h, or CTRL+l. -nnoremap j -nnoremap k -nnoremap h -nnoremap l - -" Resize split windows using arrow keys by pressing: -" CTRL+UP, CTRL+DOWN, CTRL+LEFT, or CTRL+RIGHT. -noremap + -noremap - -noremap < -noremap > - -" Moving between tabs -map t gt - -" Opening/Creating a file in a new tab - write the tab to open -nnoremap bn :tabedit - -" Saving a file using CTRL+S -map :w - -" Quitting and saving a file using CTRL+S -map bd :bd -map BD :bd! -map wq :wq -nnoremap q :q! -nnoremap Q :qa! - -" Surround word with a wanted character -nnoremap sw echo "Press a character: " \| let c = nr2char(getchar()) \| exec "normal viwo\ei" . c . "\eea" . c . "\e" \| redraw - -" Replace all occurrences of a word -nnoremap rw :%s/\<\>//g - -" Toggle between creating a Hex conversion file and reversing the conversion -nnoremap hx call HexState() - -" For copy and past if supports clipbard -if has('gui_running') - map p "+P - xnoremap p "_dP - nmap Y "+Y - nnoremap y "*y :let @+=@* - vnoremap y "*y :let @+=@* - nmap D "+D - nnoremap d "+d - vnoremap d "+d -endif - -" Change -nnoremap c "_c - -" Delete -nnoremap x "_x - -" Seeing the registers -nnoremap ' registers - -" Moving lines in visual mode -vnoremap J :m '>+1gv=gv -vnoremap K :m '>-2gv=gv - -" Join -nnoremap J mzJ`z - -" Perform dot commands over visual blocks: -vnoremap . :normal . - -" Source file -nnoremap so :so - -" Compiler -nnoremap rr :w:terminal compiler %:resize 10 - -" Open quickfix/location list" -nnoremap oq :copen -nnoremap ol :lopen - -" }}} - - -" SETTINGS --------------------------------------------------------------- {{{ - -" Cursor shapes -let &t_SI = "\[6 q" -let &t_SR = "\[4 q" -let &t_EI = "\[2 q" - -" Clipboard -set clipboard+=unnamedplus - -" Disable auto commenting in a new line -autocmd Filetype * setlocal formatoptions-=c formatoptions-=r formatoptions-=o - -" Setting the character encoding of Vim to UTF-8 -set encoding=UTF-8 - -" Enable type file detection. Vim will be able to try to detect the type of file is use. -filetype on - -" Enable spell check -set nospell -highlight SpellBad ctermfg=204 guifg=#F28FAD gui=undercurl guisp=#F28FAD -highlight SpellCap ctermfg=75 guifg=#9D7CD8 gui=undercurl guisp=#9D7CD8 -highlight SpellRare ctermfg=81 guifg=#0DB9D7 gui=undercurl guisp=#0DB9D7 -highlight SpellLocal ctermfg=142 guifg=#FAB387 gui=undercurl guisp=#FAB387 - -" Avoids updating the screen before commands are completed -set lazyredraw - -" Smart tab -set smarttab - -" Search down to subfolders -set path+=** - -" Enable plugins and load plugin for the detected file type. -filetype plugin on - -" Load an indent file for the detected file type. -filetype indent on - -" Turn syntax highlighting on. -syntax on - -" Turns off highlighting on the bits of code that are changed, so the line that is changed is highlighted but the actual text that has changed stands out on the line and is readable. -if &diff - highlight! link DiffText MatchParen -endif - -" Add numbers to the file. -set number relativenumber - -" Mouse functionality -set mouse=a - -" Background color -" set bg=light - -" Color scheme -colorscheme desert - -" Highlight cursor line underneath the cursor horizontally. -set cursorline - -" Disable highlight cursor line underneath the cursor vertically. -set nocursorcolumn - -" Set shift width to 4 spaces.Set tab width to 4 columns. -set shiftwidth=4 -set tabstop=4 - -" If the current file type is HTML, CSS, JS, JSX, TS, TSX set indentation to 2 spaces. -autocmd Filetype html,css,js,jsx,ts,tsx setlocal tabstop=2 shiftwidth=2 expandtab - -" Do not save backup files. -set nobackup - -" Do wrap lines. -set wrap - -" While searching though a file incrementally highlight matching characters as you type. -set incsearch -set hlsearch - -" Ignore capital letters during search. -set ignorecase - -" Show partial command you type in the last line of the screen. -set showcmd - -" Show the mode you are on the last line. -set showmode - -" Show matching words during a search. -set showmatch - -" Show title of the file -set title - -" Timeout -set timeoutlen=300 " Time (in milliseconds) to wait for a mapping -set ttimeoutlen=10 " Time (in milliseconds) to wait for terminal key codes - -" Set the commands to save in history default number is 20. -set history=1000 - -" Setting the split window to open as i like (like in a WM - qtile) -set splitbelow splitright - -" Enable auto completion menu after pressing TAB. -set wildmenu - -" There are certain files that we would never want to edit with Vim. -" Wild menu will ignore files with these extensions. -set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx - -" If Vim version is equal to or greater than 7.3 enable undo file. -" This allows you to undo changes to a file even after saving it. -if version >= 703 - set undodir=~/.config/vim/backup - set undofile - set undoreload=10000 -endif - - -" File Browsing settings -let g:netrw_banner=0 -let g:netrw_liststyle=3 -let g:netrw_showhide=1 -let g:netrw_winsize=20 - - -" Auto Completion - Enable Omni complete features -set omnifunc=syntaxcomplete#Complete - - -" Enable Spelling Suggestions for Auto-Completion: -set complete+=k -set completeopt=menu,menuone,noinsert - - -" Minimalist-Tab Complete -inoremap TabComplete() -fun! TabComplete() - if getline('.')[col('.') - 2] =~ '\K' || pumvisible() - return "\" - else - return "\" - endif -endfun - - -" Minimalist-Autocomplete -inoremap pumvisible() ? "\" : "\" -autocmd InsertCharPre * call AutoComplete() -fun! AutoComplete() - if v:char =~ '\K' - \ && getline('.')[col('.') - 4] !~ '\K' - \ && getline('.')[col('.') - 3] =~ '\K' - \ && getline('.')[col('.') - 2] =~ '\K' " last char - \ && getline('.')[col('.') - 1] !~ '\K' - - call feedkeys("\", 'n') - end -endfun - - -" Closing compaction in insert mode -inoremap [ [] -inoremap ( () -inoremap { {} -inoremap /* /**/ - -" }}} - - -" STATUS LINE ------------------------------------------------------------ {{{ - -set laststatus=2 -set statusline= -set statusline+=%2* -set statusline+=%{StatuslineMode()} -set statusline+=%{SpellCheckStatus()} -set statusline+=%1* -set statusline+=%3* -set statusline+=< -set statusline+=- -set statusline+=%f -set statusline+=- -set statusline+=> -set statusline+=%4* -set statusline+=%m -set statusline+=%= -set statusline+=%h -set statusline+=%r -set statusline+=%4* -set statusline+=%c -set statusline+=/ -set statusline+=%l -set statusline+=/ -set statusline+=%L -set statusline+=%1* -set statusline+=| -set statusline+=%y -set statusline+=%4* -set statusline+=%P -set statusline+=%3* -set statusline+=t: -set statusline+=%n - -" }}} - - -" STATUS FUNCTIONS ------------------------------------------------------- {{{ - -" Mode -function! StatuslineMode() - let l:mode=mode() - if l:mode==#"n" - return "NORMAL" - elseif l:mode==#"V" - return "VISUAL LINE" - elseif l:mode==?"v" - return "VISUAL" - elseif l:mode==#"i" - return "INSERT" - elseif l:mode ==# "\" - return "V-BLOCK" - elseif l:mode==#"R" - return "REPLACE" - elseif l:mode==?"s" - return "SELECT" - elseif l:mode==#"t" - return "TERMINAL" - elseif l:mode==#"c" - return "COMMAND" - elseif l:mode==#"!" - return "SHELL" - else - return "VIM" - endif -endfunction - -" Spell Check Status -function! SpellCheckStatus() - if &spell - return " [SPELL]" - else - return '' - endif -endfunction -" }}} - - -" VIMSCRIPT -------------------------------------------------------------- {{{ - -" This will enable code folding. -" Use the marker method of folding. -augroup filetype_vim - autocmd! - autocmd FileType vim setlocal foldmethod=marker -augroup END - - - -" INIT VIM --------------------------------------------------------------- {{{ - -if filereadable(expand("~/.config/vim/init.vim")) - source ~/.config/vim/init.vim -endif - -" }}} - - -" SHORTCUTS -------------------------------------------------------------- {{{ - -if filereadable(expand("~/.config/vim/shortcuts.vim")) - silent! source ~/.config/vim/shortcuts.vim -endif - -if filereadable(expand("~/.config/vim/rootshortcuts.vim")) - silent! source ~/.config/vim/rootshortcuts.vim -endif - -" }}} - - -" COLORS ----------------------------------------------------------------- {{{ - -" Terminal color -set t_Co=256 -if exists('+termguicolors') - set termguicolors -else - set notermguicolors -endif - -" Cursor -hi CursorLine cterm=NONE ctermbg=236 ctermfg=NONE gui=NONE guibg=Grey30 guifg=NONE - -" Transparent -hi Normal ctermbg=NONE guibg=NONE -hi NonText ctermbg=NONE guibg=NONE -hi LineNr ctermbg=NONE guibg=NONE -hi Folded ctermbg=NONE guibg=NONE -hi EndOfBuffer ctermfg=Grey guifg=Grey - -hi User1 ctermbg=brown ctermfg=white guibg=NONE guifg=white -hi User2 ctermbg=lightgreen ctermfg=black guibg=lightgreen guifg=black -hi User3 ctermbg=brown ctermfg=lightcyan guibg=NONE guifg=lightblue -hi User4 ctermbg=brown ctermfg=green guibg=NONE guifg=lightgreen - -" }}} diff --git a/fedora/.config/yazi/flavors/ayu-dark.yazi/LICENSE b/fedora/.config/yazi/flavors/ayu-dark.yazi/LICENSE deleted file mode 100755 index 894ccc9..0000000 --- a/fedora/.config/yazi/flavors/ayu-dark.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Kamal Chandra Upreti - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/ayu-dark.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/ayu-dark.yazi/LICENSE-tmtheme deleted file mode 100755 index 97c6154..0000000 --- a/fedora/.config/yazi/flavors/ayu-dark.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 Ike Ku - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/ayu-dark.yazi/README.md b/fedora/.config/yazi/flavors/ayu-dark.yazi/README.md deleted file mode 100644 index 6384dcc..0000000 --- a/fedora/.config/yazi/flavors/ayu-dark.yazi/README.md +++ /dev/null @@ -1,32 +0,0 @@ -
- Yazi logo -
- -

- Ayu Dark Flavor for Yazi -

- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -```bash -ya pack -a kmlupreti/ayu-dark -``` - -## โš™๏ธ Usage - -Add the these lines to your `theme.toml` configuration file to use it: - -```toml -[flavor] -dark = "ayu-dark" -``` - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/ayu-dark.yazi/flavor.toml b/fedora/.config/yazi/flavors/ayu-dark.yazi/flavor.toml deleted file mode 100755 index 7fafb1b..0000000 --- a/fedora/.config/yazi/flavors/ayu-dark.yazi/flavor.toml +++ /dev/null @@ -1,137 +0,0 @@ -[mgr] -# current working dir -cwd = { fg = "#5c6773" } - -# Hovered -hovered = { reversed = true } -preview_hovered = { underline = true } - -# find -find_keyword = { fg = "#1f6f88", bold = true, italic = true, underline = true } -find_position = { fg = "#1f6f88", bold = true, italic = true } - -# Symlink -symlink_target = { italic = true } - -# marker -marker_copied = { fg = "#0a0e14", bg = "#7e9350" } -marker_cut = { fg = "#0a0e14", bg = "#a85361" } -marker_marked = { fg = "#0a0e14", bg = "#1f6f88" } -marker_selected = { fg = "#0a0e14", bg = "#c2a05c" } - -# count -count_copied = { fg = "#0a0e14", bg = "#7e9350" } -count_cut = { fg = "#5c6773", bg = "#a85361" } -count_selected = { fg = "#0a0e14", bg = "#c2a05c" } - -# border -border_symbol = " " - -[tabs] -active = { fg = "#0a0e14", bg = "#c2a05c", bold = true } -inactive = { fg = "#c2a05c", bg = "#0a0e14" } -sep_inner = { open = "", close = "" } -sep_outer = { open = "๎‚ถ", close = "๎‚ฐ" } - -[mode] -normal_main = { fg = "#0a0e14", bg = "#c2a05c", bold = true } -normal_alt = { fg = "#1f6f88", bg = "#2d3640", bold = true } - -select_main = { fg = "#0a0e14", bg = "#1f6f88", bold = true } -select_alt = { fg = "#0a0e14", bg = "#1f6f88", bold = true } - -unset_main = { fg = "#0a0e14", bg = "#a85361", bold = true } -unset_alt = { fg = "#0a0e14", bg = "#a85361", bold = true } - -[status] -overall = {} -sep_left = { open = "๎‚ถ", close = "๎‚ฐ" } -sep_right = { open = "๎‚ฒ", close = "๎‚ด" } - -# Progress -progress_label = { fg = "#0a0e14", bold = true } -progress_normal = { fg = "#c2a05c", bg = "#0a0e14" } -progress_error = { fg = "#a85361", bg = "#0a0e14" } - -# permissions -perm_type = { fg = "#c2c2c2" } -perm_write = { fg = "#a85361" } -perm_exec = { fg = "#7e9350" } -perm_read = { fg = "#1f6f88" } -perm_sep = { fg = "#5c6773" } - -[select] -border = { fg = "#c2a05c" } -active = { fg = "#a85361", bold = true } -inactive = { fg = "#5c6773", bg = "#0a0e14" } - -[input] -border = { fg = "#c2a05c" } -value = { fg = "#5c6773" } - -[completion] -border = { fg = "#c2a05c", bg = "#0a0e14" } - -[tasks] -border = { fg = "#c2a05c" } -title = { fg = "#5c6773" } -hovered = { fg = "#7e9350", underline = true } - -[which] -cols = 3 -mask = { bg = "#0a0e14" } -cand = { fg = "#c2a05c" } -rest = { fg = "#0a0e14" } -desc = { fg = "#5c6773" } -separator = " โฏˆ " -separator_style = { fg = "#5c6773" } - -[help] -on = { fg = "#c2a05c" } -run = { fg = "#7e9350" } -footer = { fg = "#0a0e14", bg = "#5c6773" } - -[notify] -title_info = { fg = "#7e9350" } -title_warn = { fg = "#c2a05c" } -title_error = { fg = "#a85361" } - -[filetype] -rules = [ - # directories - { name = "*/", fg = "#1f6f88" }, - - # executables - { name = "*", is = "exec", fg = "#7e9350" }, - - # images - { mime = "image/*", fg = "#c2a05c" }, - - # media - { mime = "{audio,video}/*", fg = "#7e9350" }, - - # archives - { mime = "application/{,g}zip", fg = "#a85361" }, - { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "#a85361" }, - - # documents - { mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#1f6f88" }, - - # scripts and code - { mime = "application/{x-shellscript,x-python,x-ruby,x-javascript}", fg = "#c2a05c" }, - { mime = "text/x-{c,c++}", fg = "#1f6f88" }, - - # config files - { name = "*.json", fg = "#c2a05c" }, - { name = "*.yml", fg = "#1f6f88" }, - { name = "*.toml", fg = "#9464b6" }, - - # special files - { name = "*", is = "orphan", bg = "#0a0e14" }, - - # dummy files - { name = "*", is = "dummy", bg = "#0a0e14" }, - - # fallback - { name = "*/", fg = "#1f6f88" }, -] diff --git a/fedora/.config/yazi/flavors/ayu-dark.yazi/preview.png b/fedora/.config/yazi/flavors/ayu-dark.yazi/preview.png deleted file mode 100644 index cdaeeff..0000000 Binary files a/fedora/.config/yazi/flavors/ayu-dark.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/ayu-dark.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/ayu-dark.yazi/tmtheme.xml deleted file mode 100755 index a6d90da..0000000 --- a/fedora/.config/yazi/flavors/ayu-dark.yazi/tmtheme.xml +++ /dev/null @@ -1,1025 +0,0 @@ - - - - - author - Ike Ku - colorSpaceName - sRGB - name - ayu - semanticClass - ayu.dark - settings - - - settings - - accent - #F29718 - activeGuide - #363F46 - background - #0F1419 - caret - #F29718 - findHighlight - #F29718 - findHighlightForeground - #0F1419 - foreground - #BFBAB0 - guide - #20272C - gutter - #0F1419 - gutterForeground - #252D33 - inactiveBackground - #0F1419 - inactiveSelection - #131E27 - invisibles - #252D33 - lineHighlight - #0A0E12 - popupCss - html, body { - background-color: #13181D; - color: #BFBAB0; -} -body { - padding: 1px 3px; -} -a { - color: rgba(57, 186, 230, .7); -} - - selection - #16242E - selectionBorder - #192B37 - shadow - #00000010 - stackGuide - #20272C - - - - name - Comment - scope - comment, punctuation.definition.comment - settings - - fontStyle - italic - foreground - #5C6773 - - - - name - Variable - scope - variable - settings - - foreground - #BFBAB0 - - - - name - String - scope - string, constant.other.symbol - settings - - foreground - #C2D94C - - - - name - Number - scope - constant.numeric - settings - - foreground - #F29718 - - - - name - Regular Expressions and Escape Characters - scope - string.regexp, constant.character.escape - settings - - foreground - #95E6CB - - - - name - Built-in constant - scope - constant.language - settings - - foreground - #F29718 - - - - name - User-defined constant - scope - constant.character, constant.other - settings - - foreground - #F29718 - - - - name - Member Variable - scope - variable.member - settings - - foreground - #ec5f67 - - - - name - Keyword - scope - keyword - keyword.operator, keyword.operator.word - settings - - foreground - #FF7733 - - - - name - Operators - scope - keyword.operator - settings - - foreground - #F29668 - - - - name - Punctuation - scope - punctuation.separator, punctuation.terminator - settings - - foreground - #BFBAB0CC - - - - name - Punctuation - scope - punctuation.section - settings - - foreground - #BFBAB0 - - - - name - Accessor - scope - punctuation.accessor - settings - - foreground - #F29668 - - - - name - Annotation Punctuation - scope - punctuation.definition.annotation - settings - - foreground - #BFBAB0CC - - - - name - JavaScript Dollar - scope - variable.other.dollar.only.js, variable.other.object.dollar.only.js, variable.type.dollar.only.js, support.class.dollar.only.js - settings - - foreground - #E6B673 - - - - name - Storage - scope - storage - settings - - foreground - #FF7733 - - - - name - Storage type - scope - storage.type - settings - - foreground - #FF7733 - - - - name - Function name - scope - entity.name.function - settings - - foreground - #FFB454 - - - - name - Entity name - scope - entity.name - (entity.name.section | entity.name.tag | entity.name.label) - settings - - foreground - #59C2FF - - - - name - Inherited class - scope - entity.other.inherited-class - settings - - fontStyle - underline - foreground - #59C2FF - - - - name - Function argument - scope - variable.parameter - settings - - foreground - #F29718 - - - - name - Language variable - scope - variable.language - settings - - fontStyle - italic - foreground - #39BAE6 - - - - name - Tag - scope - entity.name.tag, meta.tag.sgml - settings - - foreground - #39BAE6 - - - - name - Tag start/end - scope - punctuation.definition.tag.end, punctuation.definition.tag.begin, punctuation.definition.tag - settings - - foreground - #39BAE690 - - - - name - Tag attribute - scope - entity.other.attribute-name - settings - - foreground - #FFB454 - - - - name - Function call - scope - variable.function, variable.annotation - settings - - foreground - #FFB454 - - - - name - Library function - scope - support.function, support.macro - settings - - foreground - #F07178 - - - - name - Library constant - scope - support.constant - settings - - fontStyle - italic - foreground - #F29668 - - - - name - Library class/type - scope - support.type, support.class - settings - - fontStyle - italic - foreground - #39BAE6 - - - - name - Invalid - scope - invalid - settings - - foreground - #FF3333 - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - background - #FF7733 - foreground - #FFFFFF - - - - name - diff.header - scope - meta.diff, meta.diff.header - settings - - foreground - #c594c5 - - - - name - Ruby class methods - scope - source.ruby variable.other.readwrite - settings - - foreground - #FFB454 - - - - name - CSS tag names - scope - source.css entity.name.tag, source.sass entity.name.tag, source.scss entity.name.tag, source.less entity.name.tag, source.stylus entity.name.tag - settings - - foreground - #59C2FF - - - - name - CSS browser prefix - scope - source.css support.type, source.sass support.type, source.scss support.type, source.less support.type, source.stylus support.type - settings - - foreground - #5C6773 - - - - name - CSS Properties - scope - support.type.property-name - settings - - fontStyle - normal - foreground - #39BAE6 - - - - name - Search Results Nums - scope - constant.numeric.line-number.find-in-files - match - settings - - foreground - #5C6773 - - - - name - Search Results Match Nums - scope - constant.numeric.line-number.match - settings - - foreground - #FF7733 - - - - name - Search Results Lines - scope - entity.name.filename.find-in-files - settings - - foreground - #C2D94C - - - - scope - message.error - settings - - foreground - #FF3333 - - - - name - JSON Key - Level 8 - scope - source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #39BAE6 - - - - name - JSON Key - Level 7 - scope - source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #39BAE6 - - - - name - JSON Key - Level 6 - scope - source.json meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #39BAE6 - - - - name - JSON Key - Level 5 - scope - source.json meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #39BAE6 - - - - name - JSON Key - Level 4 - scope - source.json meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #39BAE6 - - - - name - JSON Key - Level 3 - scope - source.json meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #39BAE6 - - - - name - JSON Key - Level 2 - scope - source.json meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #39BAE6 - - - - name - JSON Key - Level 1 - scope - source.json meta meta.structure.dictionary.json string.quoted.double.json - meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta.structure.dictionary.json punctuation.definition.string - meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #39BAE6 - - - - name - JSON Key - Level 0 - scope - source.json meta.structure.dictionary.json string.quoted.double.json - meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json punctuation.definition.string - meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #39BAE6 - - - - name - Markup Heading - scope - markup.heading - settings - - fontStyle - bold - foreground - #FF7733 - - - - name - Markup Links - scope - string.other.link, markup.underline.link - settings - - fontStyle - italic underline - foreground - #95E6CB - - - - name - Markup image - scope - punctuation.definition.image - settings - - foreground - #FFB454 - - - - name - Markup Italic - scope - markup.italic - settings - - fontStyle - italic - foreground - #F07178 - - - - name - Markup Bold - scope - markup.bold - settings - - fontStyle - bold - foreground - #F07178 - - - - name - Markup Bold/italic - scope - markup.italic markup.bold | markup.bold markup.italic - settings - - fontStyle - bold italic - - - - name - Markup Code - scope - markup.raw - settings - - background - #BFBAB007 - - - - name - Markup Code Inline - scope - markup.raw.inline - settings - - background - #BFBAB010 - - - - name - Markdown Separator - scope - meta.separator - settings - - background - #BFBAB010 - fontStyle - bold - foreground - #5C6773 - - - - name - Markup Blockquote - scope - markup.quote - settings - - fontStyle - italic - foreground - #F29718 - - - - name - Markup List Bullet - scope - markup.list.numbered.bullet, markup.list punctuation.definition.list_item - settings - - foreground - #95E6CB - - - - name - Markup Inserted - scope - markup.inserted - settings - - foreground - #C2D94C - - - - name - Markup Changed - scope - markup.changed - settings - - foreground - #39BAE6 - - - - name - Markup Deleted - scope - markup.deleted - settings - - foreground - #F07178 - - - - name - Markup Strike - scope - markup.strike - settings - - foreground - #E6B673 - - - - name - Markup Table - scope - markup.table - settings - - background - #BFBAB010 - foreground - #39BAE6 - - - - name - Markup Raw Inline - scope - text.html.markdown markup.raw.inline - settings - - foreground - #F29668 - - - - name - Markdown - Line Break - scope - text.html.markdown meta.dummy.line-break - settings - - foreground - #5C6773 - - - - name - Markdown - Raw Block Fenced - scope - markup.raw.block.fenced.markdown - settings - - background - #BFBAB010 - foreground - #BFBAB0 - - - - name - Markdown - Fenced Bode Block - scope - punctuation.definition.fenced.markdown, variable.language.fenced.markdown - settings - - background - #BFBAB010 - foreground - #5C6773 - - - - name - Markdown - Fenced Language - scope - variable.language.fenced.markdown - settings - - foreground - #5C6773 - - - - name - GitGutter Added - scope - markup.inserted.git_gutter - settings - - foreground - #C2D94C - - - - name - GitGutter Changed - scope - markup.changed.git_gutter - settings - - foreground - #39BAE6 - - - - name - GitGutter Deleted - scope - markup.deleted.git_gutter - settings - - foreground - #FF3333 - - - - name - GitGutter Ignored - scope - markup.ignored.git_gutter - settings - - foreground - #20272C - - - - name - GitGutter Untracked - scope - markup.untracked.git_gutter - settings - - foreground - #20272C - - - - name - GutterColor - scope - gutter_color - settings - - foreground - #FFFFFF - - - - name - AceJump Label - Blue - scope - acejump.label.blue - settings - - background - #39BAE6 - foreground - #FFFFFF - - - - name - AceJump Label - Green - scope - acejump.label.green - settings - - background - #C2D94C - foreground - #FFFFFF - - - - name - AceJump Label - Orange - scope - acejump.label.orange - settings - - background - #FF7733 - foreground - #FFFFFF - - - - name - AceJump Label - Purple - scope - acejump.label.purple - settings - - background - #F07178 - foreground - #FFFFFF - - - - name - SublimeLinter Warning - scope - sublimelinter.mark.warning - settings - - foreground - #39BAE6 - - - - name - SublimeLinter Gutter Mark - scope - sublimelinter.gutter-mark - settings - - foreground - #FFFFFF - - - - name - SublimeLinter Error - scope - sublimelinter.mark.error - settings - - foreground - #FF3333 - - - - uuid - 0e709986-46a0-40a0-b3bf-c8dfe525c455 - - diff --git a/fedora/.config/yazi/flavors/catppuccin-frappe.yazi/LICENSE b/fedora/.config/yazi/flavors/catppuccin-frappe.yazi/LICENSE deleted file mode 100644 index fb5b1d6..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-frappe.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 yazi-rs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/catppuccin-frappe.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/catppuccin-frappe.yazi/LICENSE-tmtheme deleted file mode 100644 index 006383b..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-frappe.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Catppuccin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/catppuccin-frappe.yazi/README.md b/fedora/.config/yazi/flavors/catppuccin-frappe.yazi/README.md deleted file mode 100644 index 737a6aa..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-frappe.yazi/README.md +++ /dev/null @@ -1,36 +0,0 @@ -
- Yazi logo -
- -

- Catppuccin Frappe Flavor for Yazi -

- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -```sh -ya pkg add yazi-rs/flavors:catppuccin-frappe -``` - -## โš™๏ธ Usage - -Set the content of your `theme.toml` to enable it as your _dark_ flavor: - -```toml -[flavor] -dark = "catppuccin-frappe" -``` - -Make sure your `theme.toml` doesn't contain anything other than `[flavor]`, unless you want to override certain styles of this flavor. - -See the [Yazi flavor documentation](https://yazi-rs.github.io/docs/flavors/overview) for more details. - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/catppuccin-frappe.yazi/flavor.toml b/fedora/.config/yazi/flavors/catppuccin-frappe.yazi/flavor.toml deleted file mode 100644 index bb32478..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-frappe.yazi/flavor.toml +++ /dev/null @@ -1,189 +0,0 @@ -# vim:fileencoding=utf-8:foldmethod=marker - -# : Manager {{{ - -[mgr] -cwd = { fg = "#81c8be" } - -# Hovered -hovered = { reversed = true } -preview_hovered = { underline = true } - -# Find -find_keyword = { fg = "#e5c890", bold = true, italic = true, underline = true } -find_position = { fg = "#f4b8e4", bg = "reset", bold = true, italic = true } - -# Marker -marker_copied = { fg = "#a6d189", bg = "#a6d189" } -marker_cut = { fg = "#e78284", bg = "#e78284" } -marker_marked = { fg = "#81c8be", bg = "#81c8be" } -marker_selected = { fg = "#e5c890", bg = "#e5c890" } - -# Count -count_copied = { fg = "#303446", bg = "#a6d189" } -count_cut = { fg = "#303446", bg = "#e78284" } -count_selected = { fg = "#303446", bg = "#e5c890" } - -# Border -border_symbol = "โ”‚" -border_style = { fg = "#838ba7" } - -# : }}} - - -# : Tabs {{{ - -[tabs] -active = { fg = "#303446", bg = "#8caaee", bold = true } -inactive = { fg = "#8caaee", bg = "#414559" } - -# : }}} - - -# : Mode {{{ - -[mode] - -normal_main = { fg = "#303446", bg = "#8caaee", bold = true } -normal_alt = { fg = "#8caaee", bg = "#414559" } - -# Select mode -select_main = { fg = "#303446", bg = "#81c8be", bold = true } -select_alt = { fg = "#81c8be", bg = "#414559" } - -# Unset mode -unset_main = { fg = "#303446", bg = "#eebebe", bold = true } -unset_alt = { fg = "#eebebe", bg = "#414559" } - -# : }}} - - -# : Status bar {{{ - -[status] -# Permissions -perm_sep = { fg = "#838ba7" } -perm_type = { fg = "#8caaee" } -perm_read = { fg = "#e5c890" } -perm_write = { fg = "#e78284" } -perm_exec = { fg = "#a6d189" } - -# Progress -progress_label = { fg = "#ffffff", bold = true } -progress_normal = { fg = "#8caaee", bg = "#51576d" } -progress_error = { fg = "#8caaee", bg = "#e78284" } - -# : }}} - - -# : Pick {{{ - -[pick] -border = { fg = "#8caaee" } -active = { fg = "#f4b8e4", bold = true } -inactive = {} - -# : }}} - - -# : Input {{{ - -[input] -border = { fg = "#8caaee" } -title = {} -value = {} -selected = { reversed = true } - -# : }}} - - -# : Completion {{{ - -[cmp] -border = { fg = "#8caaee" } - -# : }}} - - -# : Tasks {{{ - -[tasks] -border = { fg = "#8caaee" } -title = {} -hovered = { fg = "#f4b8e4", bold = true } - -# : }}} - - -# : Which {{{ - -[which] -mask = { bg = "#414559" } -cand = { fg = "#81c8be" } -rest = { fg = "#949cbb" } -desc = { fg = "#f4b8e4" } -separator = " ๎ชœ " -separator_style = { fg = "#626880" } - -# : }}} - - -# : Help {{{ - -[help] -on = { fg = "#81c8be" } -run = { fg = "#f4b8e4" } -hovered = { reversed = true, bold = true } -footer = { fg = "#414559", bg = "#c6d0f5" } - -# : }}} - - -# : Spotter {{{ - -[spot] -border = { fg = "#8caaee" } -title = { fg = "#8caaee" } -tbl_col = { fg = "#81c8be" } -tbl_cell = { fg = "#f4b8e4", bg = "#51576d" } - -# : }}} - - -# : Notification {{{ - -[notify] -title_info = { fg = "#a6d189" } -title_warn = { fg = "#e5c890" } -title_error = { fg = "#e78284" } - -# : }}} - - -# : File-specific styles {{{ - -[filetype] - -rules = [ - # Images - { mime = "image/*", fg = "#81c8be" }, - - # Media - { mime = "{audio,video}/*", fg = "#e5c890" }, - - # Archives - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#f4b8e4" }, - - # Documents - { mime = "application/{pdf,doc,rtf}", fg = "#a6d189" }, - - # Fallback - { url = "*", fg = "#c6d0f5" }, - { url = "*/", fg = "#8caaee" }, - - # TODO: remove - { name = "*", fg = "#c6d0f5" }, - { name = "*/", fg = "#8caaee" } -] - -# : }}} diff --git a/fedora/.config/yazi/flavors/catppuccin-frappe.yazi/preview.png b/fedora/.config/yazi/flavors/catppuccin-frappe.yazi/preview.png deleted file mode 100644 index 03203c9..0000000 Binary files a/fedora/.config/yazi/flavors/catppuccin-frappe.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/catppuccin-frappe.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/catppuccin-frappe.yazi/tmtheme.xml deleted file mode 100644 index 6d0a97f..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-frappe.yazi/tmtheme.xml +++ /dev/null @@ -1,2112 +0,0 @@ - - - - - name - Catppuccin Frappรฉ - semanticClass - theme.dark.catppuccin-frappรฉ - uuid - e0ada983-8938-490c-86f0-97a1a0ec58e4 - author - Catppuccin Org - colorSpaceName - sRGB - settings - - - settings - - background - #303446 - foreground - #c6d0f5 - caret - #f2d5cf - lineHighlight - #414559 - misspelling - #e78284 - accent - #ca9ee6 - selection - #949cbb40 - activeGuide - #51576d - findHighlight - #506373 - gutterForeground - #838ba7 - - - - name - Basic text & variable names (incl. leading punctuation) - scope - text, source, variable.other.readwrite, punctuation.definition.variable - settings - - foreground - #c6d0f5 - - - - name - Parentheses, Brackets, Braces - scope - punctuation - settings - - foreground - #949cbb - fontStyle - - - - - name - Comments - scope - comment, punctuation.definition.comment - settings - - foreground - #949cbb - fontStyle - italic - - - - scope - string, punctuation.definition.string - settings - - foreground - #a6d189 - - - - scope - constant.character.escape - settings - - foreground - #f4b8e4 - - - - name - Booleans, constants, numbers - scope - constant.numeric, variable.other.constant, entity.name.constant, constant.language.boolean, constant.language.false, constant.language.true, keyword.other.unit.user-defined, keyword.other.unit.suffix.floating-point - settings - - foreground - #ef9f76 - - - - scope - keyword, keyword.operator.word, keyword.operator.new, variable.language.super, support.type.primitive, storage.type, storage.modifier, punctuation.definition.keyword - settings - - foreground - #ca9ee6 - fontStyle - - - - - scope - entity.name.tag.documentation - settings - - foreground - #ca9ee6 - - - - name - Punctuation - scope - keyword.operator, punctuation.accessor, punctuation.definition.generic, meta.function.closure punctuation.section.parameters, punctuation.definition.tag, punctuation.separator.key-value - settings - - foreground - #81c8be - - - - scope - entity.name.function, meta.function-call.method, support.function, support.function.misc, variable.function - settings - - foreground - #8caaee - fontStyle - italic - - - - name - Classes - scope - entity.name.class, entity.other.inherited-class, support.class, meta.function-call.constructor, entity.name.struct - settings - - foreground - #e5c890 - fontStyle - italic - - - - name - Enum - scope - entity.name.enum - settings - - foreground - #e5c890 - fontStyle - italic - - - - name - Enum member - scope - meta.enum variable.other.readwrite, variable.other.enummember - settings - - foreground - #81c8be - - - - name - Object properties - scope - meta.property.object - settings - - foreground - #81c8be - - - - name - Types - scope - meta.type, meta.type-alias, support.type, entity.name.type - settings - - foreground - #e5c890 - fontStyle - italic - - - - name - Decorators - scope - meta.annotation variable.function, meta.annotation variable.annotation.function, meta.annotation punctuation.definition.annotation, meta.decorator, punctuation.decorator - settings - - foreground - #ef9f76 - - - - scope - variable.parameter, meta.function.parameters - settings - - foreground - #ea999c - fontStyle - italic - - - - name - Built-ins - scope - constant.language, support.function.builtin - settings - - foreground - #e78284 - - - - scope - entity.other.attribute-name.documentation - settings - - foreground - #e78284 - - - - name - Preprocessor directives - scope - keyword.control.directive, punctuation.definition.directive - settings - - foreground - #e5c890 - - - - name - Type parameters - scope - punctuation.definition.typeparameters - settings - - foreground - #99d1db - - - - name - Namespaces - scope - entity.name.namespace - settings - - foreground - #e5c890 - - - - name - Property names (left hand assignments in json/yaml/css) - scope - support.type.property-name.css - settings - - foreground - #8caaee - fontStyle - - - - - name - This/Self keyword - scope - variable.language.this, variable.language.this punctuation.definition.variable - settings - - foreground - #e78284 - - - - name - Object properties - scope - variable.object.property - settings - - foreground - #c6d0f5 - - - - name - String template interpolation - scope - string.template variable, string variable - settings - - foreground - #c6d0f5 - - - - name - `new` as bold - scope - keyword.operator.new - settings - - fontStyle - bold - - - - name - C++ extern keyword - scope - storage.modifier.specifier.extern.cpp - settings - - foreground - #ca9ee6 - - - - name - C++ scope resolution - scope - entity.name.scope-resolution.template.call.cpp, entity.name.scope-resolution.parameter.cpp, entity.name.scope-resolution.cpp, entity.name.scope-resolution.function.definition.cpp - settings - - foreground - #e5c890 - - - - name - C++ doc keywords - scope - storage.type.class.doxygen - settings - - fontStyle - - - - - name - C++ operators - scope - storage.modifier.reference.cpp - settings - - foreground - #81c8be - - - - name - C# Interpolated Strings - scope - meta.interpolation.cs - settings - - foreground - #c6d0f5 - - - - name - C# xml-style docs - scope - comment.block.documentation.cs - settings - - foreground - #c6d0f5 - - - - name - Classes, reflecting the className color in JSX - scope - source.css entity.other.attribute-name.class.css, entity.other.attribute-name.parent-selector.css punctuation.definition.entity.css - settings - - foreground - #e5c890 - - - - name - Operators - scope - punctuation.separator.operator.css - settings - - foreground - #81c8be - - - - name - Pseudo classes - scope - source.css entity.other.attribute-name.pseudo-class - settings - - foreground - #81c8be - - - - scope - source.css constant.other.unicode-range - settings - - foreground - #ef9f76 - - - - scope - source.css variable.parameter.url - settings - - foreground - #a6d189 - fontStyle - - - - - name - CSS vendored property names - scope - support.type.vendored.property-name - settings - - foreground - #99d1db - - - - name - Less/SCSS right-hand variables (@/$-prefixed) - scope - source.css meta.property-value variable, source.css meta.property-value variable.other.less, source.css meta.property-value variable.other.less punctuation.definition.variable.less, meta.definition.variable.scss - settings - - foreground - #ea999c - - - - name - CSS variables (--prefixed) - scope - source.css meta.property-list variable, meta.property-list variable.other.less, meta.property-list variable.other.less punctuation.definition.variable.less - settings - - foreground - #8caaee - - - - name - CSS Percentage values, styled the same as numbers - scope - keyword.other.unit.percentage.css - settings - - foreground - #ef9f76 - - - - name - CSS Attribute selectors, styled the same as strings - scope - source.css meta.attribute-selector - settings - - foreground - #a6d189 - - - - name - JSON/YAML keys, other left-hand assignments - scope - keyword.other.definition.ini, punctuation.support.type.property-name.json, support.type.property-name.json, punctuation.support.type.property-name.toml, support.type.property-name.toml, entity.name.tag.yaml, punctuation.support.type.property-name.yaml, support.type.property-name.yaml - settings - - foreground - #8caaee - fontStyle - - - - - name - JSON/YAML constants - scope - constant.language.json, constant.language.yaml - settings - - foreground - #ef9f76 - - - - name - YAML anchors - scope - entity.name.type.anchor.yaml, variable.other.alias.yaml - settings - - foreground - #e5c890 - fontStyle - - - - - name - TOML tables / ini groups - scope - support.type.property-name.table, entity.name.section.group-title.ini - settings - - foreground - #e5c890 - - - - name - TOML dates - scope - constant.other.time.datetime.offset.toml - settings - - foreground - #f4b8e4 - - - - name - YAML anchor puctuation - scope - punctuation.definition.anchor.yaml, punctuation.definition.alias.yaml - settings - - foreground - #f4b8e4 - - - - name - YAML triple dashes - scope - entity.other.document.begin.yaml - settings - - foreground - #f4b8e4 - - - - name - Markup Diff - scope - markup.changed.diff - settings - - foreground - #ef9f76 - - - - name - Diff - scope - meta.diff.header.from-file, meta.diff.header.to-file, punctuation.definition.from-file.diff, punctuation.definition.to-file.diff - settings - - foreground - #8caaee - - - - name - Diff Inserted - scope - markup.inserted.diff - settings - - foreground - #a6d189 - - - - name - Diff Deleted - scope - markup.deleted.diff - settings - - foreground - #e78284 - - - - name - dotenv left-hand side assignments - scope - variable.other.env - settings - - foreground - #8caaee - - - - name - dotenv reference to existing env variable - scope - string.quoted variable.other.env - settings - - foreground - #c6d0f5 - - - - name - GDScript functions - scope - support.function.builtin.gdscript - settings - - foreground - #8caaee - - - - name - GDScript constants - scope - constant.language.gdscript - settings - - foreground - #ef9f76 - - - - name - Comment keywords - scope - comment meta.annotation.go - settings - - foreground - #ea999c - - - - name - go:embed, go:build, etc. - scope - comment meta.annotation.parameters.go - settings - - foreground - #ef9f76 - - - - name - Go constants (nil, true, false) - scope - constant.language.go - settings - - foreground - #ef9f76 - - - - name - GraphQL variables - scope - variable.graphql - settings - - foreground - #c6d0f5 - - - - name - GraphQL aliases - scope - string.unquoted.alias.graphql - settings - - foreground - #eebebe - - - - name - GraphQL enum members - scope - constant.character.enum.graphql - settings - - foreground - #81c8be - - - - name - GraphQL field in types - scope - meta.objectvalues.graphql constant.object.key.graphql string.unquoted.graphql - settings - - foreground - #eebebe - - - - name - HTML/XML DOCTYPE as keyword - scope - keyword.other.doctype, meta.tag.sgml.doctype punctuation.definition.tag, meta.tag.metadata.doctype entity.name.tag, meta.tag.metadata.doctype punctuation.definition.tag - settings - - foreground - #ca9ee6 - - - - name - HTML/XML-like <tags/> - scope - entity.name.tag - settings - - foreground - #8caaee - fontStyle - - - - - name - Special characters like &amp; - scope - text.html constant.character.entity, text.html constant.character.entity punctuation, constant.character.entity.xml, constant.character.entity.xml punctuation, constant.character.entity.js.jsx, constant.charactger.entity.js.jsx punctuation, constant.character.entity.tsx, constant.character.entity.tsx punctuation - settings - - foreground - #e78284 - - - - name - HTML/XML tag attribute values - scope - entity.other.attribute-name - settings - - foreground - #e5c890 - - - - name - Components - scope - support.class.component, support.class.component.jsx, support.class.component.tsx, support.class.component.vue - settings - - foreground - #f4b8e4 - fontStyle - - - - - name - Annotations - scope - punctuation.definition.annotation, storage.type.annotation - settings - - foreground - #ef9f76 - - - - name - Java enums - scope - constant.other.enum.java - settings - - foreground - #81c8be - - - - name - Java imports - scope - storage.modifier.import.java - settings - - foreground - #c6d0f5 - - - - name - Javadoc - scope - comment.block.javadoc.java keyword.other.documentation.javadoc.java - settings - - fontStyle - - - - - name - Exported Variable - scope - meta.export variable.other.readwrite.js - settings - - foreground - #ea999c - - - - name - JS/TS constants & properties - scope - variable.other.constant.js, variable.other.constant.ts, variable.other.property.js, variable.other.property.ts - settings - - foreground - #c6d0f5 - - - - name - JSDoc; these are mainly params, so styled as such - scope - variable.other.jsdoc, comment.block.documentation variable.other - settings - - foreground - #ea999c - fontStyle - - - - - name - JSDoc keywords - scope - storage.type.class.jsdoc - settings - - fontStyle - - - - - scope - support.type.object.console.js - settings - - foreground - #c6d0f5 - - - - name - Node constants as keywords (module, etc.) - scope - support.constant.node, support.type.object.module.js - settings - - foreground - #ca9ee6 - - - - name - implements as keyword - scope - storage.modifier.implements - settings - - foreground - #ca9ee6 - - - - name - Builtin types - scope - constant.language.null.js, constant.language.null.ts, constant.language.undefined.js, constant.language.undefined.ts, support.type.builtin.ts - settings - - foreground - #ca9ee6 - - - - scope - variable.parameter.generic - settings - - foreground - #e5c890 - - - - name - Arrow functions - scope - keyword.declaration.function.arrow.js, storage.type.function.arrow.ts - settings - - foreground - #81c8be - - - - name - Decorator punctuations (decorators inherit from blue functions, instead of styleguide peach) - scope - punctuation.decorator.ts - settings - - foreground - #8caaee - fontStyle - italic - - - - name - Extra JS/TS keywords - scope - keyword.operator.expression.in.js, keyword.operator.expression.in.ts, keyword.operator.expression.infer.ts, keyword.operator.expression.instanceof.js, keyword.operator.expression.instanceof.ts, keyword.operator.expression.is, keyword.operator.expression.keyof.ts, keyword.operator.expression.of.js, keyword.operator.expression.of.ts, keyword.operator.expression.typeof.ts - settings - - foreground - #ca9ee6 - - - - name - Julia macros - scope - support.function.macro.julia - settings - - foreground - #81c8be - fontStyle - italic - - - - name - Julia language constants (true, false) - scope - constant.language.julia - settings - - foreground - #ef9f76 - - - - name - Julia other constants (these seem to be arguments inside arrays) - scope - constant.other.symbol.julia - settings - - foreground - #ea999c - - - - name - LaTeX preamble - scope - text.tex keyword.control.preamble - settings - - foreground - #81c8be - - - - name - LaTeX be functions - scope - text.tex support.function.be - settings - - foreground - #99d1db - - - - name - LaTeX math - scope - constant.other.general.math.tex - settings - - foreground - #eebebe - - - - name - Liquid Builtin Objects & User Defined Variables - scope - variable.language.liquid - settings - - foreground - #f4b8e4 - - - - name - Lua docstring keywords - scope - comment.line.double-dash.documentation.lua storage.type.annotation.lua - settings - - foreground - #ca9ee6 - fontStyle - - - - - name - Lua docstring variables - scope - comment.line.double-dash.documentation.lua entity.name.variable.lua, comment.line.double-dash.documentation.lua variable.lua - settings - - foreground - #c6d0f5 - - - - scope - heading.1.markdown punctuation.definition.heading.markdown, heading.1.markdown, heading.1.quarto punctuation.definition.heading.quarto, heading.1.quarto, markup.heading.atx.1.mdx, markup.heading.atx.1.mdx punctuation.definition.heading.mdx, markup.heading.setext.1.markdown, markup.heading.heading-0.asciidoc - settings - - foreground - #e78284 - - - - scope - heading.2.markdown punctuation.definition.heading.markdown, heading.2.markdown, heading.2.quarto punctuation.definition.heading.quarto, heading.2.quarto, markup.heading.atx.2.mdx, markup.heading.atx.2.mdx punctuation.definition.heading.mdx, markup.heading.setext.2.markdown, markup.heading.heading-1.asciidoc - settings - - foreground - #ef9f76 - - - - scope - heading.3.markdown punctuation.definition.heading.markdown, heading.3.markdown, heading.3.quarto punctuation.definition.heading.quarto, heading.3.quarto, markup.heading.atx.3.mdx, markup.heading.atx.3.mdx punctuation.definition.heading.mdx, markup.heading.heading-2.asciidoc - settings - - foreground - #e5c890 - - - - scope - heading.4.markdown punctuation.definition.heading.markdown, heading.4.markdown, heading.4.quarto punctuation.definition.heading.quarto, heading.4.quarto, markup.heading.atx.4.mdx, markup.heading.atx.4.mdx punctuation.definition.heading.mdx, markup.heading.heading-3.asciidoc - settings - - foreground - #a6d189 - - - - scope - heading.5.markdown punctuation.definition.heading.markdown, heading.5.markdown, heading.5.quarto punctuation.definition.heading.quarto, heading.5.quarto, markup.heading.atx.5.mdx, markup.heading.atx.5.mdx punctuation.definition.heading.mdx, markup.heading.heading-4.asciidoc - settings - - foreground - #85c1dc - - - - scope - heading.6.markdown punctuation.definition.heading.markdown, heading.6.markdown, heading.6.quarto punctuation.definition.heading.quarto, heading.6.quarto, markup.heading.atx.6.mdx, markup.heading.atx.6.mdx punctuation.definition.heading.mdx, markup.heading.heading-5.asciidoc - settings - - foreground - #babbf1 - - - - scope - markup.bold - settings - - foreground - #e78284 - fontStyle - bold - - - - scope - markup.italic - settings - - foreground - #e78284 - fontStyle - italic - - - - scope - markup.strikethrough - settings - - foreground - #a5adce - fontStyle - strikethrough - - - - name - Markdown auto links - scope - punctuation.definition.link, markup.underline.link - settings - - foreground - #8caaee - - - - name - Markdown links - scope - text.html.markdown punctuation.definition.link.title, text.html.quarto punctuation.definition.link.title, string.other.link.title.markdown, string.other.link.title.quarto, markup.link, punctuation.definition.constant.markdown, punctuation.definition.constant.quarto, constant.other.reference.link.markdown, constant.other.reference.link.quarto, markup.substitution.attribute-reference - settings - - foreground - #babbf1 - - - - name - Markdown code spans - scope - punctuation.definition.raw.markdown, punctuation.definition.raw.quarto, markup.inline.raw.string.markdown, markup.inline.raw.string.quarto, markup.raw.block.markdown, markup.raw.block.quarto - settings - - foreground - #a6d189 - - - - name - Markdown triple backtick language identifier - scope - fenced_code.block.language - settings - - foreground - #99d1db - - - - name - Markdown triple backticks - scope - markup.fenced_code.block punctuation.definition, markup.raw support.asciidoc - settings - - foreground - #949cbb - - - - name - Markdown quotes - scope - markup.quote, punctuation.definition.quote.begin - settings - - foreground - #f4b8e4 - - - - name - Markdown separators - scope - meta.separator.markdown - settings - - foreground - #81c8be - - - - name - Markdown list bullets - scope - punctuation.definition.list.begin.markdown, punctuation.definition.list.begin.quarto, markup.list.bullet - settings - - foreground - #81c8be - - - - name - Quarto headings - scope - markup.heading.quarto - settings - - fontStyle - bold - - - - name - Nix attribute names - scope - entity.other.attribute-name.multipart.nix, entity.other.attribute-name.single.nix - settings - - foreground - #8caaee - - - - name - Nix parameter names - scope - variable.parameter.name.nix - settings - - foreground - #c6d0f5 - fontStyle - - - - - name - Nix interpolated parameter names - scope - meta.embedded variable.parameter.name.nix - settings - - foreground - #babbf1 - fontStyle - - - - - name - Nix paths - scope - string.unquoted.path.nix - settings - - foreground - #f4b8e4 - fontStyle - - - - - name - PHP Attributes - scope - support.attribute.builtin, meta.attribute.php - settings - - foreground - #e5c890 - - - - name - PHP Parameters (needed for the leading dollar sign) - scope - meta.function.parameters.php punctuation.definition.variable.php - settings - - foreground - #ea999c - - - - name - PHP Constants (null, __FILE__, etc.) - scope - constant.language.php - settings - - foreground - #ca9ee6 - - - - name - PHP functions - scope - text.html.php support.function - settings - - foreground - #99d1db - - - - name - PHPdoc keywords - scope - keyword.other.phpdoc.php - settings - - fontStyle - - - - - name - Python argument functions reset to text, otherwise they inherit blue from function-call - scope - support.variable.magic.python, meta.function-call.arguments.python - settings - - foreground - #c6d0f5 - - - - name - Python double underscore functions - scope - support.function.magic.python - settings - - foreground - #99d1db - fontStyle - italic - - - - name - Python `self` keyword - scope - variable.parameter.function.language.special.self.python, variable.language.special.self.python - settings - - foreground - #e78284 - fontStyle - italic - - - - name - python keyword flow/logical (for ... in) - scope - keyword.control.flow.python, keyword.operator.logical.python - settings - - foreground - #ca9ee6 - - - - name - python storage type - scope - storage.type.function.python - settings - - foreground - #ca9ee6 - - - - name - python function support - scope - support.token.decorator.python, meta.function.decorator.identifier.python - settings - - foreground - #99d1db - - - - name - python function calls - scope - meta.function-call.python - settings - - foreground - #8caaee - - - - name - python function decorators - scope - entity.name.function.decorator.python, punctuation.definition.decorator.python - settings - - foreground - #ef9f76 - fontStyle - italic - - - - name - python placeholder reset to normal string - scope - constant.character.format.placeholder.other.python - settings - - foreground - #f4b8e4 - - - - name - Python exception & builtins such as exit() - scope - support.type.exception.python, support.function.builtin.python - settings - - foreground - #ef9f76 - - - - name - entity.name.type - scope - support.type.python - settings - - foreground - #ca9ee6 - - - - name - python constants (True/False) - scope - constant.language.python - settings - - foreground - #ef9f76 - - - - name - Arguments accessed later in the function body - scope - meta.indexed-name.python, meta.item-access.python - settings - - foreground - #ea999c - fontStyle - italic - - - - name - Python f-strings/binary/unicode storage types - scope - storage.type.string.python - settings - - foreground - #a6d189 - fontStyle - italic - - - - name - Python type hints - scope - meta.function.parameters.python - settings - - fontStyle - - - - - name - Regex string begin/end in JS/TS - scope - string.regexp punctuation.definition.string.begin, string.regexp punctuation.definition.string.end - settings - - foreground - #f4b8e4 - - - - name - Regex anchors (^, $) - scope - keyword.control.anchor.regexp - settings - - foreground - #ca9ee6 - - - - name - Regex regular string match - scope - string.regexp.ts - settings - - foreground - #c6d0f5 - - - - name - Regex group parenthesis & backreference (\1, \2, \3, ...) - scope - punctuation.definition.group.regexp, keyword.other.back-reference.regexp - settings - - foreground - #a6d189 - - - - name - Regex character class [] - scope - punctuation.definition.character-class.regexp - settings - - foreground - #e5c890 - - - - name - Regex character classes (\d, \w, \s) - scope - constant.other.character-class.regexp - settings - - foreground - #f4b8e4 - - - - name - Regex range - scope - constant.other.character-class.range.regexp - settings - - foreground - #f2d5cf - - - - name - Regex quantifier - scope - keyword.operator.quantifier.regexp - settings - - foreground - #81c8be - - - - name - Regex constant/numeric - scope - constant.character.numeric.regexp - settings - - foreground - #ef9f76 - - - - name - Regex lookaheads, negative lookaheads, lookbehinds, negative lookbehinds - scope - punctuation.definition.group.no-capture.regexp, meta.assertion.look-ahead.regexp, meta.assertion.negative-look-ahead.regexp - settings - - foreground - #8caaee - - - - name - Rust attribute - scope - meta.annotation.rust, meta.annotation.rust punctuation, meta.attribute.rust, punctuation.definition.attribute.rust - settings - - foreground - #e5c890 - fontStyle - italic - - - - name - Rust attribute strings - scope - meta.attribute.rust string.quoted.double.rust, meta.attribute.rust string.quoted.single.char.rust - settings - - fontStyle - - - - - name - Rust keyword - scope - entity.name.function.macro.rules.rust, storage.type.module.rust, storage.modifier.rust, storage.type.struct.rust, storage.type.enum.rust, storage.type.trait.rust, storage.type.union.rust, storage.type.impl.rust, storage.type.rust, storage.type.function.rust, storage.type.type.rust - settings - - foreground - #ca9ee6 - fontStyle - - - - - name - Rust u/i32, u/i64, etc. - scope - entity.name.type.numeric.rust - settings - - foreground - #ca9ee6 - fontStyle - - - - - name - Rust generic - scope - meta.generic.rust - settings - - foreground - #ef9f76 - - - - name - Rust impl - scope - entity.name.impl.rust - settings - - foreground - #e5c890 - fontStyle - italic - - - - name - Rust module - scope - entity.name.module.rust - settings - - foreground - #ef9f76 - - - - name - Rust trait - scope - entity.name.trait.rust - settings - - foreground - #e5c890 - fontStyle - italic - - - - name - Rust struct - scope - storage.type.source.rust - settings - - foreground - #e5c890 - - - - name - Rust union - scope - entity.name.union.rust - settings - - foreground - #e5c890 - - - - name - Rust enum member - scope - meta.enum.rust storage.type.source.rust - settings - - foreground - #81c8be - - - - name - Rust macro - scope - support.macro.rust, meta.macro.rust support.function.rust, entity.name.function.macro.rust - settings - - foreground - #8caaee - fontStyle - italic - - - - name - Rust lifetime - scope - storage.modifier.lifetime.rust, entity.name.type.lifetime - settings - - foreground - #8caaee - fontStyle - italic - - - - name - Rust string formatting - scope - string.quoted.double.rust constant.other.placeholder.rust - settings - - foreground - #f4b8e4 - - - - name - Rust return type generic - scope - meta.function.return-type.rust meta.generic.rust storage.type.rust - settings - - foreground - #c6d0f5 - - - - name - Rust functions - scope - meta.function.call.rust - settings - - foreground - #8caaee - - - - name - Rust angle brackets - scope - punctuation.brackets.angle.rust - settings - - foreground - #99d1db - - - - name - Rust constants - scope - constant.other.caps.rust - settings - - foreground - #ef9f76 - - - - name - Rust function parameters - scope - meta.function.definition.rust variable.other.rust - settings - - foreground - #ea999c - - - - name - Rust closure variables - scope - meta.function.call.rust variable.other.rust - settings - - foreground - #c6d0f5 - - - - name - Rust self - scope - variable.language.self.rust - settings - - foreground - #e78284 - - - - name - Rust metavariable names - scope - variable.other.metavariable.name.rust, meta.macro.metavariable.rust keyword.operator.macro.dollar.rust - settings - - foreground - #f4b8e4 - - - - name - Shell shebang - scope - comment.line.shebang, comment.line.shebang punctuation.definition.comment, comment.line.shebang, punctuation.definition.comment.shebang.shell, meta.shebang.shell - settings - - foreground - #f4b8e4 - fontStyle - italic - - - - name - Shell shebang command - scope - comment.line.shebang constant.language - settings - - foreground - #81c8be - fontStyle - italic - - - - name - Shell interpolated command - scope - meta.function-call.arguments.shell punctuation.definition.variable.shell, meta.function-call.arguments.shell punctuation.section.interpolation, meta.function-call.arguments.shell punctuation.definition.variable.shell, meta.function-call.arguments.shell punctuation.section.interpolation - settings - - foreground - #e78284 - - - - name - Shell interpolated command variable - scope - meta.string meta.interpolation.parameter.shell variable.other.readwrite - settings - - foreground - #ef9f76 - fontStyle - italic - - - - scope - source.shell punctuation.section.interpolation, punctuation.definition.evaluation.backticks.shell - settings - - foreground - #81c8be - - - - name - Shell EOF - scope - entity.name.tag.heredoc.shell - settings - - foreground - #ca9ee6 - - - - name - Shell quoted variable - scope - string.quoted.double.shell variable.other.normal.shell - settings - - foreground - #c6d0f5 - - - - scope - markup.heading.typst - settings - - foreground - #e78284 - - - - name - JSON Keys - scope - source.json meta.mapping.key string - settings - - foreground - #8caaee - - - - name - JSON key surrounding quotes - scope - source.json meta.mapping.key punctuation.definition.string.begin, source.json meta.mapping.key punctuation.definition.string.end - settings - - foreground - #949cbb - - - - scope - markup.heading.synopsis.man, markup.heading.title.man, markup.heading.other.man, markup.heading.env.man - settings - - foreground - #ca9ee6 - - - - scope - markup.heading.commands.man - settings - - foreground - #8caaee - - - - scope - markup.heading.env.man - settings - - foreground - #f4b8e4 - - - - name - Man page options - scope - entity.name - settings - - foreground - #81c8be - - - - scope - markup.heading.1.markdown - settings - - foreground - #e78284 - - - - scope - markup.heading.2.markdown - settings - - foreground - #ef9f76 - - - - scope - markup.heading.markdown - settings - - foreground - #e5c890 - - - - - \ No newline at end of file diff --git a/fedora/.config/yazi/flavors/catppuccin-latte.yazi/LICENSE b/fedora/.config/yazi/flavors/catppuccin-latte.yazi/LICENSE deleted file mode 100644 index fb5b1d6..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-latte.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 yazi-rs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/catppuccin-latte.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/catppuccin-latte.yazi/LICENSE-tmtheme deleted file mode 100644 index 006383b..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-latte.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Catppuccin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/catppuccin-latte.yazi/README.md b/fedora/.config/yazi/flavors/catppuccin-latte.yazi/README.md deleted file mode 100644 index ea1c35e..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-latte.yazi/README.md +++ /dev/null @@ -1,36 +0,0 @@ -
- Yazi logo -
- -

- Catppuccin Latte Flavor for Yazi -

- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -```sh -ya pkg add yazi-rs/flavors:catppuccin-latte -``` - -## โš™๏ธ Usage - -Set the content of your `theme.toml` to enable it as your _light_ flavor: - -```toml -[flavor] -light = "catppuccin-latte" -``` - -Make sure your `theme.toml` doesn't contain anything other than `[flavor]`, unless you want to override certain styles of this flavor. - -See the [Yazi flavor documentation](https://yazi-rs.github.io/docs/flavors/overview) for more details. - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/catppuccin-latte.yazi/flavor.toml b/fedora/.config/yazi/flavors/catppuccin-latte.yazi/flavor.toml deleted file mode 100644 index ba2bb78..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-latte.yazi/flavor.toml +++ /dev/null @@ -1,189 +0,0 @@ -# vim:fileencoding=utf-8:foldmethod=marker - -# : Manager {{{ - -[mgr] -cwd = { fg = "#179299" } - -# Hovered -hovered = { reversed = true } -preview_hovered = { underline = true } - -# Find -find_keyword = { fg = "#df8e1d", bold = true, italic = true, underline = true } -find_position = { fg = "#ea76cb", bg = "reset", bold = true, italic = true } - -# Marker -marker_copied = { fg = "#40a02b", bg = "#40a02b" } -marker_cut = { fg = "#d20f39", bg = "#d20f39" } -marker_marked = { fg = "#179299", bg = "#179299" } -marker_selected = { fg = "#df8e1d", bg = "#df8e1d" } - -# Count -count_copied = { fg = "#eff1f5", bg = "#40a02b" } -count_cut = { fg = "#eff1f5", bg = "#d20f39" } -count_selected = { fg = "#eff1f5", bg = "#df8e1d" } - -# Border -border_symbol = "โ”‚" -border_style = { fg = "#8c8fa1" } - -# : }}} - - -# : Tabs {{{ - -[tabs] -active = { fg = "#eff1f5", bg = "#1e66f5", bold = true } -inactive = { fg = "#1e66f5", bg = "#ccd0da" } - -# : }}} - - -# : Mode {{{ - -[mode] - -normal_main = { fg = "#eff1f5", bg = "#1e66f5", bold = true } -normal_alt = { fg = "#1e66f5", bg = "#ccd0da" } - -# Select mode -select_main = { fg = "#eff1f5", bg = "#179299", bold = true } -select_alt = { fg = "#179299", bg = "#ccd0da" } - -# Unset mode -unset_main = { fg = "#eff1f5", bg = "#dd7878", bold = true } -unset_alt = { fg = "#dd7878", bg = "#ccd0da" } - -# : }}} - - -# : Status bar {{{ - -[status] -# Permissions -perm_sep = { fg = "#8c8fa1" } -perm_type = { fg = "#1e66f5" } -perm_read = { fg = "#df8e1d" } -perm_write = { fg = "#d20f39" } -perm_exec = { fg = "#40a02b" } - -# Progress -progress_label = { fg = "#ffffff", bold = true } -progress_normal = { fg = "#1e66f5", bg = "#bcc0cc" } -progress_error = { fg = "#1e66f5", bg = "#d20f39" } - -# : }}} - - -# : Pick {{{ - -[pick] -border = { fg = "#1e66f5" } -active = { fg = "#ea76cb", bold = true } -inactive = {} - -# : }}} - - -# : Input {{{ - -[input] -border = { fg = "#1e66f5" } -title = {} -value = {} -selected = { reversed = true } - -# : }}} - - -# : Completion {{{ - -[cmp] -border = { fg = "#1e66f5" } - -# : }}} - - -# : Tasks {{{ - -[tasks] -border = { fg = "#1e66f5" } -title = {} -hovered = { fg = "#ea76cb", bold = true } - -# : }}} - - -# : Which {{{ - -[which] -mask = { bg = "#ccd0da" } -cand = { fg = "#179299" } -rest = { fg = "#7c7f93" } -desc = { fg = "#ea76cb" } -separator = " ๎ชœ " -separator_style = { fg = "#acb0be" } - -# : }}} - - -# : Help {{{ - -[help] -on = { fg = "#179299" } -run = { fg = "#ea76cb" } -hovered = { reversed = true, bold = true } -footer = { fg = "#ccd0da", bg = "#4c4f69" } - -# : }}} - - -# : Spotter {{{ - -[spot] -border = { fg = "#1e66f5" } -title = { fg = "#1e66f5" } -tbl_col = { fg = "#179299" } -tbl_cell = { fg = "#ea76cb", bg = "#bcc0cc" } - -# : }}} - - -# : Notification {{{ - -[notify] -title_info = { fg = "#40a02b" } -title_warn = { fg = "#df8e1d" } -title_error = { fg = "#d20f39" } - -# : }}} - - -# : File-specific styles {{{ - -[filetype] - -rules = [ - # Images - { mime = "image/*", fg = "#179299" }, - - # Media - { mime = "{audio,video}/*", fg = "#df8e1d" }, - - # Archives - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#ea76cb" }, - - # Documents - { mime = "application/{pdf,doc,rtf}", fg = "#40a02b" }, - - # Fallback - { url = "*", fg = "#4c4f69" }, - { url = "*/", fg = "#1e66f5" }, - - # TODO: remove - { name = "*", fg = "#4c4f69" }, - { name = "*/", fg = "#1e66f5" } -] - -# : }}} diff --git a/fedora/.config/yazi/flavors/catppuccin-latte.yazi/preview.png b/fedora/.config/yazi/flavors/catppuccin-latte.yazi/preview.png deleted file mode 100644 index 7712450..0000000 Binary files a/fedora/.config/yazi/flavors/catppuccin-latte.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/catppuccin-latte.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/catppuccin-latte.yazi/tmtheme.xml deleted file mode 100644 index ddeb349..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-latte.yazi/tmtheme.xml +++ /dev/null @@ -1,2112 +0,0 @@ - - - - - name - Catppuccin Latte - semanticClass - theme.light.catppuccin-latte - uuid - 96a262cd-4b2f-49f5-9125-8dd0077cbfe1 - author - Catppuccin Org - colorSpaceName - sRGB - settings - - - settings - - background - #eff1f5 - foreground - #4c4f69 - caret - #dc8a78 - lineHighlight - #ccd0da - misspelling - #d20f39 - accent - #8839ef - selection - #7c7f934d - activeGuide - #bcc0cc - findHighlight - #a9daf0 - gutterForeground - #8c8fa1 - - - - name - Basic text & variable names (incl. leading punctuation) - scope - text, source, variable.other.readwrite, punctuation.definition.variable - settings - - foreground - #4c4f69 - - - - name - Parentheses, Brackets, Braces - scope - punctuation - settings - - foreground - #7c7f93 - fontStyle - - - - - name - Comments - scope - comment, punctuation.definition.comment - settings - - foreground - #7c7f93 - fontStyle - italic - - - - scope - string, punctuation.definition.string - settings - - foreground - #40a02b - - - - scope - constant.character.escape - settings - - foreground - #ea76cb - - - - name - Booleans, constants, numbers - scope - constant.numeric, variable.other.constant, entity.name.constant, constant.language.boolean, constant.language.false, constant.language.true, keyword.other.unit.user-defined, keyword.other.unit.suffix.floating-point - settings - - foreground - #fe640b - - - - scope - keyword, keyword.operator.word, keyword.operator.new, variable.language.super, support.type.primitive, storage.type, storage.modifier, punctuation.definition.keyword - settings - - foreground - #8839ef - fontStyle - - - - - scope - entity.name.tag.documentation - settings - - foreground - #8839ef - - - - name - Punctuation - scope - keyword.operator, punctuation.accessor, punctuation.definition.generic, meta.function.closure punctuation.section.parameters, punctuation.definition.tag, punctuation.separator.key-value - settings - - foreground - #179299 - - - - scope - entity.name.function, meta.function-call.method, support.function, support.function.misc, variable.function - settings - - foreground - #1e66f5 - fontStyle - italic - - - - name - Classes - scope - entity.name.class, entity.other.inherited-class, support.class, meta.function-call.constructor, entity.name.struct - settings - - foreground - #df8e1d - fontStyle - italic - - - - name - Enum - scope - entity.name.enum - settings - - foreground - #df8e1d - fontStyle - italic - - - - name - Enum member - scope - meta.enum variable.other.readwrite, variable.other.enummember - settings - - foreground - #179299 - - - - name - Object properties - scope - meta.property.object - settings - - foreground - #179299 - - - - name - Types - scope - meta.type, meta.type-alias, support.type, entity.name.type - settings - - foreground - #df8e1d - fontStyle - italic - - - - name - Decorators - scope - meta.annotation variable.function, meta.annotation variable.annotation.function, meta.annotation punctuation.definition.annotation, meta.decorator, punctuation.decorator - settings - - foreground - #fe640b - - - - scope - variable.parameter, meta.function.parameters - settings - - foreground - #e64553 - fontStyle - italic - - - - name - Built-ins - scope - constant.language, support.function.builtin - settings - - foreground - #d20f39 - - - - scope - entity.other.attribute-name.documentation - settings - - foreground - #d20f39 - - - - name - Preprocessor directives - scope - keyword.control.directive, punctuation.definition.directive - settings - - foreground - #df8e1d - - - - name - Type parameters - scope - punctuation.definition.typeparameters - settings - - foreground - #04a5e5 - - - - name - Namespaces - scope - entity.name.namespace - settings - - foreground - #df8e1d - - - - name - Property names (left hand assignments in json/yaml/css) - scope - support.type.property-name.css - settings - - foreground - #1e66f5 - fontStyle - - - - - name - This/Self keyword - scope - variable.language.this, variable.language.this punctuation.definition.variable - settings - - foreground - #d20f39 - - - - name - Object properties - scope - variable.object.property - settings - - foreground - #4c4f69 - - - - name - String template interpolation - scope - string.template variable, string variable - settings - - foreground - #4c4f69 - - - - name - `new` as bold - scope - keyword.operator.new - settings - - fontStyle - bold - - - - name - C++ extern keyword - scope - storage.modifier.specifier.extern.cpp - settings - - foreground - #8839ef - - - - name - C++ scope resolution - scope - entity.name.scope-resolution.template.call.cpp, entity.name.scope-resolution.parameter.cpp, entity.name.scope-resolution.cpp, entity.name.scope-resolution.function.definition.cpp - settings - - foreground - #df8e1d - - - - name - C++ doc keywords - scope - storage.type.class.doxygen - settings - - fontStyle - - - - - name - C++ operators - scope - storage.modifier.reference.cpp - settings - - foreground - #179299 - - - - name - C# Interpolated Strings - scope - meta.interpolation.cs - settings - - foreground - #4c4f69 - - - - name - C# xml-style docs - scope - comment.block.documentation.cs - settings - - foreground - #4c4f69 - - - - name - Classes, reflecting the className color in JSX - scope - source.css entity.other.attribute-name.class.css, entity.other.attribute-name.parent-selector.css punctuation.definition.entity.css - settings - - foreground - #df8e1d - - - - name - Operators - scope - punctuation.separator.operator.css - settings - - foreground - #179299 - - - - name - Pseudo classes - scope - source.css entity.other.attribute-name.pseudo-class - settings - - foreground - #179299 - - - - scope - source.css constant.other.unicode-range - settings - - foreground - #fe640b - - - - scope - source.css variable.parameter.url - settings - - foreground - #40a02b - fontStyle - - - - - name - CSS vendored property names - scope - support.type.vendored.property-name - settings - - foreground - #04a5e5 - - - - name - Less/SCSS right-hand variables (@/$-prefixed) - scope - source.css meta.property-value variable, source.css meta.property-value variable.other.less, source.css meta.property-value variable.other.less punctuation.definition.variable.less, meta.definition.variable.scss - settings - - foreground - #e64553 - - - - name - CSS variables (--prefixed) - scope - source.css meta.property-list variable, meta.property-list variable.other.less, meta.property-list variable.other.less punctuation.definition.variable.less - settings - - foreground - #1e66f5 - - - - name - CSS Percentage values, styled the same as numbers - scope - keyword.other.unit.percentage.css - settings - - foreground - #fe640b - - - - name - CSS Attribute selectors, styled the same as strings - scope - source.css meta.attribute-selector - settings - - foreground - #40a02b - - - - name - JSON/YAML keys, other left-hand assignments - scope - keyword.other.definition.ini, punctuation.support.type.property-name.json, support.type.property-name.json, punctuation.support.type.property-name.toml, support.type.property-name.toml, entity.name.tag.yaml, punctuation.support.type.property-name.yaml, support.type.property-name.yaml - settings - - foreground - #1e66f5 - fontStyle - - - - - name - JSON/YAML constants - scope - constant.language.json, constant.language.yaml - settings - - foreground - #fe640b - - - - name - YAML anchors - scope - entity.name.type.anchor.yaml, variable.other.alias.yaml - settings - - foreground - #df8e1d - fontStyle - - - - - name - TOML tables / ini groups - scope - support.type.property-name.table, entity.name.section.group-title.ini - settings - - foreground - #df8e1d - - - - name - TOML dates - scope - constant.other.time.datetime.offset.toml - settings - - foreground - #ea76cb - - - - name - YAML anchor puctuation - scope - punctuation.definition.anchor.yaml, punctuation.definition.alias.yaml - settings - - foreground - #ea76cb - - - - name - YAML triple dashes - scope - entity.other.document.begin.yaml - settings - - foreground - #ea76cb - - - - name - Markup Diff - scope - markup.changed.diff - settings - - foreground - #fe640b - - - - name - Diff - scope - meta.diff.header.from-file, meta.diff.header.to-file, punctuation.definition.from-file.diff, punctuation.definition.to-file.diff - settings - - foreground - #1e66f5 - - - - name - Diff Inserted - scope - markup.inserted.diff - settings - - foreground - #40a02b - - - - name - Diff Deleted - scope - markup.deleted.diff - settings - - foreground - #d20f39 - - - - name - dotenv left-hand side assignments - scope - variable.other.env - settings - - foreground - #1e66f5 - - - - name - dotenv reference to existing env variable - scope - string.quoted variable.other.env - settings - - foreground - #4c4f69 - - - - name - GDScript functions - scope - support.function.builtin.gdscript - settings - - foreground - #1e66f5 - - - - name - GDScript constants - scope - constant.language.gdscript - settings - - foreground - #fe640b - - - - name - Comment keywords - scope - comment meta.annotation.go - settings - - foreground - #e64553 - - - - name - go:embed, go:build, etc. - scope - comment meta.annotation.parameters.go - settings - - foreground - #fe640b - - - - name - Go constants (nil, true, false) - scope - constant.language.go - settings - - foreground - #fe640b - - - - name - GraphQL variables - scope - variable.graphql - settings - - foreground - #4c4f69 - - - - name - GraphQL aliases - scope - string.unquoted.alias.graphql - settings - - foreground - #dd7878 - - - - name - GraphQL enum members - scope - constant.character.enum.graphql - settings - - foreground - #179299 - - - - name - GraphQL field in types - scope - meta.objectvalues.graphql constant.object.key.graphql string.unquoted.graphql - settings - - foreground - #dd7878 - - - - name - HTML/XML DOCTYPE as keyword - scope - keyword.other.doctype, meta.tag.sgml.doctype punctuation.definition.tag, meta.tag.metadata.doctype entity.name.tag, meta.tag.metadata.doctype punctuation.definition.tag - settings - - foreground - #8839ef - - - - name - HTML/XML-like <tags/> - scope - entity.name.tag - settings - - foreground - #1e66f5 - fontStyle - - - - - name - Special characters like &amp; - scope - text.html constant.character.entity, text.html constant.character.entity punctuation, constant.character.entity.xml, constant.character.entity.xml punctuation, constant.character.entity.js.jsx, constant.charactger.entity.js.jsx punctuation, constant.character.entity.tsx, constant.character.entity.tsx punctuation - settings - - foreground - #d20f39 - - - - name - HTML/XML tag attribute values - scope - entity.other.attribute-name - settings - - foreground - #df8e1d - - - - name - Components - scope - support.class.component, support.class.component.jsx, support.class.component.tsx, support.class.component.vue - settings - - foreground - #ea76cb - fontStyle - - - - - name - Annotations - scope - punctuation.definition.annotation, storage.type.annotation - settings - - foreground - #fe640b - - - - name - Java enums - scope - constant.other.enum.java - settings - - foreground - #179299 - - - - name - Java imports - scope - storage.modifier.import.java - settings - - foreground - #4c4f69 - - - - name - Javadoc - scope - comment.block.javadoc.java keyword.other.documentation.javadoc.java - settings - - fontStyle - - - - - name - Exported Variable - scope - meta.export variable.other.readwrite.js - settings - - foreground - #e64553 - - - - name - JS/TS constants & properties - scope - variable.other.constant.js, variable.other.constant.ts, variable.other.property.js, variable.other.property.ts - settings - - foreground - #4c4f69 - - - - name - JSDoc; these are mainly params, so styled as such - scope - variable.other.jsdoc, comment.block.documentation variable.other - settings - - foreground - #e64553 - fontStyle - - - - - name - JSDoc keywords - scope - storage.type.class.jsdoc - settings - - fontStyle - - - - - scope - support.type.object.console.js - settings - - foreground - #4c4f69 - - - - name - Node constants as keywords (module, etc.) - scope - support.constant.node, support.type.object.module.js - settings - - foreground - #8839ef - - - - name - implements as keyword - scope - storage.modifier.implements - settings - - foreground - #8839ef - - - - name - Builtin types - scope - constant.language.null.js, constant.language.null.ts, constant.language.undefined.js, constant.language.undefined.ts, support.type.builtin.ts - settings - - foreground - #8839ef - - - - scope - variable.parameter.generic - settings - - foreground - #df8e1d - - - - name - Arrow functions - scope - keyword.declaration.function.arrow.js, storage.type.function.arrow.ts - settings - - foreground - #179299 - - - - name - Decorator punctuations (decorators inherit from blue functions, instead of styleguide peach) - scope - punctuation.decorator.ts - settings - - foreground - #1e66f5 - fontStyle - italic - - - - name - Extra JS/TS keywords - scope - keyword.operator.expression.in.js, keyword.operator.expression.in.ts, keyword.operator.expression.infer.ts, keyword.operator.expression.instanceof.js, keyword.operator.expression.instanceof.ts, keyword.operator.expression.is, keyword.operator.expression.keyof.ts, keyword.operator.expression.of.js, keyword.operator.expression.of.ts, keyword.operator.expression.typeof.ts - settings - - foreground - #8839ef - - - - name - Julia macros - scope - support.function.macro.julia - settings - - foreground - #179299 - fontStyle - italic - - - - name - Julia language constants (true, false) - scope - constant.language.julia - settings - - foreground - #fe640b - - - - name - Julia other constants (these seem to be arguments inside arrays) - scope - constant.other.symbol.julia - settings - - foreground - #e64553 - - - - name - LaTeX preamble - scope - text.tex keyword.control.preamble - settings - - foreground - #179299 - - - - name - LaTeX be functions - scope - text.tex support.function.be - settings - - foreground - #04a5e5 - - - - name - LaTeX math - scope - constant.other.general.math.tex - settings - - foreground - #dd7878 - - - - name - Liquid Builtin Objects & User Defined Variables - scope - variable.language.liquid - settings - - foreground - #ea76cb - - - - name - Lua docstring keywords - scope - comment.line.double-dash.documentation.lua storage.type.annotation.lua - settings - - foreground - #8839ef - fontStyle - - - - - name - Lua docstring variables - scope - comment.line.double-dash.documentation.lua entity.name.variable.lua, comment.line.double-dash.documentation.lua variable.lua - settings - - foreground - #4c4f69 - - - - scope - heading.1.markdown punctuation.definition.heading.markdown, heading.1.markdown, heading.1.quarto punctuation.definition.heading.quarto, heading.1.quarto, markup.heading.atx.1.mdx, markup.heading.atx.1.mdx punctuation.definition.heading.mdx, markup.heading.setext.1.markdown, markup.heading.heading-0.asciidoc - settings - - foreground - #d20f39 - - - - scope - heading.2.markdown punctuation.definition.heading.markdown, heading.2.markdown, heading.2.quarto punctuation.definition.heading.quarto, heading.2.quarto, markup.heading.atx.2.mdx, markup.heading.atx.2.mdx punctuation.definition.heading.mdx, markup.heading.setext.2.markdown, markup.heading.heading-1.asciidoc - settings - - foreground - #fe640b - - - - scope - heading.3.markdown punctuation.definition.heading.markdown, heading.3.markdown, heading.3.quarto punctuation.definition.heading.quarto, heading.3.quarto, markup.heading.atx.3.mdx, markup.heading.atx.3.mdx punctuation.definition.heading.mdx, markup.heading.heading-2.asciidoc - settings - - foreground - #df8e1d - - - - scope - heading.4.markdown punctuation.definition.heading.markdown, heading.4.markdown, heading.4.quarto punctuation.definition.heading.quarto, heading.4.quarto, markup.heading.atx.4.mdx, markup.heading.atx.4.mdx punctuation.definition.heading.mdx, markup.heading.heading-3.asciidoc - settings - - foreground - #40a02b - - - - scope - heading.5.markdown punctuation.definition.heading.markdown, heading.5.markdown, heading.5.quarto punctuation.definition.heading.quarto, heading.5.quarto, markup.heading.atx.5.mdx, markup.heading.atx.5.mdx punctuation.definition.heading.mdx, markup.heading.heading-4.asciidoc - settings - - foreground - #209fb5 - - - - scope - heading.6.markdown punctuation.definition.heading.markdown, heading.6.markdown, heading.6.quarto punctuation.definition.heading.quarto, heading.6.quarto, markup.heading.atx.6.mdx, markup.heading.atx.6.mdx punctuation.definition.heading.mdx, markup.heading.heading-5.asciidoc - settings - - foreground - #7287fd - - - - scope - markup.bold - settings - - foreground - #d20f39 - fontStyle - bold - - - - scope - markup.italic - settings - - foreground - #d20f39 - fontStyle - italic - - - - scope - markup.strikethrough - settings - - foreground - #6c6f85 - fontStyle - strikethrough - - - - name - Markdown auto links - scope - punctuation.definition.link, markup.underline.link - settings - - foreground - #1e66f5 - - - - name - Markdown links - scope - text.html.markdown punctuation.definition.link.title, text.html.quarto punctuation.definition.link.title, string.other.link.title.markdown, string.other.link.title.quarto, markup.link, punctuation.definition.constant.markdown, punctuation.definition.constant.quarto, constant.other.reference.link.markdown, constant.other.reference.link.quarto, markup.substitution.attribute-reference - settings - - foreground - #7287fd - - - - name - Markdown code spans - scope - punctuation.definition.raw.markdown, punctuation.definition.raw.quarto, markup.inline.raw.string.markdown, markup.inline.raw.string.quarto, markup.raw.block.markdown, markup.raw.block.quarto - settings - - foreground - #40a02b - - - - name - Markdown triple backtick language identifier - scope - fenced_code.block.language - settings - - foreground - #04a5e5 - - - - name - Markdown triple backticks - scope - markup.fenced_code.block punctuation.definition, markup.raw support.asciidoc - settings - - foreground - #7c7f93 - - - - name - Markdown quotes - scope - markup.quote, punctuation.definition.quote.begin - settings - - foreground - #ea76cb - - - - name - Markdown separators - scope - meta.separator.markdown - settings - - foreground - #179299 - - - - name - Markdown list bullets - scope - punctuation.definition.list.begin.markdown, punctuation.definition.list.begin.quarto, markup.list.bullet - settings - - foreground - #179299 - - - - name - Quarto headings - scope - markup.heading.quarto - settings - - fontStyle - bold - - - - name - Nix attribute names - scope - entity.other.attribute-name.multipart.nix, entity.other.attribute-name.single.nix - settings - - foreground - #1e66f5 - - - - name - Nix parameter names - scope - variable.parameter.name.nix - settings - - foreground - #4c4f69 - fontStyle - - - - - name - Nix interpolated parameter names - scope - meta.embedded variable.parameter.name.nix - settings - - foreground - #7287fd - fontStyle - - - - - name - Nix paths - scope - string.unquoted.path.nix - settings - - foreground - #ea76cb - fontStyle - - - - - name - PHP Attributes - scope - support.attribute.builtin, meta.attribute.php - settings - - foreground - #df8e1d - - - - name - PHP Parameters (needed for the leading dollar sign) - scope - meta.function.parameters.php punctuation.definition.variable.php - settings - - foreground - #e64553 - - - - name - PHP Constants (null, __FILE__, etc.) - scope - constant.language.php - settings - - foreground - #8839ef - - - - name - PHP functions - scope - text.html.php support.function - settings - - foreground - #04a5e5 - - - - name - PHPdoc keywords - scope - keyword.other.phpdoc.php - settings - - fontStyle - - - - - name - Python argument functions reset to text, otherwise they inherit blue from function-call - scope - support.variable.magic.python, meta.function-call.arguments.python - settings - - foreground - #4c4f69 - - - - name - Python double underscore functions - scope - support.function.magic.python - settings - - foreground - #04a5e5 - fontStyle - italic - - - - name - Python `self` keyword - scope - variable.parameter.function.language.special.self.python, variable.language.special.self.python - settings - - foreground - #d20f39 - fontStyle - italic - - - - name - python keyword flow/logical (for ... in) - scope - keyword.control.flow.python, keyword.operator.logical.python - settings - - foreground - #8839ef - - - - name - python storage type - scope - storage.type.function.python - settings - - foreground - #8839ef - - - - name - python function support - scope - support.token.decorator.python, meta.function.decorator.identifier.python - settings - - foreground - #04a5e5 - - - - name - python function calls - scope - meta.function-call.python - settings - - foreground - #1e66f5 - - - - name - python function decorators - scope - entity.name.function.decorator.python, punctuation.definition.decorator.python - settings - - foreground - #fe640b - fontStyle - italic - - - - name - python placeholder reset to normal string - scope - constant.character.format.placeholder.other.python - settings - - foreground - #ea76cb - - - - name - Python exception & builtins such as exit() - scope - support.type.exception.python, support.function.builtin.python - settings - - foreground - #fe640b - - - - name - entity.name.type - scope - support.type.python - settings - - foreground - #8839ef - - - - name - python constants (True/False) - scope - constant.language.python - settings - - foreground - #fe640b - - - - name - Arguments accessed later in the function body - scope - meta.indexed-name.python, meta.item-access.python - settings - - foreground - #e64553 - fontStyle - italic - - - - name - Python f-strings/binary/unicode storage types - scope - storage.type.string.python - settings - - foreground - #40a02b - fontStyle - italic - - - - name - Python type hints - scope - meta.function.parameters.python - settings - - fontStyle - - - - - name - Regex string begin/end in JS/TS - scope - string.regexp punctuation.definition.string.begin, string.regexp punctuation.definition.string.end - settings - - foreground - #ea76cb - - - - name - Regex anchors (^, $) - scope - keyword.control.anchor.regexp - settings - - foreground - #8839ef - - - - name - Regex regular string match - scope - string.regexp.ts - settings - - foreground - #4c4f69 - - - - name - Regex group parenthesis & backreference (\1, \2, \3, ...) - scope - punctuation.definition.group.regexp, keyword.other.back-reference.regexp - settings - - foreground - #40a02b - - - - name - Regex character class [] - scope - punctuation.definition.character-class.regexp - settings - - foreground - #df8e1d - - - - name - Regex character classes (\d, \w, \s) - scope - constant.other.character-class.regexp - settings - - foreground - #ea76cb - - - - name - Regex range - scope - constant.other.character-class.range.regexp - settings - - foreground - #dc8a78 - - - - name - Regex quantifier - scope - keyword.operator.quantifier.regexp - settings - - foreground - #179299 - - - - name - Regex constant/numeric - scope - constant.character.numeric.regexp - settings - - foreground - #fe640b - - - - name - Regex lookaheads, negative lookaheads, lookbehinds, negative lookbehinds - scope - punctuation.definition.group.no-capture.regexp, meta.assertion.look-ahead.regexp, meta.assertion.negative-look-ahead.regexp - settings - - foreground - #1e66f5 - - - - name - Rust attribute - scope - meta.annotation.rust, meta.annotation.rust punctuation, meta.attribute.rust, punctuation.definition.attribute.rust - settings - - foreground - #df8e1d - fontStyle - italic - - - - name - Rust attribute strings - scope - meta.attribute.rust string.quoted.double.rust, meta.attribute.rust string.quoted.single.char.rust - settings - - fontStyle - - - - - name - Rust keyword - scope - entity.name.function.macro.rules.rust, storage.type.module.rust, storage.modifier.rust, storage.type.struct.rust, storage.type.enum.rust, storage.type.trait.rust, storage.type.union.rust, storage.type.impl.rust, storage.type.rust, storage.type.function.rust, storage.type.type.rust - settings - - foreground - #8839ef - fontStyle - - - - - name - Rust u/i32, u/i64, etc. - scope - entity.name.type.numeric.rust - settings - - foreground - #8839ef - fontStyle - - - - - name - Rust generic - scope - meta.generic.rust - settings - - foreground - #fe640b - - - - name - Rust impl - scope - entity.name.impl.rust - settings - - foreground - #df8e1d - fontStyle - italic - - - - name - Rust module - scope - entity.name.module.rust - settings - - foreground - #fe640b - - - - name - Rust trait - scope - entity.name.trait.rust - settings - - foreground - #df8e1d - fontStyle - italic - - - - name - Rust struct - scope - storage.type.source.rust - settings - - foreground - #df8e1d - - - - name - Rust union - scope - entity.name.union.rust - settings - - foreground - #df8e1d - - - - name - Rust enum member - scope - meta.enum.rust storage.type.source.rust - settings - - foreground - #179299 - - - - name - Rust macro - scope - support.macro.rust, meta.macro.rust support.function.rust, entity.name.function.macro.rust - settings - - foreground - #1e66f5 - fontStyle - italic - - - - name - Rust lifetime - scope - storage.modifier.lifetime.rust, entity.name.type.lifetime - settings - - foreground - #1e66f5 - fontStyle - italic - - - - name - Rust string formatting - scope - string.quoted.double.rust constant.other.placeholder.rust - settings - - foreground - #ea76cb - - - - name - Rust return type generic - scope - meta.function.return-type.rust meta.generic.rust storage.type.rust - settings - - foreground - #4c4f69 - - - - name - Rust functions - scope - meta.function.call.rust - settings - - foreground - #1e66f5 - - - - name - Rust angle brackets - scope - punctuation.brackets.angle.rust - settings - - foreground - #04a5e5 - - - - name - Rust constants - scope - constant.other.caps.rust - settings - - foreground - #fe640b - - - - name - Rust function parameters - scope - meta.function.definition.rust variable.other.rust - settings - - foreground - #e64553 - - - - name - Rust closure variables - scope - meta.function.call.rust variable.other.rust - settings - - foreground - #4c4f69 - - - - name - Rust self - scope - variable.language.self.rust - settings - - foreground - #d20f39 - - - - name - Rust metavariable names - scope - variable.other.metavariable.name.rust, meta.macro.metavariable.rust keyword.operator.macro.dollar.rust - settings - - foreground - #ea76cb - - - - name - Shell shebang - scope - comment.line.shebang, comment.line.shebang punctuation.definition.comment, comment.line.shebang, punctuation.definition.comment.shebang.shell, meta.shebang.shell - settings - - foreground - #ea76cb - fontStyle - italic - - - - name - Shell shebang command - scope - comment.line.shebang constant.language - settings - - foreground - #179299 - fontStyle - italic - - - - name - Shell interpolated command - scope - meta.function-call.arguments.shell punctuation.definition.variable.shell, meta.function-call.arguments.shell punctuation.section.interpolation, meta.function-call.arguments.shell punctuation.definition.variable.shell, meta.function-call.arguments.shell punctuation.section.interpolation - settings - - foreground - #d20f39 - - - - name - Shell interpolated command variable - scope - meta.string meta.interpolation.parameter.shell variable.other.readwrite - settings - - foreground - #fe640b - fontStyle - italic - - - - scope - source.shell punctuation.section.interpolation, punctuation.definition.evaluation.backticks.shell - settings - - foreground - #179299 - - - - name - Shell EOF - scope - entity.name.tag.heredoc.shell - settings - - foreground - #8839ef - - - - name - Shell quoted variable - scope - string.quoted.double.shell variable.other.normal.shell - settings - - foreground - #4c4f69 - - - - scope - markup.heading.typst - settings - - foreground - #d20f39 - - - - name - JSON Keys - scope - source.json meta.mapping.key string - settings - - foreground - #1e66f5 - - - - name - JSON key surrounding quotes - scope - source.json meta.mapping.key punctuation.definition.string.begin, source.json meta.mapping.key punctuation.definition.string.end - settings - - foreground - #7c7f93 - - - - scope - markup.heading.synopsis.man, markup.heading.title.man, markup.heading.other.man, markup.heading.env.man - settings - - foreground - #8839ef - - - - scope - markup.heading.commands.man - settings - - foreground - #1e66f5 - - - - scope - markup.heading.env.man - settings - - foreground - #ea76cb - - - - name - Man page options - scope - entity.name - settings - - foreground - #179299 - - - - scope - markup.heading.1.markdown - settings - - foreground - #d20f39 - - - - scope - markup.heading.2.markdown - settings - - foreground - #fe640b - - - - scope - markup.heading.markdown - settings - - foreground - #df8e1d - - - - - \ No newline at end of file diff --git a/fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/LICENSE b/fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/LICENSE deleted file mode 100644 index fb5b1d6..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 yazi-rs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/LICENSE-tmtheme deleted file mode 100644 index 006383b..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Catppuccin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/README.md b/fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/README.md deleted file mode 100644 index 752908c..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/README.md +++ /dev/null @@ -1,36 +0,0 @@ -
- Yazi logo -
- -

- Catppuccin Macchiato Flavor for Yazi -

- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -```sh -ya pkg add yazi-rs/flavors:catppuccin-macchiato -``` - -## โš™๏ธ Usage - -Set the content of your `theme.toml` to enable it as your _dark_ flavor: - -```toml -[flavor] -dark = "catppuccin-macchiato" -``` - -Make sure your `theme.toml` doesn't contain anything other than `[flavor]`, unless you want to override certain styles of this flavor. - -See the [Yazi flavor documentation](https://yazi-rs.github.io/docs/flavors/overview) for more details. - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/flavor.toml b/fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/flavor.toml deleted file mode 100644 index 9d3042f..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/flavor.toml +++ /dev/null @@ -1,189 +0,0 @@ -# vim:fileencoding=utf-8:foldmethod=marker - -# : Manager {{{ - -[mgr] -cwd = { fg = "#8bd5ca" } - -# Hovered -hovered = { reversed = true } -preview_hovered = { underline = true } - -# Find -find_keyword = { fg = "#eed49f", bold = true, italic = true, underline = true } -find_position = { fg = "#f5bde6", bg = "reset", bold = true, italic = true } - -# Marker -marker_copied = { fg = "#a6da95", bg = "#a6da95" } -marker_cut = { fg = "#ed8796", bg = "#ed8796" } -marker_marked = { fg = "#8bd5ca", bg = "#8bd5ca" } -marker_selected = { fg = "#eed49f", bg = "#eed49f" } - -# Count -count_copied = { fg = "#24273a", bg = "#a6da95" } -count_cut = { fg = "#24273a", bg = "#ed8796" } -count_selected = { fg = "#24273a", bg = "#eed49f" } - -# Border -border_symbol = "โ”‚" -border_style = { fg = "#8087a2" } - -# : }}} - - -# : Tabs {{{ - -[tabs] -active = { fg = "#24273a", bg = "#8aadf4", bold = true } -inactive = { fg = "#8aadf4", bg = "#363a4f" } - -# : }}} - - -# : Mode {{{ - -[mode] - -normal_main = { fg = "#24273a", bg = "#8aadf4", bold = true } -normal_alt = { fg = "#8aadf4", bg = "#363a4f" } - -# Select mode -select_main = { fg = "#24273a", bg = "#8bd5ca", bold = true } -select_alt = { fg = "#8bd5ca", bg = "#363a4f" } - -# Unset mode -unset_main = { fg = "#24273a", bg = "#f0c6c6", bold = true } -unset_alt = { fg = "#f0c6c6", bg = "#363a4f" } - -# : }}} - - -# : Status bar {{{ - -[status] -# Permissions -perm_sep = { fg = "#8087a2" } -perm_type = { fg = "#8aadf4" } -perm_read = { fg = "#eed49f" } -perm_write = { fg = "#ed8796" } -perm_exec = { fg = "#a6da95" } - -# Progress -progress_label = { fg = "#ffffff", bold = true } -progress_normal = { fg = "#8aadf4", bg = "#494d64" } -progress_error = { fg = "#8aadf4", bg = "#ed8796" } - -# : }}} - - -# : Pick {{{ - -[pick] -border = { fg = "#8aadf4" } -active = { fg = "#f5bde6", bold = true } -inactive = {} - -# : }}} - - -# : Input {{{ - -[input] -border = { fg = "#8aadf4" } -title = {} -value = {} -selected = { reversed = true } - -# : }}} - - -# : Completion {{{ - -[cmp] -border = { fg = "#8aadf4" } - -# : }}} - - -# : Tasks {{{ - -[tasks] -border = { fg = "#8aadf4" } -title = {} -hovered = { fg = "#f5bde6", bold = true } - -# : }}} - - -# : Which {{{ - -[which] -mask = { bg = "#363a4f" } -cand = { fg = "#8bd5ca" } -rest = { fg = "#939ab7" } -desc = { fg = "#f5bde6" } -separator = " ๎ชœ " -separator_style = { fg = "#5b6078" } - -# : }}} - - -# : Help {{{ - -[help] -on = { fg = "#8bd5ca" } -run = { fg = "#f5bde6" } -hovered = { reversed = true, bold = true } -footer = { fg = "#363a4f", bg = "#cad3f5" } - -# : }}} - - -# : Spotter {{{ - -[spot] -border = { fg = "#8aadf4" } -title = { fg = "#8aadf4" } -tbl_col = { fg = "#8bd5ca" } -tbl_cell = { fg = "#f5bde6", bg = "#494d64" } - -# : }}} - - -# : Notification {{{ - -[notify] -title_info = { fg = "#a6da95" } -title_warn = { fg = "#eed49f" } -title_error = { fg = "#ed8796" } - -# : }}} - - -# : File-specific styles {{{ - -[filetype] - -rules = [ - # Images - { mime = "image/*", fg = "#8bd5ca" }, - - # Media - { mime = "{audio,video}/*", fg = "#eed49f" }, - - # Archives - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#f5bde6" }, - - # Documents - { mime = "application/{pdf,doc,rtf}", fg = "#a6da95" }, - - # Fallback - { url = "*", fg = "#cad3f5" }, - { url = "*/", fg = "#8aadf4" }, - - # TODO: remove - { name = "*", fg = "#cad3f5" }, - { name = "*/", fg = "#8aadf4" } -] - -# : }}} diff --git a/fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/preview.png b/fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/preview.png deleted file mode 100644 index a200463..0000000 Binary files a/fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/tmtheme.xml deleted file mode 100644 index 8f21312..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-macchiato.yazi/tmtheme.xml +++ /dev/null @@ -1,2112 +0,0 @@ - - - - - name - Catppuccin Macchiato - semanticClass - theme.dark.catppuccin-macchiato - uuid - 02b2bdf3-9eb7-4396-bf04-f17f1468f99f - author - Catppuccin Org - colorSpaceName - sRGB - settings - - - settings - - background - #24273a - foreground - #cad3f5 - caret - #f4dbd6 - lineHighlight - #363a4f - misspelling - #ed8796 - accent - #c6a0f6 - selection - #939ab740 - activeGuide - #494d64 - findHighlight - #455c6d - gutterForeground - #8087a2 - - - - name - Basic text & variable names (incl. leading punctuation) - scope - text, source, variable.other.readwrite, punctuation.definition.variable - settings - - foreground - #cad3f5 - - - - name - Parentheses, Brackets, Braces - scope - punctuation - settings - - foreground - #939ab7 - fontStyle - - - - - name - Comments - scope - comment, punctuation.definition.comment - settings - - foreground - #939ab7 - fontStyle - italic - - - - scope - string, punctuation.definition.string - settings - - foreground - #a6da95 - - - - scope - constant.character.escape - settings - - foreground - #f5bde6 - - - - name - Booleans, constants, numbers - scope - constant.numeric, variable.other.constant, entity.name.constant, constant.language.boolean, constant.language.false, constant.language.true, keyword.other.unit.user-defined, keyword.other.unit.suffix.floating-point - settings - - foreground - #f5a97f - - - - scope - keyword, keyword.operator.word, keyword.operator.new, variable.language.super, support.type.primitive, storage.type, storage.modifier, punctuation.definition.keyword - settings - - foreground - #c6a0f6 - fontStyle - - - - - scope - entity.name.tag.documentation - settings - - foreground - #c6a0f6 - - - - name - Punctuation - scope - keyword.operator, punctuation.accessor, punctuation.definition.generic, meta.function.closure punctuation.section.parameters, punctuation.definition.tag, punctuation.separator.key-value - settings - - foreground - #8bd5ca - - - - scope - entity.name.function, meta.function-call.method, support.function, support.function.misc, variable.function - settings - - foreground - #8aadf4 - fontStyle - italic - - - - name - Classes - scope - entity.name.class, entity.other.inherited-class, support.class, meta.function-call.constructor, entity.name.struct - settings - - foreground - #eed49f - fontStyle - italic - - - - name - Enum - scope - entity.name.enum - settings - - foreground - #eed49f - fontStyle - italic - - - - name - Enum member - scope - meta.enum variable.other.readwrite, variable.other.enummember - settings - - foreground - #8bd5ca - - - - name - Object properties - scope - meta.property.object - settings - - foreground - #8bd5ca - - - - name - Types - scope - meta.type, meta.type-alias, support.type, entity.name.type - settings - - foreground - #eed49f - fontStyle - italic - - - - name - Decorators - scope - meta.annotation variable.function, meta.annotation variable.annotation.function, meta.annotation punctuation.definition.annotation, meta.decorator, punctuation.decorator - settings - - foreground - #f5a97f - - - - scope - variable.parameter, meta.function.parameters - settings - - foreground - #ee99a0 - fontStyle - italic - - - - name - Built-ins - scope - constant.language, support.function.builtin - settings - - foreground - #ed8796 - - - - scope - entity.other.attribute-name.documentation - settings - - foreground - #ed8796 - - - - name - Preprocessor directives - scope - keyword.control.directive, punctuation.definition.directive - settings - - foreground - #eed49f - - - - name - Type parameters - scope - punctuation.definition.typeparameters - settings - - foreground - #91d7e3 - - - - name - Namespaces - scope - entity.name.namespace - settings - - foreground - #eed49f - - - - name - Property names (left hand assignments in json/yaml/css) - scope - support.type.property-name.css - settings - - foreground - #8aadf4 - fontStyle - - - - - name - This/Self keyword - scope - variable.language.this, variable.language.this punctuation.definition.variable - settings - - foreground - #ed8796 - - - - name - Object properties - scope - variable.object.property - settings - - foreground - #cad3f5 - - - - name - String template interpolation - scope - string.template variable, string variable - settings - - foreground - #cad3f5 - - - - name - `new` as bold - scope - keyword.operator.new - settings - - fontStyle - bold - - - - name - C++ extern keyword - scope - storage.modifier.specifier.extern.cpp - settings - - foreground - #c6a0f6 - - - - name - C++ scope resolution - scope - entity.name.scope-resolution.template.call.cpp, entity.name.scope-resolution.parameter.cpp, entity.name.scope-resolution.cpp, entity.name.scope-resolution.function.definition.cpp - settings - - foreground - #eed49f - - - - name - C++ doc keywords - scope - storage.type.class.doxygen - settings - - fontStyle - - - - - name - C++ operators - scope - storage.modifier.reference.cpp - settings - - foreground - #8bd5ca - - - - name - C# Interpolated Strings - scope - meta.interpolation.cs - settings - - foreground - #cad3f5 - - - - name - C# xml-style docs - scope - comment.block.documentation.cs - settings - - foreground - #cad3f5 - - - - name - Classes, reflecting the className color in JSX - scope - source.css entity.other.attribute-name.class.css, entity.other.attribute-name.parent-selector.css punctuation.definition.entity.css - settings - - foreground - #eed49f - - - - name - Operators - scope - punctuation.separator.operator.css - settings - - foreground - #8bd5ca - - - - name - Pseudo classes - scope - source.css entity.other.attribute-name.pseudo-class - settings - - foreground - #8bd5ca - - - - scope - source.css constant.other.unicode-range - settings - - foreground - #f5a97f - - - - scope - source.css variable.parameter.url - settings - - foreground - #a6da95 - fontStyle - - - - - name - CSS vendored property names - scope - support.type.vendored.property-name - settings - - foreground - #91d7e3 - - - - name - Less/SCSS right-hand variables (@/$-prefixed) - scope - source.css meta.property-value variable, source.css meta.property-value variable.other.less, source.css meta.property-value variable.other.less punctuation.definition.variable.less, meta.definition.variable.scss - settings - - foreground - #ee99a0 - - - - name - CSS variables (--prefixed) - scope - source.css meta.property-list variable, meta.property-list variable.other.less, meta.property-list variable.other.less punctuation.definition.variable.less - settings - - foreground - #8aadf4 - - - - name - CSS Percentage values, styled the same as numbers - scope - keyword.other.unit.percentage.css - settings - - foreground - #f5a97f - - - - name - CSS Attribute selectors, styled the same as strings - scope - source.css meta.attribute-selector - settings - - foreground - #a6da95 - - - - name - JSON/YAML keys, other left-hand assignments - scope - keyword.other.definition.ini, punctuation.support.type.property-name.json, support.type.property-name.json, punctuation.support.type.property-name.toml, support.type.property-name.toml, entity.name.tag.yaml, punctuation.support.type.property-name.yaml, support.type.property-name.yaml - settings - - foreground - #8aadf4 - fontStyle - - - - - name - JSON/YAML constants - scope - constant.language.json, constant.language.yaml - settings - - foreground - #f5a97f - - - - name - YAML anchors - scope - entity.name.type.anchor.yaml, variable.other.alias.yaml - settings - - foreground - #eed49f - fontStyle - - - - - name - TOML tables / ini groups - scope - support.type.property-name.table, entity.name.section.group-title.ini - settings - - foreground - #eed49f - - - - name - TOML dates - scope - constant.other.time.datetime.offset.toml - settings - - foreground - #f5bde6 - - - - name - YAML anchor puctuation - scope - punctuation.definition.anchor.yaml, punctuation.definition.alias.yaml - settings - - foreground - #f5bde6 - - - - name - YAML triple dashes - scope - entity.other.document.begin.yaml - settings - - foreground - #f5bde6 - - - - name - Markup Diff - scope - markup.changed.diff - settings - - foreground - #f5a97f - - - - name - Diff - scope - meta.diff.header.from-file, meta.diff.header.to-file, punctuation.definition.from-file.diff, punctuation.definition.to-file.diff - settings - - foreground - #8aadf4 - - - - name - Diff Inserted - scope - markup.inserted.diff - settings - - foreground - #a6da95 - - - - name - Diff Deleted - scope - markup.deleted.diff - settings - - foreground - #ed8796 - - - - name - dotenv left-hand side assignments - scope - variable.other.env - settings - - foreground - #8aadf4 - - - - name - dotenv reference to existing env variable - scope - string.quoted variable.other.env - settings - - foreground - #cad3f5 - - - - name - GDScript functions - scope - support.function.builtin.gdscript - settings - - foreground - #8aadf4 - - - - name - GDScript constants - scope - constant.language.gdscript - settings - - foreground - #f5a97f - - - - name - Comment keywords - scope - comment meta.annotation.go - settings - - foreground - #ee99a0 - - - - name - go:embed, go:build, etc. - scope - comment meta.annotation.parameters.go - settings - - foreground - #f5a97f - - - - name - Go constants (nil, true, false) - scope - constant.language.go - settings - - foreground - #f5a97f - - - - name - GraphQL variables - scope - variable.graphql - settings - - foreground - #cad3f5 - - - - name - GraphQL aliases - scope - string.unquoted.alias.graphql - settings - - foreground - #f0c6c6 - - - - name - GraphQL enum members - scope - constant.character.enum.graphql - settings - - foreground - #8bd5ca - - - - name - GraphQL field in types - scope - meta.objectvalues.graphql constant.object.key.graphql string.unquoted.graphql - settings - - foreground - #f0c6c6 - - - - name - HTML/XML DOCTYPE as keyword - scope - keyword.other.doctype, meta.tag.sgml.doctype punctuation.definition.tag, meta.tag.metadata.doctype entity.name.tag, meta.tag.metadata.doctype punctuation.definition.tag - settings - - foreground - #c6a0f6 - - - - name - HTML/XML-like <tags/> - scope - entity.name.tag - settings - - foreground - #8aadf4 - fontStyle - - - - - name - Special characters like &amp; - scope - text.html constant.character.entity, text.html constant.character.entity punctuation, constant.character.entity.xml, constant.character.entity.xml punctuation, constant.character.entity.js.jsx, constant.charactger.entity.js.jsx punctuation, constant.character.entity.tsx, constant.character.entity.tsx punctuation - settings - - foreground - #ed8796 - - - - name - HTML/XML tag attribute values - scope - entity.other.attribute-name - settings - - foreground - #eed49f - - - - name - Components - scope - support.class.component, support.class.component.jsx, support.class.component.tsx, support.class.component.vue - settings - - foreground - #f5bde6 - fontStyle - - - - - name - Annotations - scope - punctuation.definition.annotation, storage.type.annotation - settings - - foreground - #f5a97f - - - - name - Java enums - scope - constant.other.enum.java - settings - - foreground - #8bd5ca - - - - name - Java imports - scope - storage.modifier.import.java - settings - - foreground - #cad3f5 - - - - name - Javadoc - scope - comment.block.javadoc.java keyword.other.documentation.javadoc.java - settings - - fontStyle - - - - - name - Exported Variable - scope - meta.export variable.other.readwrite.js - settings - - foreground - #ee99a0 - - - - name - JS/TS constants & properties - scope - variable.other.constant.js, variable.other.constant.ts, variable.other.property.js, variable.other.property.ts - settings - - foreground - #cad3f5 - - - - name - JSDoc; these are mainly params, so styled as such - scope - variable.other.jsdoc, comment.block.documentation variable.other - settings - - foreground - #ee99a0 - fontStyle - - - - - name - JSDoc keywords - scope - storage.type.class.jsdoc - settings - - fontStyle - - - - - scope - support.type.object.console.js - settings - - foreground - #cad3f5 - - - - name - Node constants as keywords (module, etc.) - scope - support.constant.node, support.type.object.module.js - settings - - foreground - #c6a0f6 - - - - name - implements as keyword - scope - storage.modifier.implements - settings - - foreground - #c6a0f6 - - - - name - Builtin types - scope - constant.language.null.js, constant.language.null.ts, constant.language.undefined.js, constant.language.undefined.ts, support.type.builtin.ts - settings - - foreground - #c6a0f6 - - - - scope - variable.parameter.generic - settings - - foreground - #eed49f - - - - name - Arrow functions - scope - keyword.declaration.function.arrow.js, storage.type.function.arrow.ts - settings - - foreground - #8bd5ca - - - - name - Decorator punctuations (decorators inherit from blue functions, instead of styleguide peach) - scope - punctuation.decorator.ts - settings - - foreground - #8aadf4 - fontStyle - italic - - - - name - Extra JS/TS keywords - scope - keyword.operator.expression.in.js, keyword.operator.expression.in.ts, keyword.operator.expression.infer.ts, keyword.operator.expression.instanceof.js, keyword.operator.expression.instanceof.ts, keyword.operator.expression.is, keyword.operator.expression.keyof.ts, keyword.operator.expression.of.js, keyword.operator.expression.of.ts, keyword.operator.expression.typeof.ts - settings - - foreground - #c6a0f6 - - - - name - Julia macros - scope - support.function.macro.julia - settings - - foreground - #8bd5ca - fontStyle - italic - - - - name - Julia language constants (true, false) - scope - constant.language.julia - settings - - foreground - #f5a97f - - - - name - Julia other constants (these seem to be arguments inside arrays) - scope - constant.other.symbol.julia - settings - - foreground - #ee99a0 - - - - name - LaTeX preamble - scope - text.tex keyword.control.preamble - settings - - foreground - #8bd5ca - - - - name - LaTeX be functions - scope - text.tex support.function.be - settings - - foreground - #91d7e3 - - - - name - LaTeX math - scope - constant.other.general.math.tex - settings - - foreground - #f0c6c6 - - - - name - Liquid Builtin Objects & User Defined Variables - scope - variable.language.liquid - settings - - foreground - #f5bde6 - - - - name - Lua docstring keywords - scope - comment.line.double-dash.documentation.lua storage.type.annotation.lua - settings - - foreground - #c6a0f6 - fontStyle - - - - - name - Lua docstring variables - scope - comment.line.double-dash.documentation.lua entity.name.variable.lua, comment.line.double-dash.documentation.lua variable.lua - settings - - foreground - #cad3f5 - - - - scope - heading.1.markdown punctuation.definition.heading.markdown, heading.1.markdown, heading.1.quarto punctuation.definition.heading.quarto, heading.1.quarto, markup.heading.atx.1.mdx, markup.heading.atx.1.mdx punctuation.definition.heading.mdx, markup.heading.setext.1.markdown, markup.heading.heading-0.asciidoc - settings - - foreground - #ed8796 - - - - scope - heading.2.markdown punctuation.definition.heading.markdown, heading.2.markdown, heading.2.quarto punctuation.definition.heading.quarto, heading.2.quarto, markup.heading.atx.2.mdx, markup.heading.atx.2.mdx punctuation.definition.heading.mdx, markup.heading.setext.2.markdown, markup.heading.heading-1.asciidoc - settings - - foreground - #f5a97f - - - - scope - heading.3.markdown punctuation.definition.heading.markdown, heading.3.markdown, heading.3.quarto punctuation.definition.heading.quarto, heading.3.quarto, markup.heading.atx.3.mdx, markup.heading.atx.3.mdx punctuation.definition.heading.mdx, markup.heading.heading-2.asciidoc - settings - - foreground - #eed49f - - - - scope - heading.4.markdown punctuation.definition.heading.markdown, heading.4.markdown, heading.4.quarto punctuation.definition.heading.quarto, heading.4.quarto, markup.heading.atx.4.mdx, markup.heading.atx.4.mdx punctuation.definition.heading.mdx, markup.heading.heading-3.asciidoc - settings - - foreground - #a6da95 - - - - scope - heading.5.markdown punctuation.definition.heading.markdown, heading.5.markdown, heading.5.quarto punctuation.definition.heading.quarto, heading.5.quarto, markup.heading.atx.5.mdx, markup.heading.atx.5.mdx punctuation.definition.heading.mdx, markup.heading.heading-4.asciidoc - settings - - foreground - #7dc4e4 - - - - scope - heading.6.markdown punctuation.definition.heading.markdown, heading.6.markdown, heading.6.quarto punctuation.definition.heading.quarto, heading.6.quarto, markup.heading.atx.6.mdx, markup.heading.atx.6.mdx punctuation.definition.heading.mdx, markup.heading.heading-5.asciidoc - settings - - foreground - #b7bdf8 - - - - scope - markup.bold - settings - - foreground - #ed8796 - fontStyle - bold - - - - scope - markup.italic - settings - - foreground - #ed8796 - fontStyle - italic - - - - scope - markup.strikethrough - settings - - foreground - #a5adcb - fontStyle - strikethrough - - - - name - Markdown auto links - scope - punctuation.definition.link, markup.underline.link - settings - - foreground - #8aadf4 - - - - name - Markdown links - scope - text.html.markdown punctuation.definition.link.title, text.html.quarto punctuation.definition.link.title, string.other.link.title.markdown, string.other.link.title.quarto, markup.link, punctuation.definition.constant.markdown, punctuation.definition.constant.quarto, constant.other.reference.link.markdown, constant.other.reference.link.quarto, markup.substitution.attribute-reference - settings - - foreground - #b7bdf8 - - - - name - Markdown code spans - scope - punctuation.definition.raw.markdown, punctuation.definition.raw.quarto, markup.inline.raw.string.markdown, markup.inline.raw.string.quarto, markup.raw.block.markdown, markup.raw.block.quarto - settings - - foreground - #a6da95 - - - - name - Markdown triple backtick language identifier - scope - fenced_code.block.language - settings - - foreground - #91d7e3 - - - - name - Markdown triple backticks - scope - markup.fenced_code.block punctuation.definition, markup.raw support.asciidoc - settings - - foreground - #939ab7 - - - - name - Markdown quotes - scope - markup.quote, punctuation.definition.quote.begin - settings - - foreground - #f5bde6 - - - - name - Markdown separators - scope - meta.separator.markdown - settings - - foreground - #8bd5ca - - - - name - Markdown list bullets - scope - punctuation.definition.list.begin.markdown, punctuation.definition.list.begin.quarto, markup.list.bullet - settings - - foreground - #8bd5ca - - - - name - Quarto headings - scope - markup.heading.quarto - settings - - fontStyle - bold - - - - name - Nix attribute names - scope - entity.other.attribute-name.multipart.nix, entity.other.attribute-name.single.nix - settings - - foreground - #8aadf4 - - - - name - Nix parameter names - scope - variable.parameter.name.nix - settings - - foreground - #cad3f5 - fontStyle - - - - - name - Nix interpolated parameter names - scope - meta.embedded variable.parameter.name.nix - settings - - foreground - #b7bdf8 - fontStyle - - - - - name - Nix paths - scope - string.unquoted.path.nix - settings - - foreground - #f5bde6 - fontStyle - - - - - name - PHP Attributes - scope - support.attribute.builtin, meta.attribute.php - settings - - foreground - #eed49f - - - - name - PHP Parameters (needed for the leading dollar sign) - scope - meta.function.parameters.php punctuation.definition.variable.php - settings - - foreground - #ee99a0 - - - - name - PHP Constants (null, __FILE__, etc.) - scope - constant.language.php - settings - - foreground - #c6a0f6 - - - - name - PHP functions - scope - text.html.php support.function - settings - - foreground - #91d7e3 - - - - name - PHPdoc keywords - scope - keyword.other.phpdoc.php - settings - - fontStyle - - - - - name - Python argument functions reset to text, otherwise they inherit blue from function-call - scope - support.variable.magic.python, meta.function-call.arguments.python - settings - - foreground - #cad3f5 - - - - name - Python double underscore functions - scope - support.function.magic.python - settings - - foreground - #91d7e3 - fontStyle - italic - - - - name - Python `self` keyword - scope - variable.parameter.function.language.special.self.python, variable.language.special.self.python - settings - - foreground - #ed8796 - fontStyle - italic - - - - name - python keyword flow/logical (for ... in) - scope - keyword.control.flow.python, keyword.operator.logical.python - settings - - foreground - #c6a0f6 - - - - name - python storage type - scope - storage.type.function.python - settings - - foreground - #c6a0f6 - - - - name - python function support - scope - support.token.decorator.python, meta.function.decorator.identifier.python - settings - - foreground - #91d7e3 - - - - name - python function calls - scope - meta.function-call.python - settings - - foreground - #8aadf4 - - - - name - python function decorators - scope - entity.name.function.decorator.python, punctuation.definition.decorator.python - settings - - foreground - #f5a97f - fontStyle - italic - - - - name - python placeholder reset to normal string - scope - constant.character.format.placeholder.other.python - settings - - foreground - #f5bde6 - - - - name - Python exception & builtins such as exit() - scope - support.type.exception.python, support.function.builtin.python - settings - - foreground - #f5a97f - - - - name - entity.name.type - scope - support.type.python - settings - - foreground - #c6a0f6 - - - - name - python constants (True/False) - scope - constant.language.python - settings - - foreground - #f5a97f - - - - name - Arguments accessed later in the function body - scope - meta.indexed-name.python, meta.item-access.python - settings - - foreground - #ee99a0 - fontStyle - italic - - - - name - Python f-strings/binary/unicode storage types - scope - storage.type.string.python - settings - - foreground - #a6da95 - fontStyle - italic - - - - name - Python type hints - scope - meta.function.parameters.python - settings - - fontStyle - - - - - name - Regex string begin/end in JS/TS - scope - string.regexp punctuation.definition.string.begin, string.regexp punctuation.definition.string.end - settings - - foreground - #f5bde6 - - - - name - Regex anchors (^, $) - scope - keyword.control.anchor.regexp - settings - - foreground - #c6a0f6 - - - - name - Regex regular string match - scope - string.regexp.ts - settings - - foreground - #cad3f5 - - - - name - Regex group parenthesis & backreference (\1, \2, \3, ...) - scope - punctuation.definition.group.regexp, keyword.other.back-reference.regexp - settings - - foreground - #a6da95 - - - - name - Regex character class [] - scope - punctuation.definition.character-class.regexp - settings - - foreground - #eed49f - - - - name - Regex character classes (\d, \w, \s) - scope - constant.other.character-class.regexp - settings - - foreground - #f5bde6 - - - - name - Regex range - scope - constant.other.character-class.range.regexp - settings - - foreground - #f4dbd6 - - - - name - Regex quantifier - scope - keyword.operator.quantifier.regexp - settings - - foreground - #8bd5ca - - - - name - Regex constant/numeric - scope - constant.character.numeric.regexp - settings - - foreground - #f5a97f - - - - name - Regex lookaheads, negative lookaheads, lookbehinds, negative lookbehinds - scope - punctuation.definition.group.no-capture.regexp, meta.assertion.look-ahead.regexp, meta.assertion.negative-look-ahead.regexp - settings - - foreground - #8aadf4 - - - - name - Rust attribute - scope - meta.annotation.rust, meta.annotation.rust punctuation, meta.attribute.rust, punctuation.definition.attribute.rust - settings - - foreground - #eed49f - fontStyle - italic - - - - name - Rust attribute strings - scope - meta.attribute.rust string.quoted.double.rust, meta.attribute.rust string.quoted.single.char.rust - settings - - fontStyle - - - - - name - Rust keyword - scope - entity.name.function.macro.rules.rust, storage.type.module.rust, storage.modifier.rust, storage.type.struct.rust, storage.type.enum.rust, storage.type.trait.rust, storage.type.union.rust, storage.type.impl.rust, storage.type.rust, storage.type.function.rust, storage.type.type.rust - settings - - foreground - #c6a0f6 - fontStyle - - - - - name - Rust u/i32, u/i64, etc. - scope - entity.name.type.numeric.rust - settings - - foreground - #c6a0f6 - fontStyle - - - - - name - Rust generic - scope - meta.generic.rust - settings - - foreground - #f5a97f - - - - name - Rust impl - scope - entity.name.impl.rust - settings - - foreground - #eed49f - fontStyle - italic - - - - name - Rust module - scope - entity.name.module.rust - settings - - foreground - #f5a97f - - - - name - Rust trait - scope - entity.name.trait.rust - settings - - foreground - #eed49f - fontStyle - italic - - - - name - Rust struct - scope - storage.type.source.rust - settings - - foreground - #eed49f - - - - name - Rust union - scope - entity.name.union.rust - settings - - foreground - #eed49f - - - - name - Rust enum member - scope - meta.enum.rust storage.type.source.rust - settings - - foreground - #8bd5ca - - - - name - Rust macro - scope - support.macro.rust, meta.macro.rust support.function.rust, entity.name.function.macro.rust - settings - - foreground - #8aadf4 - fontStyle - italic - - - - name - Rust lifetime - scope - storage.modifier.lifetime.rust, entity.name.type.lifetime - settings - - foreground - #8aadf4 - fontStyle - italic - - - - name - Rust string formatting - scope - string.quoted.double.rust constant.other.placeholder.rust - settings - - foreground - #f5bde6 - - - - name - Rust return type generic - scope - meta.function.return-type.rust meta.generic.rust storage.type.rust - settings - - foreground - #cad3f5 - - - - name - Rust functions - scope - meta.function.call.rust - settings - - foreground - #8aadf4 - - - - name - Rust angle brackets - scope - punctuation.brackets.angle.rust - settings - - foreground - #91d7e3 - - - - name - Rust constants - scope - constant.other.caps.rust - settings - - foreground - #f5a97f - - - - name - Rust function parameters - scope - meta.function.definition.rust variable.other.rust - settings - - foreground - #ee99a0 - - - - name - Rust closure variables - scope - meta.function.call.rust variable.other.rust - settings - - foreground - #cad3f5 - - - - name - Rust self - scope - variable.language.self.rust - settings - - foreground - #ed8796 - - - - name - Rust metavariable names - scope - variable.other.metavariable.name.rust, meta.macro.metavariable.rust keyword.operator.macro.dollar.rust - settings - - foreground - #f5bde6 - - - - name - Shell shebang - scope - comment.line.shebang, comment.line.shebang punctuation.definition.comment, comment.line.shebang, punctuation.definition.comment.shebang.shell, meta.shebang.shell - settings - - foreground - #f5bde6 - fontStyle - italic - - - - name - Shell shebang command - scope - comment.line.shebang constant.language - settings - - foreground - #8bd5ca - fontStyle - italic - - - - name - Shell interpolated command - scope - meta.function-call.arguments.shell punctuation.definition.variable.shell, meta.function-call.arguments.shell punctuation.section.interpolation, meta.function-call.arguments.shell punctuation.definition.variable.shell, meta.function-call.arguments.shell punctuation.section.interpolation - settings - - foreground - #ed8796 - - - - name - Shell interpolated command variable - scope - meta.string meta.interpolation.parameter.shell variable.other.readwrite - settings - - foreground - #f5a97f - fontStyle - italic - - - - scope - source.shell punctuation.section.interpolation, punctuation.definition.evaluation.backticks.shell - settings - - foreground - #8bd5ca - - - - name - Shell EOF - scope - entity.name.tag.heredoc.shell - settings - - foreground - #c6a0f6 - - - - name - Shell quoted variable - scope - string.quoted.double.shell variable.other.normal.shell - settings - - foreground - #cad3f5 - - - - scope - markup.heading.typst - settings - - foreground - #ed8796 - - - - name - JSON Keys - scope - source.json meta.mapping.key string - settings - - foreground - #8aadf4 - - - - name - JSON key surrounding quotes - scope - source.json meta.mapping.key punctuation.definition.string.begin, source.json meta.mapping.key punctuation.definition.string.end - settings - - foreground - #939ab7 - - - - scope - markup.heading.synopsis.man, markup.heading.title.man, markup.heading.other.man, markup.heading.env.man - settings - - foreground - #c6a0f6 - - - - scope - markup.heading.commands.man - settings - - foreground - #8aadf4 - - - - scope - markup.heading.env.man - settings - - foreground - #f5bde6 - - - - name - Man page options - scope - entity.name - settings - - foreground - #8bd5ca - - - - scope - markup.heading.1.markdown - settings - - foreground - #ed8796 - - - - scope - markup.heading.2.markdown - settings - - foreground - #f5a97f - - - - scope - markup.heading.markdown - settings - - foreground - #eed49f - - - - - \ No newline at end of file diff --git a/fedora/.config/yazi/flavors/catppuccin-mocha.yazi/LICENSE b/fedora/.config/yazi/flavors/catppuccin-mocha.yazi/LICENSE deleted file mode 100644 index fb5b1d6..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-mocha.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 yazi-rs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/catppuccin-mocha.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/catppuccin-mocha.yazi/LICENSE-tmtheme deleted file mode 100644 index 006383b..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-mocha.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Catppuccin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/catppuccin-mocha.yazi/README.md b/fedora/.config/yazi/flavors/catppuccin-mocha.yazi/README.md deleted file mode 100644 index 20840dc..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-mocha.yazi/README.md +++ /dev/null @@ -1,36 +0,0 @@ -
- Yazi logo -
- -

- Catppuccin Mocha Flavor for Yazi -

- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -```sh -ya pkg add yazi-rs/flavors:catppuccin-mocha -``` - -## โš™๏ธ Usage - -Set the content of your `theme.toml` to enable it as your _dark_ flavor: - -```toml -[flavor] -dark = "catppuccin-mocha" -``` - -Make sure your `theme.toml` doesn't contain anything other than `[flavor]`, unless you want to override certain styles of this flavor. - -See the [Yazi flavor documentation](https://yazi-rs.github.io/docs/flavors/overview) for more details. - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/catppuccin-mocha.yazi/flavor.toml b/fedora/.config/yazi/flavors/catppuccin-mocha.yazi/flavor.toml deleted file mode 100644 index 39a3ef5..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-mocha.yazi/flavor.toml +++ /dev/null @@ -1,189 +0,0 @@ -# vim:fileencoding=utf-8:foldmethod=marker - -# : Manager {{{ - -[mgr] -cwd = { fg = "#94e2d5" } - -# Hovered -hovered = { reversed = true } -preview_hovered = { underline = true } - -# Find -find_keyword = { fg = "#f9e2af", bold = true, italic = true, underline = true } -find_position = { fg = "#f5c2e7", bg = "reset", bold = true, italic = true } - -# Marker -marker_copied = { fg = "#a6e3a1", bg = "#a6e3a1" } -marker_cut = { fg = "#f38ba8", bg = "#f38ba8" } -marker_marked = { fg = "#94e2d5", bg = "#94e2d5" } -marker_selected = { fg = "#f9e2af", bg = "#f9e2af" } - -# Count -count_copied = { fg = "#1e1e2e", bg = "#a6e3a1" } -count_cut = { fg = "#1e1e2e", bg = "#f38ba8" } -count_selected = { fg = "#1e1e2e", bg = "#f9e2af" } - -# Border -border_symbol = "โ”‚" -border_style = { fg = "#7f849c" } - -# : }}} - - -# : Tabs {{{ - -[tabs] -active = { fg = "#1e1e2e", bg = "#89b4fa", bold = true } -inactive = { fg = "#89b4fa", bg = "#313244" } - -# : }}} - - -# : Mode {{{ - -[mode] - -normal_main = { fg = "#1e1e2e", bg = "#89b4fa", bold = true } -normal_alt = { fg = "#89b4fa", bg = "#313244" } - -# Select mode -select_main = { fg = "#1e1e2e", bg = "#94e2d5", bold = true } -select_alt = { fg = "#94e2d5", bg = "#313244" } - -# Unset mode -unset_main = { fg = "#1e1e2e", bg = "#f2cdcd", bold = true } -unset_alt = { fg = "#f2cdcd", bg = "#313244" } - -# : }}} - - -# : Status bar {{{ - -[status] -# Permissions -perm_sep = { fg = "#7f849c" } -perm_type = { fg = "#89b4fa" } -perm_read = { fg = "#f9e2af" } -perm_write = { fg = "#f38ba8" } -perm_exec = { fg = "#a6e3a1" } - -# Progress -progress_label = { fg = "#ffffff", bold = true } -progress_normal = { fg = "#89b4fa", bg = "#45475a" } -progress_error = { fg = "#89b4fa", bg = "#f38ba8" } - -# : }}} - - -# : Pick {{{ - -[pick] -border = { fg = "#89b4fa" } -active = { fg = "#f5c2e7", bold = true } -inactive = {} - -# : }}} - - -# : Input {{{ - -[input] -border = { fg = "#89b4fa" } -title = {} -value = {} -selected = { reversed = true } - -# : }}} - - -# : Completion {{{ - -[cmp] -border = { fg = "#89b4fa" } - -# : }}} - - -# : Tasks {{{ - -[tasks] -border = { fg = "#89b4fa" } -title = {} -hovered = { fg = "#f5c2e7", bold = true } - -# : }}} - - -# : Which {{{ - -[which] -mask = { bg = "#313244" } -cand = { fg = "#94e2d5" } -rest = { fg = "#9399b2" } -desc = { fg = "#f5c2e7" } -separator = " ๎ชœ " -separator_style = { fg = "#585b70" } - -# : }}} - - -# : Help {{{ - -[help] -on = { fg = "#94e2d5" } -run = { fg = "#f5c2e7" } -hovered = { reversed = true, bold = true } -footer = { fg = "#313244", bg = "#cdd6f4" } - -# : }}} - - -# : Spotter {{{ - -[spot] -border = { fg = "#89b4fa" } -title = { fg = "#89b4fa" } -tbl_col = { fg = "#94e2d5" } -tbl_cell = { fg = "#f5c2e7", bg = "#45475a" } - -# : }}} - - -# : Notification {{{ - -[notify] -title_info = { fg = "#a6e3a1" } -title_warn = { fg = "#f9e2af" } -title_error = { fg = "#f38ba8" } - -# : }}} - - -# : File-specific styles {{{ - -[filetype] - -rules = [ - # Images - { mime = "image/*", fg = "#94e2d5" }, - - # Media - { mime = "{audio,video}/*", fg = "#f9e2af" }, - - # Archives - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#f5c2e7" }, - - # Documents - { mime = "application/{pdf,doc,rtf}", fg = "#a6e3a1" }, - - # Fallback - { url = "*", fg = "#cdd6f4" }, - { url = "*/", fg = "#89b4fa" }, - - # TODO: remove - { name = "*", fg = "#cdd6f4" }, - { name = "*/", fg = "#89b4fa" } -] - -# : }}} diff --git a/fedora/.config/yazi/flavors/catppuccin-mocha.yazi/preview.png b/fedora/.config/yazi/flavors/catppuccin-mocha.yazi/preview.png deleted file mode 100644 index a684ec8..0000000 Binary files a/fedora/.config/yazi/flavors/catppuccin-mocha.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/catppuccin-mocha.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/catppuccin-mocha.yazi/tmtheme.xml deleted file mode 100644 index c7781ce..0000000 --- a/fedora/.config/yazi/flavors/catppuccin-mocha.yazi/tmtheme.xml +++ /dev/null @@ -1,2112 +0,0 @@ - - - - - name - Catppuccin Mocha - semanticClass - theme.dark.catppuccin-mocha - uuid - 627ce890-fabb-4d39-9819-7be71f4bdca7 - author - Catppuccin Org - colorSpaceName - sRGB - settings - - - settings - - background - #1e1e2e - foreground - #cdd6f4 - caret - #f5e0dc - lineHighlight - #313244 - misspelling - #f38ba8 - accent - #cba6f7 - selection - #9399b240 - activeGuide - #45475a - findHighlight - #3e5767 - gutterForeground - #7f849c - - - - name - Basic text & variable names (incl. leading punctuation) - scope - text, source, variable.other.readwrite, punctuation.definition.variable - settings - - foreground - #cdd6f4 - - - - name - Parentheses, Brackets, Braces - scope - punctuation - settings - - foreground - #9399b2 - fontStyle - - - - - name - Comments - scope - comment, punctuation.definition.comment - settings - - foreground - #9399b2 - fontStyle - italic - - - - scope - string, punctuation.definition.string - settings - - foreground - #a6e3a1 - - - - scope - constant.character.escape - settings - - foreground - #f5c2e7 - - - - name - Booleans, constants, numbers - scope - constant.numeric, variable.other.constant, entity.name.constant, constant.language.boolean, constant.language.false, constant.language.true, keyword.other.unit.user-defined, keyword.other.unit.suffix.floating-point - settings - - foreground - #fab387 - - - - scope - keyword, keyword.operator.word, keyword.operator.new, variable.language.super, support.type.primitive, storage.type, storage.modifier, punctuation.definition.keyword - settings - - foreground - #cba6f7 - fontStyle - - - - - scope - entity.name.tag.documentation - settings - - foreground - #cba6f7 - - - - name - Punctuation - scope - keyword.operator, punctuation.accessor, punctuation.definition.generic, meta.function.closure punctuation.section.parameters, punctuation.definition.tag, punctuation.separator.key-value - settings - - foreground - #94e2d5 - - - - scope - entity.name.function, meta.function-call.method, support.function, support.function.misc, variable.function - settings - - foreground - #89b4fa - fontStyle - italic - - - - name - Classes - scope - entity.name.class, entity.other.inherited-class, support.class, meta.function-call.constructor, entity.name.struct - settings - - foreground - #f9e2af - fontStyle - italic - - - - name - Enum - scope - entity.name.enum - settings - - foreground - #f9e2af - fontStyle - italic - - - - name - Enum member - scope - meta.enum variable.other.readwrite, variable.other.enummember - settings - - foreground - #94e2d5 - - - - name - Object properties - scope - meta.property.object - settings - - foreground - #94e2d5 - - - - name - Types - scope - meta.type, meta.type-alias, support.type, entity.name.type - settings - - foreground - #f9e2af - fontStyle - italic - - - - name - Decorators - scope - meta.annotation variable.function, meta.annotation variable.annotation.function, meta.annotation punctuation.definition.annotation, meta.decorator, punctuation.decorator - settings - - foreground - #fab387 - - - - scope - variable.parameter, meta.function.parameters - settings - - foreground - #eba0ac - fontStyle - italic - - - - name - Built-ins - scope - constant.language, support.function.builtin - settings - - foreground - #f38ba8 - - - - scope - entity.other.attribute-name.documentation - settings - - foreground - #f38ba8 - - - - name - Preprocessor directives - scope - keyword.control.directive, punctuation.definition.directive - settings - - foreground - #f9e2af - - - - name - Type parameters - scope - punctuation.definition.typeparameters - settings - - foreground - #89dceb - - - - name - Namespaces - scope - entity.name.namespace - settings - - foreground - #f9e2af - - - - name - Property names (left hand assignments in json/yaml/css) - scope - support.type.property-name.css - settings - - foreground - #89b4fa - fontStyle - - - - - name - This/Self keyword - scope - variable.language.this, variable.language.this punctuation.definition.variable - settings - - foreground - #f38ba8 - - - - name - Object properties - scope - variable.object.property - settings - - foreground - #cdd6f4 - - - - name - String template interpolation - scope - string.template variable, string variable - settings - - foreground - #cdd6f4 - - - - name - `new` as bold - scope - keyword.operator.new - settings - - fontStyle - bold - - - - name - C++ extern keyword - scope - storage.modifier.specifier.extern.cpp - settings - - foreground - #cba6f7 - - - - name - C++ scope resolution - scope - entity.name.scope-resolution.template.call.cpp, entity.name.scope-resolution.parameter.cpp, entity.name.scope-resolution.cpp, entity.name.scope-resolution.function.definition.cpp - settings - - foreground - #f9e2af - - - - name - C++ doc keywords - scope - storage.type.class.doxygen - settings - - fontStyle - - - - - name - C++ operators - scope - storage.modifier.reference.cpp - settings - - foreground - #94e2d5 - - - - name - C# Interpolated Strings - scope - meta.interpolation.cs - settings - - foreground - #cdd6f4 - - - - name - C# xml-style docs - scope - comment.block.documentation.cs - settings - - foreground - #cdd6f4 - - - - name - Classes, reflecting the className color in JSX - scope - source.css entity.other.attribute-name.class.css, entity.other.attribute-name.parent-selector.css punctuation.definition.entity.css - settings - - foreground - #f9e2af - - - - name - Operators - scope - punctuation.separator.operator.css - settings - - foreground - #94e2d5 - - - - name - Pseudo classes - scope - source.css entity.other.attribute-name.pseudo-class - settings - - foreground - #94e2d5 - - - - scope - source.css constant.other.unicode-range - settings - - foreground - #fab387 - - - - scope - source.css variable.parameter.url - settings - - foreground - #a6e3a1 - fontStyle - - - - - name - CSS vendored property names - scope - support.type.vendored.property-name - settings - - foreground - #89dceb - - - - name - Less/SCSS right-hand variables (@/$-prefixed) - scope - source.css meta.property-value variable, source.css meta.property-value variable.other.less, source.css meta.property-value variable.other.less punctuation.definition.variable.less, meta.definition.variable.scss - settings - - foreground - #eba0ac - - - - name - CSS variables (--prefixed) - scope - source.css meta.property-list variable, meta.property-list variable.other.less, meta.property-list variable.other.less punctuation.definition.variable.less - settings - - foreground - #89b4fa - - - - name - CSS Percentage values, styled the same as numbers - scope - keyword.other.unit.percentage.css - settings - - foreground - #fab387 - - - - name - CSS Attribute selectors, styled the same as strings - scope - source.css meta.attribute-selector - settings - - foreground - #a6e3a1 - - - - name - JSON/YAML keys, other left-hand assignments - scope - keyword.other.definition.ini, punctuation.support.type.property-name.json, support.type.property-name.json, punctuation.support.type.property-name.toml, support.type.property-name.toml, entity.name.tag.yaml, punctuation.support.type.property-name.yaml, support.type.property-name.yaml - settings - - foreground - #89b4fa - fontStyle - - - - - name - JSON/YAML constants - scope - constant.language.json, constant.language.yaml - settings - - foreground - #fab387 - - - - name - YAML anchors - scope - entity.name.type.anchor.yaml, variable.other.alias.yaml - settings - - foreground - #f9e2af - fontStyle - - - - - name - TOML tables / ini groups - scope - support.type.property-name.table, entity.name.section.group-title.ini - settings - - foreground - #f9e2af - - - - name - TOML dates - scope - constant.other.time.datetime.offset.toml - settings - - foreground - #f5c2e7 - - - - name - YAML anchor puctuation - scope - punctuation.definition.anchor.yaml, punctuation.definition.alias.yaml - settings - - foreground - #f5c2e7 - - - - name - YAML triple dashes - scope - entity.other.document.begin.yaml - settings - - foreground - #f5c2e7 - - - - name - Markup Diff - scope - markup.changed.diff - settings - - foreground - #fab387 - - - - name - Diff - scope - meta.diff.header.from-file, meta.diff.header.to-file, punctuation.definition.from-file.diff, punctuation.definition.to-file.diff - settings - - foreground - #89b4fa - - - - name - Diff Inserted - scope - markup.inserted.diff - settings - - foreground - #a6e3a1 - - - - name - Diff Deleted - scope - markup.deleted.diff - settings - - foreground - #f38ba8 - - - - name - dotenv left-hand side assignments - scope - variable.other.env - settings - - foreground - #89b4fa - - - - name - dotenv reference to existing env variable - scope - string.quoted variable.other.env - settings - - foreground - #cdd6f4 - - - - name - GDScript functions - scope - support.function.builtin.gdscript - settings - - foreground - #89b4fa - - - - name - GDScript constants - scope - constant.language.gdscript - settings - - foreground - #fab387 - - - - name - Comment keywords - scope - comment meta.annotation.go - settings - - foreground - #eba0ac - - - - name - go:embed, go:build, etc. - scope - comment meta.annotation.parameters.go - settings - - foreground - #fab387 - - - - name - Go constants (nil, true, false) - scope - constant.language.go - settings - - foreground - #fab387 - - - - name - GraphQL variables - scope - variable.graphql - settings - - foreground - #cdd6f4 - - - - name - GraphQL aliases - scope - string.unquoted.alias.graphql - settings - - foreground - #f2cdcd - - - - name - GraphQL enum members - scope - constant.character.enum.graphql - settings - - foreground - #94e2d5 - - - - name - GraphQL field in types - scope - meta.objectvalues.graphql constant.object.key.graphql string.unquoted.graphql - settings - - foreground - #f2cdcd - - - - name - HTML/XML DOCTYPE as keyword - scope - keyword.other.doctype, meta.tag.sgml.doctype punctuation.definition.tag, meta.tag.metadata.doctype entity.name.tag, meta.tag.metadata.doctype punctuation.definition.tag - settings - - foreground - #cba6f7 - - - - name - HTML/XML-like <tags/> - scope - entity.name.tag - settings - - foreground - #89b4fa - fontStyle - - - - - name - Special characters like &amp; - scope - text.html constant.character.entity, text.html constant.character.entity punctuation, constant.character.entity.xml, constant.character.entity.xml punctuation, constant.character.entity.js.jsx, constant.charactger.entity.js.jsx punctuation, constant.character.entity.tsx, constant.character.entity.tsx punctuation - settings - - foreground - #f38ba8 - - - - name - HTML/XML tag attribute values - scope - entity.other.attribute-name - settings - - foreground - #f9e2af - - - - name - Components - scope - support.class.component, support.class.component.jsx, support.class.component.tsx, support.class.component.vue - settings - - foreground - #f5c2e7 - fontStyle - - - - - name - Annotations - scope - punctuation.definition.annotation, storage.type.annotation - settings - - foreground - #fab387 - - - - name - Java enums - scope - constant.other.enum.java - settings - - foreground - #94e2d5 - - - - name - Java imports - scope - storage.modifier.import.java - settings - - foreground - #cdd6f4 - - - - name - Javadoc - scope - comment.block.javadoc.java keyword.other.documentation.javadoc.java - settings - - fontStyle - - - - - name - Exported Variable - scope - meta.export variable.other.readwrite.js - settings - - foreground - #eba0ac - - - - name - JS/TS constants & properties - scope - variable.other.constant.js, variable.other.constant.ts, variable.other.property.js, variable.other.property.ts - settings - - foreground - #cdd6f4 - - - - name - JSDoc; these are mainly params, so styled as such - scope - variable.other.jsdoc, comment.block.documentation variable.other - settings - - foreground - #eba0ac - fontStyle - - - - - name - JSDoc keywords - scope - storage.type.class.jsdoc - settings - - fontStyle - - - - - scope - support.type.object.console.js - settings - - foreground - #cdd6f4 - - - - name - Node constants as keywords (module, etc.) - scope - support.constant.node, support.type.object.module.js - settings - - foreground - #cba6f7 - - - - name - implements as keyword - scope - storage.modifier.implements - settings - - foreground - #cba6f7 - - - - name - Builtin types - scope - constant.language.null.js, constant.language.null.ts, constant.language.undefined.js, constant.language.undefined.ts, support.type.builtin.ts - settings - - foreground - #cba6f7 - - - - scope - variable.parameter.generic - settings - - foreground - #f9e2af - - - - name - Arrow functions - scope - keyword.declaration.function.arrow.js, storage.type.function.arrow.ts - settings - - foreground - #94e2d5 - - - - name - Decorator punctuations (decorators inherit from blue functions, instead of styleguide peach) - scope - punctuation.decorator.ts - settings - - foreground - #89b4fa - fontStyle - italic - - - - name - Extra JS/TS keywords - scope - keyword.operator.expression.in.js, keyword.operator.expression.in.ts, keyword.operator.expression.infer.ts, keyword.operator.expression.instanceof.js, keyword.operator.expression.instanceof.ts, keyword.operator.expression.is, keyword.operator.expression.keyof.ts, keyword.operator.expression.of.js, keyword.operator.expression.of.ts, keyword.operator.expression.typeof.ts - settings - - foreground - #cba6f7 - - - - name - Julia macros - scope - support.function.macro.julia - settings - - foreground - #94e2d5 - fontStyle - italic - - - - name - Julia language constants (true, false) - scope - constant.language.julia - settings - - foreground - #fab387 - - - - name - Julia other constants (these seem to be arguments inside arrays) - scope - constant.other.symbol.julia - settings - - foreground - #eba0ac - - - - name - LaTeX preamble - scope - text.tex keyword.control.preamble - settings - - foreground - #94e2d5 - - - - name - LaTeX be functions - scope - text.tex support.function.be - settings - - foreground - #89dceb - - - - name - LaTeX math - scope - constant.other.general.math.tex - settings - - foreground - #f2cdcd - - - - name - Liquid Builtin Objects & User Defined Variables - scope - variable.language.liquid - settings - - foreground - #f5c2e7 - - - - name - Lua docstring keywords - scope - comment.line.double-dash.documentation.lua storage.type.annotation.lua - settings - - foreground - #cba6f7 - fontStyle - - - - - name - Lua docstring variables - scope - comment.line.double-dash.documentation.lua entity.name.variable.lua, comment.line.double-dash.documentation.lua variable.lua - settings - - foreground - #cdd6f4 - - - - scope - heading.1.markdown punctuation.definition.heading.markdown, heading.1.markdown, heading.1.quarto punctuation.definition.heading.quarto, heading.1.quarto, markup.heading.atx.1.mdx, markup.heading.atx.1.mdx punctuation.definition.heading.mdx, markup.heading.setext.1.markdown, markup.heading.heading-0.asciidoc - settings - - foreground - #f38ba8 - - - - scope - heading.2.markdown punctuation.definition.heading.markdown, heading.2.markdown, heading.2.quarto punctuation.definition.heading.quarto, heading.2.quarto, markup.heading.atx.2.mdx, markup.heading.atx.2.mdx punctuation.definition.heading.mdx, markup.heading.setext.2.markdown, markup.heading.heading-1.asciidoc - settings - - foreground - #fab387 - - - - scope - heading.3.markdown punctuation.definition.heading.markdown, heading.3.markdown, heading.3.quarto punctuation.definition.heading.quarto, heading.3.quarto, markup.heading.atx.3.mdx, markup.heading.atx.3.mdx punctuation.definition.heading.mdx, markup.heading.heading-2.asciidoc - settings - - foreground - #f9e2af - - - - scope - heading.4.markdown punctuation.definition.heading.markdown, heading.4.markdown, heading.4.quarto punctuation.definition.heading.quarto, heading.4.quarto, markup.heading.atx.4.mdx, markup.heading.atx.4.mdx punctuation.definition.heading.mdx, markup.heading.heading-3.asciidoc - settings - - foreground - #a6e3a1 - - - - scope - heading.5.markdown punctuation.definition.heading.markdown, heading.5.markdown, heading.5.quarto punctuation.definition.heading.quarto, heading.5.quarto, markup.heading.atx.5.mdx, markup.heading.atx.5.mdx punctuation.definition.heading.mdx, markup.heading.heading-4.asciidoc - settings - - foreground - #74c7ec - - - - scope - heading.6.markdown punctuation.definition.heading.markdown, heading.6.markdown, heading.6.quarto punctuation.definition.heading.quarto, heading.6.quarto, markup.heading.atx.6.mdx, markup.heading.atx.6.mdx punctuation.definition.heading.mdx, markup.heading.heading-5.asciidoc - settings - - foreground - #b4befe - - - - scope - markup.bold - settings - - foreground - #f38ba8 - fontStyle - bold - - - - scope - markup.italic - settings - - foreground - #f38ba8 - fontStyle - italic - - - - scope - markup.strikethrough - settings - - foreground - #a6adc8 - fontStyle - strikethrough - - - - name - Markdown auto links - scope - punctuation.definition.link, markup.underline.link - settings - - foreground - #89b4fa - - - - name - Markdown links - scope - text.html.markdown punctuation.definition.link.title, text.html.quarto punctuation.definition.link.title, string.other.link.title.markdown, string.other.link.title.quarto, markup.link, punctuation.definition.constant.markdown, punctuation.definition.constant.quarto, constant.other.reference.link.markdown, constant.other.reference.link.quarto, markup.substitution.attribute-reference - settings - - foreground - #b4befe - - - - name - Markdown code spans - scope - punctuation.definition.raw.markdown, punctuation.definition.raw.quarto, markup.inline.raw.string.markdown, markup.inline.raw.string.quarto, markup.raw.block.markdown, markup.raw.block.quarto - settings - - foreground - #a6e3a1 - - - - name - Markdown triple backtick language identifier - scope - fenced_code.block.language - settings - - foreground - #89dceb - - - - name - Markdown triple backticks - scope - markup.fenced_code.block punctuation.definition, markup.raw support.asciidoc - settings - - foreground - #9399b2 - - - - name - Markdown quotes - scope - markup.quote, punctuation.definition.quote.begin - settings - - foreground - #f5c2e7 - - - - name - Markdown separators - scope - meta.separator.markdown - settings - - foreground - #94e2d5 - - - - name - Markdown list bullets - scope - punctuation.definition.list.begin.markdown, punctuation.definition.list.begin.quarto, markup.list.bullet - settings - - foreground - #94e2d5 - - - - name - Quarto headings - scope - markup.heading.quarto - settings - - fontStyle - bold - - - - name - Nix attribute names - scope - entity.other.attribute-name.multipart.nix, entity.other.attribute-name.single.nix - settings - - foreground - #89b4fa - - - - name - Nix parameter names - scope - variable.parameter.name.nix - settings - - foreground - #cdd6f4 - fontStyle - - - - - name - Nix interpolated parameter names - scope - meta.embedded variable.parameter.name.nix - settings - - foreground - #b4befe - fontStyle - - - - - name - Nix paths - scope - string.unquoted.path.nix - settings - - foreground - #f5c2e7 - fontStyle - - - - - name - PHP Attributes - scope - support.attribute.builtin, meta.attribute.php - settings - - foreground - #f9e2af - - - - name - PHP Parameters (needed for the leading dollar sign) - scope - meta.function.parameters.php punctuation.definition.variable.php - settings - - foreground - #eba0ac - - - - name - PHP Constants (null, __FILE__, etc.) - scope - constant.language.php - settings - - foreground - #cba6f7 - - - - name - PHP functions - scope - text.html.php support.function - settings - - foreground - #89dceb - - - - name - PHPdoc keywords - scope - keyword.other.phpdoc.php - settings - - fontStyle - - - - - name - Python argument functions reset to text, otherwise they inherit blue from function-call - scope - support.variable.magic.python, meta.function-call.arguments.python - settings - - foreground - #cdd6f4 - - - - name - Python double underscore functions - scope - support.function.magic.python - settings - - foreground - #89dceb - fontStyle - italic - - - - name - Python `self` keyword - scope - variable.parameter.function.language.special.self.python, variable.language.special.self.python - settings - - foreground - #f38ba8 - fontStyle - italic - - - - name - python keyword flow/logical (for ... in) - scope - keyword.control.flow.python, keyword.operator.logical.python - settings - - foreground - #cba6f7 - - - - name - python storage type - scope - storage.type.function.python - settings - - foreground - #cba6f7 - - - - name - python function support - scope - support.token.decorator.python, meta.function.decorator.identifier.python - settings - - foreground - #89dceb - - - - name - python function calls - scope - meta.function-call.python - settings - - foreground - #89b4fa - - - - name - python function decorators - scope - entity.name.function.decorator.python, punctuation.definition.decorator.python - settings - - foreground - #fab387 - fontStyle - italic - - - - name - python placeholder reset to normal string - scope - constant.character.format.placeholder.other.python - settings - - foreground - #f5c2e7 - - - - name - Python exception & builtins such as exit() - scope - support.type.exception.python, support.function.builtin.python - settings - - foreground - #fab387 - - - - name - entity.name.type - scope - support.type.python - settings - - foreground - #cba6f7 - - - - name - python constants (True/False) - scope - constant.language.python - settings - - foreground - #fab387 - - - - name - Arguments accessed later in the function body - scope - meta.indexed-name.python, meta.item-access.python - settings - - foreground - #eba0ac - fontStyle - italic - - - - name - Python f-strings/binary/unicode storage types - scope - storage.type.string.python - settings - - foreground - #a6e3a1 - fontStyle - italic - - - - name - Python type hints - scope - meta.function.parameters.python - settings - - fontStyle - - - - - name - Regex string begin/end in JS/TS - scope - string.regexp punctuation.definition.string.begin, string.regexp punctuation.definition.string.end - settings - - foreground - #f5c2e7 - - - - name - Regex anchors (^, $) - scope - keyword.control.anchor.regexp - settings - - foreground - #cba6f7 - - - - name - Regex regular string match - scope - string.regexp.ts - settings - - foreground - #cdd6f4 - - - - name - Regex group parenthesis & backreference (\1, \2, \3, ...) - scope - punctuation.definition.group.regexp, keyword.other.back-reference.regexp - settings - - foreground - #a6e3a1 - - - - name - Regex character class [] - scope - punctuation.definition.character-class.regexp - settings - - foreground - #f9e2af - - - - name - Regex character classes (\d, \w, \s) - scope - constant.other.character-class.regexp - settings - - foreground - #f5c2e7 - - - - name - Regex range - scope - constant.other.character-class.range.regexp - settings - - foreground - #f5e0dc - - - - name - Regex quantifier - scope - keyword.operator.quantifier.regexp - settings - - foreground - #94e2d5 - - - - name - Regex constant/numeric - scope - constant.character.numeric.regexp - settings - - foreground - #fab387 - - - - name - Regex lookaheads, negative lookaheads, lookbehinds, negative lookbehinds - scope - punctuation.definition.group.no-capture.regexp, meta.assertion.look-ahead.regexp, meta.assertion.negative-look-ahead.regexp - settings - - foreground - #89b4fa - - - - name - Rust attribute - scope - meta.annotation.rust, meta.annotation.rust punctuation, meta.attribute.rust, punctuation.definition.attribute.rust - settings - - foreground - #f9e2af - fontStyle - italic - - - - name - Rust attribute strings - scope - meta.attribute.rust string.quoted.double.rust, meta.attribute.rust string.quoted.single.char.rust - settings - - fontStyle - - - - - name - Rust keyword - scope - entity.name.function.macro.rules.rust, storage.type.module.rust, storage.modifier.rust, storage.type.struct.rust, storage.type.enum.rust, storage.type.trait.rust, storage.type.union.rust, storage.type.impl.rust, storage.type.rust, storage.type.function.rust, storage.type.type.rust - settings - - foreground - #cba6f7 - fontStyle - - - - - name - Rust u/i32, u/i64, etc. - scope - entity.name.type.numeric.rust - settings - - foreground - #cba6f7 - fontStyle - - - - - name - Rust generic - scope - meta.generic.rust - settings - - foreground - #fab387 - - - - name - Rust impl - scope - entity.name.impl.rust - settings - - foreground - #f9e2af - fontStyle - italic - - - - name - Rust module - scope - entity.name.module.rust - settings - - foreground - #fab387 - - - - name - Rust trait - scope - entity.name.trait.rust - settings - - foreground - #f9e2af - fontStyle - italic - - - - name - Rust struct - scope - storage.type.source.rust - settings - - foreground - #f9e2af - - - - name - Rust union - scope - entity.name.union.rust - settings - - foreground - #f9e2af - - - - name - Rust enum member - scope - meta.enum.rust storage.type.source.rust - settings - - foreground - #94e2d5 - - - - name - Rust macro - scope - support.macro.rust, meta.macro.rust support.function.rust, entity.name.function.macro.rust - settings - - foreground - #89b4fa - fontStyle - italic - - - - name - Rust lifetime - scope - storage.modifier.lifetime.rust, entity.name.type.lifetime - settings - - foreground - #89b4fa - fontStyle - italic - - - - name - Rust string formatting - scope - string.quoted.double.rust constant.other.placeholder.rust - settings - - foreground - #f5c2e7 - - - - name - Rust return type generic - scope - meta.function.return-type.rust meta.generic.rust storage.type.rust - settings - - foreground - #cdd6f4 - - - - name - Rust functions - scope - meta.function.call.rust - settings - - foreground - #89b4fa - - - - name - Rust angle brackets - scope - punctuation.brackets.angle.rust - settings - - foreground - #89dceb - - - - name - Rust constants - scope - constant.other.caps.rust - settings - - foreground - #fab387 - - - - name - Rust function parameters - scope - meta.function.definition.rust variable.other.rust - settings - - foreground - #eba0ac - - - - name - Rust closure variables - scope - meta.function.call.rust variable.other.rust - settings - - foreground - #cdd6f4 - - - - name - Rust self - scope - variable.language.self.rust - settings - - foreground - #f38ba8 - - - - name - Rust metavariable names - scope - variable.other.metavariable.name.rust, meta.macro.metavariable.rust keyword.operator.macro.dollar.rust - settings - - foreground - #f5c2e7 - - - - name - Shell shebang - scope - comment.line.shebang, comment.line.shebang punctuation.definition.comment, comment.line.shebang, punctuation.definition.comment.shebang.shell, meta.shebang.shell - settings - - foreground - #f5c2e7 - fontStyle - italic - - - - name - Shell shebang command - scope - comment.line.shebang constant.language - settings - - foreground - #94e2d5 - fontStyle - italic - - - - name - Shell interpolated command - scope - meta.function-call.arguments.shell punctuation.definition.variable.shell, meta.function-call.arguments.shell punctuation.section.interpolation, meta.function-call.arguments.shell punctuation.definition.variable.shell, meta.function-call.arguments.shell punctuation.section.interpolation - settings - - foreground - #f38ba8 - - - - name - Shell interpolated command variable - scope - meta.string meta.interpolation.parameter.shell variable.other.readwrite - settings - - foreground - #fab387 - fontStyle - italic - - - - scope - source.shell punctuation.section.interpolation, punctuation.definition.evaluation.backticks.shell - settings - - foreground - #94e2d5 - - - - name - Shell EOF - scope - entity.name.tag.heredoc.shell - settings - - foreground - #cba6f7 - - - - name - Shell quoted variable - scope - string.quoted.double.shell variable.other.normal.shell - settings - - foreground - #cdd6f4 - - - - scope - markup.heading.typst - settings - - foreground - #f38ba8 - - - - name - JSON Keys - scope - source.json meta.mapping.key string - settings - - foreground - #89b4fa - - - - name - JSON key surrounding quotes - scope - source.json meta.mapping.key punctuation.definition.string.begin, source.json meta.mapping.key punctuation.definition.string.end - settings - - foreground - #9399b2 - - - - scope - markup.heading.synopsis.man, markup.heading.title.man, markup.heading.other.man, markup.heading.env.man - settings - - foreground - #cba6f7 - - - - scope - markup.heading.commands.man - settings - - foreground - #89b4fa - - - - scope - markup.heading.env.man - settings - - foreground - #f5c2e7 - - - - name - Man page options - scope - entity.name - settings - - foreground - #94e2d5 - - - - scope - markup.heading.1.markdown - settings - - foreground - #f38ba8 - - - - scope - markup.heading.2.markdown - settings - - foreground - #fab387 - - - - scope - markup.heading.markdown - settings - - foreground - #f9e2af - - - - - \ No newline at end of file diff --git a/fedora/.config/yazi/flavors/dracula.yazi/LICENSE b/fedora/.config/yazi/flavors/dracula.yazi/LICENSE deleted file mode 100644 index fb5b1d6..0000000 --- a/fedora/.config/yazi/flavors/dracula.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 yazi-rs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/dracula.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/dracula.yazi/LICENSE-tmtheme deleted file mode 100644 index f9105d5..0000000 --- a/fedora/.config/yazi/flavors/dracula.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-present Dracula Theme - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/dracula.yazi/README.md b/fedora/.config/yazi/flavors/dracula.yazi/README.md deleted file mode 100644 index 8429ef6..0000000 --- a/fedora/.config/yazi/flavors/dracula.yazi/README.md +++ /dev/null @@ -1,36 +0,0 @@ -
- Yazi logo -
- -

- Dracula Flavor for Yazi -

- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -```sh -ya pkg add yazi-rs/flavors:dracula -``` - -## โš™๏ธ Usage - -Set the content of your `theme.toml` to enable it as your _dark_ flavor: - -```toml -[flavor] -dark = "dracula" -``` - -Make sure your `theme.toml` doesn't contain anything other than `[flavor]`, unless you want to override certain styles of this flavor. - -See the [Yazi flavor documentation](https://yazi-rs.github.io/docs/flavors/overview) for more details. - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/dracula.yazi/flavor.toml b/fedora/.config/yazi/flavors/dracula.yazi/flavor.toml deleted file mode 100644 index 3434eb9..0000000 --- a/fedora/.config/yazi/flavors/dracula.yazi/flavor.toml +++ /dev/null @@ -1,189 +0,0 @@ -# vim:fileencoding=utf-8:foldmethod=marker - -# : Manager {{{ - -[mgr] -cwd = { fg = "#8be9fd" } - -# Hovered -hovered = { reversed = true } -preview_hovered = { underline = true } - -# Find -find_keyword = { fg = "#f1fa8c", bold = true, italic = true, underline = true } -find_position = { fg = "#ff79c6", bg = "reset", bold = true, italic = true } - -# Marker -marker_copied = { fg = "#50fa7b", bg = "#50fa7b" } -marker_cut = { fg = "#ff5555", bg = "#ff5555" } -marker_marked = { fg = "#8be9fd", bg = "#8be9fd" } -marker_selected = { fg = "#f1fa8c", bg = "#f1fa8c" } - -# Count -count_copied = { fg = "#282a36", bg = "#50fa7b" } -count_cut = { fg = "#282a36", bg = "#ff5555" } -count_selected = { fg = "#282a36", bg = "#f1fa8c" } - -# Border -border_symbol = "โ”‚" -border_style = { fg = "#7282b5" } - -# : }}} - - -# : Tabs {{{ - -[tabs] -active = { fg = "#282a36", bg = "#bd93f9", bold = true } -inactive = { fg = "#bd93f9", bg = "#44475a" } - -# : }}} - - -# : Mode {{{ - -[mode] - -normal_main = { fg = "#282a36", bg = "#bd93f9", bold = true } -normal_alt = { fg = "#bd93f9", bg = "#44475a" } - -# Select mode -select_main = { fg = "#282a36", bg = "#8be9fd", bold = true } -select_alt = { fg = "#8be9fd", bg = "#44475a" } - -# Unset mode -unset_main = { fg = "#282a36", bg = "#ffb86c", bold = true } -unset_alt = { fg = "#ffb86c", bg = "#44475a" } - -# : }}} - - -# : Status bar {{{ - -[status] -# Permissions -perm_sep = { fg = "#7282b5" } -perm_type = { fg = "#bd93f9" } -perm_read = { fg = "#f1fa8c" } -perm_write = { fg = "#ff5555" } -perm_exec = { fg = "#50fa7b" } - -# Progress -progress_label = { fg = "#ffffff", bold = true } -progress_normal = { fg = "#bd93f9", bg = "#63667d" } -progress_error = { fg = "#bd93f9", bg = "#ff5555" } - -# : }}} - - -# : Pick {{{ - -[pick] -border = { fg = "#bd93f9" } -active = { fg = "#ff79c6", bold = true } -inactive = {} - -# : }}} - - -# : Input {{{ - -[input] -border = { fg = "#bd93f9" } -title = {} -value = {} -selected = { reversed = true } - -# : }}} - - -# : Completion {{{ - -[cmp] -border = { fg = "#bd93f9" } - -# : }}} - - -# : Tasks {{{ - -[tasks] -border = { fg = "#bd93f9" } -title = {} -hovered = { fg = "#ff79c6", bold = true } - -# : }}} - - -# : Which {{{ - -[which] -mask = { bg = "#44475a" } -cand = { fg = "#8be9fd" } -rest = { fg = "#8998c9" } -desc = { fg = "#ff79c6" } -separator = " ๎ชœ " -separator_style = { fg = "#83869c" } - -# : }}} - - -# : Help {{{ - -[help] -on = { fg = "#8be9fd" } -run = { fg = "#ff79c6" } -hovered = { reversed = true, bold = true } -footer = { fg = "#44475a", bg = "#f8f8f2" } - -# : }}} - - -# : Spotter {{{ - -[spot] -border = { fg = "#bd93f9" } -title = { fg = "#bd93f9" } -tbl_col = { fg = "#8be9fd" } -tbl_cell = { fg = "#ff79c6", bg = "#63667d" } - -# : }}} - - -# : Notification {{{ - -[notify] -title_info = { fg = "#50fa7b" } -title_warn = { fg = "#f1fa8c" } -title_error = { fg = "#ff5555" } - -# : }}} - - -# : File-specific styles {{{ - -[filetype] - -rules = [ - # Images - { mime = "image/*", fg = "#8be9fd" }, - - # Media - { mime = "{audio,video}/*", fg = "#f1fa8c" }, - - # Archives - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#ff79c6" }, - - # Documents - { mime = "application/{pdf,doc,rtf}", fg = "#50fa7b" }, - - # Fallback - { url = "*", fg = "#f8f8f2" }, - { url = "*/", fg = "#bd93f9" }, - - # TODO: remove - { name = "*", fg = "#f8f8f2" }, - { name = "*/", fg = "#bd93f9" } -] - -# : }}} diff --git a/fedora/.config/yazi/flavors/dracula.yazi/preview.png b/fedora/.config/yazi/flavors/dracula.yazi/preview.png deleted file mode 100644 index 7d8adf3..0000000 Binary files a/fedora/.config/yazi/flavors/dracula.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/dracula.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/dracula.yazi/tmtheme.xml deleted file mode 100644 index c3434ec..0000000 --- a/fedora/.config/yazi/flavors/dracula.yazi/tmtheme.xml +++ /dev/null @@ -1,940 +0,0 @@ - - - - - - - - name - Dracula - settings - - - settings - - background - #282a36 - caret - #f8f8f0 - block_caret - #999a9e - foreground - #f8f8f2 - invisibles - #3B3A32 - lineHighlight - #44475a - selection - #44475a - findHighlight - #effb7b - findHighlightForeground - #000000 - selectionBorder - #222218 - activeGuide - #9D550FB0 - bracketsForeground - #F8F8F2A5 - bracketsOptions - underline - bracketContentsForeground - #F8F8F2A5 - bracketContentsOptions - underline - tagsOptions - stippled_underline - - - - name - Comment - scope - comment - settings - - foreground - #6272a4 - fontStyle - - - - - name - String - scope - string - settings - - foreground - #f1fa8c - - - - name - Number - scope - constant.numeric - settings - - foreground - #bd93f9 - - - - name - Built-in constant - scope - constant.language - settings - - foreground - #bd93f9 - - - - name - User-defined constant - scope - constant.character, constant.other - settings - - foreground - #bd93f9 - - - - name - Variable - scope - variable - settings - - fontStyle - - - - - name - Ruby's @variable - scope - variable.other.readwrite.instance - settings - - fontStyle - - foreground - #ffb86c - - - - name - String interpolation - scope - constant.character.escaped, constant.character.escape, string source, string source.ruby - settings - - fontStyle - - foreground - #ff79c6 - - - - name - Ruby Regexp - scope - source.ruby string.regexp.classic.ruby,source.ruby string.regexp.mod-r.ruby - settings - - fontStyle - - foreground - #ff5555 - - - - name - Keyword - scope - keyword - settings - - foreground - #ff79c6 - - - - name - Storage - scope - storage - settings - - fontStyle - - foreground - #ff79c6 - - - - name - Storage type - scope - storage.type - settings - - fontStyle - italic - foreground - #8be9fd - - - - name - Storage Type Namespace - scope - storage.type.namespace - settings - - fontStyle - italic - foreground - #8be9fd - - - - name - Storage Type Class - scope - storage.type.class - settings - - fontStyle - italic - foreground - #ff79c6 - - - - name - Class name - scope - entity.name.class - settings - - fontStyle - underline - foreground - #8be9fd - - - - name - Meta Path - scope - meta.path - settings - - fontStyle - underline - foreground - #66d9ef - - - - name - Inherited class - scope - entity.other.inherited-class - settings - - fontStyle - italic underline - foreground - #8be9fd - - - - name - Function name - scope - entity.name.function - settings - - fontStyle - - foreground - #50fa7b - - - - name - Function argument - scope - variable.parameter - settings - - fontStyle - italic - foreground - #ffb86c - - - - name - Tag name - scope - entity.name.tag - settings - - fontStyle - - foreground - #ff79c6 - - - - name - Tag attribute - scope - entity.other.attribute-name - settings - - fontStyle - - foreground - #50fa7b - - - - name - Library function - scope - support.function - settings - - fontStyle - - foreground - #8be9fd - - - - name - Library constant - scope - support.constant - settings - - fontStyle - - foreground - #6be5fd - - - - name - Library class/type - scope - support.type, support.class - settings - - fontStyle - italic - foreground - #66d9ef - - - - name - Library variable - scope - support.other.variable - settings - - fontStyle - - - - - name - Support Other Namespace - scope - support.other.namespace - settings - - fontStyle - italic - foreground - #66d9ef - - - - name - Invalid - scope - invalid - settings - - background - #ff79c6 - fontStyle - - foreground - #F8F8F0 - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - background - #bd93f9 - foreground - #F8F8F0 - - - - name - JSON String - scope - meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #CFCFC2 - - - - name - diff.header - scope - meta.diff, meta.diff.header - settings - - foreground - #6272a4 - - - - name - diff.deleted - scope - markup.deleted - settings - - foreground - #ff79c6 - - - - name - diff.inserted - scope - markup.inserted - settings - - foreground - #50fa7b - - - - name - diff.changed - scope - markup.changed - settings - - foreground - #E6DB74 - - - - scope - constant.numeric.line-number.find-in-files - match - settings - - foreground - #bd93f9 - - - - scope - entity.name.filename - settings - - foreground - #E6DB74 - - - - scope - message.error - settings - - foreground - #F83333 - - - - name - JSON Punctuation - scope - punctuation.definition.string.begin.json - meta.structure.dictionary.value.json, punctuation.definition.string.end.json - meta.structure.dictionary.value.json - settings - - foreground - #EEEEEE - - - - name - JSON Structure - scope - meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #8be9fd - - - - name - JSON String - scope - meta.structure.dictionary.value.json string.quoted.double.json - settings - - foreground - #f1fa8c - - - - name - JSON: 6 deep - scope - meta meta meta meta meta meta meta.structure.dictionary.value string - settings - - foreground - #50fa7b - - - - name - JSON: 5 deep - scope - meta meta meta meta meta meta.structure.dictionary.value string - settings - - foreground - #ffb86c - - - - name - JSON: 4 deep - scope - meta meta meta meta meta.structure.dictionary.value string - settings - - foreground - #ff79c6 - - - - name - JSON: 3 deep - scope - meta meta meta meta.structure.dictionary.value string - settings - - foreground - #bd93f9 - - - - name - JSON: 2 deep - scope - meta meta meta.structure.dictionary.value string - settings - - foreground - #50fa7b - - - - name - JSON: 1 deep - scope - meta meta.structure.dictionary.value string - settings - - foreground - #ffb86c - - - - - - name - Markup: strike - scope - markup.strike - settings - - fontStyle - italic - foreground - #FFB86C - - - - name - Markup: bold - scope - markup.bold - settings - - fontStyle - bold - foreground - #FFB86C - - - - name - Markup: italic - scope - markup.italic - settings - - fontStyle - italic - foreground - #FFB86C - - - - name - Markdown: heading - scope - markup.heading - settings - - foreground - #8BE9FD - - - - name - Markdown: List Items Punctuation - scope - punctuation.definition.list_item.markdown - settings - - foreground - #FF79C6 - - - - name - Markdown: Blockquote - scope - markup.quote - settings - - fontStyle - italic - foreground - #6272A4 - - - - name - Markdown: Blockquote Punctuation - scope - punctuation.definition.blockquote.markdown - settings - - fontStyle - italic - background - #6272A4 - foreground - #6272A4 - - - - name - Markdown: Separator - scope - meta.separator - settings - - foreground - #6272A4 - - - - name - Markup: raw inline - scope - text.html.markdown markup.raw.inline - settings - - foreground - #50FA7B - - - - name - Markup: underline - scope - markup.underline - settings - - fontStyle - underline - foreground - #BD93F9 - - - - name - Markup: Raw block - scope - markup.raw.block - settings - - foreground - #CFCFC2 - - - - name - Markdown: Raw Block fenced source - scope - markup.raw.block.fenced.markdown source - settings - - foreground - #F8F8F2 - - - - name - Markdown: Fenced Bode Block - scope - punctuation.definition.fenced.markdown, variable.language.fenced.markdown - settings - - fontStyle - italic - foreground - #6272A4 - - - - name - Markdown: Fenced Language - scope - variable.language.fenced.markdown - settings - - fontStyle - italic - foreground - #6272A4 - - - - name - Punctuation Accessor - scope - punctuation.accessor - settings - - foreground - #FF79C6 - - - - name - Meta Function Return Type - scope - meta.function.return-type - settings - - foreground - #FF79C6 - - - - name - Punctuation Section Block Begin - scope - punctuation.section.block.begin - settings - - foreground - #ffffff - - - - name - Punctuation Section Block End - scope - punctuation.section.block.end - settings - - foreground - #ffffff - - - - name - Punctuation Section Embedded Begin - scope - punctuation.section.embedded.begin - settings - - foreground - #ff79c6 - - - - name - Punctuation Section Embedded End - scope - punctuation.section.embedded.end - settings - - foreground - #ff79c6 - - - - name - Punctuation Separator Namespace - scope - punctuation.separator.namespace - settings - - foreground - #ff79c6 - - - - name - Variable Function - scope - variable.function - settings - - foreground - #50fa7b - - - - name - Variable Other - scope - variable.other - settings - - foreground - #ffffff - - - - name - Variable Language - scope - variable.language - settings - - foreground - #bd93f9 - - - - name - Entity Name Module Ruby - scope - entity.name.module.ruby - settings - - foreground - #8be9fd - - - - name - Entity Name Constant Ruby - scope - entity.name.constant.ruby - settings - - foreground - #bd93f9 - - - - name - Support Function Builtin Ruby - scope - support.function.builtin.ruby - settings - - foreground - #ffffff - - - - name - Storage Type Namespace CS - scope - storage.type.namespace.cs - settings - - foreground - #ff79c6 - - - - name - Entity Name Namespace CS - scope - entity.name.namespace.cs - settings - - foreground - #8be9fd - - - - uuid - 83091B89-765E-4F0D-9275-0EC6CB084126 - colorSpaceName - sRGB - semanticClass - theme.dracula - author - Zeno Rocha - - diff --git a/fedora/.config/yazi/flavors/everforest-medium.yazi/LICENSE b/fedora/.config/yazi/flavors/everforest-medium.yazi/LICENSE deleted file mode 100644 index 41d1e5e..0000000 --- a/fedora/.config/yazi/flavors/everforest-medium.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Chromium Oxide - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/everforest-medium.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/everforest-medium.yazi/LICENSE-tmtheme deleted file mode 100644 index 8f1431d..0000000 --- a/fedora/.config/yazi/flavors/everforest-medium.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Mitchell Hanberg - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/everforest-medium.yazi/README.md b/fedora/.config/yazi/flavors/everforest-medium.yazi/README.md deleted file mode 100644 index 95029b5..0000000 --- a/fedora/.config/yazi/flavors/everforest-medium.yazi/README.md +++ /dev/null @@ -1,45 +0,0 @@ -
- Yazi logo -
- -

- Example Flavor for Yazi -

- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -```bash -ya pkg add Chromium-3-Oxide/everforest-medium -``` - -Or: - -```bash -ya pack -a Chromium-3-Oxide/everforest-medium -``` - -## โš™๏ธ Usage - -Add the these lines to your `theme.toml` configuration file to use it: - -```toml -[flavor] -dark = "everforest-medium" -``` - -For Yazi versions before 0.4: - -```toml -[flavor] -use = "everforest-medium" -``` - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/everforest-medium.yazi/flavor.toml b/fedora/.config/yazi/flavors/everforest-medium.yazi/flavor.toml deleted file mode 100644 index 03f3bce..0000000 --- a/fedora/.config/yazi/flavors/everforest-medium.yazi/flavor.toml +++ /dev/null @@ -1,229 +0,0 @@ -# vim:fileencoding=utf-8:foldmethod=marker - -# : Manager {{{ - -[mgr] -cwd = { fg = "#7fbbb3" } - -# Hovered -hovered = { reversed = true } -preview_hovered = { underline = true } - -# Find -find_keyword = { fg = "#dbbc7f", bold = true, italic = true, underline = true } -find_position = { fg = "#d699b6", bg = "reset", bold = true, italic = true } - -# Symlink -symlink_target = { italic = true } - -# Marker -marker_copied = { fg = "#a7c080", bg = "#a7c080" } -marker_cut = { fg = "#e67e80", bg = "#e67e80" } -marker_marked = { fg = "#7fbbb3", bg = "#7fbbb3" } -marker_selected = { fg = "#dbbc7f", bg = "#dbbc7f" } - -# Count -count_copied = { fg = "#343f44", bg = "#a7c080" } -count_cut = { fg = "#343f44", bg = "#e67e80" } -count_selected = { fg = "#343f44", bg = "#dbbc7f" } - -# Border -border_symbol = "โ”‚" -border_style = { fg = "#4f585e" } - -# Highlighting -syntect_theme = "" - -# : }}} - - -# : Tabs {{{ - -[tabs] -active = { bg = "#7fbbb3", bold = true } -inactive = { fg = "#7fbbb3", bg = "#4f585e" } - -# Separator -sep_inner = { open = "๎‚ถ", close = "๎‚ด" } -sep_outer = { open = "๎‚ถ", close = "๎‚ด" } - -# : }}} - - -# : Mode {{{ - -[mode] -normal_main = { fg = "#3d484d", bg = "#a7c080", bold = true } -normal_alt = { fg = "#7fbbb3", bg = "#4f585e", bold = true } - -# Select mode -select_main = { fg = "#3d484d", bg = "#e67e80", bold = true } -select_alt = { fg = "#7fbbb3", bg = "#4f585e", bold = true } - -# Unset mode -unset_main = { fg = "#3d484d", bg = "#7fbbb3", bold = true } -unset_alt = { fg = "#7fbbb3", bg = "#4f585e", bold = true } - -# : }}} - - -# : Status bar {{{ - -[status] -overall = {} -sep_left = { open = "๎‚ถ", close = "๎‚ด" } -sep_right = { open = "๎‚ถ", close = "๎‚ด" } - -# Permissions -permissions_s = { fg = "#2d353b" } -permissions_t = { fg = "#a7c080" } -permissions_r = { fg = "#dbbc7f" } -permissions_w = { fg = "#e67e80" } -permissions_x = { fg = "#7fbbb3" } - -# Progress -progress_label = { bold = true } -progress_normal = { fg = "#7fbbb3", bg = "#232a2e" } -progress_error = { fg = "#e67e80", bg = "#232a2e" } - -# : }}} - - -# : Which {{{ - -[which] -cols = 3 -mask = { bg = "#2d353b" } -cand = { fg = "#7fbbb3" } -rest = { fg = "#2d353b" } -desc = { fg = "#d699b6" } -separator = " ๎ชœ " -separator_style = { fg = "#2d353b" } - -# : }}} - - -# : Confirmation {{{ - -[confirm] -border = { fg = "#7fbbb3" } -title = { fg = "#7fbbb3" } -body = {} -list = {} -btn_yes = { reversed = true } -btn_no = {} -btn_labels = [ " [Y]es ", " (N)o " ] - -# : }}} - - -# : Spotter {{{ - -[spot] -border = { fg = "#7fbbb3" } -title = { fg = "#7fbbb3" } - -# Table -tbl_col = { fg = "#7fbbb3" } -tbl_cell = { fg = "#dbbc7f", reversed = true } - -# : }}} - - -# : Notification {{{ - -[notify] -title_info = { fg = "#a7c080" } -title_warn = { fg = "#dbbc7f" } -title_error = { fg = "#e67e80" } - -# Icons -icon_info = "๏š" -icon_warn = "๏ฑ" -icon_error = "๏—" - -# : }}} - - -# : Picker {{{ - -[pick] -border = { fg = "#7fbbb3" } -active = { fg = "#d699b6", bold = true } -inactive = {} - -# : }}} - - -# : Input {{{ - -[input] -border = { fg = "#7fbbb3" } -title = {} -value = {} -selected = { reversed = true } - -# : }}} - - -# : Completion {{{ - -[cmp] -border = { fg = "#7fbbb3" } -active = { reversed = true } -inactive = {} - -# Icons -icon_file = "๏…›" -icon_folder = "๏„•" -icon_command = "๏’‰" - -# : }}} - - -# : Task manager {{{ - -[tasks] -border = { fg = "#7fbbb3" } -title = {} -hovered = { fg = "#d699b6", underline = true } - -# : }}} - - -# : Help menu {{{ - -[help] -on = { fg = "#7fbbb3" } -run = { fg = "#d699b6" } -desc = {} -hovered = { reversed = true, bold = true } -footer = { fg = "#2d353b", bg = "#d3c6aa" } - -# : }}} - - -# : File-specific styles {{{ - -[filetype] - -rules = [ - # Images - { mime = "image/*", fg = "#7fbbb3" }, - - # Media - { mime = "{audio,video}/*", fg = "#d699b6" }, - - # Archives - { mime = "application/*zip", fg = "#e67e80" }, - { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "#e67e80" }, - - # Documents - { mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#7fbbb3" }, - - # Fallback - { name = "*", fg = "#83c092" }, - { name = "*/", fg = "#a7c080" } -] - -# : }}} diff --git a/fedora/.config/yazi/flavors/everforest-medium.yazi/preview.png b/fedora/.config/yazi/flavors/everforest-medium.yazi/preview.png deleted file mode 100644 index d3960cc..0000000 Binary files a/fedora/.config/yazi/flavors/everforest-medium.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/everforest-medium.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/everforest-medium.yazi/tmtheme.xml deleted file mode 100644 index 59f8266..0000000 --- a/fedora/.config/yazi/flavors/everforest-medium.yazi/tmtheme.xml +++ /dev/null @@ -1,3186 +0,0 @@ - - - - - name - Everforest Dark - settings - - - settings - - accent - #a7c080 - background - #2d353b - caret - #d3c6aa - foreground - #d3c6aa - lineHighlight - #3d484d90 - selection - #475258c0 - activeGuide - #9aa79d20 - findHighlight - #899c4040 - misspelling - #da6362 - - - - name - GitGutter deleted - scope - markup.deleted.git_gutter - settings - - foreground - #e67e80a0 - - - - name - GitGutter inserted - scope - markup.inserted.git_gutter - settings - - foreground - #a7c080a0 - - - - name - GitGutter changed - scope - markup.changed.git_gutter - settings - - foreground - #7fbbb3a0 - - - - name - GitGutter untracked - scope - markup.untracked.git_gutter - settings - - foreground - #dbbc7fa0 - - - - name - GitGutter ignored - scope - markup.ignored.git_gutter - settings - - foreground - #4f585e - - - - name - GitGutter comment - scope - comment.line.annotation.git_gutter - settings - - foreground - - name - Comment - scope - comment, string.comment, punctuation.definition.comment - settings - - foreground - #859289 - fontStyle - italic - - - - - - name - Keyword - scope - keyword, storage.type.function, storage.type.class, storage.type.enum, storage.type.interface, storage.type.property, keyword.operator.new, keyword.operator.expression, keyword.operator.new, keyword.operator.delete, storage.type.extends - settings - - foreground - #e67e80 - - - - name - Debug - scope - keyword.other.debugger - settings - - foreground - #e67e80 - - - - name - Storage - scope - storage, modifier, keyword.var, entity.name.tag, keyword.control.case, keyword.control.switch - settings - - foreground - #e69875 - - - - name - Operator - scope - keyword.operator - settings - - foreground - #e69875 - - - - name - String - scope - string, punctuation.definition.string.end, punctuation.definition.string.begin, punctuation.definition.string.template.begin, punctuation.definition.string.template.end - settings - - foreground - #dbbc7f - - - - name - Attribute - scope - entity.other.attribute-name - settings - - foreground - #dbbc7f - - - - name - String Escape - scope - constant.character.escape, punctuation.quasi.element, punctuation.definition.template-expression, punctuation.section.embedded, storage.type.format, constant.other.placeholder, constant.other.placeholder, variable.interpolation - settings - - foreground - #a7c080 - - - - name - Function - scope - entity.name.function, support.function, meta.function, meta.function-call, meta.definition.method - settings - - foreground - #a7c080 - - - - name - Preproc - scope - keyword.control.at-rule, keyword.control.import, keyword.control.export, storage.type.namespace, punctuation.decorator, keyword.control.directive, keyword.preprocessor, punctuation.definition.preprocessor, punctuation.definition.directive, keyword.other.import, keyword.other.package, entity.name.type.namespace, entity.name.scope-resolution, keyword.other.using, keyword.package, keyword.import, keyword.map - settings - - foreground - #83c092 - - - - name - Annotation - scope - storage.type.annotation - settings - - foreground - #83c092 - - - - name - Label - scope - entity.name.label, constant.other.label - settings - - foreground - #83c092 - - - - name - Modules - scope - support.module, support.node, support.other.module, support.type.object.module, entity.name.type.module, entity.name.type.class.module, keyword.control.module - settings - - foreground - #83c092 - - - - name - Type - scope - storage.type, support.type, entity.name.type, keyword.type - settings - - foreground - #7fbbb3 - - - - name - Class - scope - entity.name.type.class, support.class, entity.name.class, entity.other.inherited-class, storage.class - settings - - foreground - #7fbbb3 - - - - name - Number - scope - constant.numeric - settings - - foreground - #d699b6 - - - - name - Boolean - scope - constant.language.boolean - settings - - foreground - #d699b6 - - - - name - Macro - scope - entity.name.function.preprocessor - settings - - foreground - #d699b6 - - - - name - Special identifier - scope - variable.language.this, variable.language.self, variable.language.super, keyword.other.this, variable.language.special, constant.language.null, constant.language.undefined, constant.language.nan - settings - - foreground - #d699b6 - - - - name - Constant - scope - constant.language, support.constant - settings - - foreground - #d699b6 - - - - name - Identifier - scope - variable, support.variable, meta.definition.variable - settings - - foreground - #d3c6aa - - - - name - Property - scope - variable.object.property, support.variable.property, variable.other.property, variable.other.object.property, variable.other.enummember, variable.other.member, meta.object-literal.key - settings - - foreground - #d3c6aa - - - - name - Delimiter - scope - punctuation, meta.brace, meta.delimiter, meta.bracket - settings - - foreground - #d3c6aa - - - - name - Markdown heading1 - scope - heading.1.markdown, markup.heading.setext.1.markdown - settings - - foreground - #e67e80 - fontStyle - bold - - - - name - Markdown heading2 - scope - heading.2.markdown, markup.heading.setext.2.markdown - settings - - foreground - #e69875 - fontStyle - bold - - - - name - Markdown heading3 - scope - heading.3.markdown - settings - - foreground - #dbbc7f - fontStyle - bold - - - - name - Markdown heading4 - scope - heading.4.markdown - settings - - foreground - #a7c080 - fontStyle - bold - - - - name - Markdown heading5 - scope - heading.5.markdown - settings - - foreground - #7fbbb3 - fontStyle - bold - - - - name - Markdown heading6 - scope - heading.6.markdown - settings - - foreground - #d699b6 - fontStyle - bold - - - - name - Markdown heading delimiter - scope - punctuation.definition.heading.markdown - settings - - foreground - #859289 - fontStyle - regular - - - - name - Markdown link - scope - string.other.link.title.markdown, constant.other.reference.link.markdown, string.other.link.description.markdown - settings - - foreground - #d699b6 - fontStyle - regular - - - - name - Markdown link text - scope - markup.underline.link.image.markdown, markup.underline.link.markdown - settings - - foreground - #a7c080 - fontStyle - underline - - - - name - Markdown delimiter - scope - punctuation.definition.string.begin.markdown, punctuation.definition.string.end.markdown, punctuation.definition.italic.markdown, punctuation.definition.quote.begin.markdown, punctuation.definition.metadata.markdown, punctuation.separator.key-value.markdown, punctuation.definition.constant.markdown - settings - - foreground - #859289 - - - - name - Markdown bold delimiter - scope - punctuation.definition.bold.markdown - settings - - foreground - #859289 - fontStyle - regular - - - - name - Markdown separator delimiter - scope - meta.separator.markdown, punctuation.definition.constant.begin.markdown, punctuation.definition.constant.end.markdown - settings - - foreground - #859289 - fontStyle - bold - - - - name - Markdown italic - scope - markup.italic - settings - - fontStyle - italic - - - - name - Markdown bold - scope - markup.bold - settings - - fontStyle - bold - - - - name - Markdown bold italic - scope - markup.bold markup.italic, markup.italic markup.bold - settings - - fontStyle - italic bold - - - - name - Markdown code delimiter - scope - punctuation.definition.markdown, punctuation.definition.raw.markdown - settings - - foreground - #dbbc7f - - - - name - Markdown code type - scope - fenced_code.block.language - settings - - foreground - #dbbc7f - - - - name - Markdown code block - scope - markup.fenced_code.block.markdown, markup.inline.raw.string.markdown - settings - - foreground - #a7c080 - - - - name - Markdown list mark - scope - punctuation.definition.list.begin.markdown - settings - - foreground - #e67e80 - - - - name - reStructuredText heading - scope - punctuation.definition.heading.restructuredtext - settings - - foreground - #e69875 - fontStyle - bold - - - - name - reStructuredText delimiter - scope - punctuation.definition.field.restructuredtext, punctuation.separator.key-value.restructuredtext, punctuation.definition.directive.restructuredtext, punctuation.definition.constant.restructuredtext, punctuation.definition.italic.restructuredtext, punctuation.definition.table.restructuredtext - settings - - foreground - #859289 - - - - name - reStructuredText delimiter bold - scope - punctuation.definition.bold.restructuredtext - settings - - foreground - #859289 - fontStyle - regular - - - - name - reStructuredText aqua - scope - entity.name.tag.restructuredtext, punctuation.definition.link.restructuredtext, punctuation.definition.raw.restructuredtext, punctuation.section.raw.restructuredtext - settings - - foreground - #83c092 - - - - name - reStructuredText purple - scope - constant.other.footnote.link.restructuredtext - settings - - foreground - #d699b6 - - - - name - reStructuredText red - scope - support.directive.restructuredtext - settings - - foreground - #e67e80 - - - - name - reStructuredText green - scope - entity.name.directive.restructuredtext, markup.raw.restructuredtext, markup.raw.inner.restructuredtext, string.other.link.title.restructuredtext - settings - - foreground - #a7c080 - - - - name - LaTex delimiter - scope - punctuation.definition.function.latex, punctuation.definition.function.tex, punctuation.definition.keyword.latex, constant.character.newline.tex, punctuation.definition.keyword.tex - settings - - foreground - #859289 - - - - name - LaTex red - scope - support.function.be.latex - settings - - foreground - #e67e80 - - - - name - LaTex orange - scope - support.function.section.latex, keyword.control.table.cell.latex, keyword.control.table.newline.latex - settings - - foreground - #e69875 - - - - name - LaTex yellow - scope - support.class.latex, variable.parameter.latex, variable.parameter.function.latex, variable.parameter.definition.label.latex, constant.other.reference.label.latex - settings - - foreground - #dbbc7f - - - - name - LaTex purple - scope - keyword.control.preamble.latex - settings - - foreground - #d699b6 - - - - name - Html grey - scope - punctuation.separator.namespace.xml - settings - - foreground - #859289 - - - - name - Html orange - scope - entity.name.tag.html, entity.name.tag.xml, entity.name.tag.localname.xml - settings - - foreground - #e69875 - - - - name - Html yellow - scope - entity.other.attribute-name.html, entity.other.attribute-name.xml, entity.other.attribute-name.localname.xml - settings - - foreground - #dbbc7f - - - - name - Html green - scope - string.quoted.double.html, string.quoted.single.html, punctuation.definition.string.begin.html, punctuation.definition.string.end.html, punctuation.separator.key-value.html, punctuation.definition.string.begin.xml, punctuation.definition.string.end.xml, string.quoted.double.xml, string.quoted.single.xml, punctuation.definition.tag.begin.html, punctuation.definition.tag.end.html, punctuation.definition.tag.xml, meta.tag.xml, meta.tag.preprocessor.xml, meta.tag.other.html, meta.tag.block.any.html, meta.tag.inline.any.html - settings - - foreground - #a7c080 - - - - name - Html purple - scope - variable.language.documentroot.xml, meta.tag.sgml.doctype.xml - settings - - foreground - #d699b6 - - - - name - Proto yellow - scope - storage.type.proto - settings - - foreground - #dbbc7f - - - - name - Proto green - scope - string.quoted.double.proto.syntax, string.quoted.single.proto.syntax, string.quoted.double.proto, string.quoted.single.proto - settings - - foreground - #a7c080 - - - - name - Proto aqua - scope - entity.name.class.proto, entity.name.class.message.proto - settings - - foreground - #83c092 - - - - name - CSS grey - scope - punctuation.definition.entity.css, punctuation.separator.key-value.css, punctuation.terminator.rule.css, punctuation.separator.list.comma.css - settings - - foreground - #859289 - - - - name - CSS red - scope - entity.other.attribute-name.class.css - settings - - foreground - #e67e80 - - - - name - CSS orange - scope - keyword.other.unit - settings - - foreground - #e69875 - - - - name - CSS yellow - scope - entity.other.attribute-name.pseudo-class.css, entity.other.attribute-name.pseudo-element.css - settings - - foreground - #dbbc7f - - - - name - CSS green - scope - string.quoted.single.css, string.quoted.double.css, support.constant.property-value.css, meta.property-value.css, punctuation.definition.string.begin.css, punctuation.definition.string.end.css, constant.numeric.css, support.constant.font-name.css, variable.parameter.keyframe-list.css - settings - - foreground - #a7c080 - - - - name - CSS aqua - scope - support.type.property-name.css - settings - - foreground - #83c092 - - - - name - CSS blue - scope - support.type.vendored.property-name.css - settings - - foreground - #7fbbb3 - - - - name - CSS purple - scope - entity.name.tag.css, entity.other.keyframe-offset.css, punctuation.definition.keyword.css, keyword.control.at-rule.keyframes.css, meta.selector.css - settings - - foreground - #d699b6 - - - - name - SASS grey - scope - punctuation.definition.entity.scss, punctuation.separator.key-value.scss, punctuation.terminator.rule.scss, punctuation.separator.list.comma.scss - settings - - foreground - #859289 - - - - name - SASS orange - scope - keyword.control.at-rule.keyframes.scss - settings - - foreground - #e69875 - - - - name - SASS yellow - scope - punctuation.definition.interpolation.begin.bracket.curly.scss, punctuation.definition.interpolation.end.bracket.curly.scss - settings - - foreground - #dbbc7f - - - - name - SASS green - scope - punctuation.definition.string.begin.scss, punctuation.definition.string.end.scss, string.quoted.double.scss, string.quoted.single.scss, constant.character.css.sass, meta.property-value.scss - settings - - foreground - #a7c080 - - - - name - SASS purple - scope - keyword.control.at-rule.include.scss, keyword.control.at-rule.use.scss, keyword.control.at-rule.mixin.scss, keyword.control.at-rule.extend.scss, keyword.control.at-rule.import.scss - settings - - foreground - #d699b6 - - - - name - Stylus white - scope - meta.function.stylus - settings - - foreground - #d3c6aa - - - - name - Stylus yellow - scope - entity.name.function.stylus - settings - - foreground - #dbbc7f - - - - name - JavaScript white - scope - string.unquoted.js - settings - - foreground - #d3c6aa - - - - name - JavaScript grey - scope - punctuation.accessor.js, punctuation.separator.key-value.js, punctuation.separator.label.js, keyword.operator.accessor.js - settings - - foreground - #859289 - - - - name - JavaScript red - scope - punctuation.definition.block.tag.jsdoc - settings - - foreground - #e67e80 - - - - name - JavaScript orange - scope - storage.type.js, storage.type.function.arrow.js - settings - - foreground - #e69875 - - - - name - JSX white - scope - JSXNested - settings - - foreground - #d3c6aa - - - - name - JSX green - scope - punctuation.definition.tag.jsx, entity.other.attribute-name.jsx, punctuation.definition.tag.begin.js.jsx, punctuation.definition.tag.end.js.jsx, entity.other.attribute-name.js.jsx - settings - - foreground - #a7c080 - - - - name - TypeScript white - scope - entity.name.type.module.ts - settings - - foreground - #d3c6aa - - - - name - TypeScript grey - scope - keyword.operator.type.annotation.ts, punctuation.accessor.ts, punctuation.separator.key-value.ts - settings - - foreground - #859289 - - - - name - TypeScript green - scope - punctuation.definition.tag.directive.ts, entity.other.attribute-name.directive.ts - settings - - foreground - #a7c080 - - - - name - TypeScript aqua - scope - entity.name.type.ts, entity.name.type.interface.ts, entity.other.inherited-class.ts, entity.name.type.alias.ts, entity.name.type.class.ts, entity.name.type.enum.ts - settings - - foreground - #83c092 - - - - name - TypeScript orange - scope - storage.type.ts, storage.type.function.arrow.ts, storage.type.type.ts - settings - - foreground - #e69875 - - - - name - TypeScript blue - scope - entity.name.type.module.ts - settings - - foreground - #7fbbb3 - - - - name - TypeScript purple - scope - keyword.control.import.ts, keyword.control.export.ts, storage.type.namespace.ts - settings - - foreground - #d699b6 - - - - name - TSX white - scope - entity.name.type.module.tsx - settings - - foreground - #d3c6aa - - - - name - TSX grey - scope - keyword.operator.type.annotation.tsx, punctuation.accessor.tsx, punctuation.separator.key-value.tsx - settings - - foreground - #859289 - - - - name - TSX green - scope - punctuation.definition.tag.directive.tsx, entity.other.attribute-name.directive.tsx, punctuation.definition.tag.begin.tsx, punctuation.definition.tag.end.tsx, entity.other.attribute-name.tsx - settings - - foreground - #a7c080 - - - - name - TSX aqua - scope - entity.name.type.tsx, entity.name.type.interface.tsx, entity.other.inherited-class.tsx, entity.name.type.alias.tsx, entity.name.type.class.tsx, entity.name.type.enum.tsx - settings - - foreground - #83c092 - - - - name - TSX blue - scope - entity.name.type.module.tsx - settings - - foreground - #7fbbb3 - - - - name - TSX purple - scope - keyword.control.import.tsx, keyword.control.export.tsx, storage.type.namespace.tsx - settings - - foreground - #d699b6 - - - - name - TSX orange - scope - storage.type.tsx, storage.type.function.arrow.tsx, storage.type.type.tsx, support.class.component.tsx - settings - - foreground - #e69875 - - - - name - CoffeeScript orange - scope - storage.type.function.coffee - settings - - foreground - #e69875 - - - - name - PureScript white - scope - meta.type-signature.purescript - settings - - foreground - #d3c6aa - - - - name - PureScript orange - scope - keyword.other.double-colon.purescript, keyword.other.arrow.purescript, keyword.other.big-arrow.purescript - settings - - foreground - #e69875 - - - - name - PureScript yellow - scope - entity.name.function.purescript - settings - - foreground - #dbbc7f - - - - name - PureScript green - scope - string.quoted.single.purescript, string.quoted.double.purescript, punctuation.definition.string.begin.purescript, punctuation.definition.string.end.purescript, string.quoted.triple.purescript, entity.name.type.purescript - settings - - foreground - #a7c080 - - - - name - PureScript purple - scope - support.other.module.purescript - settings - - foreground - #d699b6 - - - - name - Dart grey - scope - punctuation.dot.dart - settings - - foreground - #859289 - - - - name - Dart orange - scope - storage.type.primitive.dart - settings - - foreground - #e69875 - - - - name - Dart yellow - scope - support.class.dart - settings - - foreground - #dbbc7f - - - - name - Dart green - scope - entity.name.function.dart, string.interpolated.single.dart, string.interpolated.double.dart - settings - - foreground - #a7c080 - - - - name - Dart blue - scope - variable.language.dart - settings - - foreground - #7fbbb3 - - - - name - Dart purple - scope - keyword.other.import.dart, storage.type.annotation.dart - settings - - foreground - #d699b6 - - - - name - Pug red - scope - entity.other.attribute-name.class.pug - settings - - foreground - #e67e80 - - - - name - Pug orange - scope - storage.type.function.pug - settings - - foreground - #e69875 - - - - name - Pug aqua - scope - entity.other.attribute-name.tag.pug - settings - - foreground - #83c092 - - - - name - Pug purple - scope - entity.name.tag.pug, storage.type.import.include.pug - settings - - foreground - #d699b6 - - - - name - C white - scope - meta.function-call.c, storage.modifier.array.bracket.square.c, meta.function.definition.parameters.c - settings - - foreground - #d3c6aa - - - - name - C grey - scope - punctuation.separator.dot-access.c, constant.character.escape.line-continuation.c - settings - - foreground - #859289 - - - - name - C red - scope - keyword.control.directive.include.c, punctuation.definition.directive.c, keyword.control.directive.pragma.c, keyword.control.directive.line.c, keyword.control.directive.define.c, keyword.control.directive.conditional.c, keyword.control.directive.diagnostic.error.c, keyword.control.directive.undef.c, keyword.control.directive.conditional.ifdef.c, keyword.control.directive.endif.c, keyword.control.directive.conditional.ifndef.c, keyword.control.directive.conditional.if.c, keyword.control.directive.else.c - settings - - foreground - #e67e80 - - - - name - C orange - scope - punctuation.separator.pointer-access.c - settings - - foreground - #e69875 - - - - name - C aqua - scope - variable.other.member.c - settings - - foreground - #83c092 - - - - name - C++ white - scope - meta.function-call.cpp, storage.modifier.array.bracket.square.cpp, meta.function.definition.parameters.cpp, meta.body.function.definition.cpp - settings - - foreground - #d3c6aa - - - - name - C++ grey - scope - punctuation.separator.dot-access.cpp, constant.character.escape.line-continuation.cpp - settings - - foreground - #859289 - - - - name - C++ red - scope - keyword.control.directive.include.cpp, punctuation.definition.directive.cpp, keyword.control.directive.pragma.cpp, keyword.control.directive.line.cpp, keyword.control.directive.define.cpp, keyword.control.directive.conditional.cpp, keyword.control.directive.diagnostic.error.cpp, keyword.control.directive.undef.cpp, keyword.control.directive.conditional.ifdef.cpp, keyword.control.directive.endif.cpp, keyword.control.directive.conditional.ifndef.cpp, keyword.control.directive.conditional.if.cpp, keyword.control.directive.else.cpp, storage.type.namespace.definition.cpp, keyword.other.using.directive.cpp, storage.type.struct.cpp - settings - - foreground - #e67e80 - - - - name - C++ orange - scope - punctuation.separator.pointer-access.cpp, punctuation.section.angle-brackets.begin.template.call.cpp, punctuation.section.angle-brackets.end.template.call.cpp - settings - - foreground - #e69875 - - - - name - C++ aqua - scope - variable.other.member.cpp - settings - - foreground - #83c092 - - - - name - C# red - scope - keyword.other.using.cs - settings - - foreground - #e67e80 - - - - name - C# yellow - scope - keyword.type.cs, constant.character.escape.cs, punctuation.definition.interpolation.begin.cs, punctuation.definition.interpolation.end.cs - settings - - foreground - #dbbc7f - - - - name - C# green - scope - string.quoted.double.cs, string.quoted.single.cs, punctuation.definition.string.begin.cs, punctuation.definition.string.end.cs - settings - - foreground - #a7c080 - - - - name - C# aqua - scope - variable.other.object.property.cs - settings - - foreground - #83c092 - - - - name - C# purple - scope - entity.name.type.namespace.cs - settings - - foreground - #d699b6 - - - - name - F# white - scope - keyword.symbol.fsharp, constant.language.unit.fsharp - settings - - foreground - #d3c6aa - - - - name - F# yellow - scope - keyword.format.specifier.fsharp, entity.name.type.fsharp - settings - - foreground - #dbbc7f - - - - name - F# green - scope - string.quoted.double.fsharp, string.quoted.single.fsharp, punctuation.definition.string.begin.fsharp, punctuation.definition.string.end.fsharp - settings - - foreground - #a7c080 - - - - name - F# blue - scope - entity.name.section.fsharp - settings - - foreground - #7fbbb3 - - - - name - F# purple - scope - support.function.attribute.fsharp - settings - - foreground - #d699b6 - - - - name - Java grey - scope - punctuation.separator.java, punctuation.separator.period.java - settings - - foreground - #859289 - - - - name - Java red - scope - keyword.other.import.java, keyword.other.package.java - settings - - foreground - #e67e80 - - - - name - Java orange - scope - storage.type.function.arrow.java, keyword.control.ternary.java - settings - - foreground - #e69875 - - - - name - Java aqua - scope - variable.other.property.java - settings - - foreground - #83c092 - - - - name - Java purple - scope - variable.language.wildcard.java, storage.modifier.import.java, storage.type.annotation.java, punctuation.definition.annotation.java, storage.modifier.package.java, entity.name.type.module.java - settings - - foreground - #d699b6 - - - - name - Kotlin red - scope - keyword.other.import.kotlin - settings - - foreground - #e67e80 - - - - name - Kotlin orange - scope - storage.type.kotlin - settings - - foreground - #e69875 - - - - name - Kotlin aqua - scope - constant.language.kotlin - settings - - foreground - #83c092 - - - - name - Kotlin purple - scope - entity.name.package.kotlin, storage.type.annotation.kotlin - settings - - foreground - #d699b6 - - - - name - Scala purple - scope - entity.name.package.scala - settings - - foreground - #d699b6 - - - - name - Scala blue - scope - constant.language.scala - settings - - foreground - #7fbbb3 - - - - name - Scala aqua - scope - entity.name.import.scala - settings - - foreground - #83c092 - - - - name - Scala green - scope - string.quoted.double.scala, string.quoted.single.scala, punctuation.definition.string.begin.scala, punctuation.definition.string.end.scala, string.quoted.double.interpolated.scala, string.quoted.single.interpolated.scala, string.quoted.triple.scala - settings - - foreground - #a7c080 - - - - name - Scala yellow - scope - entity.name.class, entity.other.inherited-class.scala - settings - - foreground - #dbbc7f - - - - name - Scala orange - scope - keyword.declaration.stable.scala, keyword.other.arrow.scala - settings - - foreground - #e69875 - - - - name - Scala red - scope - keyword.other.import.scala - settings - - foreground - #e67e80 - - - - name - Groovy white - scope - keyword.operator.navigation.groovy, meta.method.body.java, meta.definition.method.groovy, meta.definition.method.signature.java - settings - - foreground - #d3c6aa - - - - name - Scala grey - scope - punctuation.separator.groovy - settings - - foreground - #859289 - - - - name - Scala red - scope - keyword.other.import.groovy, keyword.other.package.groovy, keyword.other.import.static.groovy - settings - - foreground - #e67e80 - - - - name - Groovy orange - scope - storage.type.def.groovy - settings - - foreground - #e69875 - - - - name - Groovy green - scope - variable.other.interpolated.groovy, meta.method.groovy - settings - - foreground - #a7c080 - - - - name - Groovy aqua - scope - storage.modifier.import.groovy, storage.modifier.package.groovy - settings - - foreground - #83c092 - - - - name - Groovy purple - scope - storage.type.annotation.groovy - settings - - foreground - #d699b6 - - - - name - Go red - scope - keyword.type.go - settings - - foreground - #e67e80 - - - - name - Go aqua - scope - entity.name.package.go - settings - - foreground - #83c092 - - - - name - Go purple - scope - keyword.import.go, keyword.package.go - settings - - foreground - #d699b6 - - - - name - Rust white - scope - entity.name.type.mod.rust - settings - - foreground - #d3c6aa - - - - name - Rust grey - scope - keyword.operator.path.rust, keyword.operator.member-access.rust - settings - - foreground - #859289 - - - - name - Rust orange - scope - storage.type.rust - settings - - foreground - #e69875 - - - - name - Rust aqua - scope - support.constant.core.rust - settings - - foreground - #83c092 - - - - name - Rust purple - scope - meta.attribute.rust, variable.language.rust, storage.type.module.rust - settings - - foreground - #d699b6 - - - - name - Swift white - scope - meta.function-call.swift, support.function.any-method.swift - settings - - foreground - #d3c6aa - - - - name - Swift aqua - scope - support.variable.swift - settings - - foreground - #83c092 - - - - name - PHP white - scope - keyword.operator.class.php - settings - - foreground - #d3c6aa - - - - name - PHP orange - scope - storage.type.trait.php - settings - - foreground - #e69875 - - - - name - PHP aqua - scope - constant.language.php, support.other.namespace.php - settings - - foreground - #83c092 - - - - name - PHP blue - scope - storage.type.modifier.access.control.public.cpp, storage.type.modifier.access.control.private.cpp - settings - - foreground - #7fbbb3 - - - - name - PHP purple - scope - keyword.control.import.include.php, storage.type.php - settings - - foreground - #d699b6 - - - - name - Python white - scope - meta.function-call.arguments.python - settings - - foreground - #d3c6aa - - - - name - Python grey - scope - punctuation.definition.decorator.python, punctuation.separator.period.python - settings - - foreground - #859289 - - - - name - Python aqua - scope - constant.language.python - settings - - foreground - #83c092 - - - - name - Python purple - scope - keyword.control.import.python, keyword.control.import.from.python - settings - - foreground - #d699b6 - - - - name - Lua aqua - scope - constant.language.lua - settings - - foreground - #83c092 - - - - name - Lua blue - scope - entity.name.class.lua - settings - - foreground - #7fbbb3 - - - - name - Ruby white - scope - meta.function.method.with-arguments.ruby - settings - - foreground - #d3c6aa - - - - name - Ruby grey - scope - punctuation.separator.method.ruby - settings - - foreground - #859289 - - - - name - Ruby orange - scope - keyword.control.pseudo-method.ruby, storage.type.variable.ruby - settings - - foreground - #e69875 - - - - name - Ruby green - scope - keyword.other.special-method.ruby - settings - - foreground - #a7c080 - - - - name - Ruby purple - scope - keyword.control.module.ruby, punctuation.definition.constant.ruby - settings - - foreground - #d699b6 - - - - name - Ruby yellow - scope - string.regexp.character-class.ruby,string.regexp.interpolated.ruby,punctuation.definition.character-class.ruby,string.regexp.group.ruby, punctuation.section.regexp.ruby, punctuation.definition.group.ruby - settings - - foreground - #dbbc7f - - - - name - Ruby blue - scope - variable.other.constant.ruby - settings - - foreground - #7fbbb3 - - - - name - Haskell orange - scope - keyword.other.arrow.haskell, keyword.other.big-arrow.haskell, keyword.other.double-colon.haskell - settings - - foreground - #e69875 - - - - name - Haskell yellow - scope - storage.type.haskell - settings - - foreground - #dbbc7f - - - - name - Haskell green - scope - constant.other.haskell, string.quoted.double.haskell, string.quoted.single.haskell, punctuation.definition.string.begin.haskell, punctuation.definition.string.end.haskell - settings - - foreground - #a7c080 - - - - name - Haskell blue - scope - entity.name.function.haskell - settings - - foreground - #7fbbb3 - - - - name - Haskell aqua - scope - entity.name.namespace, meta.preprocessor.haskell - settings - - foreground - #83c092 - - - - name - Julia red - scope - keyword.control.import.julia, keyword.control.export.julia - settings - - foreground - #e67e80 - - - - name - Julia orange - scope - keyword.storage.modifier.julia - settings - - foreground - #e69875 - - - - name - Julia aqua - scope - constant.language.julia - settings - - foreground - #83c092 - - - - name - Julia purple - scope - support.function.macro.julia - settings - - foreground - #d699b6 - - - - name - Elm white - scope - keyword.other.period.elm - settings - - foreground - #d3c6aa - - - - name - Elm yellow - scope - storage.type.elm - settings - - foreground - #dbbc7f - - - - name - R orange - scope - keyword.other.r - settings - - foreground - #e69875 - - - - name - R green - scope - entity.name.function.r, variable.function.r - settings - - foreground - #a7c080 - - - - name - R aqua - scope - constant.language.r - settings - - foreground - #83c092 - - - - name - R purple - scope - entity.namespace.r - settings - - foreground - #d699b6 - - - - name - Erlang grey - scope - punctuation.separator.module-function.erlang, punctuation.section.directive.begin.erlang - settings - - foreground - #859289 - - - - name - Erlang red - scope - keyword.control.directive.erlang, keyword.control.directive.define.erlang - settings - - foreground - #e67e80 - - - - name - Erlang yellow - scope - entity.name.type.class.module.erlang - settings - - foreground - #dbbc7f - - - - name - Erlang green - scope - string.quoted.double.erlang, string.quoted.single.erlang, punctuation.definition.string.begin.erlang, punctuation.definition.string.end.erlang - settings - - foreground - #a7c080 - - - - name - Erlang purple - scope - keyword.control.directive.export.erlang, keyword.control.directive.module.erlang, keyword.control.directive.import.erlang, keyword.control.directive.behaviour.erlang - settings - - foreground - #d699b6 - - - - name - Elixir aqua - scope - variable.other.readwrite.module.elixir, punctuation.definition.variable.elixir - settings - - foreground - #83c092 - - - - name - Elixir blue - scope - constant.language.elixir - settings - - foreground - #7fbbb3 - - - - name - Elixir purple - scope - keyword.control.module.elixir - settings - - foreground - #d699b6 - - - - name - OCaml white - scope - entity.name.type.value-signature.ocaml - settings - - foreground - #d3c6aa - - - - name - OCaml orange - scope - keyword.other.ocaml - settings - - foreground - #e69875 - - - - name - OCaml aqua - scope - constant.language.variant.ocaml - settings - - foreground - #83c092 - - - - name - Perl red - scope - storage.type.sub.perl, storage.type.declare.routine.perl - settings - - foreground - #e67e80 - - - - name - Lisp white - scope - meta.function.lisp - settings - - foreground - #d3c6aa - - - - name - Lisp red - scope - storage.type.function-type.lisp - settings - - foreground - #e67e80 - - - - name - Lisp green - scope - keyword.constant.lisp - settings - - foreground - #a7c080 - - - - name - Lisp aqua - scope - entity.name.function.lisp - settings - - foreground - #83c092 - - - - name - Clojure green - scope - constant.keyword.clojure, support.variable.clojure, meta.definition.variable.clojure - settings - - foreground - #a7c080 - - - - name - Clojure purple - scope - entity.global.clojure - settings - - foreground - #d699b6 - - - - name - Clojure blue - scope - entity.name.function.clojure - settings - - foreground - #7fbbb3 - - - - name - Shell white - scope - meta.scope.if-block.shell, meta.scope.group.shell - settings - - foreground - #d3c6aa - - - - name - Shell yellow - scope - support.function.builtin.shell, entity.name.function.shell - settings - - foreground - #dbbc7f - - - - name - Shell green - scope - string.quoted.double.shell, string.quoted.single.shell, punctuation.definition.string.begin.shell, punctuation.definition.string.end.shell, string.unquoted.heredoc.shell - settings - - foreground - #a7c080 - - - - name - Shell purple - scope - keyword.control.heredoc-token.shell, variable.other.normal.shell, punctuation.definition.variable.shell, variable.other.special.shell, variable.other.positional.shell, variable.other.bracket.shell - settings - - foreground - #d699b6 - - - - name - Fish red - scope - support.function.builtin.fish - settings - - foreground - #e67e80 - - - - name - Fish orange - scope - support.function.unix.fish - settings - - foreground - #e69875 - - - - name - Fish blue - scope - variable.other.normal.fish, punctuation.definition.variable.fish, variable.other.fixed.fish, variable.other.special.fish - settings - - foreground - #7fbbb3 - - - - name - Fish green - scope - string.quoted.double.fish, punctuation.definition.string.end.fish, punctuation.definition.string.begin.fish, string.quoted.single.fish - settings - - foreground - #a7c080 - - - - name - Fish purple - scope - constant.character.escape.single.fish - settings - - foreground - #d699b6 - - - - name - PowerShell grey - scope - punctuation.definition.variable.powershell - settings - - foreground - #859289 - - - - name - PowerShell yellow - scope - entity.name.function.powershell, support.function.attribute.powershell, support.function.powershell - settings - - foreground - #dbbc7f - - - - name - PowerShell green - scope - string.quoted.single.powershell, string.quoted.double.powershell, punctuation.definition.string.begin.powershell, punctuation.definition.string.end.powershell, string.quoted.double.heredoc.powershell - settings - - foreground - #a7c080 - - - - name - PowerShell aqua - scope - variable.other.member.powershell - settings - - foreground - #83c092 - - - - name - GraphQL white - scope - string.unquoted.alias.graphql - settings - - foreground - #d3c6aa - - - - name - GraphQL red - scope - keyword.type.graphql - settings - - foreground - #e67e80 - - - - name - GraphQL purple - scope - entity.name.fragment.graphql - settings - - foreground - #d699b6 - - - - name - Makefile orange - scope - entity.name.function.target.makefile - settings - - foreground - #e69875 - - - - name - Makefile yellow - scope - variable.other.makefile - settings - - foreground - #dbbc7f - - - - name - Makefile green - scope - meta.scope.prerequisites.makefile - settings - - foreground - #a7c080 - - - - name - CMake green - scope - string.source.cmake - settings - - foreground - #a7c080 - - - - name - CMake aqua - scope - entity.source.cmake - settings - - foreground - #83c092 - - - - name - CMake purple - scope - storage.source.cmake - settings - - foreground - #d699b6 - - - - name - VimL grey - scope - punctuation.definition.map.viml - settings - - foreground - #859289 - - - - name - VimL orange - scope - storage.type.map.viml - settings - - foreground - #e69875 - - - - name - VimL green - scope - constant.character.map.viml, constant.character.map.key.viml - settings - - foreground - #a7c080 - - - - name - VimL blue - scope - constant.character.map.special.viml - settings - - foreground - #7fbbb3 - - - - name - Tmux green - scope - constant.language.tmux, constant.numeric.tmux - settings - - foreground - #a7c080 - - - - name - Dockerfile orange - scope - entity.name.function.package-manager.dockerfile - settings - - foreground - #e69875 - - - - name - Dockerfile yellow - scope - keyword.operator.flag.dockerfile - settings - - foreground - #dbbc7f - - - - name - Dockerfile green - scope - string.quoted.double.dockerfile, string.quoted.single.dockerfile - settings - - foreground - #a7c080 - - - - name - Dockerfile aqua - scope - constant.character.escape.dockerfile - settings - - foreground - #83c092 - - - - name - Dockerfile purple - scope - entity.name.type.base-image.dockerfile, entity.name.image.dockerfile - settings - - foreground - #d699b6 - - - - name - Diff grey - scope - punctuation.definition.separator.diff - settings - - foreground - #859289 - - - - name - Diff red - scope - markup.deleted.diff, punctuation.definition.deleted.diff - settings - - foreground - #e67e80 - - - - name - Diff orange - scope - meta.diff.range.context, punctuation.definition.range.diff - settings - - foreground - #e69875 - - - - name - Diff yellow - scope - meta.diff.header.from-file - settings - - foreground - #dbbc7f - - - - name - Diff green - scope - markup.inserted.diff, punctuation.definition.inserted.diff - settings - - foreground - #a7c080 - - - - name - Diff blue - scope - markup.changed.diff, punctuation.definition.changed.diff - settings - - foreground - #7fbbb3 - - - - name - Diff purple - scope - punctuation.definition.from-file.diff - settings - - foreground - #d699b6 - - - - name - Git red - scope - entity.name.section.group-title.ini, punctuation.definition.entity.ini - settings - - foreground - #e67e80 - - - - name - Git orange - scope - punctuation.separator.key-value.ini - settings - - foreground - #e69875 - - - - name - Git green - scope - string.quoted.double.ini, string.quoted.single.ini, punctuation.definition.string.begin.ini, punctuation.definition.string.end.ini - settings - - foreground - #a7c080 - - - - name - Git aqua - scope - keyword.other.definition.ini - settings - - foreground - #83c092 - - - - name - SQL yellow - scope - support.function.aggregate.sql - settings - - foreground - #dbbc7f - - - - name - SQL green - scope - string.quoted.single.sql, punctuation.definition.string.end.sql, punctuation.definition.string.begin.sql, string.quoted.double.sql - settings - - foreground - #a7c080 - - - - name - GraphQL yellow - scope - support.type.graphql - settings - - foreground - #dbbc7f - - - - name - GraphQL blue - scope - variable.parameter.graphql - settings - - foreground - #7fbbb3 - - - - name - GraphQL aqua - scope - constant.character.enum.graphql - settings - - foreground - #83c092 - - - - name - JSON grey - scope - punctuation.support.type.property-name.begin.json, punctuation.support.type.property-name.end.json, punctuation.separator.dictionary.key-value.json, punctuation.definition.string.begin.json, punctuation.definition.string.end.json, punctuation.separator.dictionary.pair.json, punctuation.separator.array.json - settings - - foreground - #859289 - - - - name - JSON orange - scope - support.type.property-name.json - settings - - foreground - #e69875 - - - - name - JSON green - scope - string.quoted.double.json - settings - - foreground - #a7c080 - - - - name - YAML grey - scope - punctuation.separator.key-value.mapping.yaml - settings - - foreground - #859289 - - - - name - YAML green - scope - string.unquoted.plain.out.yaml, string.quoted.single.yaml, string.quoted.double.yaml, punctuation.definition.string.begin.yaml, punctuation.definition.string.end.yaml, string.unquoted.plain.in.yaml, string.unquoted.block.yaml - settings - - foreground - #a7c080 - - - - name - YAML aqua - scope - punctuation.definition.anchor.yaml, punctuation.definition.block.sequence.item.yaml - settings - - foreground - #83c092 - - - - name - TOML orange - scope - keyword.key.toml - settings - - foreground - #e69875 - - - - name - TOML green - scope - string.quoted.single.basic.line.toml, string.quoted.single.literal.line.toml, punctuation.definition.keyValuePair.toml - settings - - foreground - #a7c080 - - - - name - TOML blue - scope - constant.other.boolean.toml - settings - - foreground - #7fbbb3 - - - - name - TOML purple - scope - entity.other.attribute-name.table.toml, punctuation.definition.table.toml, entity.other.attribute-name.table.array.toml, punctuation.definition.table.array.toml - settings - - foreground - #d699b6 - - - - name - Comment - scope - comment, string.comment, punctuation.definition.comment - settings - - foreground - #859289 - fontStyle - italic - - - - uuid - 3f688e48-bd62-4cd7-9981-9b491786d8c6 - colorSpaceName - sRGB - semanticClass - theme.dark.everforest-dark - author - - comment - - - diff --git a/fedora/.config/yazi/flavors/gruvbox-dark.yazi/LICENSE b/fedora/.config/yazi/flavors/gruvbox-dark.yazi/LICENSE deleted file mode 100644 index e6984c6..0000000 --- a/fedora/.config/yazi/flavors/gruvbox-dark.yazi/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2024 Ben Yip - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/fedora/.config/yazi/flavors/gruvbox-dark.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/gruvbox-dark.yazi/LICENSE-tmtheme deleted file mode 100644 index c996915..0000000 --- a/fedora/.config/yazi/flavors/gruvbox-dark.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Subhaditya Nath - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/gruvbox-dark.yazi/README.md b/fedora/.config/yazi/flavors/gruvbox-dark.yazi/README.md deleted file mode 100644 index d6fb349..0000000 --- a/fedora/.config/yazi/flavors/gruvbox-dark.yazi/README.md +++ /dev/null @@ -1,32 +0,0 @@ -
-Yazi logo -
- -

- Gruvbox Dark Flavor for Yazi -

- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -```bash -ya pack -a bennyyip/gruvbox-dark -``` - -## โš™๏ธ Usage - -Add the these lines to your `theme.toml` configuration file to use it: - -```toml -[flavor] -dark = "gruvbox-dark" -``` - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/gruvbox-dark.yazi/flavor.toml b/fedora/.config/yazi/flavors/gruvbox-dark.yazi/flavor.toml deleted file mode 100644 index b2eb7cf..0000000 --- a/fedora/.config/yazi/flavors/gruvbox-dark.yazi/flavor.toml +++ /dev/null @@ -1,176 +0,0 @@ -# vim:fileencoding=utf-8:foldmethod=marker - -# : Manager {{{ - -[manager] -cwd = { fg = "#83a598" } - -# Hovered -hovered = { reversed = true, bold = true } -# hovered = { bg = "#3c3836", bold = true } -preview_hovered = { underline = true } - -# Find -find_keyword = { fg = "#b8bb26", italic = true } -find_position = { fg = "#fe8019", bg = "reset", italic = true } - -# Marker -marker_copied = { fg = "#8ec07c", bg = "#8ec07c" } -marker_cut = { fg = "#d3869b", bg = "#d3869b" } -marker_marked = { fg = "#83a598", bg = "#83a598" } -marker_selected = { fg = "#fbf1c7", bg = "#fbf1c7" } - -# Tab -tab_active = { fg = "#282828", bg = "#a89984" } -tab_inactive = { fg = "#a89984", bg = "#504945" } -tab_width = 1 - -# Count -count_copied = { fg = "#282828", bg = "#8ec07c" } -count_cut = { fg = "#282828", bg = "#d3869b" } -count_selected = { fg = "#282828", bg = "#fbf1c7" } - -# Border -border_symbol = "โ”‚" -border_style = { fg = "#665c54" } - -# : }}} - -# : Mode {{{ - -[mode] -normal_main = { fg = "#282828", bg = "#a89984", bold = true } -normal_alt = { fg = "#a89984", bg = "#504945" } -select_main = { fg = "#282828", bg = "#fe8019", bold = true } -select_alt = { fg = "#a89984", bg = "#504945" } -unset_main = { fg = "#282828", bg = "#b8bb26", bold = true } -unset_alt = { fg = "#a89984", bg = "#504945" } - -# : }}} - -# : Status {{{ - -[status] -sep_left = { open = "\ue0be", close = "\ue0b8" } -sep_right = { open = "\ue0be", close = "\ue0b8" } -overall = { } - -# Progress -progress_label = { fg = "#ebdbb2", bold = true } -progress_normal = { fg = "#504945", bg = "#3c3836" } -progress_error = { fg = "#fb4934", bg = "#3c3836" } - -# Permissions -perm_type = { fg = "#504945" } -perm_read = { fg = "#b8bb26" } -perm_write = { fg = "#fb4934" } -perm_exec = { fg = "#b8bb26" } -perm_sep = { fg = "#665c54" } - -# : }}} - -# : Select {{{ - -[pick] -border = { fg = "#458588" } -active = { fg = "#d3869b", bold = true } -inactive = {} - -# : }}} - -# : Input {{{ - -[input] -border = { fg = "#ebdbb2" } -title = {} -value = {} -selected = { reversed = true } - -# : }}} - -# : Tasks {{{ - -[tasks] -border = { fg = "#504945" } -title = {} -hovered = { underline = true } - -# : }}} - -# : Which {{{ - -[which] -mask = { bg = "#3c3836" } -cand = { fg = "#83a598" } -rest = { fg = "#928374" } -desc = { fg = "#fe8019" } -separator = " ๎ชœ " -separator_style = { fg = "#504945" } - -# : }}} - -# : Help {{{ - -[help] -on = { fg = "#83a598" } -run = { fg = "#d3869b" } -hovered = { reversed = true, bold = true } -footer = { fg = "#3c3836", bg = "#a89984" } - -# : }}} - -# : Notify {{{ - -[notify] -title_info = { fg = "#8ec07c" } -title_warn = { fg = "#fbf1c7" } -title_error = { fg = "#d3869b" } - -# : }}} - -# : File-specific styles {{{ - -[filetype] -rules = [ - # Images - { mime = "image/*", fg = "#d3869b" }, - - # Media - { mime = "{audio,video}/*", fg = "#fabd2f" }, - - # Archives - { mime = "application/*zip", fg = "#fb4934" }, - { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "#fb4934" }, - - # Documents - { mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#689d6a" }, - - # Fallback - { name = "*", fg = "#ebdbb2" }, - { name = "*/", fg = "#83a598" }, -] - -# : }}} - -# : Confirmation {{{ - -[confirm] -border = { fg = "#a89984" } -title = { fg = "#83a598" } -content = { fg = "#fbf1c7" } -body = { fg = "red" } -list = { fg = "#ebdbb2" } -btn_yes = { reversed = true, fg = "#ebdbb2" } -btn_no = {} -btn_labels = [ " [Y]es ", " (N)o " ] - -# : }}} - -# : Completion {{{ - -[cmp] -border = { fg = "#a89984" } -active = { reversed = true, fg = "#83a598" } -inactive = { fg = "#ebdbb2" } - -# : }}} diff --git a/fedora/.config/yazi/flavors/gruvbox-dark.yazi/preview.png b/fedora/.config/yazi/flavors/gruvbox-dark.yazi/preview.png deleted file mode 100644 index d157dfe..0000000 Binary files a/fedora/.config/yazi/flavors/gruvbox-dark.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/gruvbox-dark.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/gruvbox-dark.yazi/tmtheme.xml deleted file mode 100644 index 59c1ecd..0000000 --- a/fedora/.config/yazi/flavors/gruvbox-dark.yazi/tmtheme.xml +++ /dev/null @@ -1,1509 +0,0 @@ - - - - - comment - Based on gruvbox for Vim (https://github.com/morhetz/gruvbox) - originalAuthor - Pavel Pertsev (https://github.com/morhetz) - author - Brian Reilly (https://github.com/Briles/gruvbox) - name - gruvbox (Dark) (Medium) - colorSpaceName - sRGB - settings - - - settings - - background - #222222 - caret - #a89984 - foreground - #ebdbb280 - invisibles - #ebdbb226 - lineHighlight - #3c3836 - selection - #3c3836 - inactiveSelection - #3c3836 - guide - #ebdbb226 - activeGuide - #ebdbb280 - stackGuide - #ebdbb240 - bracketContentsOptions - underline - bracketContentsForeground - #bdae93 - bracketsOptions - underline - bracketsForeground - #bdae93 - gutterForeground - #928374 - highlight - #fbf1c7 - highlightForeground - #fbf1c7 - findHighlight - #d79921 - findHighlightForeground - #222222 - tagsOptions - underline - selectionBorder - #3c3836 - popupCss - - html { - background-color: #1b1b1b; - color: #fbf1c7; - padding: 12px; - } - - a { - color: #8ec07c; - } - - .error, .deleted { - color: #fb4934; - } - - .success, .inserted, .name { - color: #b8bb26; - } - - .warning, .modified { - color: #fabd2f; - } - - .type { - color: #fabd2f; - font-style: italic; - } - - .param { - color: #fbf1c7; - } - - .current { - text-decoration: underline; - } - - - - - name - Text and Source Base Colors - scope - meta.group, meta.method-call.source.cs, meta.method.attribute.source.cs, meta.method.body.java, meta.method.body.source.cs, meta.method.source.cs, none, source, text - settings - - foreground - #fbf1c7 - - - - name - Punctuation - scope - entity.quasi.element meta.group.braces, keyword.operator keyword.operator.neon, keyword.operator operator.neon, keyword.operator.accessor, keyword.other.accessor, meta.attribute-selector keyword.operator.stylus, meta.brace, meta.delimiter, meta.group.braces, meta.punctuation.separator, meta.separator, punctuation - settings - - foreground - #fbf1c7 - - - - name - Comments - scope - comment, comment text, markup.strikethrough, punctuation.definition.comment, punctuation.whitespace.comment, string.comment, text.cancelled - settings - - fontStyle - italic - foreground - #928374 - - - - name - Keywords Inside Comments - scope - comment.keyword, comment.keyword.punctuation - settings - - foreground - #d5c4a1 - - - - name - DocBlockr & Other Keywords Inside Comments - scope - comment.parameter, comment.punctuation, comment.string, comment.type, keyword.other.phpdoc.php, punctuation.definition.keyword.javadoc, source.groovy keyword.other.documentation, source.java keyword.other.documentation, storage.type.annotation.coffeescript, storage.type.class.jsdoc - settings - - foreground - #bdae93 - - - - name - Entity - scope - constant.language.name, entity.name.type, entity.other.inherited-class - settings - - foreground - #fabd2f - - - - name - Template String Punctuation - scope - constant.other.placeholder, entity.name.tag.mustache, entity.tag.tagbraces, punctuation.definition.string.template, punctuation.definition.template-expression, punctuation.quasi, punctuation.section.embedded, string.interpolated, variable.other.interpolation.scss - settings - - foreground - #8ec07c - - - - name - Keywords - scope - js.embedded.control.flow keyword.operator.js, keyword, keyword.control, keyword.operator.logical.python, meta.at-rule.media support.function.misc, meta.prolog.haml, meta.tag.sgml.doctype.html, storage.type.function.jade, storage.type.function.pug, storage.type.import.haxe, storage.type.import.include.jade, storage.type.import.include.pug, support.keyword.timing-direction, variable.documentroot - settings - - foreground - #fb4934 - - - - name - CSS At-Rule Punctuation (@) & At-Rule Vendor Prefixes - scope - keyword.control.at-rule support.type.property-vendor, punctuation.definition.keyword - settings - - foreground - #cc241d - - - - name - Operators - scope - keyword.control.new, keyword.control.operator, keyword.operator, keyword.other.arrow, keyword.other.double-colon, punctuation.operator - settings - - foreground - #8ec07c - - - - name - Constants Punctuation - scope - constant.other.color punctuation.definition.constant, constant.other.symbol punctuation.definition.constant, constant.other.unit, keyword.other.unit, punctuation.section.flowtype, support.constant.unicode-range.prefix - settings - - foreground - #b16286 - - - - name - Storage - scope - storage, storage.type.annotation, storage.type.primitive - settings - - foreground - #fb4934 - - - - scope - storage.modifier.import, storage.modifier.package, storage.type.import, variable.import, variable.package - settings - - foreground - #fbf1c7 - - - - name - Function Keyword - scope - entity.quasi.tag.name, meta.function storage.type.matlab, storage.type.function - settings - - foreground - #8ec07c - - - - name - Variables - scope - entity.name.val.declaration, entity.name.variable, meta.definition.variable, storage.type.variable, support.type.custom-property, support.type.variable-name, variable, variable.interpolation variable, variable.other.interpolation variable, variable.parameter.dosbatch, variable.parameter.output.function.matlab, variable.parameter.sass - settings - - foreground - #83a598 - - - - name - Variable - Punctuation - scope - keyword.other.custom-property.prefix, punctuation.definition.custom-property, punctuation.definition.variable, support.constant.custom-property-name.prefix, variable.interpolation, variable.other.dollar punctuation.dollar, variable.other.object.dollar punctuation.dollar - settings - - foreground - #458588 - - - - name - Function Declaration - Punctuation - scope - entity.name.function punctuation.dollar - settings - - foreground - #98971a - - - - name - Object Properties - scope - meta.property.object - settings - - foreground - #fbf1c7 - - - - name - Object Literal Properties - scope - constant.other.object.key string, meta.object-literal.key - settings - - foreground - #fbf1c7 - - - - name - Parameters - scope - meta.parameters, variable.parameter - settings - - foreground - #fbf1c7 - - - - name - SASS Import URL - scope - variable.parameter.url - settings - - foreground - #b8bb26 - - - - name - Language Constants - scope - constant, constant.numeric, constant.other, constant.other.color, constant.other.symbol, support.constant, support.constant.color, support.constant.font-name, support.constant.media, support.constant.prototype, variable.language - settings - - foreground - #d3869b - - - - name - Language Constants Punctuation - scope - variable.language punctuation.definition.variable - settings - - foreground - #b16286 - - - - name - User-Defined Constants - scope - entity.name.constant, variable.other.constant - settings - - foreground - #fabd2f - - - - name - Escaped Characters - scope - constant.character.escape, constant.character.escaped, constant.character.quoted, constant.other.character-class.escape - settings - - foreground - #fb4934 - - - - name - Invalids and Illegals - scope - invalid - settings - - foreground - #fbf1c7 - background - #fb4934 - - - - name - Inner Scopes of Invalids and Illegals - scope - invalid keyword.other.custom-property.prefix, invalid support.type.custom-property.name - settings - - foreground - #fbf1c7 - - - - name - Errors - scope - message.error - settings - - foreground - #fb4934 - - - - name - Strings - scope - meta.object-literal.key string, string - settings - - foreground - #b8bb26 - - - - name - JSON Keys - scope - meta.structure.dictionary.key.json string - settings - - foreground - #83a598 - - - - name - Regular Expressions Text - scope - source.regexp, string.regexp - settings - - foreground - #b8bb26 - - - - name - Regular Expressions Start & End Punctuation - scope - string.regexp punctuation.definition.string - settings - - foreground - #bdae93 - - - - name - Regular Expressions Character Class Punctuation ([]) - scope - keyword.control.set.regexp, punctuation.definition.character-class, string.regexp.character-class.ruby - settings - - foreground - #d3869b - - - - name - Regular Expressions Capturing Group - scope - string.regexp.group - settings - - foreground - #fbf1c7 - - - - name - Regular Expressions Assertions - scope - constant.other.assertion.regexp, punctuation.definition.group.assertion.regexp, punctuation.definition.group.capture.regexp - settings - - foreground - #83a598 - - - - name - Regular Expressions Character Class - scope - constant.other.character-class.escape.backslash.regexp, keyword.control.character-class.regexp, string.regexp.character-class constant.character.escape - settings - - foreground - #fabd2f - - - - name - Regular Expressions Quantifiers & Operators - scope - string.regexp.arbitrary-repetition, string.regexp.arbitrary-repetition punctuation - settings - - foreground - #8ec07c - - - - name - Hyperlinks - scope - constant.other.reference.link, string.other.link - settings - - foreground - #8ec07c - - - - name - Hyperlink Punctuation - scope - meta.image.inline punctuation.definition.string, meta.link.inline punctuation.definition.string, meta.link.reference punctuation.definition.constant, meta.link.reference.literal punctuation.definition.constant, meta.link.reference.literal punctuation.definition.string - settings - - foreground - #689d6a - - - - name - Markup Tag Punctuation - scope - punctuation.definition.tag - settings - - foreground - #83a598 - - - - name - Markdown Heading - scope - markup.heading - settings - - foreground - #b8bb26 - - - - name - Markdown Heading Punctuation - scope - punctuation.definition.heading, punctuation.definition.identity - settings - - foreground - #98971a - - - - name - Markdown Bold Text - scope - markup.bold - settings - - foreground - #fe8019 - fontStyle - bold - - - - name - Markdown Bold Text Punctuation - scope - punctuation.definition.bold - settings - - foreground - #d65d0e - fontStyle - bold - - - - name - Markdown Italic Text - scope - markup.italic - settings - - foreground - #fb4934 - fontStyle - italic - - - - name - Markdown Italic Text Punctuation - scope - punctuation.definition.italic - settings - - foreground - #cc241d - fontStyle - italic - - - - name - Markdown Inline Code - scope - markup.raw.inline - settings - - foreground - #fabd2f - - - - name - Markdown Inline Code Punctuation - scope - markup.raw.inline punctuation.definition.raw - settings - - foreground - #d79921 - - - - name - Markdown Quoted - scope - markup.quote - settings - - foreground - #d3869b - - - - name - Markdown Quoted Punctuation - scope - markup.quote punctuation.definition.blockquote - settings - - foreground - #b16286 - - - - name - Markdown List - scope - markup.list - settings - - foreground - #83a598 - - - - name - Markdown List Punctuation - scope - markup.list punctuation.definition.list_item - settings - - foreground - #458588 - - - - name - Markdown Separators - scope - meta.separator.markdown - settings - - foreground - #928374 - - - - name - Support - scope - meta.function-call.constructor variable.type, support.class, support.type, variable.other.class - settings - - foreground - #fabd2f - - - - name - Supporting Type - Dollar Punctuation - scope - support.class punctuation.dollar - settings - - foreground - #d79921 - - - - name - Function Calls - scope - entity.name.function.jade, entity.name.function.pug, keyword.other.special-method, meta.function-call variable.function, meta.function-call variable.other.dollar.only punctuation.dollar, support.function - settings - - foreground - #8ec07c - - - - name - Method Calls - scope - meta.function-call.method support.function, meta.function-call.method variable.function, meta.function-call.static variable.function, meta.method-call, meta.method-call support.function, meta.method-call variable.function, support.function.mutator - settings - - foreground - #689d6a - - - - name - Special Variables - scope - support.module - settings - - foreground - #d3869b - - - - name - Entities - scope - entity.name.accessor, entity.name.function, entity.name.label, entity.name.section - settings - - foreground - #b8bb26 - - - - name - Modules - scope - entity.name.module - settings - - foreground - #fe8019 - - - - name - HTML & CSS ID - scope - constant.id.tag, entity.name.tag.id, entity.other.attribute-name.id - settings - - foreground - #fe8019 - - - - name - HTML & CSS ID Punctuation (#) - scope - entity.other.attribute-name.id punctuation.definition.entity - settings - - foreground - #d65d0e - - - - name - HTML & CSS Class - scope - entity.name.tag.class, entity.other.attribute-name.class - settings - - foreground - #fabd2f - - - - name - HTML & CSS Class Punctuation (.) - scope - entity.other.attribute-name.class punctuation.definition.entity - settings - - foreground - #d79921 - - - - name - CSS Attribute Selector Attribute Name - scope - meta.attribute-selector entity.other.attribute-name - settings - - foreground - #d79921 - - - - name - HTML & XML Entity Punctuation - scope - constant.character.entity punctuation.definition.constant, constant.character.entity punctuation.definition.entity - settings - - foreground - #b16286 - - - - scope - entity.name.class, entity.name.type.class - settings - - foreground - #fabd2f - - - - name - Markup Tag - scope - entity.name.function.neon, entity.name.namespace.wildcard, entity.name.tag, entity.tag, keyword.control.untitled, keyword.doctype.xml, keyword.operator support.other.neon, punctuation.definition.prolog.haml, source.less keyword.control.html.elements - settings - - foreground - #83a598 - - - - name - HTML Attribute Names - scope - entity.name.attribute-name, entity.other.attribute-name, meta.section.attributes.haml constant.other.symbol.ruby - settings - - foreground - #fabd2f - - - - name - CSS Pseudo Elements/Classes & Vendor Prefixes - scope - entity.other.attribute-name.placeholder punctuation.definition.entity, entity.other.attribute-name.pseudo-class, entity.other.attribute-name.pseudo-element, entity.other.attribute-name.tag.pseudo-class, entity.other.attribute-name.tag.pseudo-element, entity.other.pseudo-class, entity.other.pseudo-element, support.type.vendor-prefix - settings - - foreground - #d79921 - - - - name - CSS Animations / Keyframes - scope - entity.function-name.stylus, entity.other.animation-keyframe.stylus, entity.other.animation-name, keyword.language.function.misc.stylus, meta.at-rule.keyframes entity.name.function, variable.other.animation-name - settings - - foreground - #8ec07c - - - - name - Author-Defined Names - scope - entity.other.namespace-prefix - settings - - foreground - #8ec07c - - - - scope - meta.class.body, meta.tag - settings - - foreground - #fbf1c7 - - - - name - Markdown Image & Hyperlink - scope - meta.image, meta.link - settings - - foreground - #d3869b - - - - name - Markdown Image & Hyperlink Punctuation - scope - meta.image punctuation.definition.metadata, meta.link punctuation.definition.metadata - settings - - foreground - #b16286 - - - - scope - meta.require - settings - - foreground - #b8bb26 - - - - name - Function Call Braces - scope - constant.name.attribute.tag.jade, constant.name.attribute.tag.pug, meta.brace.round, meta.function-call meta.group punctuation.definition.group, punctuation.definition.method-parameters, punctuation.definition.parameters - settings - - foreground - #bdae93 - - - - name - CSS Property Names - scope - meta.property-name, support.type.property-name, support.type.shape.definition support.constant.property-value - settings - - foreground - #b8bb26 - - - - name - CSS Property Name Vendor Prefixes - scope - meta.property-name support.type.vendor-prefix, support.type.property-name.media support.type.vendor-prefix - settings - - foreground - #98971a - - - - name - CSS Property Values - scope - constant.string.sass, meta.property-value, support.constant.property-value - settings - - foreground - #fbf1c7 - - - - name - CSS Property Value Vendor Prefixes - scope - meta.property-value support.type.vendor-prefix - settings - - foreground - #bdae93 - - - - name - Diff Foreground Text - scope - source.diff - settings - - foreground - #a89984 - - - - name - Diff Header Text From - scope - meta.diff.header.from-file - settings - - foreground - #83a598 - - - - name - Diff Header Text From Punctuation - scope - punctuation.definition.from-file - settings - - foreground - #458588 - - - - name - Diff Header Text To - scope - meta.diff.header.to-file - settings - - foreground - #d3869b - - - - name - Diff Header Text To Punctuation - scope - punctuation.definition.to-file - settings - - foreground - #b16286 - - - - name - Diff Additions & Deletions Stats - scope - meta.diff.range, meta.toc-list.line-number - settings - - foreground - #fabd2f - - - - name - Diff Additions & Deletions Stats Punctuation - scope - punctuation.definition.range.diff - settings - - foreground - #d79921 - - - - name - FiF Line Number - scope - constant.numeric.line-number - settings - - foreground - #928374 - - - - name - FiF Line Number Matched - scope - constant.numeric.line-number.match - settings - - foreground - #8ec07c - - - - name - FiF Filename - scope - entity.name.filename - settings - - foreground - #b8bb26 - - - - name - GitGutter & Diff Deleted - scope - markup.deleted, punctuation.definition.deleted - settings - - foreground - #fb4934 - - - - name - GitGutter & Diff Inserted - scope - markup.inserted, punctuation.definition.inserted - settings - - foreground - #b8bb26 - - - - name - GitGutter & Diff Changed - scope - markup.changed, punctuation.definition.changed - settings - - foreground - #fabd2f - - - - name - GitGutter ignored - scope - markup.ignored - settings - - foreground - #928374 - - - - name - GitGutter untracked - scope - markup.untracked - settings - - foreground - #928374 - - - - name - Bracket Tag - scope - brackethighlighter.tag - settings - - foreground - #bdae93 - - - - name - Bracket Curly - scope - brackethighlighter.curly - settings - - foreground - #bdae93 - - - - name - Bracket Round - scope - brackethighlighter.round - settings - - foreground - #bdae93 - - - - name - Bracket Square - scope - brackethighlighter.square - settings - - foreground - #bdae93 - - - - name - Bracket Angle - scope - brackethighlighter.angle - settings - - foreground - #bdae93 - - - - name - Bracket Quote - scope - brackethighlighter.quote - settings - - foreground - #bdae93 - - - - name - Bracket Unmatched - scope - brackethighlighter.unmatched - settings - - foreground - #fb4934 - - - - name - SublimeLinter Error - scope - sublimelinter.mark.error - settings - - foreground - #fb4934 - - - - name - SublimeLinter Gutter Mark - scope - sublimelinter.gutter-mark - settings - - foreground - #928374 - - - - name - SublimeLinter Warning - scope - sublimelinter.mark.warning - settings - - foreground - #fabd2f - - - - name - HexViewer Upper Byte Nibble - scope - raw.nibble.upper - settings - - foreground - #fbf1c7 - - - - name - HexViewer Lower Byte Nibble - scope - raw.nibble.lower - settings - - foreground - #fbf1c7 - - - - name - HexViewer Highlight - scope - hexviewer.highlight - settings - - foreground - #222222 - background - #fabd2f - - - - name - HexViewer Edited Highlight - scope - hexviewer.highlight.edited - settings - - foreground - #222222 - background - #fe8019 - - - - name - Raw New Line: Carriage Return - scope - glyph.carriage-return - settings - - foreground - #ebdbb226 - - - - name - Raw New Line: New Line Glyph - scope - glyph.new-line - settings - - foreground - #ebdbb226 - - - - name - PlainTasks: Header - scope - keyword.control.header.todo - settings - - foreground - #b8bb26 - background - #3a3a3a - - - - name - PlainTasks: Notes - scope - notes.todo - settings - - foreground - #bdae93 - - - - name - PlainTasks: Punctuation - scope - text.todo punctuation.definition.bold, text.todo punctuation.definition.italic - settings - - foreground - #7c6f64 - - - - name - PlainTasks: Task Pending - scope - meta.item.todo.pending - settings - - foreground - #fbf1c7 - - - - name - PlainTasks: Task Pending Punctuation - scope - punctuation.definition.bullet.pending.todo - settings - - foreground - #928374 - - - - name - PlainTasks: Task Completed Punctuation - scope - punctuation.definition.bullet.completed.todo - settings - - foreground - #8ec07c - - - - name - PlainTasks: Task Cancelled Punctuation - scope - punctuation.definition.bullet.cancelled.todo - settings - - foreground - #fb4934 - - - - name - PlainTasks: Tag Critical - scope - string.other.tag.todo.critical - settings - - foreground - #fb4934 - fontStyle - bold - - - - name - PlainTasks: Tag High - scope - string.other.tag.todo.high - settings - - foreground - #fe8019 - fontStyle - bold - - - - name - PlainTasks: Tag Low - scope - string.other.tag.todo.low - settings - - foreground - #83a598 - fontStyle - bold - - - - name - PlainTasks: Tag Today - scope - string.other.tag.todo.today - settings - - foreground - #fabd2f - fontStyle - bold - - - - name - PlainTasks: Tag - scope - meta.tag.todo - settings - - foreground - #d3869b - - - - name - PlainTasks: URL - scope - punctuation.definition.url, todo.url - settings - - foreground - #83a598 - - - - name - PlainTasks: Separator - scope - meta.punctuation.archive.todo, meta.punctuation.separator.todo - settings - - fontStyle - italic - foreground - #928374 - - - - - diff --git a/fedora/.config/yazi/flavors/kanagawa-dragon.yazi/LICENSE b/fedora/.config/yazi/flavors/kanagawa-dragon.yazi/LICENSE deleted file mode 100644 index 1b1dfdc..0000000 --- a/fedora/.config/yazi/flavors/kanagawa-dragon.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Dmitry Nefedov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/kanagawa-dragon.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/kanagawa-dragon.yazi/LICENSE-tmtheme deleted file mode 100644 index 1b1dfdc..0000000 --- a/fedora/.config/yazi/flavors/kanagawa-dragon.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Dmitry Nefedov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/kanagawa-dragon.yazi/README.md b/fedora/.config/yazi/flavors/kanagawa-dragon.yazi/README.md deleted file mode 100644 index eacd8a8..0000000 --- a/fedora/.config/yazi/flavors/kanagawa-dragon.yazi/README.md +++ /dev/null @@ -1,32 +0,0 @@ -
- Yazi logo -
- -

- Kanagawa Dragon Flavor for Yazi -

- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -```bash -ya pack -a marcosvnmelo/kanagawa-dragon -``` - -## โš™๏ธ Usage - -Add these lines to your `theme.toml` configuration file to use it: - -```toml -[flavor] -dark = "kanagawa-dragon" -``` - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/kanagawa-dragon.yazi/flavor.toml b/fedora/.config/yazi/flavors/kanagawa-dragon.yazi/flavor.toml deleted file mode 100644 index e96acdc..0000000 --- a/fedora/.config/yazi/flavors/kanagawa-dragon.yazi/flavor.toml +++ /dev/null @@ -1,137 +0,0 @@ -## Color palette -## Check https://github.com/rebelot/kanagawa.nvim for more details -# sumiInk0 "#16161d" dark bg -# sumiInk3 "#181616" bg -# sumiInk4 "#0d0c0c" -# sumiInk6 "#54546d" -# fujiWhite "#c5c9c5" fg -# oldWhite "#7fb4ca" dark fg -# fujiGray "#a6a69c" -# peachRed "#ff5d62" -# autumnRed "#c4746e" -# crystalBlue "#8ba4b0" -# waveRed "#e46876" -# carpYellow "#e6c384" -# springGreen "#8a9a7b" -# autumnGreen "#76946a" -# oniViolet "#a292a3" -# waveAqua1 "#6a9589" -# surimiOrange "#e46876" -# waveAqua2 "#7aa89f" - -[manager] -marker_copied = { fg = "#8a9a7b", bg = "#8a9a7b" } -marker_cut = { fg = "#e46876", bg = "#e46876" } -marker_marked = { fg = "#a292a3", bg = "#a292a3" } -marker_selected = { fg = "#e46876", bg = "#e46876" } - -cwd = { fg = "#e6c384" } -hovered = { reversed = true } -preview_hovered = { reversed = true } - -find_keyword = { fg = "#e46876", bg = "#181616" } -find_position = {} - -tab_active = { reversed = true } -tab_inactive = {} -tab_width = 1 - -count_copied = { fg = "#181616", bg = "#8a9a7b" } -count_cut = { fg = "#181616", bg = "#e46876" } -count_selected = { fg = "#181616", bg = "#e6c384" } - -border_symbol = "โ”‚" -border_style = { fg = "#c5c9c5" } - - -[mode] -normal_main = { fg = "#181616", bg = "#8ba4b0" } -normal_alt = { fg = "#8ba4b0", bg = "#0d0c0c" } -select_main = { fg = "#181616", bg = "#a292a3" } -select_alt = { fg = "#a292a3", bg = "#0d0c0c" } -unset_main = { fg = "#181616", bg = "#e6c384" } -unset_alt = { fg = "#e6c384", bg = "#0d0c0c" } - - -[status] -sep_left = { open = "", close = "" } -sep_right = { open = "", close = "" } -overall = { fg = "#7fb4ca", bg = "#16161d" } - -progress_label = { fg = "#8ba4b0", bg = "#0d0c0c", bold = true } -progress_normal = { fg = "#0d0c0c", bg = "#181616" } -progress_error = { fg = "#0d0c0c", bg = "#181616" } - -perm_type = { fg = "#8a9a7b" } -perm_read = { fg = "#e6c384" } -perm_write = { fg = "#ff5d62" } -perm_exec = { fg = "#7aa89f" } -perm_sep = { fg = "#a292a3" } - - -[pick] -border = { fg = "#8ea4a2" } -active = { fg = "#a292a3", bold = true } -inactive = {} - -[input] -border = { fg = "#8ea4a2" } -title = {} -value = {} -selected = { reversed = true } - -[completion] -border = { fg = "#8ea4a2" } -active = { reversed = true } -inactive = {} - -[tasks] -border = { fg = "#8ea4a2" } -title = {} -hovered = { fg = "#a292a3" } - -[which] -cols = 2 -separator = " - " -separator_style = { fg = "#a6a69c" } -mask = { bg = "#16161d" } -rest = { fg = "#a6a69c" } -cand = { fg = "#8ba4b0" } -desc = { fg = "#54546d" } - -[help] -on = { fg = "#7aa89f" } -run = { fg = "#a292a3" } -desc = {} -hovered = { reversed = true, bold = true } -footer = { fg = "#181616", bg = "#c5c9c5" } - -[notify] -title_info = { fg = "#8a9a7b" } -title_warn = { fg = "#e6c384" } -title_error = { fg = "#ff5d62" } - -[filetype] -rules = [ - # images - { mime = "image/*", fg = "#e6c384" }, - - # media - { mime = "{audio,video}/*", fg = "#a292a3" }, - - # archives - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#e46876" }, - - # documents - { mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#6a9589" }, - - # broken links - { name = "*", is = "orphan", fg = "#c4746e" }, - - # executables - { name = "*", is = "exec", fg = "#76946a" }, - - # fallback - { name = "*", fg = "#c5c9c5" }, - { name = "*/", fg = "#8ba4b0" }, -] diff --git a/fedora/.config/yazi/flavors/kanagawa-dragon.yazi/preview.png b/fedora/.config/yazi/flavors/kanagawa-dragon.yazi/preview.png deleted file mode 100644 index a6dfa80..0000000 Binary files a/fedora/.config/yazi/flavors/kanagawa-dragon.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/kanagawa-dragon.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/kanagawa-dragon.yazi/tmtheme.xml deleted file mode 100644 index 4a38718..0000000 --- a/fedora/.config/yazi/flavors/kanagawa-dragon.yazi/tmtheme.xml +++ /dev/null @@ -1,448 +0,0 @@ - - - - - name - Kanagawa Dragon - settings - - - settings - - background - #1F1F28 - caret - #C8C093 - foreground - #c5c9c5 - invisibles - #54546D - lineHighlight - #2D4F67 - selection - #2D4F67 - findHighlight - #2D4F67 - selectionBorder - #222218 - gutterForeground - #54546D - - - - name - Comment - scope - comment - settings - - foreground - #a6a69c - - - - name - String - scope - string - settings - - foreground - #87a987 - - - - name - Number - scope - constant.numeric - settings - - foreground - #D27E99 - - - - name - Built-in constant - scope - constant.language - settings - - foreground - #b6927b - - - - name - User-defined constant - scope - constant.character, constant.other - settings - - foreground - #E6C384 - - - - name - Variable - scope - variable - settings - - fontStyle - #E6C384 - - - - name - Ruby's @variable - scope - variable.other.readwrite.instance - settings - - fontStyle - - foreground - #E6C384 - - - - name - String interpolation - scope - constant.character.escaped, constant.character.escape, string source, string source.ruby - settings - - fontStyle - - foreground - #c4b28a - - - - name - Keyword - scope - keyword - settings - - foreground - #E46876 - - - - name - Storage - scope - storage - settings - - fontStyle - - foreground - #a292a3 - - - - name - Storage type - scope - storage.type - settings - - foreground - #a292a3 - - - - name - Class name - scope - entity.name.class - settings - - foreground - #7AA89F - - - - name - Inherited class - scope - entity.other.inherited-class - settings - - foreground - #7AA89F - - - - name - Function name - scope - entity.name.function - settings - - fontStyle - - foreground - #8ba4b0 - - - - name - Function argument - scope - variable.parameter - settings - - foreground - #b8b4d0 - - - - name - Tag name - scope - entity.name.tag - settings - - fontStyle - - foreground - #7FB4CA - - - - name - Tag attribute - scope - entity.other.attribute-name - settings - - fontStyle - - foreground - #E6C384 - - - - name - Library function - scope - support.function - settings - - fontStyle - - foreground - #7FB4CA - - - - name - Library constant - scope - support.constant - settings - - fontStyle - - foreground - #7FB4CA - - - - name - Library class/type - scope - support.type, support.class - settings - - foreground - #7AA89F - - - - name - Library variable - scope - support.other.variable - settings - - foreground - #b6927b - - - - name - Invalid - scope - invalid - settings - - fontStyle - - foreground - #b98d7b - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - foreground - #717C7C - - - - name - JSON String - scope - meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #a292a3 - - - - name - diff.header - scope - meta.diff, meta.diff.header - settings - - foreground - #8ba4b0 - - - - name - diff.deleted - scope - markup.deleted - settings - - background - #43242B - - - - name - diff.inserted - scope - markup.inserted - settings - - background - #2B3328 - - - - name - diff.changed - scope - markup.changed - settings - - background - #49443C - - - - scope - constant.numeric.line-number.find-in-files - match - settings - - foreground - #54546D - - - - scope - entity.name.filename - settings - - foreground - #C8C093 - - - - scope - message.error - settings - - foreground - #E46876 - - - - name - JSON Punctuation - scope - punctuation.definition.string.begin.json - meta.structure.dictionary.value.json, punctuation.definition.string.end.json - meta.structure.dictionary.value.json - settings - - foreground - #9CABCA - - - - name - JSON Structure - scope - meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #a292a3 - - - - name - JSON String - scope - meta.structure.dictionary.value.json string.quoted.double.json - settings - - foreground - #ffffff - - - - name - Escape Characters - scope - constant.character.escape - settings - - foreground - #b98d7b - - - - name - Regular Expressions - scope - string.regexp - settings - - foreground - #E6C384 - - - - uuid - 592FC036-6BB7-4676-A2F5-2894D48C8E33 - colorSpaceName - sRGB - semanticClass - theme.dark.kanagawa-dragon - - diff --git a/fedora/.config/yazi/flavors/kanagawa-lotus.yazi/LICENSE b/fedora/.config/yazi/flavors/kanagawa-lotus.yazi/LICENSE deleted file mode 100644 index 26e253b..0000000 --- a/fedora/.config/yazi/flavors/kanagawa-lotus.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2025 Alexander Muratov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/kanagawa-lotus.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/kanagawa-lotus.yazi/LICENSE-tmtheme deleted file mode 100644 index 26e253b..0000000 --- a/fedora/.config/yazi/flavors/kanagawa-lotus.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2025 Alexander Muratov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/kanagawa-lotus.yazi/README.md b/fedora/.config/yazi/flavors/kanagawa-lotus.yazi/README.md deleted file mode 100644 index e92033a..0000000 --- a/fedora/.config/yazi/flavors/kanagawa-lotus.yazi/README.md +++ /dev/null @@ -1,41 +0,0 @@ -
- Yazi logo -
- -

- Kanagawa Lotus Flavor for Yazi -

- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -```bash -ya pack -a muratoffalex/kanagawa-lotus -``` - -## โš™๏ธ Usage - -To set it as your light flavor, change the content of your theme.toml to: - -```toml -[flavor] -light = "kanagawa-lotus" -``` - -Make sure your theme.toml doesn't contain anything other than [flavor], unless you want to override certain styles of this flavor. - -See the Yazi flavor documentation for more details. - -## ๐Ÿ”— Related Flavors - -- [๐ŸŒŠ Kanagawa Wave](https://github.com/dangooddd/kanagawa.yazi) -- [๐Ÿ‰ Kanagawa Dragon](https://github.com/marcosvnmelo/kanagawa-dragon.yazi) - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/kanagawa-lotus.yazi/flavor.toml b/fedora/.config/yazi/flavors/kanagawa-lotus.yazi/flavor.toml deleted file mode 100644 index ad9b7bd..0000000 --- a/fedora/.config/yazi/flavors/kanagawa-lotus.yazi/flavor.toml +++ /dev/null @@ -1,130 +0,0 @@ -## Color palette -## Check https://github.com/rebelot/kanagawa.nvim for more details -# lotusWhite0 "#d5cea3" dark bg -# lotusWhite3 "#f2ecbc" bg -# lotusWhite4 "#e7dba0" -# lotusViolet1 "#a09cac" -# lotusInk1 "#545464" fg -# lotusInk2 "#43436c" dark fg -# lotusGray3 "#8a8980" -# lotusRed2 "#d7474b" -# lotusRed "#c84053" -# lotusBlue4 "#4d699b" -# lotusRed "#c84053" -# lotusYellow "#77713f" -# lotusGreen "#6f894e" -# lotusGreen2 "#6e915f" -# lotusViolet4 "#624c83" -# lotusAqua "#597b75" -# lotusOrange "#cc6d00" -# lotusAqua2 "#5e857a" - -[mgr] -marker_copied = { fg = "#6f894e", bg = "#6f894e" } -marker_cut = { fg = "#c84053", bg = "#c84053" } -marker_marked = { fg = "#624c83", bg = "#624c83" } -marker_selected = { fg = "#cc6d00", bg = "#cc6d00" } -cwd = { fg = "#77713f" } -hovered = { reversed = true } -preview_hovered = { reversed = true } -find_keyword = { fg = "#cc6d00", bg = "#f2ecbc" } -find_position = {} -count_copied = { fg = "#f2ecbc", bg = "#6f894e" } -count_cut = { fg = "#f2ecbc", bg = "#c84053" } -count_selected = { fg = "#f2ecbc", bg = "#77713f" } -border_symbol = "โ”‚" -border_style = { fg = "#545464" } - -[tabs] -active = { fg = "#f2ecbc", bg = "#4d699b" } -inactive = { fg = "#43436c", bg = "#e7dba0" } -sep_inner = { open = "", close = "" } -sep_outer = { open = "", close = "" } - -[mode] -normal_main = { fg = "#f2ecbc", bg = "#4d699b" } -normal_alt = { fg = "#4d699b", bg = "#e7dba0" } -select_main = { fg = "#f2ecbc", bg = "#624c83" } -select_alt = { fg = "#624c83", bg = "#e7dba0" } -unset_main = { fg = "#f2ecbc", bg = "#77713f" } -unset_alt = { fg = "#77713f", bg = "#e7dba0" } - -[status] -sep_left = { open = "", close = "" } -sep_right = { open = "", close = "" } -overall = { fg = "#43436c", bg = "#d5cea3" } -progress_label = { fg = "#4d699b", bg = "#e7dba0", bold = true } -progress_normal = { fg = "#e7dba0", bg = "#f2ecbc" } -progress_error = { fg = "#e7dba0", bg = "#f2ecbc" } -perm_type = { fg = "#6f894e" } -perm_read = { fg = "#77713f" } -perm_write = { fg = "#d7474b" } -perm_exec = { fg = "#5e857a" } -perm_sep = { fg = "#624c83" } - -[which] -cols = 2 -separator = " - " -separator_style = { fg = "#8a8980" } -mask = { bg = "#d5cea3" } -rest = { fg = "#8a8980" } -cand = { fg = "#4d699b" } -desc = { fg = "#a09cac" } - -[pick] -border = { fg = "#5a7785" } -active = { fg = "#624c83", bold = true } -inactive = {} - -[input] -border = { fg = "#5a7785" } -title = {} -value = {} -selected = { reversed = true } - -[cmp] -border = { fg = "#5a7785" } -active = { reversed = true } -inactive = {} - -[tasks] -border = { fg = "#5a7785" } -title = {} -hovered = { fg = "#624c83" } - -[help] -on = { fg = "#5e857a" } -run = { fg = "#624c83" } -desc = {} -hovered = { reversed = true, bold = true } -footer = { fg = "#f2ecbc", bg = "#545464" } - -[notify] -title_info = { fg = "#6f894e" } -title_warn = { fg = "#77713f" } -title_error = { fg = "#d7474b" } - -[filetype] -rules = [ - # images - { mime = "image/*", fg = "#77713f" }, - - # media - { mime = "{audio,video}/*", fg = "#624c83" }, - - # archives - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#c84053" }, - - # documents - { mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#597b75" }, - - # broken links - { name = "*", is = "orphan", fg = "#d7474b" }, - - # executables - { name = "*", is = "exec", fg = "#6e915f" }, - - # fallback - { name = "*", fg = "#545464" }, - { name = "*/", fg = "#4d699b" }, -] diff --git a/fedora/.config/yazi/flavors/kanagawa-lotus.yazi/preview.png b/fedora/.config/yazi/flavors/kanagawa-lotus.yazi/preview.png deleted file mode 100644 index 41c6392..0000000 Binary files a/fedora/.config/yazi/flavors/kanagawa-lotus.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/kanagawa-lotus.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/kanagawa-lotus.yazi/tmtheme.xml deleted file mode 100644 index ee63cd5..0000000 --- a/fedora/.config/yazi/flavors/kanagawa-lotus.yazi/tmtheme.xml +++ /dev/null @@ -1,448 +0,0 @@ - - - - - name - Kanagawa Lotus - settings - - - settings - - background - #f2ecbc - caret - #43436c - foreground - #545464 - invisibles - #a09cac - lineHighlight - #b5cbd2 - selection - #b5cbd2 - findHighlight - #b5cbd2 - selectionBorder - #e7dba0 - gutterForeground - #a09cac - - - - name - Comment - scope - comment - settings - - foreground - #8a8980 - - - - name - String - scope - string - settings - - foreground - #6f894e - - - - name - Number - scope - constant.numeric - settings - - foreground - #b35b79 - - - - name - Built-in constant - scope - constant.language - settings - - foreground - #cc6d00 - - - - name - User-defined constant - scope - constant.character, constant.other - settings - - foreground - #77713f - - - - name - Variable - scope - variable - settings - - fontStyle - #77713f - - - - name - Ruby's @variable - scope - variable.other.readwrite.instance - settings - - fontStyle - - foreground - #77713f - - - - name - String interpolation - scope - constant.character.escaped, constant.character.escape, string source, string source.ruby - settings - - fontStyle - - foreground - #836f4a - - - - name - Keyword - scope - keyword - settings - - foreground - #c84053 - - - - name - Storage - scope - storage - settings - - fontStyle - - foreground - #624c83 - - - - name - Storage type - scope - storage.type - settings - - foreground - #624c83 - - - - name - Class name - scope - entity.name.class - settings - - foreground - #597b75 - - - - name - Inherited class - scope - entity.other.inherited-class - settings - - foreground - #597b75 - - - - name - Function name - scope - entity.name.function - settings - - fontStyle - - foreground - #4d699b - - - - name - Function argument - scope - variable.parameter - settings - - foreground - #5d57a3 - - - - name - Tag name - scope - entity.name.tag - settings - - fontStyle - - foreground - #5a7785 - - - - name - Tag attribute - scope - entity.other.attribute-name - settings - - fontStyle - - foreground - #77713f - - - - name - Library function - scope - support.function - settings - - fontStyle - - foreground - #5a7785 - - - - name - Library constant - scope - support.constant - settings - - fontStyle - - foreground - #5a7785 - - - - name - Library class/type - scope - support.type, support.class - settings - - foreground - #597b75 - - - - name - Library variable - scope - support.other.variable - settings - - foreground - #cc6d00 - - - - name - Invalid - scope - invalid - settings - - fontStyle - - foreground - #d7474b - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - foreground - #8a8980 - - - - name - JSON String - scope - meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #624c83 - - - - name - diff.header - scope - meta.diff, meta.diff.header - settings - - foreground - #4d699b - - - - name - diff.deleted - scope - markup.deleted - settings - - background - #d9a594 - - - - name - diff.inserted - scope - markup.inserted - settings - - background - #b7d0ae - - - - name - diff.changed - scope - markup.changed - settings - - background - #d7e3d8 - - - - scope - constant.numeric.line-number.find-in-files - match - settings - - foreground - #a09cac - - - - scope - entity.name.filename - settings - - foreground - #43436c - - - - scope - message.error - settings - - foreground - #e82424 - - - - name - JSON Punctuation - scope - punctuation.definition.string.begin.json - meta.structure.dictionary.value.json, punctuation.definition.string.end.json - meta.structure.dictionary.value.json - settings - - foreground - #9fb5c9 - - - - name - JSON Structure - scope - meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #624c83 - - - - name - JSON String - scope - meta.structure.dictionary.value.json string.quoted.double.json - settings - - foreground - #545464 - - - - name - Escape Characters - scope - constant.character.escape - settings - - foreground - #d7474b - - - - name - Regular Expressions - scope - string.regexp - settings - - foreground - #77713f - - - - uuid - 592FC036-6BB7-4676-A2F5-2894D48C8E33 - colorSpaceName - sRGB - semanticClass - theme.light.kanagawa_lotus - - diff --git a/fedora/.config/yazi/flavors/kanagawa.yazi/LICENSE b/fedora/.config/yazi/flavors/kanagawa.yazi/LICENSE deleted file mode 100644 index 1b1dfdc..0000000 --- a/fedora/.config/yazi/flavors/kanagawa.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Dmitry Nefedov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/kanagawa.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/kanagawa.yazi/LICENSE-tmtheme deleted file mode 100644 index 1b1dfdc..0000000 --- a/fedora/.config/yazi/flavors/kanagawa.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Dmitry Nefedov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/kanagawa.yazi/README.md b/fedora/.config/yazi/flavors/kanagawa.yazi/README.md deleted file mode 100644 index d314236..0000000 --- a/fedora/.config/yazi/flavors/kanagawa.yazi/README.md +++ /dev/null @@ -1,36 +0,0 @@ -
- Yazi logo -
- -

- Kanagawa Flavor for Yazi -

- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -```bash -ya pkg add dangooddd/kanagawa -``` - -## โš™๏ธ Usage - -> [!Note] -> To achieve the look like in the screenshot you also need to install -> [full-border](https://github.com/yazi-rs/plugins/tree/main/full-border.yazi) plugin! - -Add these lines to your `theme.toml` configuration file to use it: - -```toml -[flavor] -dark = "kanagawa" -``` - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/kanagawa.yazi/flavor.toml b/fedora/.config/yazi/flavors/kanagawa.yazi/flavor.toml deleted file mode 100644 index 1abed17..0000000 --- a/fedora/.config/yazi/flavors/kanagawa.yazi/flavor.toml +++ /dev/null @@ -1,140 +0,0 @@ -## Color palette -## Check https://github.com/rebelot/kanagawa.nvim for more details -# sumiInk0 "#16161d" dark bg -# sumiInk3 "#1f1f28" bg -# sumiInk4 "#2a2a37" -# sumiInk6 "#54546d" -# fujiWhite "#dcd7ba" fg -# oldWhite "#c8c093" dark fg -# fujiGray "#727169" -# peachRed "#ff5d62" -# autumnRed "#c34043" -# crystalBlue "#7e9cd8" -# waveRed "#e46876" -# carpYellow "#e6c384" -# springGreen "#98bb6c" -# autumnGreen "#76946a" -# oniViolet "#957fb8" -# waveAqua1 "#6a9589" -# surimiOrange "#ffa066" -# waveAqua2 "#7aa89f" - -[mgr] -marker_copied = { fg = "#98bb6c", bg = "#98bb6c" } -marker_cut = { fg = "#e46876", bg = "#e46876" } -marker_marked = { fg = "#957fb8", bg = "#957fb8" } -marker_selected = { fg = "#ffa066", bg = "#ffa066" } - -cwd = { fg = "#e6c384" } -hovered = { reversed = true } -preview_hovered = { reversed = true } - -find_keyword = { fg = "#ffa066", bg = "#1f1f28" } -find_position = {} - -count_copied = { fg = "#1f1f28", bg = "#98bb6c" } -count_cut = { fg = "#1f1f28", bg = "#e46876" } -count_selected = { fg = "#1f1f28", bg = "#ffa066" } - -border_symbol = "โ”‚" -border_style = { fg = "#dcd7ba" } - -[tabs] -active = { fg = "#1f1f28", bg = "#7e9cd8" } -inactive = { fg = "#7e9cd8", bg = "#2a2a37" } - -sep_inner = { open = "", close = "" } -sep_outer = { open = "", close = "" } - - -[mode] -normal_main = { fg = "#1f1f28", bg = "#7e9cd8" } -normal_alt = { fg = "#7e9cd8", bg = "#2a2a37" } -select_main = { fg = "#1f1f28", bg = "#957fb8" } -select_alt = { fg = "#957fb8", bg = "#2a2a37" } -unset_main = { fg = "#1f1f28", bg = "#e6c384" } -unset_alt = { fg = "#e6c384", bg = "#2a2a37" } - - -[status] -sep_left = { open = "", close = "" } -sep_right = { open = "", close = "" } -overall = { fg = "#c8c093", bg = "#16161d" } - -progress_label = { fg = "#7e9cd8", bold = true } -progress_normal = { fg = "#2a2a37", bg = "#1f1f28" } -progress_error = { fg = "#2a2a37", bg = "#1f1f28" } - -perm_type = { fg = "#98bb6c" } -perm_read = { fg = "#e6c384" } -perm_write = { fg = "#ff5d62" } -perm_exec = { fg = "#7aa89f" } -perm_sep = { fg = "#957fb8" } - - -[pick] -border = { fg = "#7fb4ca" } -active = { fg = "#957fb8", bold = true } -inactive = {} - -[input] -border = { fg = "#7fb4ca" } -title = {} -value = {} -selected = { reversed = true } - -[completion] -border = { fg = "#7fb4ca" } -active = { reversed = true } -inactive = {} - -[tasks] -border = { fg = "#7fb4ca" } -title = {} -hovered = { fg = "#957fb8" } - -[which] -cols = 2 -separator = " - " -separator_style = { fg = "#727169" } -mask = { bg = "#16161d" } -rest = { fg = "#727169" } -cand = { fg = "#7e9cd8" } -desc = { fg = "#54546d" } - -[help] -on = { fg = "#7aa89f" } -run = { fg = "#957fb8" } -desc = {} -hovered = { reversed = true, bold = true } -footer = { fg = "#1f1f28", bg = "#dcd7ba" } - -[notify] -title_info = { fg = "#98bb6c" } -title_warn = { fg = "#e6c384" } -title_error = { fg = "#ff5d62" } - -[filetype] -rules = [ - # images - { mime = "image/*", fg = "#e6c384" }, - - # media - { mime = "{audio,video}/*", fg = "#957fb8" }, - - # archives - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#e46876" }, - - # documents - { mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#6a9589" }, - - # broken links - { name = "*", is = "orphan", fg = "#c34043" }, - - # executables - { name = "*", is = "exec", fg = "#76946a" }, - - # fallback - { name = "*", fg = "#dcd7ba" }, - { name = "*/", fg = "#7e9cd8" }, -] diff --git a/fedora/.config/yazi/flavors/kanagawa.yazi/preview.png b/fedora/.config/yazi/flavors/kanagawa.yazi/preview.png deleted file mode 100644 index 87d0767..0000000 Binary files a/fedora/.config/yazi/flavors/kanagawa.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/kanagawa.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/kanagawa.yazi/tmtheme.xml deleted file mode 100644 index 737e459..0000000 --- a/fedora/.config/yazi/flavors/kanagawa.yazi/tmtheme.xml +++ /dev/null @@ -1,448 +0,0 @@ - - - - - name - Kanagawa - settings - - - settings - - background - #1F1F28 - caret - #C8C093 - foreground - #DCD7BA - invisibles - #54546D - lineHighlight - #2D4F67 - selection - #2D4F67 - findHighlight - #2D4F67 - selectionBorder - #222218 - gutterForeground - #54546D - - - - name - Comment - scope - comment - settings - - foreground - #727169 - - - - name - String - scope - string - settings - - foreground - #98BB6C - - - - name - Number - scope - constant.numeric - settings - - foreground - #D27E99 - - - - name - Built-in constant - scope - constant.language - settings - - foreground - #FFA066 - - - - name - User-defined constant - scope - constant.character, constant.other - settings - - foreground - #E6C384 - - - - name - Variable - scope - variable - settings - - fontStyle - #E6C384 - - - - name - Ruby's @variable - scope - variable.other.readwrite.instance - settings - - fontStyle - - foreground - #E6C384 - - - - name - String interpolation - scope - constant.character.escaped, constant.character.escape, string source, string source.ruby - settings - - fontStyle - - foreground - #C0A36E - - - - name - Keyword - scope - keyword - settings - - foreground - #E46876 - - - - name - Storage - scope - storage - settings - - fontStyle - - foreground - #957FB8 - - - - name - Storage type - scope - storage.type - settings - - foreground - #957FB8 - - - - name - Class name - scope - entity.name.class - settings - - foreground - #7AA89F - - - - name - Inherited class - scope - entity.other.inherited-class - settings - - foreground - #7AA89F - - - - name - Function name - scope - entity.name.function - settings - - fontStyle - - foreground - #7E9CD8 - - - - name - Function argument - scope - variable.parameter - settings - - foreground - #b8b4d0 - - - - name - Tag name - scope - entity.name.tag - settings - - fontStyle - - foreground - #7FB4CA - - - - name - Tag attribute - scope - entity.other.attribute-name - settings - - fontStyle - - foreground - #E6C384 - - - - name - Library function - scope - support.function - settings - - fontStyle - - foreground - #7FB4CA - - - - name - Library constant - scope - support.constant - settings - - fontStyle - - foreground - #7FB4CA - - - - name - Library class/type - scope - support.type, support.class - settings - - foreground - #7AA89F - - - - name - Library variable - scope - support.other.variable - settings - - foreground - #FFA066 - - - - name - Invalid - scope - invalid - settings - - fontStyle - - foreground - #FF5D62 - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - foreground - #717C7C - - - - name - JSON String - scope - meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #957FB8 - - - - name - diff.header - scope - meta.diff, meta.diff.header - settings - - foreground - #7E9CD8 - - - - name - diff.deleted - scope - markup.deleted - settings - - background - #43242B - - - - name - diff.inserted - scope - markup.inserted - settings - - background - #2B3328 - - - - name - diff.changed - scope - markup.changed - settings - - background - #49443C - - - - scope - constant.numeric.line-number.find-in-files - match - settings - - foreground - #54546D - - - - scope - entity.name.filename - settings - - foreground - #C8C093 - - - - scope - message.error - settings - - foreground - #E82424 - - - - name - JSON Punctuation - scope - punctuation.definition.string.begin.json - meta.structure.dictionary.value.json, punctuation.definition.string.end.json - meta.structure.dictionary.value.json - settings - - foreground - #9CABCA - - - - name - JSON Structure - scope - meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #957FB8 - - - - name - JSON String - scope - meta.structure.dictionary.value.json string.quoted.double.json - settings - - foreground - #ffffff - - - - name - Escape Characters - scope - constant.character.escape - settings - - foreground - #FF5D62 - - - - name - Regular Expressions - scope - string.regexp - settings - - foreground - #E6C384 - - - - uuid - 592FC036-6BB7-4676-A2F5-2894D48C8E33 - colorSpaceName - sRGB - semanticClass - theme.dark.kanagawa - - diff --git a/fedora/.config/yazi/flavors/rose-pine-dawn.yazi/LICENSE b/fedora/.config/yazi/flavors/rose-pine-dawn.yazi/LICENSE deleted file mode 100644 index 78e74c8..0000000 --- a/fedora/.config/yazi/flavors/rose-pine-dawn.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2025 Mintass - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/rose-pine-dawn.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/rose-pine-dawn.yazi/LICENSE-tmtheme deleted file mode 100644 index ef13b56..0000000 --- a/fedora/.config/yazi/flavors/rose-pine-dawn.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Rosรฉ Pine - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/fedora/.config/yazi/flavors/rose-pine-dawn.yazi/README.md b/fedora/.config/yazi/flavors/rose-pine-dawn.yazi/README.md deleted file mode 100644 index 6163fb5..0000000 --- a/fedora/.config/yazi/flavors/rose-pine-dawn.yazi/README.md +++ /dev/null @@ -1,36 +0,0 @@ -
- Yazi logo -
- -

- Rosรฉ Pine Dawn Flavor for Yazi -

- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -```sh -ya pkg add Mintass/rose-pine-dawn -``` - -## โš™๏ธ Usage - -To set it as your dark flavor, change the content of your `theme.toml` to: - -```toml -[flavor] -light = "rose-pine-dawn" -``` - -Make sure your `theme.toml` doesn't contain anything other than `[flavor]`, unless you want to override certain styles of this flavor. - -See the [Yazi flavor documentation](https://yazi-rs.github.io/docs/flavors/overview) for more details. - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/rose-pine-dawn.yazi/flavor.toml b/fedora/.config/yazi/flavors/rose-pine-dawn.yazi/flavor.toml deleted file mode 100644 index cf64111..0000000 --- a/fedora/.config/yazi/flavors/rose-pine-dawn.yazi/flavor.toml +++ /dev/null @@ -1,230 +0,0 @@ -# vim:fileencoding=utf-8:foldmethod=marker - -# : Manager {{{ - -[mgr] -cwd = { fg = "#56949f" } - -# Hovered -hovered = { reversed = true } -preview_hovered = { underline = true } - -# Find -find_keyword = { fg = "#ea9d34", bold = true, italic = true, underline = true } -find_position = { fg = "#907aa9", bg = "reset", bold = true, italic = true } - -# Symlink -symlink_target = { italic = true } - -# Marker -marker_copied = { fg = "#286983", bg = "#286983" } -marker_cut = { fg = "#b4637a", bg = "#b4637a" } -marker_marked = { fg = "#d7827e", bg = "#d7827e" } -marker_selected = { fg = "#ea9d34", bg = "#ea9d34" } - -# Count -count_copied = { fg = "#575279", bg = "#286983" } -count_cut = { fg = "#575279", bg = "#b4637a" } -count_selected = { fg = "#faf4ed", bg = "#ea9d34" } - -# Border -border_symbol = "โ”‚" -border_style = { fg = "#cecacd" } - -# Highlighting -syntect_theme = "" - -# : }}} - - -# : Tabs {{{ - -[tabs] -active = { fg = "#575279", bg = "#286983", bold = true } -inactive = { fg = "#286983", bg = "#575279" } - -# Separator -sep_inner = { open = "๎‚ถ", close = "๎‚ด" } -sep_outer = { open = "๎‚ถ", close = "๎‚ด" } - -# : }}} - - -# : Mode {{{ - -[mode] -normal_main = { fg = "#faf4ed", bg = "#56949f", bold = true } -normal_alt = { fg = "#faf4ed", bg = "#575279", bold = true } - -# Select mode -select_main = { fg = "#faf4ed", bg = "#b4637a", bold = true } -select_alt = { fg = "#faf4ed", bg = "#575279", bold = true } - -# Unset mode -unset_main = { fg = "#faf4ed", bg = "#b4637a", bold = true } -unset_alt = { fg = "#faf4ed", bg = "#575279", bold = true } - -# : }}} - - -# : Status bar {{{ - -[status] -overall = { bg = "#faf4ed" } -sep_left = { open = "๎‚ถ", close = "๎‚ด" } -sep_right = { open = "๎‚ถ", close = "๎‚ด" } - -# Permissions -perm_sep = { fg = "#9893a5" } -perm_type = { fg = "#907aa9" } -perm_read = { fg = "#ea9d34" } -perm_write = { fg = "#b4637a" } -perm_exec = { fg = "#56949f" } - -# Progress -progress_label = { fg = "#575279", bold = true } -progress_normal = { fg = "#286983", bg = "#f4ede8" } -progress_error = { fg = "#b4637a", bg = "#f4ede8" } - -# : }}} - - -# : Which {{{ - -[which] -cols = 3 -mask = { bg = "#fffaf3" } -cand = { fg = "#56949f" } -rest = { fg = "#9893a5" } -desc = { fg = "#ea9d34" } -separator = " ๎ชœ " -separator_style = { fg = "#9893a5" } - -# : }}} - - -# : Confirmation {{{ - -[confirm] -border = { fg = "#cecacd" } -title = { fg = "#b4637a", bold = true } -body = { fg = "#575279" } -list = { fg = "#575279" } -btn_yes = { fg = "#faf4ed", bg = "#286983", bold = true } -btn_no = { fg = "#faf4ed", bg = "#575279", bold = true } -btn_labels = [ " [y]es ", " (n)o " ] - -# : }}} - - -# : Spotter {{{ - -[spot] -border = { fg = "#cecacd" } -title = { fg = "#56949f", bold = true } - -# Table -tbl_col = { fg = "#56949f" } -tbl_cell = { fg = "#faf4ed", bg = "#ea9d34", bold = true } - -# : }}} - - -# : Notification {{{ - -[notify] -title_info = { fg = "#286983" } -title_warn = { fg = "#ea9d34" } -title_error = { fg = "#b4637a" } - - -# : }}} - - -# : Picker {{{ - -[pick] -border = { fg = "#286983" } -active = { fg = "#907aa9", bold = true } -inactive = { fg = "#797593"} - -# : }}} - - -# : Input {{{ - -[input] -border = { fg = "#286983" } -title = { bold = true } -value = { fg = "#575279"} -selected = { reversed = true } - -# : }}} - - -# : Completion {{{ - -[cmp] -border = { fg = "#286983" } -active = { bg = "#575279", fg = "#faf4ed", bold = true } -inactive = { fg = "#797593" } - - -# : }}} - - -# : Task manager {{{ - -[tasks] -border = { fg = "#286983" } -title = { bold = true} -hovered = { fg = "#907aa9", bold = true, reversed = true } - -# : }}} - - -# : Help menu {{{ - -[help] -on = { fg = "#56949f" } -run = { fg = "#907aa9" } -desc = { fg = "#ea9d34"} -hovered = { reversed = true, bold = true } -footer = { fg = "#faf4ed", bg = "#575279" } - -# : }}} - - -# : File-specific styles {{{ - -[filetype] -rules = [ - # Images - { mime = "image/*", fg = "#907aa9" }, - - # Media - { mime = "{audio,video}/*", fg = "#ea9d34" }, - - # Archives - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#b4637a" }, - - # Documents - { mime = "application/{pdf,doc,rtf}", fg = "#d7827e" }, - - # Empty files - # { mime = "inode/empty", fg = "#b4637a" }, - - # Special files - { name = "*", is = "orphan", fg = "#faf4ed", bg = "#b4637a" }, - { name = "*", is = "exec" , fg = "#56949f" }, - - # Dummy files - { name = "*", is = "dummy", fg = "#faf4ed", bg = "#b4637a" }, - { name = "*/", is = "dummy", fg = "#faf4ed", bg = "#b4637a" }, - - # Fallback - { name = "*", fg = "#575279" }, - { name = "*/", fg = "#286983" } -] - -# : }}} \ No newline at end of file diff --git a/fedora/.config/yazi/flavors/rose-pine-dawn.yazi/preview.png b/fedora/.config/yazi/flavors/rose-pine-dawn.yazi/preview.png deleted file mode 100644 index e4ef7cb..0000000 Binary files a/fedora/.config/yazi/flavors/rose-pine-dawn.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/rose-pine-dawn.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/rose-pine-dawn.yazi/tmtheme.xml deleted file mode 100644 index 4610ea5..0000000 --- a/fedora/.config/yazi/flavors/rose-pine-dawn.yazi/tmtheme.xml +++ /dev/null @@ -1,316 +0,0 @@ - - - - - name - Rosรฉ Pine Dawn - settings - - - settings - - background - #faf4ed - caret - #cecacd - foreground - #575279 - invisibles - #fffaf3 - lineHighlight - #f4ede8 - selection - #dfdad9 - - - - name - Comment - scope - comment - settings - - fontStyle - italic - foreground - #797593 - - - - name - String - scope - string, punctuation.definition.string - settings - - foreground - #ea9d34 - - - - name - Number - scope - constant.numeric - settings - - foreground - #ea9d34 - - - - name - Built-in constant - scope - constant.language - settings - - fontStyle - bold - foreground - #ea9d34 - - - - name - User-defined constant - scope - constant.character, constant.other - settings - - foreground - #ea9d34 - - - - name - Variable - scope - variable - settings - - fontStyle - italic - foreground - #575279 - - - - name - Keyword - scope - keyword - settings - - foreground - #286983 - - - - name - Storage - scope - storage - settings - - fontStyle - - foreground - #56949f - - - - name - Storage type - scope - storage.type - settings - - fontStyle - - foreground - #56949f - - - - name - Class name - scope - entity.name.class - settings - - fontStyle - bold - foreground - #286983 - - - - name - Inherited class - scope - entity.other.inherited-class - settings - - fontStyle - italic - foreground - #286983 - - - - name - Function name - scope - entity.name.function - settings - - fontStyle - italic - foreground - #d7827e - - - - name - Function argument - scope - variable.parameter - settings - - fontStyle - - foreground - #907aa9 - - - - name - Tag name - scope - entity.name.tag - settings - - fontStyle - bold - foreground - #286983 - - - - name - Tag attribute - scope - entity.other.attribute-name - settings - - fontStyle - - foreground - #907aa9 - - - - name - Library function - scope - support.function - settings - - fontStyle - bold - foreground - #d7827e - - - - name - Library constant - scope - support.constant - settings - - fontStyle - bold - foreground - #ea9d34 - - - - name - Library class/type - scope - support.type, support.class - settings - - fontStyle - bold - foreground - #56949f - - - - name - Library variable - scope - support.other.variable - settings - - fontStyle - bold - foreground - #b4637a - - - - name - Invalid - scope - invalid - settings - - background - #b4637a - fontStyle - - foreground - #575279 - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - background - #907aa9 - foreground - #575279 - - - - name - Punctuation, Operators - scope - punctuation, keyword.operator - settings - - foreground - #797593 - - - - colorSpaceName - sRGB - semanticClass - theme.light.rosรฉ-pine-dawn - author - arrrgi - comment - All natural pine, faux fur and a bit of soho vibes for the classy minimalist - uuid - BB4B4616-E742-41D5-BB5B-63D45FA614F - - diff --git a/fedora/.config/yazi/flavors/rose-pine-moon.yazi/LICENSE b/fedora/.config/yazi/flavors/rose-pine-moon.yazi/LICENSE deleted file mode 100644 index 78e74c8..0000000 --- a/fedora/.config/yazi/flavors/rose-pine-moon.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2025 Mintass - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/rose-pine-moon.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/rose-pine-moon.yazi/LICENSE-tmtheme deleted file mode 100644 index ef13b56..0000000 --- a/fedora/.config/yazi/flavors/rose-pine-moon.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Rosรฉ Pine - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/fedora/.config/yazi/flavors/rose-pine-moon.yazi/README.md b/fedora/.config/yazi/flavors/rose-pine-moon.yazi/README.md deleted file mode 100644 index b241c25..0000000 --- a/fedora/.config/yazi/flavors/rose-pine-moon.yazi/README.md +++ /dev/null @@ -1,36 +0,0 @@ -
- Yazi logo -
- -

- Rosรฉ Pine Moon Flavor for Yazi -

- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -```sh -ya pkg add Mintass/rose-pine-moon -``` - -## โš™๏ธ Usage - -To set it as your dark flavor, change the content of your `theme.toml` to: - -```toml -[flavor] -dark = "rose-pine-moon" -``` - -Make sure your `theme.toml` doesn't contain anything other than `[flavor]`, unless you want to override certain styles of this flavor. - -See the [Yazi flavor documentation](https://yazi-rs.github.io/docs/flavors/overview) for more details. - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/rose-pine-moon.yazi/flavor.toml b/fedora/.config/yazi/flavors/rose-pine-moon.yazi/flavor.toml deleted file mode 100644 index 905ae6f..0000000 --- a/fedora/.config/yazi/flavors/rose-pine-moon.yazi/flavor.toml +++ /dev/null @@ -1,230 +0,0 @@ -# vim:fileencoding=utf-8:foldmethod=marker - -# : Manager {{{ - -[mgr] -cwd = { fg = "#9ccfd8" } - -# Hovered -hovered = { reversed = true } -preview_hovered = { underline = true } - -# Find -find_keyword = { fg = "#f6c177", bold = true, italic = true, underline = true } -find_position = { fg = "#c4a7e7", bg = "reset", bold = true, italic = true } - -# Symlink -symlink_target = { italic = true } - -# Marker -marker_copied = { fg = "#3e8fb0", bg = "#3e8fb0" } -marker_cut = { fg = "#eb6f92", bg = "#eb6f92" } -marker_marked = { fg = "#ea9a97", bg = "#ea9a97" } -marker_selected = { fg = "#f6c177", bg = "#f6c177" } - -# Count -count_copied = { fg = "#e0def4", bg = "#3e8fb0" } -count_cut = { fg = "#e0def4", bg = "#eb6f92" } -count_selected = { fg = "#232136", bg = "#f6c177" } - -# Border -border_symbol = "โ”‚" -border_style = { fg = "#56526e" } - -# Highlighting -syntect_theme = "" - -# : }}} - - -# : Tabs {{{ - -[tabs] -active = { fg = "#e0def4", bg = "#3e8fb0", bold = true } -inactive = { fg = "#3e8fb0", bg = "#e0def4" } - -# Separator -sep_inner = { open = "๎‚ถ", close = "๎‚ด" } -sep_outer = { open = "๎‚ถ", close = "๎‚ด" } - -# : }}} - - -# : Mode {{{ - -[mode] -normal_main = { fg = "#232136", bg = "#9ccfd8", bold = true } -normal_alt = { fg = "#232136", bg = "#e0def4", bold = true } - -# Select mode -select_main = { fg = "#232136", bg = "#eb6f92", bold = true } -select_alt = { fg = "#232136", bg = "#e0def4", bold = true } - -# Unset mode -unset_main = { fg = "#232136", bg = "#eb6f92", bold = true } -unset_alt = { fg = "#232136", bg = "#e0def4", bold = true } - -# : }}} - - -# : Status bar {{{ - -[status] -overall = { bg = "#232136" } -sep_left = { open = "๎‚ถ", close = "๎‚ด" } -sep_right = { open = "๎‚ถ", close = "๎‚ด" } - -# Permissions -perm_sep = { fg = "#6e6a86" } -perm_type = { fg = "#c4a7e7" } -perm_read = { fg = "#f6c177" } -perm_write = { fg = "#eb6f92" } -perm_exec = { fg = "#9ccfd8" } - -# Progress -progress_label = { fg = "#e0def4", bold = true } -progress_normal = { fg = "#3e8fb0", bg = "#2a283e" } -progress_error = { fg = "#eb6f92", bg = "#2a283e" } - -# : }}} - - -# : Which {{{ - -[which] -cols = 3 -mask = { bg = "#2a273f" } -cand = { fg = "#9ccfd8" } -rest = { fg = "#6e6a86" } -desc = { fg = "#f6c177" } -separator = " ๎ชœ " -separator_style = { fg = "#6e6a86" } - -# : }}} - - -# : Confirmation {{{ - -[confirm] -border = { fg = "#56526e" } -title = { fg = "#eb6f92", bold = true } -body = { fg = "#e0def4" } -list = { fg = "#e0def4" } -btn_yes = { fg = "#232136", bg = "#3e8fb0", bold = true } -btn_no = { fg = "#232136", bg = "#e0def4", bold = true } -btn_labels = [ " [y]es ", " (n)o " ] - -# : }}} - - -# : Spotter {{{ - -[spot] -border = { fg = "#56526e" } -title = { fg = "#9ccfd8", bold = true } - -# Table -tbl_col = { fg = "#9ccfd8" } -tbl_cell = { fg = "#232136", bg = "#f6c177", bold = true } - -# : }}} - - -# : Notification {{{ - -[notify] -title_info = { fg = "#3e8fb0" } -title_warn = { fg = "#f6c177" } -title_error = { fg = "#eb6f92" } - - -# : }}} - - -# : Picker {{{ - -[pick] -border = { fg = "#3e8fb0" } -active = { fg = "#c4a7e7", bold = true } -inactive = { fg = "#908caa"} - -# : }}} - - -# : Input {{{ - -[input] -border = { fg = "#3e8fb0" } -title = { bold = true } -value = { fg = "#e0def4"} -selected = { reversed = true } - -# : }}} - - -# : Completion {{{ - -[cmp] -border = { fg = "#3e8fb0" } -active = { bg = "#e0def4", fg = "#232136", bold = true } -inactive = { fg = "#908caa" } - - -# : }}} - - -# : Task manager {{{ - -[tasks] -border = { fg = "#3e8fb0" } -title = { bold = true} -hovered = { fg = "#c4a7e7", bold = true, reversed = true } - -# : }}} - - -# : Help menu {{{ - -[help] -on = { fg = "#9ccfd8" } -run = { fg = "#c4a7e7" } -desc = { fg = "#f6c177"} -hovered = { reversed = true, bold = true } -footer = { fg = "#232136", bg = "#e0def4" } - -# : }}} - - -# : File-specific styles {{{ - -[filetype] -rules = [ - # Images - { mime = "image/*", fg = "#c4a7e7" }, - - # Media - { mime = "{audio,video}/*", fg = "#f6c177" }, - - # Archives - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#eb6f92" }, - - # Documents - { mime = "application/{pdf,doc,rtf}", fg = "#ea9a97" }, - - # Empty files - # { mime = "inode/empty", fg = "#eb6f92" }, - - # Special files - { name = "*", is = "orphan", fg = "#232136", bg = "#eb6f92" }, - { name = "*", is = "exec" , fg = "#9ccfd8" }, - - # Dummy files - { name = "*", is = "dummy", fg = "#232136", bg = "#eb6f92" }, - { name = "*/", is = "dummy", fg = "#232136", bg = "#eb6f92" }, - - # Fallback - { name = "*", fg = "#e0def4" }, - { name = "*/", fg = "#3e8fb0" } -] - -# : }}} \ No newline at end of file diff --git a/fedora/.config/yazi/flavors/rose-pine-moon.yazi/preview.png b/fedora/.config/yazi/flavors/rose-pine-moon.yazi/preview.png deleted file mode 100644 index 9661964..0000000 Binary files a/fedora/.config/yazi/flavors/rose-pine-moon.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/rose-pine-moon.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/rose-pine-moon.yazi/tmtheme.xml deleted file mode 100644 index 3e26d9c..0000000 --- a/fedora/.config/yazi/flavors/rose-pine-moon.yazi/tmtheme.xml +++ /dev/null @@ -1,316 +0,0 @@ - - - - - name - Rosรฉ Pine Moon - settings - - - settings - - background - #232136 - caret - #56526e - foreground - #e0def4 - invisibles - #2a273f - lineHighlight - #2a283e - selection - #6e6a86 - - - - name - Comment - scope - comment - settings - - fontStyle - italic - foreground - #908caa - - - - name - String - scope - string, punctuation.definition.string - settings - - foreground - #f6c177 - - - - name - Number - scope - constant.numeric - settings - - foreground - #f6c177 - - - - name - Built-in constant - scope - constant.language - settings - - fontStyle - bold - foreground - #f6c177 - - - - name - User-defined constant - scope - constant.character, constant.other - settings - - foreground - #f6c177 - - - - name - Variable - scope - variable - settings - - fontStyle - italic - foreground - #e0def4 - - - - name - Keyword - scope - keyword - settings - - foreground - #3e8fb0 - - - - name - Storage - scope - storage - settings - - fontStyle - - foreground - #9ccfd8 - - - - name - Storage type - scope - storage.type - settings - - fontStyle - - foreground - #9ccfd8 - - - - name - Class name - scope - entity.name.class - settings - - fontStyle - bold - foreground - #3e8fb0 - - - - name - Inherited class - scope - entity.other.inherited-class - settings - - fontStyle - italic - foreground - #3e8fb0 - - - - name - Function name - scope - entity.name.function - settings - - fontStyle - italic - foreground - #ea9a97 - - - - name - Function argument - scope - variable.parameter - settings - - fontStyle - - foreground - #c4a7e7 - - - - name - Tag name - scope - entity.name.tag - settings - - fontStyle - bold - foreground - #3e8fb0 - - - - name - Tag attribute - scope - entity.other.attribute-name - settings - - fontStyle - - foreground - #c4a7e7 - - - - name - Library function - scope - support.function - settings - - fontStyle - bold - foreground - #ea9a97 - - - - name - Library constant - scope - support.constant - settings - - fontStyle - bold - foreground - #f6c177 - - - - name - Library class/type - scope - support.type, support.class - settings - - fontStyle - bold - foreground - #9ccfd8 - - - - name - Library variable - scope - support.other.variable - settings - - fontStyle - bold - foreground - #eb6f92 - - - - name - Invalid - scope - invalid - settings - - background - #eb6f92 - fontStyle - - foreground - #e0def4 - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - background - #c4a7e7 - foreground - #e0def4 - - - - name - Punctuation, Operators - scope - punctuation, keyword.operator - settings - - foreground - #908caa - - - - colorSpaceName - sRGB - semanticClass - theme.dark.rosรฉ-pine-moon - author - arrrgi - comment - All natural pine, faux fur and a bit of soho vibes for the classy minimalist - uuid - CC28B8FB-96BA-43EB-B71F-5AA3D3EBB0BB - - diff --git a/fedora/.config/yazi/flavors/rose-pine.yazi/LICENSE b/fedora/.config/yazi/flavors/rose-pine.yazi/LICENSE deleted file mode 100644 index 78e74c8..0000000 --- a/fedora/.config/yazi/flavors/rose-pine.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2025 Mintass - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/rose-pine.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/rose-pine.yazi/LICENSE-tmtheme deleted file mode 100644 index ef13b56..0000000 --- a/fedora/.config/yazi/flavors/rose-pine.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Rosรฉ Pine - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/fedora/.config/yazi/flavors/rose-pine.yazi/README.md b/fedora/.config/yazi/flavors/rose-pine.yazi/README.md deleted file mode 100644 index 56bcae4..0000000 --- a/fedora/.config/yazi/flavors/rose-pine.yazi/README.md +++ /dev/null @@ -1,36 +0,0 @@ -
- Yazi logo -
- -

- Rosรฉ Pine Flavor for Yazi -

- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -```sh -ya pkg add Mintass/rose-pine -``` - -## โš™๏ธ Usage - -To set it as your dark flavor, change the content of your `theme.toml` to: - -```toml -[flavor] -dark = "rose-pine" -``` - -Make sure your `theme.toml` doesn't contain anything other than `[flavor]`, unless you want to override certain styles of this flavor. - -See the [Yazi flavor documentation](https://yazi-rs.github.io/docs/flavors/overview) for more details. - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/rose-pine.yazi/flavor.toml b/fedora/.config/yazi/flavors/rose-pine.yazi/flavor.toml deleted file mode 100644 index c77e447..0000000 --- a/fedora/.config/yazi/flavors/rose-pine.yazi/flavor.toml +++ /dev/null @@ -1,230 +0,0 @@ -# vim:fileencoding=utf-8:foldmethod=marker - -# : Manager {{{ - -[mgr] -cwd = { fg = "#9ccfd8" } - -# Hovered -hovered = { reversed = true } -preview_hovered = { underline = true } - -# Find -find_keyword = { fg = "#f6c177", bold = true, italic = true, underline = true } -find_position = { fg = "#c4a7e7", bg = "reset", bold = true, italic = true } - -# Symlink -symlink_target = { italic = true } - -# Marker -marker_copied = { fg = "#31748f", bg = "#31748f" } -marker_cut = { fg = "#eb6f92", bg = "#eb6f92" } -marker_marked = { fg = "#ebbcba", bg = "#ebbcba" } -marker_selected = { fg = "#f6c177", bg = "#f6c177" } - -# Count -count_copied = { fg = "#e0def4", bg = "#31748f" } -count_cut = { fg = "#e0def4", bg = "#eb6f92" } -count_selected = { fg = "#191724", bg = "#f6c177" } - -# Border -border_symbol = "โ”‚" -border_style = { fg = "#524f67" } - -# Highlighting -syntect_theme = "" - -# : }}} - - -# : Tabs {{{ - -[tabs] -active = { fg = "#e0def4", bg = "#31748f", bold = true } -inactive = { fg = "#31748f", bg = "#e0def4" } - -# Separator -sep_inner = { open = "๎‚ถ", close = "๎‚ด" } -sep_outer = { open = "๎‚ถ", close = "๎‚ด" } - -# : }}} - - -# : Mode {{{ - -[mode] -normal_main = { fg = "#191724", bg = "#9ccfd8", bold = true } -normal_alt = { fg = "#191724", bg = "#e0def4", bold = true } - -# Select mode -select_main = { fg = "#191724", bg = "#eb6f92", bold = true } -select_alt = { fg = "#191724", bg = "#e0def4", bold = true } - -# Unset mode -unset_main = { fg = "#191724", bg = "#eb6f92", bold = true } -unset_alt = { fg = "#191724", bg = "#e0def4", bold = true } - -# : }}} - - -# : Status bar {{{ - -[status] -overall = { bg = "#191724" } -sep_left = { open = "๎‚ถ", close = "๎‚ด" } -sep_right = { open = "๎‚ถ", close = "๎‚ด" } - -# Permissions -perm_sep = { fg = "#6e6a86" } -perm_type = { fg = "#c4a7e7" } -perm_read = { fg = "#f6c177" } -perm_write = { fg = "#eb6f92" } -perm_exec = { fg = "#9ccfd8" } - -# Progress -progress_label = { fg = "#e0def4", bold = true } -progress_normal = { fg = "#31748f", bg = "#21202e" } -progress_error = { fg = "#eb6f92", bg = "#21202e" } - -# : }}} - - -# : Which {{{ - -[which] -cols = 3 -mask = { bg = "#1f1d2e" } -cand = { fg = "#9ccfd8" } -rest = { fg = "#6e6a86" } -desc = { fg = "#f6c177" } -separator = " ๎ชœ " -separator_style = { fg = "#6e6a86" } - -# : }}} - - -# : Confirmation {{{ - -[confirm] -border = { fg = "#524f67" } -title = { fg = "#eb6f92", bold = true } -body = { fg = "#e0def4" } -list = { fg = "#e0def4" } -btn_yes = { fg = "#191724", bg = "#31748f", bold = true } -btn_no = { fg = "#191724", bg = "#e0def4", bold = true } -btn_labels = [ " [y]es ", " (n)o " ] - -# : }}} - - -# : Spotter {{{ - -[spot] -border = { fg = "#524f67" } -title = { fg = "#9ccfd8", bold = true } - -# Table -tbl_col = { fg = "#9ccfd8" } -tbl_cell = { fg = "#191724", bg = "#f6c177", bold = true } - -# : }}} - - -# : Notification {{{ - -[notify] -title_info = { fg = "#31748f" } -title_warn = { fg = "#f6c177" } -title_error = { fg = "#eb6f92" } - - -# : }}} - - -# : Picker {{{ - -[pick] -border = { fg = "#31748f" } -active = { fg = "#c4a7e7", bold = true } -inactive = { fg = "#908caa"} - -# : }}} - - -# : Input {{{ - -[input] -border = { fg = "#31748f" } -title = { bold = true } -value = { fg = "#e0def4"} -selected = { reversed = true } - -# : }}} - - -# : Completion {{{ - -[cmp] -border = { fg = "#31748f" } -active = { bg = "#e0def4", fg = "#191724", bold = true } -inactive = { fg = "#908caa" } - - -# : }}} - - -# : Task manager {{{ - -[tasks] -border = { fg = "#31748f" } -title = { bold = true} -hovered = { fg = "#c4a7e7", bold = true, reversed = true } - -# : }}} - - -# : Help menu {{{ - -[help] -on = { fg = "#9ccfd8" } -run = { fg = "#c4a7e7" } -desc = { fg = "#f6c177"} -hovered = { reversed = true, bold = true } -footer = { fg = "#191724", bg = "#e0def4" } - -# : }}} - - -# : File-specific styles {{{ - -[filetype] -rules = [ - # Images - { mime = "image/*", fg = "#c4a7e7" }, - - # Media - { mime = "{audio,video}/*", fg = "#f6c177" }, - - # Archives - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#eb6f92" }, - - # Documents - { mime = "application/{pdf,doc,rtf}", fg = "#ebbcba" }, - - # Empty files - # { mime = "inode/empty", fg = "#eb6f92" }, - - # Special files - { name = "*", is = "orphan", fg = "#191724", bg = "#eb6f92" }, - { name = "*", is = "exec" , fg = "#9ccfd8" }, - - # Dummy files - { name = "*", is = "dummy", fg = "#191724", bg = "#eb6f92" }, - { name = "*/", is = "dummy", fg = "#191724", bg = "#eb6f92" }, - - # Fallback - { name = "*", fg = "#e0def4" }, - { name = "*/", fg = "#31748f" } -] - -# : }}} \ No newline at end of file diff --git a/fedora/.config/yazi/flavors/rose-pine.yazi/preview.png b/fedora/.config/yazi/flavors/rose-pine.yazi/preview.png deleted file mode 100644 index 9150f54..0000000 Binary files a/fedora/.config/yazi/flavors/rose-pine.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/rose-pine.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/rose-pine.yazi/tmtheme.xml deleted file mode 100644 index 70ded3e..0000000 --- a/fedora/.config/yazi/flavors/rose-pine.yazi/tmtheme.xml +++ /dev/null @@ -1,316 +0,0 @@ - - - - - name - Rosรฉ Pine - settings - - - settings - - background - #191724 - caret - #524f67 - foreground - #e0def4 - invisibles - #1f1d2e - lineHighlight - #21202e - selection - #403d52 - - - - name - Comment - scope - comment - settings - - fontStyle - italic - foreground - #908caa - - - - name - String - scope - string, punctuation.definition.string - settings - - foreground - #f6c177 - - - - name - Number - scope - constant.numeric - settings - - foreground - #f6c177 - - - - name - Built-in constant - scope - constant.language - settings - - fontStyle - bold - foreground - #f6c177 - - - - name - User-defined constant - scope - constant.character, constant.other - settings - - foreground - #f6c177 - - - - name - Variable - scope - variable - settings - - fontStyle - italic - foreground - #e0def4 - - - - name - Keyword - scope - keyword - settings - - foreground - #31748f - - - - name - Storage - scope - storage - settings - - fontStyle - - foreground - #9ccfd8 - - - - name - Storage type - scope - storage.type - settings - - fontStyle - - foreground - #9ccfd8 - - - - name - Class name - scope - entity.name.class - settings - - fontStyle - bold - foreground - #31748f - - - - name - Inherited class - scope - entity.other.inherited-class - settings - - fontStyle - italic - foreground - #31748f - - - - name - Function name - scope - entity.name.function - settings - - fontStyle - italic - foreground - #ebbcba - - - - name - Function argument - scope - variable.parameter - settings - - fontStyle - - foreground - #c4a7e7 - - - - name - Tag name - scope - entity.name.tag - settings - - fontStyle - bold - foreground - #31748f - - - - name - Tag attribute - scope - entity.other.attribute-name - settings - - fontStyle - - foreground - #c4a7e7 - - - - name - Library function - scope - support.function - settings - - fontStyle - bold - foreground - #ebbcba - - - - name - Library constant - scope - support.constant - settings - - fontStyle - bold - foreground - #f6c177 - - - - name - Library class/type - scope - support.type, support.class - settings - - fontStyle - bold - foreground - #9ccfd8 - - - - name - Library variable - scope - support.other.variable - settings - - fontStyle - bold - foreground - #eb6f92 - - - - name - Invalid - scope - invalid - settings - - background - #eb6f92 - fontStyle - - foreground - #e0def4 - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - background - #c4a7e7 - foreground - #e0def4 - - - - name - Punctuation, Operators - scope - punctuation, keyword.operator - settings - - foreground - #908caa - - - - colorSpaceName - sRGB - semanticClass - theme.dark.rosรฉ-pine - author - arrrgi - comment - All natural pine, faux fur and a bit of soho vibes for the classy minimalist - uuid - 14991673-80EB-41A2-BEFF-03216A233730 - - diff --git a/fedora/.config/yazi/flavors/scripts/README.md b/fedora/.config/yazi/flavors/scripts/README.md deleted file mode 100644 index 17a1ffe..0000000 --- a/fedora/.config/yazi/flavors/scripts/README.md +++ /dev/null @@ -1,36 +0,0 @@ -
- Yazi logo -
- -

- ${variant_cap} Flavor for Yazi -

- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -```sh -ya pkg add yazi-rs/flavors:${variant} -``` - -## โš™๏ธ Usage - -Set the content of your `theme.toml` to enable it as your _${mode}_ flavor: - -```toml -[flavor] -${mode} = "${variant}" -``` - -Make sure your `theme.toml` doesn't contain anything other than `[flavor]`, unless you want to override certain styles of this flavor. - -See the [Yazi flavor documentation](https://yazi-rs.github.io/docs/flavors/overview) for more details. - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/scripts/generate.js b/fedora/.config/yazi/flavors/scripts/generate.js deleted file mode 100644 index 194de0f..0000000 --- a/fedora/.config/yazi/flavors/scripts/generate.js +++ /dev/null @@ -1,169 +0,0 @@ -import fs, { access, mkdir, readFile, writeFile } from "node:fs/promises" -import { join } from "node:path" -import { fileURLToPath } from "node:url" - -const __dirname = fileURLToPath(new URL(".", import.meta.url)) - -const VARIANTS = { - "Dracula": { - text: "#f8f8f2", - background: "#282a36", - - primary: "#bd93f9", - secondary: "#8be9fd", - tertiary: "#ffb86c", - accent: "#ff79c6", - - surface: "#44475a", - surface1: "#63667d", - surface2: "#83869c", - - onSurface: "#6272a4", - onSurface1: "#7282b5", - onSurface2: "#8998c9", - - red: "#ff5555", - green: "#50fa7b", - blue: "#bd93f9", - yellow: "#f1fa8c", - - _tmtheme: "https://raw.githubusercontent.com/dracula/sublime/refs/heads/master/Dracula.tmTheme", - _tmthemeLicense: "https://raw.githubusercontent.com/dracula/sublime/refs/heads/master/LICENSE", - }, - "Catppuccin Macchiato": { - text: "#cad3f5", - background: "#24273a", - - primary: "#8aadf4", - secondary: "#8bd5ca", - tertiary: "#f0c6c6", - accent: "#f5bde6", - - surface: "#363a4f", - surface1: "#494d64", - surface2: "#5b6078", - - onSurface: "#6e738d", - onSurface1: "#8087a2", - onSurface2: "#939ab7", - - red: "#ed8796", - green: "#a6da95", - blue: "#8aadf4", - yellow: "#eed49f", - - _tmtheme: "https://raw.githubusercontent.com/catppuccin/bat/refs/heads/main/themes/Catppuccin%20Macchiato.tmTheme", - _tmthemeLicense: "https://raw.githubusercontent.com/catppuccin/bat/refs/heads/main/LICENSE", - }, - "Catppuccin Mocha": { - text: "#cdd6f4", - background: "#1e1e2e", - - primary: "#89b4fa", - secondary: "#94e2d5", - tertiary: "#f2cdcd", - accent: "#f5c2e7", - - surface: "#313244", - surface1: "#45475a", - surface2: "#585b70", - - onSurface: "#6c7086", - onSurface1: "#7f849c", - onSurface2: "#9399b2", - - red: "#f38ba8", - green: "#a6e3a1", - blue: "#89b4fa", - yellow: "#f9e2af", - - _tmtheme: "https://raw.githubusercontent.com/catppuccin/bat/refs/heads/main/themes/Catppuccin%20Mocha.tmTheme", - _tmthemeLicense: "https://raw.githubusercontent.com/catppuccin/bat/refs/heads/main/LICENSE", - }, - "Catppuccin Latte": { - text: "#4c4f69", - background: "#eff1f5", - - primary: "#1e66f5", - secondary: "#179299", - tertiary: "#dd7878", - accent: "#ea76cb", - - surface: "#ccd0da", - surface1: "#bcc0cc", - surface2: "#acb0be", - - onSurface: "#9ca0b0", - onSurface1: "#8c8fa1", - onSurface2: "#7c7f93", - - red: "#d20f39", - green: "#40a02b", - blue: "#1e66f5", - yellow: "#df8e1d", - - _light: true, - _tmtheme: "https://raw.githubusercontent.com/catppuccin/bat/refs/heads/main/themes/Catppuccin%20Latte.tmTheme", - _tmthemeLicense: "https://raw.githubusercontent.com/catppuccin/bat/refs/heads/main/LICENSE", - }, - "Catppuccin Frappe": { - text: "#c6d0f5", - background: "#303446", - - primary: "#8caaee", - secondary: "#81c8be", - tertiary: "#eebebe", - accent: "#f4b8e4", - - surface: "#414559", - surface1: "#51576d", - surface2: "#626880", - - onSurface: "#737994", - onSurface1: "#838ba7", - onSurface2: "#949cbb", - - red: "#e78284", - green: "#a6d189", - blue: "#8caaee", - yellow: "#e5c890", - - _tmtheme: "https://raw.githubusercontent.com/catppuccin/bat/refs/heads/main/themes/Catppuccin%20Frappe.tmTheme", - _tmthemeLicense: "https://raw.githubusercontent.com/catppuccin/bat/refs/heads/main/LICENSE", - }, -} - -const template = await readFile(join(__dirname, "./template.toml"), "utf8") -const readme = await readFile(join(__dirname, "./README.md"), "utf8") - -for (const [name, colors] of Object.entries(VARIANTS)) { - const lowerName = name.toLowerCase().replace(" ", "-") - const wd = join(__dirname, `../${lowerName}.yazi`) - try { - await access(wd) - } catch { - await mkdir(wd) - } - - // flavor.toml - let s = template - for (const [name, color] of Object.entries(colors)) { - s = s.replaceAll(`\${${name}}`, color) - } - await writeFile(join(wd, "flavor.toml"), s.replaceAll("${variant}", lowerName)) - - // README.md - await writeFile( - join(wd, "README.md"), - readme - .replaceAll("${mode}", colors._light ? "light" : "dark") - .replaceAll("${variant}", lowerName) - .replaceAll("${variant_cap}", name), - ) - - // tmtheme.xml - await writeFile(join(wd, "tmtheme.xml"), await fetch(colors._tmtheme).then(r => r.text())) - - // LICENSE-tmtheme - await writeFile(join(wd, "LICENSE-tmtheme"), await fetch(colors._tmthemeLicense).then(r => r.text())) -} diff --git a/fedora/.config/yazi/flavors/scripts/template.toml b/fedora/.config/yazi/flavors/scripts/template.toml deleted file mode 100644 index 2eb31d2..0000000 --- a/fedora/.config/yazi/flavors/scripts/template.toml +++ /dev/null @@ -1,189 +0,0 @@ -# vim:fileencoding=utf-8:foldmethod=marker - -# : Manager {{{ - -[mgr] -cwd = { fg = "${secondary}" } - -# Hovered -hovered = { reversed = true } -preview_hovered = { underline = true } - -# Find -find_keyword = { fg = "${yellow}", bold = true, italic = true, underline = true } -find_position = { fg = "${accent}", bg = "reset", bold = true, italic = true } - -# Marker -marker_copied = { fg = "${green}", bg = "${green}" } -marker_cut = { fg = "${red}", bg = "${red}" } -marker_marked = { fg = "${secondary}", bg = "${secondary}" } -marker_selected = { fg = "${yellow}", bg = "${yellow}" } - -# Count -count_copied = { fg = "${background}", bg = "${green}" } -count_cut = { fg = "${background}", bg = "${red}" } -count_selected = { fg = "${background}", bg = "${yellow}" } - -# Border -border_symbol = "โ”‚" -border_style = { fg = "${onSurface1}" } - -# : }}} - - -# : Tabs {{{ - -[tabs] -active = { fg = "${background}", bg = "${primary}", bold = true } -inactive = { fg = "${primary}", bg = "${surface}" } - -# : }}} - - -# : Mode {{{ - -[mode] - -normal_main = { fg = "${background}", bg = "${primary}", bold = true } -normal_alt = { fg = "${primary}", bg = "${surface}" } - -# Select mode -select_main = { fg = "${background}", bg = "${secondary}", bold = true } -select_alt = { fg = "${secondary}", bg = "${surface}" } - -# Unset mode -unset_main = { fg = "${background}", bg = "${tertiary}", bold = true } -unset_alt = { fg = "${tertiary}", bg = "${surface}" } - -# : }}} - - -# : Status bar {{{ - -[status] -# Permissions -perm_sep = { fg = "${onSurface1}" } -perm_type = { fg = "${blue}" } -perm_read = { fg = "${yellow}" } -perm_write = { fg = "${red}" } -perm_exec = { fg = "${green}" } - -# Progress -progress_label = { fg = "#ffffff", bold = true } -progress_normal = { fg = "${primary}", bg = "${surface1}" } -progress_error = { fg = "${primary}", bg = "${red}" } - -# : }}} - - -# : Pick {{{ - -[pick] -border = { fg = "${primary}" } -active = { fg = "${accent}", bold = true } -inactive = {} - -# : }}} - - -# : Input {{{ - -[input] -border = { fg = "${primary}" } -title = {} -value = {} -selected = { reversed = true } - -# : }}} - - -# : Completion {{{ - -[cmp] -border = { fg = "${primary}" } - -# : }}} - - -# : Tasks {{{ - -[tasks] -border = { fg = "${primary}" } -title = {} -hovered = { fg = "${accent}", bold = true } - -# : }}} - - -# : Which {{{ - -[which] -mask = { bg = "${surface}" } -cand = { fg = "${secondary}" } -rest = { fg = "${onSurface2}" } -desc = { fg = "${accent}" } -separator = " ๎ชœ " -separator_style = { fg = "${surface2}" } - -# : }}} - - -# : Help {{{ - -[help] -on = { fg = "${secondary}" } -run = { fg = "${accent}" } -hovered = { reversed = true, bold = true } -footer = { fg = "${surface}", bg = "${text}" } - -# : }}} - - -# : Spotter {{{ - -[spot] -border = { fg = "${primary}" } -title = { fg = "${primary}" } -tbl_col = { fg = "${secondary}" } -tbl_cell = { fg = "${accent}", bg = "${surface1}" } - -# : }}} - - -# : Notification {{{ - -[notify] -title_info = { fg = "${green}" } -title_warn = { fg = "${yellow}" } -title_error = { fg = "${red}" } - -# : }}} - - -# : File-specific styles {{{ - -[filetype] - -rules = [ - # Images - { mime = "image/*", fg = "${secondary}" }, - - # Media - { mime = "{audio,video}/*", fg = "${yellow}" }, - - # Archives - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "${accent}" }, - - # Documents - { mime = "application/{pdf,doc,rtf}", fg = "${green}" }, - - # Fallback - { url = "*", fg = "${text}" }, - { url = "*/", fg = "${primary}" }, - - # TODO: remove - { name = "*", fg = "${text}" }, - { name = "*/", fg = "${primary}" } -] - -# : }}} diff --git a/fedora/.config/yazi/flavors/tokyo-night.yazi/LICENSE b/fedora/.config/yazi/flavors/tokyo-night.yazi/LICENSE deleted file mode 100644 index 9a5124e..0000000 --- a/fedora/.config/yazi/flavors/tokyo-night.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 - sxyazi - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/tokyo-night.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/tokyo-night.yazi/LICENSE-tmtheme deleted file mode 100644 index 44b4479..0000000 --- a/fedora/.config/yazi/flavors/tokyo-night.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Himanshu - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/tokyo-night.yazi/README.md b/fedora/.config/yazi/flavors/tokyo-night.yazi/README.md deleted file mode 100644 index 70eb613..0000000 --- a/fedora/.config/yazi/flavors/tokyo-night.yazi/README.md +++ /dev/null @@ -1,47 +0,0 @@ -
- Yazi logo -
- -

- Tokyo Night Flavor for Yazi -

- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -### Using package manager - -```bash -ya pkg add BennyOe/tokyo-night -``` - -### Manual install - -```bash -# Linux/macOS -git clone https://github.com/BennyOe/tokyo-night.yazi.git ~/.config/yazi/flavors/tokyo-night.yazi - -# Windows -git clone https://github.com/BennyOe/tokyo-night.yazi.git %AppData%\yazi\config\flavors\tokyo-night.yazi -``` - -## โš™๏ธ Usage - -Add the these lines to your `theme.toml` configuration file to use it: - - -```toml -[flavor] -use = "tokyo-night" -# For Yazi 0.4 and above -dark = "tokyo-night" -``` - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/tokyo-night.yazi/flavor.toml b/fedora/.config/yazi/flavors/tokyo-night.yazi/flavor.toml deleted file mode 100644 index 418ee4c..0000000 --- a/fedora/.config/yazi/flavors/tokyo-night.yazi/flavor.toml +++ /dev/null @@ -1,190 +0,0 @@ -# vim:fileencoding=utf-8:foldmethod=marker - -# : Manager {{{ - -[mgr] -cwd = { fg = "#7aa2f7" } - -# Hovered -hovered = { reversed = true } -preview_hovered = { underline = true } - -# Find -find_keyword = { fg = "#f7768e", bold = true, italic = true, underline = true } -find_position = { fg = "#bb9af7", bg = "reset", bold = true, italic = true } - -# Marker -marker_copied = { fg = "#9ece6a", bg = "#9ece6a" } -marker_cut = { fg = "#e0af68", bg = "#f7768e" } -marker_marked = { fg = "#7aa2f7", bg = "#7dcfff" } -marker_selected = { fg = "#e0af68", bg = "#e0af68" } - -# Count -count_copied = { fg = "#1a1b26", bg = "#9ece6a" } -count_cut = { fg = "#1a1b26", bg = "#e0af68" } -count_selected = { fg = "#1a1b26", bg = "#7aa2f7" } - -# Border -border_symbol = "โ”‚" -border_style = { fg = "#414868" } - -# : }}} - - -# : Tabs {{{ - -[tabs] -active = { fg = "#292e42", bg = "#7aa2f7", bold = true } -inactive = { fg = "#7aa2f7", bg = "#292e42" } - -# : }}} - - -# : Mode {{{ - -[mode] - -normal_main = { fg = "#292e42", bg = "#7aa2f7", bold = true } -normal_alt = { fg = "#7aa2f7", bg = "#292e42" } - -# Select mode -select_main = { fg = "#292e42", bg = "#9ece6a", bold = true } -select_alt = { fg = "#7aa2f7", bg = "#292e42" } - -# Unset mode -unset_main = { fg = "#292e42", bg = "#bb9af7", bold = true } -unset_alt = { fg = "#7aa2f7", bg = "#292e42" } - -# : }}} - - -# : Status bar {{{ - -[status] -overall = { fg = "#7aa2f7" } -sep_left = { open = "๎‚ถ", close = "๎‚ด" } -sep_right = { open = "๎‚ถ", close = "๎‚ด" } - - -# Progress -progress_label = { fg = "#292e42", bold = true } -progress_normal = { fg = "#7aa2f7", bg = "#292e42" } -progress_error = { fg = "#f7768e", bg = "#292e42" } - -# Permissions -perm_sep = { fg = "#7aa2f7" } -perm_type = { fg = "#9ece6a" } -perm_read = { fg = "#e0af68" } -perm_write = { fg = "#f7768e" } -perm_exec = { fg = "#bb9af7" } - - -# : }}} - -# : Pick {{{ - -[pick] -border = { fg = "#7aa2f7" } -active = { fg = "#bb9af7", bold = true } -inactive = {} - -# : }}} - - -# : Input {{{ - -[input] -border = { fg = "#7aa2f7" } -title = {} -value = {} -selected = { reversed = true } - -# : }}} - - -# : Completion {{{ - -[cmp] -border = { fg = "#7aa2f7" } - -# : }}} - - -# : Tasks {{{ - -[tasks] -border = { fg = "#7aa2f7" } -title = {} -hovered = { fg = "#bb9af7", underline = true } - -# : }}} - - -# : Which {{{ - -[which] -mask = { bg = "#414868" } -cand = { fg = "#9ece6a" } -rest = { fg = "#a9b1d6" } -desc = { fg = "#bb9af7" } -separator = " ๎ชœ " -separator_style = { fg = "#626880" } - -# : }}} - - -# : Help {{{ - -[help] -on = { fg = "#9ece6a" } -run = { fg = "#bb9af7" } -hovered = { reversed = true, bold = true } -footer = { fg = "#1a1b26", bg = "#a9b1d6" } - -# : }}} - - -# : Notify {{{ - -[notify] -title_info = { fg = "#9ece6a" } -title_warn = { fg = "#f7768e" } -title_error = { fg = "#e0af68" } - -# : }}} - - -# : File-specific styles {{{ - -[filetype] - -rules = [ - # Images - { mime = "image/*", fg = "#e0af68" }, - - # Media - { mime = "video/*", fg = "#f7768e" }, - { mime = "audio/*", fg = "#f7768e" }, - - # Archives - { mime = "application/zip", fg = "#bb9af7" }, - { mime = "application/x-tar", fg = "#bb9af7" }, - { mime = "application/x-bzip*", fg = "#bb9af7" }, - { mime = "application/x-bzip2", fg = "#bb9af7" }, - { mime = "application/x-7z-compressed", fg = "#bb9af7" }, - { mime = "application/x-rar", fg = "#bb9af7" }, - { mime = "application/x-xz", fg = "#bb9af7" }, - - # Documents - { mime = "application/doc", fg = "#9ece6a" }, - { mime = "application/epub+zip", fg = "#9ece6a" }, - { mime = "application/pdf", fg = "#9ece6a" }, - { mime = "application/rtf", fg = "#9ece6a" }, - { mime = "application/vnd.*", fg = "#9ece6a" }, - - # Fallback - { name = "*", fg = "#c6d0f5" }, - { name = "*/", fg = "#7aa2f7" } -] - -# : }}} diff --git a/fedora/.config/yazi/flavors/tokyo-night.yazi/preview.png b/fedora/.config/yazi/flavors/tokyo-night.yazi/preview.png deleted file mode 100644 index 75f2f4a..0000000 Binary files a/fedora/.config/yazi/flavors/tokyo-night.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/tokyo-night.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/tokyo-night.yazi/tmtheme.xml deleted file mode 100644 index 21d2163..0000000 --- a/fedora/.config/yazi/flavors/tokyo-night.yazi/tmtheme.xml +++ /dev/null @@ -1,1329 +0,0 @@ - - - - - author - Kristi Russell (http://github.com/enkia) - colorSpaceName - sRGB - name - Enki-Tokyo-Night - semanticClass - enki.theme.tokyo - settings - - - settings - - activeGuide - #363b54 - background - #1d1f29 - caret - #DBC08A - findHighlight - #ffa300 - findHighlightForeground - #000000 - foreground - #AFBAD4ff - guide - #4f4f5e40 - gutterForeground - #3b415caa - inactiveSelection - #282833 - invisibles - #4f4f5e - lineHighlight - #00000030 - phantomCss - <![CDATA[ html { position: relative; } ]]> - popupCss - <![CDATA[ html { color: #B376B3; background-color: #2b2d3a; padding: 10px; } a { color: #6189BB; line-height: 1.2; text-decoration: none; } .error, .deleted { color: #50B4DC; } .success, .inserted { color: #9DBA72; } .warning, .modified { color: #ffa300; } ]]> - selection - #9D599D40 - selectionBorder - #9D599D - shadow - #00000010 - stackGuide - #4f4f5e60 - tagsOptions - underline - - - - name - Italics - Comments, Storage, Keyword Flow, Vue attributes, Decorators - scope - comment, meta.var.expr storage.type, keyword.control.flow, meta.directive.vue punctuation.separator.key-value.html, meta.directive.vue entity.other.attribute-name.html, tag.decorator.js entity.name.tag.js, tag.decorator.js punctuation.definition.tag.js, storage.modifier - settings - - fontStyle - italic - - - - name - Comment - scope - comment, comment.block.documentation, punctuation.definition.comment - settings - - foreground - #444b6a - - - - name - Comment Doc - scope - comment.block.documentation variable, comment.block.documentation storage, comment.block.documentation punctuation, comment.block.documentation keyword, comment.block.documentation support, comment.block.documentation markup, comment.block.documentation markup.inline.raw.string.markdown, keyword.other.phpdoc.php - settings - - foreground - #7982a9 - - - - name - Number, Boolean, Undefined, Null - scope - variable.other.constant, punctuation.definition.constant, constant.language, constant.numeric, support.constant - settings - - foreground - #ff9e64 - - - - name - String, Symbols, Markup Heading - scope - string, constant.other.symbol, constant.other.key, markup.heading, meta.attribute-selector - settings - - fontStyle - - foreground - #9ece6a - - - - name - Colors - scope - constant.other.color, constant.other.color.rgb-value.hex punctuation.definition.constant - settings - - foreground - #9aa5ce - - - - name - Invalid - scope - invalid, invalid.illegal - settings - - foreground - #ff5370 - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - foreground - #bb9af7 - - - - name - Storage Type - scope - storage.type - settings - - foreground - #bb9af7 - - - - name - Storage - modifier, var, const, let - scope - meta.var.expr storage.type, storage.modifier - settings - - foreground - #9d7cd8 - - - - name - Interpolation - scope - punctuation.definition.template-expression, punctuation.section.embedded - settings - - foreground - #7dcfff - - - - name - Spread - scope - keyword.operator.spread, keyword.operator.rest - settings - - fontStyle - bold - foreground - #f7768e - - - - name - Operator, Misc - scope - keyword.operator, keyword.control.as, keyword.other, keyword.operator.bitwise.shift, punctuation, punctuation.definition.constant.markdown, punctuation.definition.string, punctuation.support.type.property-name, text.html.vue-html meta.tag, punctuation.definition.keyword, punctuation.terminator.rule, punctuation.definition.entity, punctuation.definition.tag, punctuation.separator.inheritance.php, punctuation.definition.tag.html, keyword.other.template, keyword.other.substitution, entity.name.operator, text.html.vue meta.tag.block.any.html, text.html.vue meta.tag.inline.any.html, text.html.vue meta.tag.other.html, text.html.twig meta.tag.inline.any.html, text.html.twig meta.tag.block.any.html, text.html.twig meta.tag.structure.any.html, text.html.twig meta.tag.any.html - settings - - foreground - #89ddff - - - - name - Import, Export, From, Default - scope - keyword.control.import, keyword.control.export, keyword.control.from, keyword.control.default, meta.import keyword.other - settings - - foreground - #7dcfff - - - - name - Keyword - scope - keyword, keyword.control, keyword.other.important - settings - - foreground - #bb9af7 - - - - name - Keyword SQL - scope - keyword.other.DML - settings - - foreground - #7dcfff - - - - name - Keyword Operator Logical, Arrow, Ternary, Comparison - scope - keyword.operator.logical, storage.type.function, keyword.operator.bitwise, keyword.operator.ternary, keyword.operator.comparison, keyword.operator.relational, keyword.operator.or.regexp - settings - - foreground - #bb9af7 - - - - name - Tag - scope - entity.name.tag, entity.name.tag support.class.component, meta.tag - settings - - foreground - #f7768e - - - - name - Tag Punctuation - scope - punctuation.definition.tag, punctuation.definition.tag.html, punctuation.definition.tag.begin.html, punctuation.definition.tag.end.html - settings - - foreground - #ba3c97 - - - - name - Blade - scope - keyword.blade, entity.name.function.blade - settings - - foreground - #7aa2f7 - - - - name - PHP - Embedded Tag - scope - punctuation.section.embedded.begin.php, punctuation.section.embedded.end.php - settings - - foreground - #0db9d7 - - - - name - Smarty - Twig tag - Blade - scope - punctuation.definition.variable.smarty, punctuation.section.embedded.begin.smarty, punctuation.section.embedded.end.smarty, meta.tag.template.value.twig, punctuation.section.tag.twig, meta.tag.expression.twig, punctuation.definition.tag.expression.twig, punctuation.definition.tag.output.twig, variable.parameter.smarty - settings - - foreground - #7DCFFF - - - - name - Smarty - Twig variable - function - scope - variable.other.property.twig, support.function.twig, meta.function-call.twig, keyword.control.twig, keyword.control.smarty, keyword.operator.other.twig, keyword.operator.comparison.twig, support.function.functions.twig, support.function.functions.twig, keyword.operator.assignment.twig, support.function.filters.twig, support.function.built-in.smarty, keyword.operator.smarty, text.blade text.html.blade custom.compiler.blade.php punctuation.section.embedded.php entity.name.tag.block.any.html, text.blade text.html.blade custom.compiler.blade.php punctuation.section.embedded.php constant.other.inline-data.html, text.blade text.html.blade custom.compiler.blade.php support.function constant.other.inline-data.html - settings - - foreground - #0db9d7 - - - - name - Globals - PHP Constants etc - scope - constant.other.php, variable.other.global.safer, variable.other.global.safer punctuation.definition.variable, variable.other.global, variable.other.global punctuation.definition.variable, constant.other - settings - - foreground - #e0af68 - - - - name - Variables - scope - variable, support.variable, string constant.other.placeholder - settings - - foreground - #c0caf5 - - - - name - Object Variable - scope - variable.other.object, support.module.node - settings - - foreground - #c0caf5 - - - - name - Object Key - scope - meta.object-literal.key, meta.group.braces.curly constant.other.object.key.js string.unquoted.label.js, string.alias.graphql, string.unquoted.graphql, string.unquoted.alias.graphql, meta.field.declaration.ts variable.object.property - settings - - foreground - #73daca - - - - name - Object Property - scope - variable.other.property, support.variable.property, support.variable.property.dom, meta.function-call variable.other.object.property, variable.language.prototype, meta.property.object, variable.other.member - settings - - foreground - #7dcfff - - - - name - Object Property - scope - variable.other.object.property - settings - - foreground - #c0caf5 - - - - name - Object Literal Member lvl 3 (Vue Prop Validation) - scope - meta.objectliteral meta.object.member meta.objectliteral meta.object.member meta.objectliteral meta.object.member meta.object-literal.key - settings - - foreground - #41a6b5 - - - - name - C-related Block Level Variables - scope - source.cpp meta.block variable.other - settings - - foreground - #f7768e - - - - name - Other Variable - scope - support.other.variable - settings - - foreground - #f7768e - - - - name - Methods - scope - meta.class-method.js entity.name.function.js, entity.name.method.js, variable.function.constructor, keyword.other.special-method, storage.type.cs - settings - - foreground - #7aa2f7 - - - - name - Function Definition - scope - entity.name.function, meta.function-call, meta.function-call entity.name.function, variable.function, meta.definition.method entity.name.function, meta.object-literal entity.name.function - settings - - foreground - #7aa2f7 - - - - name - Function Argument - scope - variable.parameter.function.language.special, variable.parameter, meta.function.parameters punctuation.definition.variable, meta.function.parameter variable - settings - - foreground - #e0af68 - - - - name - Constant, Tag Attribute - scope - keyword.other.type.php, storage.type.php, constant.character, constant.escape, keyword.other.unit - settings - - foreground - #bb9af7 - - - - name - Variable Definition - scope - meta.definition.variable variable.other.constant, meta.definition.variable variable.other.readwrite, variable.other.declaration - settings - - foreground - #bb9af7 - - - - name - Inherited Class - scope - entity.other.inherited-class - settings - - fontStyle - - foreground - #bb9af7 - - - - name - Class, Support, DOM, etc - scope - support.class, support.type, variable.other.readwrite.alias, support.orther.namespace.use.php, meta.use.php, support.other.namespace.php, support.type.sys-types, support.variable.dom, support.constant.math, support.type.object.module, support.constant.json, entity.name.namespace, meta.import.qualifier, entity.name.class - settings - - foreground - #0db9d7 - - - - name - Class Name - scope - entity.name - settings - - foreground - #c0caf5 - - - - name - Support Function - scope - support.function - settings - - foreground - #0db9d7 - - - - name - CSS Class and Support - scope - source.css support.type.property-name, source.sass support.type.property-name, source.scss support.type.property-name, source.less support.type.property-name, source.stylus support.type.property-name, source.postcss support.type.property-name, support.type.property-name.css, support.type.vendored.property-name, support.type.map.key - settings - - foreground - #7aa2f7 - - - - name - CSS Font - scope - support.constant.font-name, meta.definition.variable - settings - - foreground - #9ece6a - - - - name - CSS Class - scope - entity.other.attribute-name.class, meta.at-rule.mixin.scss entity.name.function.scss - settings - - foreground - #9ece6a - - - - name - CSS ID - scope - entity.other.attribute-name.id - settings - - foreground - #fc7b7b - - - - name - CSS Tag - scope - entity.name.tag.css, entity.name.tag.reference, entity.name.tag.scss - settings - - foreground - #0db9d7 - - - - name - CSS Tag Reference - scope - entity.name.tag.reference - settings - - foreground - #e0af68 - - - - name - CSS Property Separator - scope - meta.property-list punctuation.separator.key-value - settings - - foreground - #9abdf5 - - - - name - CSS Punctuation - scope - meta.property-list, punctuation.definition.entity.css - settings - - foreground - #e0af68 - - - - name - SCSS @ - scope - meta.at-rule.mixin keyword.control.at-rule.mixin, meta.at-rule.include entity.name.function.scss, meta.at-rule.include keyword.control.at-rule.include - settings - - foreground - #bb9af7 - - - - name - SCSS Mixins, Extends, Include Keyword - scope - keyword.control.at-rule.include punctuation.definition.keyword, keyword.control.at-rule.mixin punctuation.definition.keyword, meta.at-rule.include keyword.control.at-rule.include, keyword.control.at-rule.extend punctuation.definition.keyword, meta.at-rule.extend keyword.control.at-rule.extend, entity.other.attribute-name.placeholder.css punctuation.definition.entity.css, meta.at-rule.media keyword.control.at-rule.media, meta.at-rule.mixin keyword.control.at-rule.mixin, meta.at-rule.function keyword.control.at-rule.function, keyword.control punctuation.definition.keyword, meta.at-rule.import.scss entity.other.attribute-name.placeholder.scss punctuation.definition.entity.scss, meta.at-rule.import.scss keyword.control.at-rule.import.scss - settings - - foreground - #9d7cd8 - - - - name - SCSS Include Mixin Argument - scope - meta.property-list meta.at-rule.include - settings - - foreground - #c0caf5 - - - - name - CSS value - scope - support.constant.property-value - settings - - foreground - #ff9e64 - - - - name - Sub-methods - scope - entity.name.module.js, variable.import.parameter.js, variable.other.class.js - settings - - foreground - #c0caf5 - - - - name - Language methods - scope - variable.language - settings - - foreground - #f7768e - - - - name - Variable punctuation - scope - variable.other punctuation.definition.variable - settings - - foreground - #c0caf5 - - - - name - Keyword this with Punctuation, ES7 Bind Operator - scope - source.js constant.other.object.key.js string.unquoted.label.js, variable.language.this punctuation.definition.variable, keyword.other.this - settings - - foreground - #f7768e - - - - name - HTML Attributes - scope - entity.other.attribute-name, text.html.basic entity.other.attribute-name.html, text.html.basic entity.other.attribute-name, text.blade entity.other.attribute-name.class, text.html.smarty entity.other.attribute-name.class - settings - - foreground - #bb9af7 - - - - name - Vue Template attributes - scope - meta.directive.vue punctuation.separator.key-value.html, meta.directive.vue entity.other.attribute-name.html - settings - - foreground - #bb9af7 - - - - name - Vue Template attribute separator - scope - meta.directive.vue punctuation.separator.key-value.html - settings - - foreground - #89ddff - - - - name - CSS IDs - scope - source.sass keyword.control - settings - - foreground - #7aa2f7 - - - - name - CSS psuedo selectors - scope - entity.other.attribute-name.pseudo-class, entity.other.attribute-name.pseudo-element, entity.other.attribute-name.placeholder, meta.property-list meta.property-value - settings - - foreground - #bb9af7 - - - - name - Inserted - scope - markup.inserted - settings - - foreground - #449dab - - - - name - Deleted - scope - markup.deleted - settings - - foreground - #914c54 - - - - name - Changed - scope - markup.changed - settings - - foreground - #6183bb - - - - name - Regular Expressions - scope - string.regexp - settings - - foreground - #b4f9f8 - - - - name - Regular Expressions - Punctuation - scope - punctuation.definition.group - settings - - foreground - #f7768e - - - - name - Regular Expressions - Character Class - scope - constant.other.character-class.regexp - settings - - foreground - #bb9af7 - - - - name - Regular Expressions - Character Class Set - scope - constant.other.character-class.set.regexp, punctuation.definition.character-class.regexp - settings - - foreground - #e0af68 - - - - name - Regular Expressions - Quantifier - scope - keyword.operator.quantifier.regexp - settings - - foreground - #89ddff - - - - name - Regular Expressions - Backslash - scope - constant.character.escape.backslash - settings - - foreground - #c0caf5 - - - - name - Escape Characters - scope - constant.character.escape - settings - - foreground - #89ddff - - - - name - Decorators - scope - tag.decorator.js entity.name.tag.js, tag.decorator.js punctuation.definition.tag.js - settings - - foreground - #7aa2f7 - - - - name - CSS Units - scope - keyword.other.unit - settings - - foreground - #f7768e - - - - name - JSON Key - Level 0 - scope - source.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #7aa2f7 - - - - name - JSON Key - Level 1 - scope - source.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #0db9d7 - - - - name - JSON Key - Level 2 - scope - source.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #7dcfff - - - - name - JSON Key - Level 3 - scope - source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #bb9af7 - - - - name - JSON Key - Level 4 - scope - source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #e0af68 - - - - name - JSON Key - Level 5 - scope - source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #0db9d7 - - - - name - JSON Key - Level 6 - scope - source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #73daca - - - - name - JSON Key - Level 7 - scope - source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json - settings - - foreground - #f7768e - - - - name - JSON Key - Level 8 - scope - source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json punctuation.definition.string.end.json - settings - - foreground - #9ece6a - - - - name - JSON Key - value - scope - source.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json - settings - - foreground - #9ece6a - - - - name - Plain Punctuation - scope - punctuation.definition.list_item.markdown - settings - - foreground - #9abdf5 - - - - name - Block Punctuation - scope - meta.block, meta.brace, punctuation.definition.block, punctuation.definition.use, punctuation.definition.group.shell, punctuation.definition.class, punctuation.definition.begin.bracket, punctuation.definition.end.bracket, punctuation.definition.parameters, punctuation.definition.arguments, punctuation.definition.dictionary, punctuation.definition.array, punctuation.section - settings - - foreground - #9abdf5 - - - - name - Markdown - Plain - scope - meta.jsx.children, meta.embedded.block - settings - - foreground - #c0caf5 - - - - name - HTML text - scope - text.html - settings - - foreground - #9aa5ce - - - - name - Markdown - Markup Raw Inline - scope - text.html.markdown markup.inline.raw.markdown - settings - - foreground - #bb9af7 - - - - name - Markdown - Markup Raw Inline Punctuation - scope - text.html.markdown markup.inline.raw.markdown punctuation.definition.raw.markdown - settings - - foreground - #4E5579 - - - - name - Markdown - Heading 1 - scope - heading.1.markdown entity.name, heading.1.markdown punctuation.definition.heading.markdown - settings - - fontStyle - bold - foreground - #89ddff - - - - name - Markdown - Heading 2 - scope - heading.2.markdown entity.name, heading.2.markdown punctuation.definition.heading.markdown - settings - - fontStyle - bold - foreground - #61bdf2 - - - - name - Markdown - Heading 3 - scope - heading.3.markdown entity.name, heading.3.markdown punctuation.definition.heading.markdown - settings - - fontStyle - bold - foreground - #7aa2f7 - - - - name - Markdown - Heading 4 - scope - heading.4.markdown entity.name, heading.4.markdown punctuation.definition.heading.markdown - settings - - fontStyle - bold - foreground - #6d91de - - - - name - Markdown - Heading 5 - scope - heading.5.markdown entity.name, heading.5.markdown punctuation.definition.heading.markdown - settings - - fontStyle - bold - foreground - #9aa5ce - - - - name - Markdown - Heading 6 - scope - heading.6.markdown entity.name, heading.6.markdown punctuation.definition.heading.markdown - settings - - fontStyle - bold - foreground - #747ca1 - - - - name - Markup - Italic - scope - markup.italic, markup.italic punctuation - settings - - fontStyle - italic - foreground - #c0caf5 - - - - name - Markup - Bold - scope - markup.bold, markup.bold punctuation - settings - - fontStyle - bold - foreground - #c0caf5 - - - - name - Markup - Bold-Italic - scope - markup.bold markup.italic, markup.bold markup.italic punctuation - settings - - fontStyle - bold italic - foreground - #c0caf5 - - - - name - Markup - Underline - scope - markup.underline, markup.underline punctuation - settings - - fontStyle - underline - - - - name - Markdown - Blockquote - scope - markup.quote punctuation.definition.blockquote.markdown - settings - - foreground - #4e5579 - - - - name - Markup - Quote - scope - markup.quote - settings - - fontStyle - italic - - - - name - Markdown - Link - scope - string.other.link, markup.underline.link, constant.other.reference.link.markdown, string.other.link.description.title.markdown - settings - - foreground - #73daca - - - - name - Markdown - Fenced Code Block - scope - markup.fenced_code.block.markdown, markup.inline.raw.string.markdown, variable.language.fenced.markdown - settings - - foreground - #89ddff - - - - name - Markdown - Separator - scope - meta.separator - settings - - fontStyle - bold - foreground - #444b6a - - - - name - Markup - Table - scope - markup.table - settings - - foreground - #c0cefc - - - - name - Token - Info - scope - token.info-token - settings - - foreground - #0db9d7 - - - - name - Token - Warn - scope - token.warn-token - settings - - foreground - #ffdb69 - - - - name - Token - Error - scope - token.error-token - settings - - foreground - #db4b4b - - - - name - Token - Debug - scope - token.debug-token - settings - - foreground - #b267e6 - - - - name - Apache Tag - scope - entity.tag.apacheconf - settings - - foreground - #f7768e - - - - name - Preprocessor - scope - meta.preprocessor - settings - - foreground - #73daca - - - - name - ENV value - scope - source.env - settings - - foreground - #7aa2f7 - - - - uuid - 06f855e3-9fb7-4fb1-b790-aef06065f34e - - diff --git a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/LICENSE b/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/LICENSE deleted file mode 100644 index 5436de3..0000000 --- a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Alexander Bays - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/LICENSE-tmtheme deleted file mode 100644 index 5436de3..0000000 --- a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Alexander Bays - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/README.md b/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/README.md deleted file mode 100644 index 92826d8..0000000 --- a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/README.md +++ /dev/null @@ -1,50 +0,0 @@ -
-Yazi logo -

- VSCode Dark Modern Flavor for Yazi -

- - This Yazi flavor matches the Visual Studio Code default theme. - -
- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -### Yazi CLI - -```bash -# v25.5.28+ -ya pkg add 956MB/vscode-dark-modern - -# pre v25.5.28 (deprecated) -ya pack -a 956MB/vscode-dark-modern -``` - -### Manual - -```bash -# Linux/macOS -git clone https://github.com/956MB/vscode-dark-modern.yazi.git ~/.config/yazi/flavors/vscode-dark-modern.yazi - -# Windows -git clone https://github.com/956MB/vscode-dark-modern.yazi.git %AppData%\yazi\config\flavors\vscode-dark-modern.yazi -``` - -## โš™๏ธ Usage - -Add the these lines to your `theme.toml` configuration file to use it: - -```toml -[flavor] -dark = "vscode-dark-modern" -``` - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/flavor.toml b/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/flavor.toml deleted file mode 100644 index 648f9bb..0000000 --- a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/flavor.toml +++ /dev/null @@ -1,186 +0,0 @@ -# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config. -# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas. -"$schema" = "https://yazi-rs.github.io/schemas/theme.json" - -# vscode-dark-modern -# https://github.com/956MB/vscode.yazi/blob/main/themes/vscode-dark-modern/ -# -# A theme inspired by Visual Studio Code's Dark Modern theme. - -[colors] -background = "#1F1F1F" -foreground = "#D4D4D4" -selection = "#264F78" -cursor = "#AEAFAD" -black = "#000000" -red = "#F44747" -green = "#6A9955" -yellow = "#D7BA7D" -blue = "#569CD6" -magenta = "#C586C0" -cyan = "#4EC9B0" -white = "#D4D4D4" -bright_black = "#808080" -bright_red = "#F44747" -bright_green = "#6A9955" -bright_yellow = "#DCDCAA" -bright_blue = "#569CD6" -bright_magenta = "#C586C0" -bright_cyan = "#4EC9B0" -bright_white = "#FFFFFF" - -[manager] -cwd = { fg = "cyan" } -# Hovered -hovered = { fg = "#D4D4D4", bg = "#264F78" } -preview_hovered = { underline = true } -# Find -find_keyword = { fg = "#DCDCAA", bold = true, italic = true, underline = true } -find_position = { fg = "#C586C0", bg = "#1F1F1F", bold = true, italic = true } -# Marker -marker_copied = { fg = "#73C991", bg = "#73C991" } -marker_cut = { fg = "#F44747", bg = "#F44747" } -marker_marked = { fg = "#4EC9B0", bg = "#4EC9B0" } -marker_selected = { fg = "#D7BA7D", bg = "#D7BA7D" } -# Tab -tab_active = { fg = "#D4D4D4", bg = "#1F1F1F" } -tab_inactive = { fg = "#D4D4D4", bg = "#2D2D2D" } -tab_width = 1 -# Count -count_copied = { fg = "#1F1F1F", bg = "#73C991" } -count_cut = { fg = "#1F1F1F", bg = "#F44747" } -count_selected = { fg = "#1F1F1F", bg = "#D7BA7D" } -# Border -border_symbol = "โ”‚" -border_style = { fg = "#444444" } -# Highlighting -syntect_theme = "./tmtheme.xml" -# Cursor -cursor_symbol = "โ–ˆ" -cursor = { fg = "#1F1F1F", bg = "#AEAFAD" } -# Executable -exe_symbol = "" -exe = { fg = "#4EC9B0", bg = "#1F1F1F" } -# Regular -file_symbol = "" -file = { } -# Directory -folder_symbol = "" -folder = { fg = "#569CD6", bg = "#1F1F1F" } -# Hidden -hidden_symbol = "" -hidden = { fg = "#808080" } -# Link -link_symbol = "" -link = { fg = "#4EC9B0", bg = "#1F1F1F" } -# Link (broken) -broken_symbol = "" -broken = { fg = "#F44747", bg = "#3A1212" } -# Selected -selected = { fg = "#FFFFFF", bg = "#264F78" } - -[status] -separator_open = "" -separator_close = "" -separator_style = { fg = "#444444", bg = "#444444" } -# Mode -mode_normal = { fg = "#1F1F1F", bg = "#569CD6", bold = true } -mode_select = { fg = "#1F1F1F", bg = "#FFAF00", bold = true } -mode_unset = { fg = "#1F1F1F", bg = "#F44747", bold = true } -# Progress -progress_label = { bold = true } -progress_normal = { fg = "#569CD6", bg = "#1F1F1F" } -progress_error = { fg = "#F44747", bg = "#1F1F1F" } -# Permissions -permissions_t = { fg = "#6A9955" } -permissions_r = { fg = "#D7BA7D" } -permissions_w = { fg = "#F44747" } -permissions_x = { fg = "#4EC9B0" } -permissions_s = { fg = "#808080" } - -[select] -border = { fg = "#569CD6" } -active = { fg = "#C586C0", bold = true } -inactive = {} - -[input] -border = { fg = "#569CD6" } -title = {} -value = {} -selected = { reversed = true } - -[completion] -border = { fg = "#569CD6" } -active = { bg = "#264F78" } -inactive = {} -# Icons -icon_file = "" -icon_folder = "" -icon_command = "" - -[tasks] -border = { fg = "#569CD6" } -title = {} -hovered = { underline = true } - -[which] -mask = { bg = "#1F1F1F" } -cand = { fg = "#4EC9B0" } -rest = { fg = "#808080" } -desc = { fg = "#C586C0" } -separator = " " -separator_style = { fg = "#808080" } - -[help] -on = { fg = "#4EC9B0" } -run = { fg = "#C586C0" } -desc = { fg = "#D4D4D4" } -hovered = { bg = "#264F78", bold = true } -footer = { fg = "#D4D4D4", bg = "#252526" } - -[filetype] -rules = [ - # Images - { mime = "image/*", fg = "#D7BA7D" }, - # Videos - { mime = "video/*", fg = "#C586C0" }, - # Audio - { mime = "audio/*", fg = "#C586C0" }, - # Archives - { mime = "application/zip", fg = "#F44747" }, - { mime = "application/gzip", fg = "#F44747" }, - { mime = "application/x-tar", fg = "#F44747" }, - { mime = "application/x-bzip", fg = "#F44747" }, - { mime = "application/x-bzip2", fg = "#F44747" }, - { mime = "application/x-7z-compressed", fg = "#F44747" }, - { mime = "application/x-rar", fg = "#F44747" }, - # Documents - { mime = "application/pdf", fg = "#4EC9B0" }, - { mime = "application/msword", fg = "#4EC9B0" }, - { mime = "application/vnd.openxmlformats-officedocument.*", fg = "#4EC9B0" }, - # Fallback - { name = "*", fg = "#D4D4D4" }, - { name = "*/", fg = "#569CD6" }, - # Executable - { name = "*", category = "executable", fg = "#4EC9B0", bg = "#1F1F1F" }, - # Directories - { name = "*/", fg = "#569CD6", bg = "#1F1F1F" }, - # Hidden files - { name = ".*", fg = "#808080" }, - # Symlinks - { name = "*", category = "link", fg = "#4EC9B0", bg = "#1F1F1F" }, - # Broken symlinks - { name = "*", category = "broken", fg = "#F44747", bg = "#3A1212" }, -] - -[icon] -rules = [ - { name = "Desktop", text = "" }, - { name = "Documents", text = "" }, - { name = "Downloads", text = "" }, - { name = "Pictures", text = "" }, - { name = "Music", text = "" }, - { name = "Videos", text = "" }, - { name = ".git", text = "" }, - { name = ".config", text = "" }, -] diff --git a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/1.png b/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/1.png deleted file mode 100644 index 045985b..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/1.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/2.png b/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/2.png deleted file mode 100644 index befbed9..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/2.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/3.png b/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/3.png deleted file mode 100644 index a645c27..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/3.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/4.png b/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/4.png deleted file mode 100644 index 490dcec..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/4.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/preview.png b/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/preview.png deleted file mode 100644 index 2cc6a33..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/img/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/preview.png b/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/preview.png deleted file mode 100644 index 2cc6a33..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/tmtheme.xml deleted file mode 100644 index de79514..0000000 --- a/fedora/.config/yazi/flavors/vscode-dark-modern.yazi/tmtheme.xml +++ /dev/null @@ -1,250 +0,0 @@ - - - - - name - VSCode Dark Modern - settings - - - settings - - background - #1F1F1F - foreground - #D4D4D4 - caret - #AEAFAD - invisibles - #6E7681 - lineHighlight - #222222 - selection - #264F78 - - - - name - Comment - scope - comment - settings - - foreground - #6A9955 - - - - name - String - scope - string - settings - - foreground - #CE9178 - - - - name - Number - scope - constant.numeric - settings - - foreground - #B5CEA8 - - - - name - Built-in constant - scope - constant.language - settings - - foreground - #569CD6 - - - - name - User-defined constant - scope - constant.character, constant.other - settings - - foreground - #4FC1FF - - - - name - Variable - scope - variable - settings - - foreground - #9CDCFE - - - - name - Keyword - scope - keyword - settings - - foreground - #C586C0 - - - - name - Storage - scope - storage - settings - - foreground - #569CD6 - - - - name - Storage type - scope - storage.type - settings - - foreground - #569CD6 - - - - name - Class name - scope - entity.name.class - settings - - foreground - #4EC9B0 - - - - name - Inherited class - scope - entity.other.inherited-class - settings - - foreground - #4EC9B0 - - - - name - Function name - scope - entity.name.function - settings - - foreground - #DCDCAA - - - - name - Function argument - scope - variable.parameter - settings - - foreground - #9CDCFE - - - - name - Tag name - scope - entity.name.tag - settings - - foreground - #569CD6 - - - - name - Tag attribute - scope - entity.other.attribute-name - settings - - foreground - #9CDCFE - - - - name - Library function - scope - support.function - settings - - foreground - #DCDCAA - - - - name - Library constant - scope - support.constant - settings - - foreground - #4FC1FF - - - - name - Library class/type - scope - support.type, support.class - settings - - foreground - #4EC9B0 - - - - name - Invalid - scope - invalid - settings - - foreground - #F44747 - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - foreground - #F44747 - - - - uuid - 231D4441-F280-4D49-A647-E1FD7E84D1D8 - - diff --git a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/LICENSE b/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/LICENSE deleted file mode 100644 index 5436de3..0000000 --- a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Alexander Bays - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/LICENSE-tmtheme deleted file mode 100644 index 5436de3..0000000 --- a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Alexander Bays - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/README.md b/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/README.md deleted file mode 100644 index fc5f857..0000000 --- a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/README.md +++ /dev/null @@ -1,50 +0,0 @@ -
-Yazi logo -

- VSCode Dark Plus Flavor for Yazi -

- - This Yazi flavor matches the Visual Studio Code default theme. - -
- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -### Yazi CLI - -```bash -# v25.5.28+ -ya pkg add 956MB/vscode-dark-plus - -# pre v25.5.28 (deprecated) -ya pack -a 956MB/vscode-dark-plus -``` - -### Manual - -```bash -# Linux/macOS -git clone https://github.com/956MB/vscode-dark-plus.yazi.git ~/.config/yazi/flavors/vscode-dark-plus.yazi - -# Windows -git clone https://github.com/956MB/vscode-dark-plus.yazi.git %AppData%\yazi\config\flavors\vscode-dark-plus.yazi -``` - -## โš™๏ธ Usage - -Add the these lines to your `theme.toml` configuration file to use it: - -```toml -[flavor] -dark = "vscode-dark-plus" -``` - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/flavor.toml b/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/flavor.toml deleted file mode 100644 index d30419b..0000000 --- a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/flavor.toml +++ /dev/null @@ -1,186 +0,0 @@ -# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config. -# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas. -"$schema" = "https://yazi-rs.github.io/schemas/theme.json" - -# vscode-dark-plus (Dark+) -# https://github.com/956MB/vscode.yazi/blob/main/themes/vscode-dark-plus/ -# -# A theme inspired by Visual Studio Code's Dark+ Visual Studio theme. - -[colors] -background = "#1E1E1E" -foreground = "#D4D4D4" -selection = "#3A3D41" -cursor = "#D4D4D4" -black = "#000000" -red = "#CD3131" -green = "#0DBC79" -yellow = "#E5E510" -blue = "#2472C8" -magenta = "#BC3FBC" -cyan = "#11A8CD" -white = "#E5E5E5" -bright_black = "#666666" -bright_red = "#F14C4C" -bright_green = "#23D18B" -bright_yellow = "#F5F543" -bright_blue = "#3B8EEA" -bright_magenta = "#D670D6" -bright_cyan = "#29B8DB" -bright_white = "#E5E5E5" - -[manager] -cwd = { fg = "cyan" } -# Hovered -hovered = { fg = "#D4D4D4", bg = "#3A3D41" } -preview_hovered = { underline = true } -# Find -find_keyword = { fg = "#569CD6", bold = true, italic = true, underline = true } -find_position = { fg = "#D4D4D4", bg = "#3A3D41", bold = true } -# Marker -marker_copied = { fg = "#73C991", bg = "#73C991" } -marker_cut = { fg = "#F14C4C", bg = "#F14C4C" } -marker_marked = { fg = "#569CD6", bg = "#569CD6" } -marker_selected = { fg = "#264F78", bg = "#264F78" } -# Tab -tab_active = { fg = "#D4D4D4", bg = "#1E1E1E" } -tab_inactive = { fg = "#D4D4D4", bg = "#2D2D2D" } -tab_width = 1 -# Count -count_copied = { fg = "#1E1E1E", bg = "#73C991" } -count_cut = { fg = "#1E1E1E", bg = "#F14C4C" } -count_selected = { fg = "#1E1E1E", bg = "#264F78" } -# Border -border_symbol = "โ”‚" -border_style = { fg = "#404040" } -# Highlighting -syntect_theme = "./tmtheme.xml" -# Cursor -cursor_symbol = "โ–ˆ" -cursor = { fg = "#1E1E1E", bg = "#D4D4D4" } -# Executable -exe_symbol = "" -exe = { fg = "#0DBC79", bg = "#1E1E1E" } -# Regular -file_symbol = "" -file = { } -# Directory -folder_symbol = "" -folder = { fg = "#2472C8", bg = "#1E1E1E" } -# Hidden -hidden_symbol = "" -hidden = { fg = "#666666" } -# Link -link_symbol = "" -link = { fg = "#0DBC79", bg = "#1E1E1E" } -# Link (broken) -broken_symbol = "" -broken = { fg = "#CD3131", bg = "#3A1212" } -# Selected -selected = { fg = "#FFFFFF", bg = "#3A3D41" } - -[status] -separator_open = "" -separator_close = "" -separator_style = { fg = "#404040", bg = "#404040" } -# Mode -mode_normal = { fg = "#1E1E1E", bg = "#569CD6", bold = true } -mode_select = { fg = "#1E1E1E", bg = "#FFAF00", bold = true } -mode_unset = { fg = "#1E1E1E", bg = "#F44747", bold = true } -# Progress -progress_label = { bold = true } -progress_normal = { fg = "#569CD6", bg = "#1E1E1E" } -progress_error = { fg = "#F44747", bg = "#1E1E1E" } -# Permissions -permissions_t = { fg = "#6A9955" } -permissions_r = { fg = "#CE9178" } -permissions_w = { fg = "#F44747" } -permissions_x = { fg = "#569CD6" } -permissions_s = { fg = "#808080" } - -[select] -border = { fg = "#569CD6" } -active = { fg = "#CE9178", bold = true } -inactive = {} - -[input] -border = { fg = "#569CD6" } -title = {} -value = {} -selected = { reversed = true } - -[completion] -border = { fg = "#569CD6" } -active = { bg = "#094771" } -inactive = {} -# Icons -icon_file = "" -icon_folder = "" -icon_command = "" - -[tasks] -border = { fg = "#569CD6" } -title = {} -hovered = { underline = true } - -[which] -mask = { bg = "#1E1E1E" } -cand = { fg = "#569CD6" } -rest = { fg = "#808080" } -desc = { fg = "#CE9178" } -separator = " " -separator_style = { fg = "#808080" } - -[help] -on = { fg = "#569CD6" } -run = { fg = "#CE9178" } -desc = { fg = "#D4D4D4" } -hovered = { bg = "#3A3D41", bold = true } -footer = { fg = "#D4D4D4", bg = "#252526" } - -[filetype] -rules = [ - # Images - { mime = "image/*", fg = "#CE9178" }, - # Videos - { mime = "video/*", fg = "#CE9178" }, - # Audio - { mime = "audio/*", fg = "#CE9178" }, - # Archives - { mime = "application/zip", fg = "#F44747" }, - { mime = "application/gzip", fg = "#F44747" }, - { mime = "application/x-tar", fg = "#F44747" }, - { mime = "application/x-bzip", fg = "#F44747" }, - { mime = "application/x-bzip2", fg = "#F44747" }, - { mime = "application/x-7z-compressed", fg = "#F44747" }, - { mime = "application/x-rar", fg = "#F44747" }, - # Documents - { mime = "application/pdf", fg = "#569CD6" }, - { mime = "application/msword", fg = "#569CD6" }, - { mime = "application/vnd.openxmlformats-officedocument.*", fg = "#569CD6" }, - # Fallback - { name = "*", fg = "#D4D4D4" }, - { name = "*/", fg = "#569CD6" }, - # Executable - { name = "*", category = "executable", fg = "#0DBC79", bg = "#1E1E1E" }, - # Directories - { name = "*/", fg = "#2472C8", bg = "#1E1E1E" }, - # Hidden files - { name = ".*", fg = "#666666" }, - # Symlinks - { name = "*", category = "link", fg = "#0DBC79", bg = "#1E1E1E" }, - # Broken symlinks - { name = "*", category = "broken", fg = "#CD3131", bg = "#3A1212" }, -] - -[icon] -rules = [ - { name = "Desktop", text = "" }, - { name = "Documents", text = "" }, - { name = "Downloads", text = "" }, - { name = "Pictures", text = "" }, - { name = "Music", text = "" }, - { name = "Videos", text = "" }, - { name = ".git", text = "" }, - { name = ".config", text = "" }, -] diff --git a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/1.png b/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/1.png deleted file mode 100644 index c01a73d..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/1.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/2.png b/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/2.png deleted file mode 100644 index ba6c83f..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/2.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/3.png b/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/3.png deleted file mode 100644 index 1eda310..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/3.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/4.png b/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/4.png deleted file mode 100644 index 2a49b37..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/4.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/preview.png b/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/preview.png deleted file mode 100644 index 305c43e..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/img/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/preview.png b/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/preview.png deleted file mode 100644 index 305c43e..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/tmtheme.xml deleted file mode 100644 index 7728843..0000000 --- a/fedora/.config/yazi/flavors/vscode-dark-plus.yazi/tmtheme.xml +++ /dev/null @@ -1,250 +0,0 @@ - - - - - name - VSCode Dark (Visual Studio) - settings - - - settings - - background - #1F1F1F - foreground - #D4D4D4 - caret - #AEAFAD - invisibles - #6E7681 - lineHighlight - #222222 - selection - #264F78 - - - - name - Comment - scope - comment - settings - - foreground - #6A9955 - - - - name - String - scope - string - settings - - foreground - #CE9178 - - - - name - Number - scope - constant.numeric - settings - - foreground - #B5CEA8 - - - - name - Built-in constant - scope - constant.language - settings - - foreground - #569CD6 - - - - name - User-defined constant - scope - constant.character, constant.other - settings - - foreground - #4FC1FF - - - - name - Variable - scope - variable - settings - - foreground - #9CDCFE - - - - name - Keyword - scope - keyword - settings - - foreground - #C586C0 - - - - name - Storage - scope - storage - settings - - foreground - #569CD6 - - - - name - Storage type - scope - storage.type - settings - - foreground - #569CD6 - - - - name - Class name - scope - entity.name.class - settings - - foreground - #4EC9B0 - - - - name - Inherited class - scope - entity.other.inherited-class - settings - - foreground - #4EC9B0 - - - - name - Function name - scope - entity.name.function - settings - - foreground - #DCDCAA - - - - name - Function argument - scope - variable.parameter - settings - - foreground - #9CDCFE - - - - name - Tag name - scope - entity.name.tag - settings - - foreground - #569CD6 - - - - name - Tag attribute - scope - entity.other.attribute-name - settings - - foreground - #9CDCFE - - - - name - Library function - scope - support.function - settings - - foreground - #DCDCAA - - - - name - Library constant - scope - support.constant - settings - - foreground - #4FC1FF - - - - name - Library class/type - scope - support.type, support.class - settings - - foreground - #4EC9B0 - - - - name - Invalid - scope - invalid - settings - - foreground - #F44747 - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - foreground - #F44747 - - - - uuid - 231D4441-F280-4D49-A647-E1FD7E84D1D8 - - diff --git a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/LICENSE b/fedora/.config/yazi/flavors/vscode-light-modern.yazi/LICENSE deleted file mode 100644 index 5436de3..0000000 --- a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Alexander Bays - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/vscode-light-modern.yazi/LICENSE-tmtheme deleted file mode 100644 index 5436de3..0000000 --- a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Alexander Bays - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/README.md b/fedora/.config/yazi/flavors/vscode-light-modern.yazi/README.md deleted file mode 100644 index 067aa25..0000000 --- a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/README.md +++ /dev/null @@ -1,50 +0,0 @@ -
-Yazi logo -

- VSCode Light Modern Flavor for Yazi -

- - This Yazi flavor matches the Visual Studio Code default theme. - -
- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -### Yazi CLI - -```bash -# v25.5.28+ -ya pkg add 956MB/vscode-light-modern - -# pre v25.5.28 (deprecated) -ya pack -a 956MB/vscode-light-modern -``` - -### Manual - -```bash -# Linux/macOS -git clone https://github.com/956MB/vscode-light-modern.yazi.git ~/.config/yazi/flavors/vscode-light-modern.yazi - -# Windows -git clone https://github.com/956MB/vscode-light-modern.yazi.git %AppData%\yazi\config\flavors\vscode-light-modern.yazi -``` - -## โš™๏ธ Usage - -Add the these lines to your `theme.toml` configuration file to use it: - -```toml -[flavor] -light = "vscode-light-modern" -``` - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/flavor.toml b/fedora/.config/yazi/flavors/vscode-light-modern.yazi/flavor.toml deleted file mode 100644 index 21c8aa0..0000000 --- a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/flavor.toml +++ /dev/null @@ -1,186 +0,0 @@ -# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config. -# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas. -"$schema" = "https://yazi-rs.github.io/schemas/theme.json" - -# vscode-light-modern -# https://github.com/956MB/vscode.yazi/blob/main/themes/vscode-light-modern/ -# -# A theme inspired by Visual Studio Code's Light Modern theme. - -[colors] -background = "#FFFFFF" -foreground = "#3B3B3B" -selection = "#ADD6FF" -cursor = "#005FB8" -black = "#000000" -red = "#F85149" -green = "#2EA043" -yellow = "#D7BA7D" -blue = "#005FB8" -magenta = "#AF00DB" -cyan = "#0598BC" -white = "#FFFFFF" -bright_black = "#6E7681" -bright_red = "#F85149" -bright_green = "#2EA043" -bright_yellow = "#D7BA7D" -bright_blue = "#005FB8" -bright_magenta = "#AF00DB" -bright_cyan = "#0598BC" -bright_white = "#FFFFFF" - -[manager] -cwd = { fg = "cyan" } -# Hovered -hovered = { fg = "#000000", bg = "#ADD6FF" } -preview_hovered = { underline = true } -# Find -find_keyword = { fg = "#795E26", bold = true, italic = true, underline = true } -find_position = { fg = "#AF00DB", bg = "#FFFFFF", bold = true, italic = true } -# Marker -marker_copied = { fg = "#2EA043", bg = "#2EA043" } -marker_cut = { fg = "#F85149", bg = "#F85149" } -marker_marked = { fg = "#0598BC", bg = "#0598BC" } -marker_selected = { fg = "#D7BA7D", bg = "#D7BA7D" } -# Tab -tab_active = { fg = "#3B3B3B", bg = "#FFFFFF" } -tab_inactive = { fg = "#3B3B3B", bg = "#F8F8F8" } -tab_width = 1 -# Count -count_copied = { fg = "#FFFFFF", bg = "#2EA043" } -count_cut = { fg = "#FFFFFF", bg = "#F85149" } -count_selected = { fg = "#FFFFFF", bg = "#D7BA7D" } -# Border -border_symbol = "โ”‚" -border_style = { fg = "#E5E5E5" } -# Highlighting -syntect_theme = "./tmtheme.xml" -# Cursor -cursor_symbol = "โ–ˆ" -cursor = { fg = "#FFFFFF", bg = "#005FB8" } -# Executable -exe_symbol = "" -exe = { fg = "#2EA043", bg = "#FFFFFF" } -# Regular -file_symbol = "" -file = { } -# Directory -folder_symbol = "" -folder = { fg = "#005FB8", bg = "#FFFFFF" } -# Hidden -hidden_symbol = "" -hidden = { fg = "#6E7681" } -# Link -link_symbol = "" -link = { fg = "#0598BC", bg = "#FFFFFF" } -# Link (broken) -broken_symbol = "" -broken = { fg = "#F85149", bg = "#FFF0F0" } -# Selected -selected = { fg = "#000000", bg = "#ADD6FF" } - -[status] -separator_open = "" -separator_close = "" -separator_style = { fg = "#E5E5E5", bg = "#E5E5E5" } -# Mode -mode_normal = { fg = "#FFFFFF", bg = "#005FB8", bold = true } -mode_select = { fg = "#FFFFFF", bg = "#FFAF00", bold = true } -mode_unset = { fg = "#FFFFFF", bg = "#F85149", bold = true } -# Progress -progress_label = { bold = true } -progress_normal = { fg = "#005FB8", bg = "#FFFFFF" } -progress_error = { fg = "#F85149", bg = "#FFFFFF" } -# Permissions -permissions_t = { fg = "#2EA043" } -permissions_r = { fg = "#D7BA7D" } -permissions_w = { fg = "#F85149" } -permissions_x = { fg = "#0598BC" } -permissions_s = { fg = "#6E7681" } - -[select] -border = { fg = "#005FB8" } -active = { fg = "#AF00DB", bold = true } -inactive = {} - -[input] -border = { fg = "#005FB8" } -title = {} -value = {} -selected = { reversed = true } - -[completion] -border = { fg = "#005FB8" } -active = { bg = "#ADD6FF" } -inactive = {} -# Icons -icon_file = "" -icon_folder = "" -icon_command = "" - -[tasks] -border = { fg = "#005FB8" } -title = {} -hovered = { underline = true } - -[which] -mask = { bg = "#FFFFFF" } -cand = { fg = "#0598BC" } -rest = { fg = "#6E7681" } -desc = { fg = "#AF00DB" } -separator = " " -separator_style = { fg = "#6E7681" } - -[help] -on = { fg = "#0598BC" } -run = { fg = "#AF00DB" } -desc = { fg = "#3B3B3B" } -hovered = { bg = "#ADD6FF", bold = true } -footer = { fg = "#3B3B3B", bg = "#F8F8F8" } - -[filetype] -rules = [ - # Images - { mime = "image/*", fg = "#D7BA7D" }, - # Videos - { mime = "video/*", fg = "#AF00DB" }, - # Audio - { mime = "audio/*", fg = "#AF00DB" }, - # Archives - { mime = "application/zip", fg = "#F85149" }, - { mime = "application/gzip", fg = "#F85149" }, - { mime = "application/x-tar", fg = "#F85149" }, - { mime = "application/x-bzip", fg = "#F85149" }, - { mime = "application/x-bzip2", fg = "#F85149" }, - { mime = "application/x-7z-compressed", fg = "#F85149" }, - { mime = "application/x-rar", fg = "#F85149" }, - # Documents - { mime = "application/pdf", fg = "#0598BC" }, - { mime = "application/msword", fg = "#0598BC" }, - { mime = "application/vnd.openxmlformats-officedocument.*", fg = "#0598BC" }, - # Fallback - { name = "*", fg = "#3B3B3B" }, - { name = "*/", fg = "#005FB8" }, - # Executable - { name = "*", category = "executable", fg = "#2EA043", bg = "#FFFFFF" }, - # Directories - { name = "*/", fg = "#005FB8", bg = "#FFFFFF" }, - # Hidden files - { name = ".*", fg = "#6E7681" }, - # Symlinks - { name = "*", category = "link", fg = "#0598BC", bg = "#FFFFFF" }, - # Broken symlinks - { name = "*", category = "broken", fg = "#F85149", bg = "#FFF0F0" }, -] - -[icon] -rules = [ - { name = "Desktop", text = "" }, - { name = "Documents", text = "" }, - { name = "Downloads", text = "" }, - { name = "Pictures", text = "" }, - { name = "Music", text = "" }, - { name = "Videos", text = "" }, - { name = ".git", text = "" }, - { name = ".config", text = "" }, -] diff --git a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/1.png b/fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/1.png deleted file mode 100644 index 6343c68..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/1.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/2.png b/fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/2.png deleted file mode 100644 index 9e726b9..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/2.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/3.png b/fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/3.png deleted file mode 100644 index 5124fd4..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/3.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/4.png b/fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/4.png deleted file mode 100644 index 6dc5d51..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/4.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/preview.png b/fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/preview.png deleted file mode 100644 index 13b9122..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/img/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/preview.png b/fedora/.config/yazi/flavors/vscode-light-modern.yazi/preview.png deleted file mode 100644 index 13b9122..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/vscode-light-modern.yazi/tmtheme.xml deleted file mode 100644 index 5aa76f8..0000000 --- a/fedora/.config/yazi/flavors/vscode-light-modern.yazi/tmtheme.xml +++ /dev/null @@ -1,250 +0,0 @@ - - - - - name - VSCode Light Modern - settings - - - settings - - background - #FFFFFF - foreground - #000000 - caret - #000000 - invisibles - #D3D3D3 - lineHighlight - #E5EBF1 - selection - #ADD6FF - - - - name - Comment - scope - comment - settings - - foreground - #008000 - - - - name - String - scope - string - settings - - foreground - #A31515 - - - - name - Number - scope - constant.numeric - settings - - foreground - #098658 - - - - name - Built-in constant - scope - constant.language - settings - - foreground - #0000FF - - - - name - User-defined constant - scope - constant.character, constant.other - settings - - foreground - #0000FF - - - - name - Variable - scope - variable - settings - - foreground - #795E26 - - - - name - Keyword - scope - keyword - settings - - foreground - #AF00DB - - - - name - Storage - scope - storage - settings - - foreground - #0000FF - - - - name - Storage type - scope - storage.type - settings - - foreground - #0000FF - - - - name - Class name - scope - entity.name.class - settings - - foreground - #267F99 - - - - name - Inherited class - scope - entity.other.inherited-class - settings - - foreground - #267F99 - - - - name - Function name - scope - entity.name.function - settings - - foreground - #795E26 - - - - name - Function argument - scope - variable.parameter - settings - - foreground - #001080 - - - - name - Tag name - scope - entity.name.tag - settings - - foreground - #800000 - - - - name - Tag attribute - scope - entity.other.attribute-name - settings - - foreground - #E50000 - - - - name - Library function - scope - support.function - settings - - foreground - #795E26 - - - - name - Library constant - scope - support.constant - settings - - foreground - #0000FF - - - - name - Library class/type - scope - support.type, support.class - settings - - foreground - #267F99 - - - - name - Invalid - scope - invalid - settings - - foreground - #CD3131 - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - foreground - #CD3131 - - - - uuid - 231D4441-F280-4D49-A647-E1FD7E84D1D8 - - diff --git a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/LICENSE b/fedora/.config/yazi/flavors/vscode-light-plus.yazi/LICENSE deleted file mode 100644 index 5436de3..0000000 --- a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Alexander Bays - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/LICENSE-tmtheme b/fedora/.config/yazi/flavors/vscode-light-plus.yazi/LICENSE-tmtheme deleted file mode 100644 index 5436de3..0000000 --- a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Alexander Bays - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/README.md b/fedora/.config/yazi/flavors/vscode-light-plus.yazi/README.md deleted file mode 100644 index e491da6..0000000 --- a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/README.md +++ /dev/null @@ -1,50 +0,0 @@ -
-Yazi logo -

- VSCode Light Plus Flavor for Yazi -

- - This Yazi flavor matches the Visual Studio Code default theme. - -
- -## ๐Ÿ‘€ Preview - - - -## ๐ŸŽจ Installation - -### Yazi CLI - -```bash -# v25.5.28+ -ya pkg add 956MB/vscode-light-plus - -# pre v25.5.28 (deprecated) -ya pack -a 956MB/vscode-light-plus -``` - -### Manual - -```bash -# Linux/macOS -git clone https://github.com/956MB/vscode-light-plus.yazi.git ~/.config/yazi/flavors/vscode-light-plus.yazi - -# Windows -git clone https://github.com/956MB/vscode-light-plus.yazi.git %AppData%\yazi\config\flavors\vscode-light-plus.yazi -``` - -## โš™๏ธ Usage - -Add the these lines to your `theme.toml` configuration file to use it: - -```toml -[flavor] -light = "vscode-light-plus" -``` - -## ๐Ÿ“œ License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/flavor.toml b/fedora/.config/yazi/flavors/vscode-light-plus.yazi/flavor.toml deleted file mode 100644 index 133c35d..0000000 --- a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/flavor.toml +++ /dev/null @@ -1,186 +0,0 @@ -# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config. -# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas. -"$schema" = "https://yazi-rs.github.io/schemas/theme.json" - -# vscode-light-plus (Light+) -# https://github.com/956MB/vscode.yazi/blob/main/themes/vscode-light-plus/ -# -# A theme inspired by Visual Studio Code's Light+ theme. - -[colors] -background = "#FFFFFF" -foreground = "#000000" -selection = "#ADD6FF" -cursor = "#000000" -black = "#000000" -red = "#CD3131" -green = "#008000" -yellow = "#949800" -blue = "#0000FF" -magenta = "#AF00DB" -cyan = "#0598BC" -white = "#FFFFFF" -bright_black = "#767676" -bright_red = "#CD3131" -bright_green = "#008000" -bright_yellow = "#949800" -bright_blue = "#0000FF" -bright_magenta = "#AF00DB" -bright_cyan = "#0598BC" -bright_white = "#FFFFFF" - -[manager] -cwd = { fg = "cyan" } -# Hovered -hovered = { fg = "#000000", bg = "#ADD6FF" } -preview_hovered = { underline = true } -# Find -find_keyword = { fg = "#795E26", bold = true, italic = true, underline = true } -find_position = { fg = "#AF00DB", bg = "#FFFFFF", bold = true, italic = true } -# Marker -marker_copied = { fg = "#008000", bg = "#008000" } -marker_cut = { fg = "#CD3131", bg = "#CD3131" } -marker_marked = { fg = "#0598BC", bg = "#0598BC" } -marker_selected = { fg = "#949800", bg = "#949800" } -# Tab -tab_active = { fg = "#000000", bg = "#FFFFFF" } -tab_inactive = { fg = "#000000", bg = "#F3F3F3" } -tab_width = 1 -# Count -count_copied = { fg = "#FFFFFF", bg = "#008000" } -count_cut = { fg = "#FFFFFF", bg = "#CD3131" } -count_selected = { fg = "#FFFFFF", bg = "#949800" } -# Border -border_symbol = "โ”‚" -border_style = { fg = "#D4D4D4" } -# Highlighting -syntect_theme = "./tmtheme.xml" -# Cursor -cursor_symbol = "โ–ˆ" -cursor = { fg = "#FFFFFF", bg = "#000000" } -# Executable -exe_symbol = "" -exe = { fg = "#008000", bg = "#FFFFFF" } -# Regular -file_symbol = "" -file = { } -# Directory -folder_symbol = "" -folder = { fg = "#0000FF", bg = "#FFFFFF" } -# Hidden -hidden_symbol = "" -hidden = { fg = "#767676" } -# Link -link_symbol = "" -link = { fg = "#0598BC", bg = "#FFFFFF" } -# Link (broken) -broken_symbol = "" -broken = { fg = "#CD3131", bg = "#FFF0F0" } -# Selected -selected = { fg = "#000000", bg = "#ADD6FF" } - -[status] -separator_open = "" -separator_close = "" -separator_style = { fg = "#D4D4D4", bg = "#D4D4D4" } -# Mode -mode_normal = { fg = "#FFFFFF", bg = "#0000FF", bold = true } -mode_select = { fg = "#FFFFFF", bg = "#FFAF00", bold = true } -mode_unset = { fg = "#FFFFFF", bg = "#CD3131", bold = true } -# Progress -progress_label = { bold = true } -progress_normal = { fg = "#0000FF", bg = "#FFFFFF" } -progress_error = { fg = "#CD3131", bg = "#FFFFFF" } -# Permissions -permissions_t = { fg = "#008000" } -permissions_r = { fg = "#949800" } -permissions_w = { fg = "#CD3131" } -permissions_x = { fg = "#0598BC" } -permissions_s = { fg = "#767676" } - -[select] -border = { fg = "#0000FF" } -active = { fg = "#AF00DB", bold = true } -inactive = {} - -[input] -border = { fg = "#0000FF" } -title = {} -value = {} -selected = { reversed = true } - -[completion] -border = { fg = "#0000FF" } -active = { bg = "#ADD6FF" } -inactive = {} -# Icons -icon_file = "" -icon_folder = "" -icon_command = "" - -[tasks] -border = { fg = "#0000FF" } -title = {} -hovered = { underline = true } - -[which] -mask = { bg = "#FFFFFF" } -cand = { fg = "#0598BC" } -rest = { fg = "#767676" } -desc = { fg = "#AF00DB" } -separator = " " -separator_style = { fg = "#767676" } - -[help] -on = { fg = "#0598BC" } -run = { fg = "#AF00DB" } -desc = { fg = "#000000" } -hovered = { bg = "#ADD6FF", bold = true } -footer = { fg = "#000000", bg = "#F3F3F3" } - -[filetype] -rules = [ - # Images - { mime = "image/*", fg = "#949800" }, - # Videos - { mime = "video/*", fg = "#AF00DB" }, - # Audio - { mime = "audio/*", fg = "#AF00DB" }, - # Archives - { mime = "application/zip", fg = "#CD3131" }, - { mime = "application/gzip", fg = "#CD3131" }, - { mime = "application/x-tar", fg = "#CD3131" }, - { mime = "application/x-bzip", fg = "#CD3131" }, - { mime = "application/x-bzip2", fg = "#CD3131" }, - { mime = "application/x-7z-compressed", fg = "#CD3131" }, - { mime = "application/x-rar", fg = "#CD3131" }, - # Documents - { mime = "application/pdf", fg = "#0598BC" }, - { mime = "application/msword", fg = "#0598BC" }, - { mime = "application/vnd.openxmlformats-officedocument.*", fg = "#0598BC" }, - # Fallback - { name = "*", fg = "#000000" }, - { name = "*/", fg = "#0000FF" }, - # Executable - { name = "*", category = "executable", fg = "#008000", bg = "#FFFFFF" }, - # Directories - { name = "*/", fg = "#0000FF", bg = "#FFFFFF" }, - # Hidden files - { name = ".*", fg = "#767676" }, - # Symlinks - { name = "*", category = "link", fg = "#0598BC", bg = "#FFFFFF" }, - # Broken symlinks - { name = "*", category = "broken", fg = "#CD3131", bg = "#FFF0F0" }, -] - -[icon] -rules = [ - { name = "Desktop", text = "" }, - { name = "Documents", text = "" }, - { name = "Downloads", text = "" }, - { name = "Pictures", text = "" }, - { name = "Music", text = "" }, - { name = "Videos", text = "" }, - { name = ".git", text = "" }, - { name = ".config", text = "" }, -] diff --git a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/1.png b/fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/1.png deleted file mode 100644 index c749e04..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/1.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/2.png b/fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/2.png deleted file mode 100644 index 818ec57..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/2.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/3.png b/fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/3.png deleted file mode 100644 index b146126..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/3.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/4.png b/fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/4.png deleted file mode 100644 index 5dde089..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/4.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/preview.png b/fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/preview.png deleted file mode 100644 index 8000111..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/img/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/preview.png b/fedora/.config/yazi/flavors/vscode-light-plus.yazi/preview.png deleted file mode 100644 index 8000111..0000000 Binary files a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/preview.png and /dev/null differ diff --git a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/tmtheme.xml b/fedora/.config/yazi/flavors/vscode-light-plus.yazi/tmtheme.xml deleted file mode 100644 index 8e2420d..0000000 --- a/fedora/.config/yazi/flavors/vscode-light-plus.yazi/tmtheme.xml +++ /dev/null @@ -1,250 +0,0 @@ - - - - - name - VSCode Light+ - settings - - - settings - - background - #FFFFFF - foreground - #000000 - caret - #000000 - invisibles - #D3D3D3 - lineHighlight - #E5EBF1 - selection - #ADD6FF - - - - name - Comment - scope - comment - settings - - foreground - #008000 - - - - name - String - scope - string - settings - - foreground - #A31515 - - - - name - Number - scope - constant.numeric - settings - - foreground - #098658 - - - - name - Built-in constant - scope - constant.language - settings - - foreground - #0000FF - - - - name - User-defined constant - scope - constant.character, constant.other - settings - - foreground - #0000FF - - - - name - Variable - scope - variable - settings - - foreground - #795E26 - - - - name - Keyword - scope - keyword - settings - - foreground - #AF00DB - - - - name - Storage - scope - storage - settings - - foreground - #0000FF - - - - name - Storage type - scope - storage.type - settings - - foreground - #0000FF - - - - name - Class name - scope - entity.name.class - settings - - foreground - #267F99 - - - - name - Inherited class - scope - entity.other.inherited-class - settings - - foreground - #267F99 - - - - name - Function name - scope - entity.name.function - settings - - foreground - #795E26 - - - - name - Function argument - scope - variable.parameter - settings - - foreground - #001080 - - - - name - Tag name - scope - entity.name.tag - settings - - foreground - #800000 - - - - name - Tag attribute - scope - entity.other.attribute-name - settings - - foreground - #E50000 - - - - name - Library function - scope - support.function - settings - - foreground - #795E26 - - - - name - Library constant - scope - support.constant - settings - - foreground - #0000FF - - - - name - Library class/type - scope - support.type, support.class - settings - - foreground - #267F99 - - - - name - Invalid - scope - invalid - settings - - foreground - #CD3131 - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - foreground - #CD3131 - - - - uuid - 231D4441-F280-4D49-A647-E1FD7E84D1D8 - - diff --git a/fedora/.config/yazi/init.lua b/fedora/.config/yazi/init.lua deleted file mode 100644 index 6c7ee4f..0000000 --- a/fedora/.config/yazi/init.lua +++ /dev/null @@ -1,72 +0,0 @@ -Status:children_add(function(self) - local h = self._current.hovered - if h and h.link_to then - return " -> " .. tostring(h.link_to) - else - return "" - end -end, 3300, Status.LEFT) - -Status:children_add(function() - local h = cx.active.current.hovered - if not h or ya.target_family() ~= "unix" then - return "" - end - - return ui.Line({ - ui.Span(ya.user_name(h.cha.uid) or tostring(h.cha.uid)):fg("magenta"), - ":", - ui.Span(ya.group_name(h.cha.gid) or tostring(h.cha.gid)):fg("magenta"), - " ", - }) -end, 500, Status.RIGHT) - -Header:children_add(function() - if ya.target_family() ~= "unix" then - return "" - end - return ui.Span(ya.user_name() .. "@" .. ya.host_name() .. ":"):fg("blue") -end, 500, Header.LEFT) - -if os.getenv("NVIM") then - require("toggle-pane"):entry("min-preview") -end - -require("smart-enter"):setup({ - open_multi = true, -}) - -require("full-border"):setup({ - type = ui.Border.PLAIN, -- or ui.Border.ROUNDED -}) - -th.git = th.git or {} -th.git.modified_sign = "M" -th.git.deleted_sign = "D" -th.git.added_sign = "A" -th.git.untracked_sign = "?" -th.git.ignored_sign = "X" -th.git.updated_sign = "U" - -require("git"):setup() - -require("mactag"):setup({ - keys = { - r = "Red", - o = "Orange", - y = "Yellow", - g = "Green", - b = "Blue", - p = "Purple", - }, - colors = { - Red = "#ee7b70", - Orange = "#f5bd5c", - Yellow = "#fbe764", - Green = "#91fc87", - Blue = "#5fa3f8", - Purple = "#cb88f8", - }, -}) - -require("folder-rules"):setup() diff --git a/fedora/.config/yazi/keymap-default.toml b/fedora/.config/yazi/keymap-default.toml deleted file mode 100644 index 6b7acad..0000000 --- a/fedora/.config/yazi/keymap-default.toml +++ /dev/null @@ -1,490 +0,0 @@ -# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config. -# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas. -"$schema" = "https://yazi-rs.github.io/schemas/keymap.json" - -[mgr] - -keymap = [ - { on = "", run = "escape", desc = "Exit visual mode, clear selection, or cancel search" }, - { on = "", run = "escape", desc = "Exit visual mode, clear selection, or cancel search" }, - { on = "q", run = "quit", desc = "Quit the process" }, - { on = "Q", run = "quit --no-cwd-file", desc = "Quit without outputting cwd-file" }, - { on = "", run = "close", desc = "Close the current tab, or quit if it's last" }, - { on = "", run = "suspend", desc = "Suspend the process" }, - - # Hopping - { on = "k", run = "arrow prev", desc = "Previous file" }, - { on = "j", run = "arrow next", desc = "Next file" }, - - { on = "", run = "arrow prev", desc = "Previous file" }, - { on = "", run = "arrow next", desc = "Next file" }, - - { on = "", run = "arrow -50%", desc = "Move cursor up half page" }, - { on = "", run = "arrow 50%", desc = "Move cursor down half page" }, - # { on = "", run = "arrow -100%", desc = "Move cursor up one page" }, - # { on = "", run = "arrow 100%", desc = "Move cursor down one page" }, - - { on = "", run = "arrow -50%", desc = "Move cursor up half page" }, - { on = "", run = "arrow 50%", desc = "Move cursor down half page" }, - { on = "", run = "arrow -100%", desc = "Move cursor up one page" }, - { on = "", run = "arrow 100%", desc = "Move cursor down one page" }, - - { on = [ "g", "g" ], run = "arrow top", desc = "Go to top" }, - { on = "G", run = "arrow bot", desc = "Go to bottom" }, - - # Navigation - { on = "h", run = "leave", desc = "Back to the parent directory" }, - { on = "l", run = "enter", desc = "Enter the child directory" }, - - { on = "", run = "leave", desc = "Back to the parent directory" }, - { on = "", run = "enter", desc = "Enter the child directory" }, - - { on = "H", run = "back", desc = "Back to previous directory" }, - { on = "L", run = "forward", desc = "Forward to next directory" }, - - # Toggle - { on = "", run = [ "toggle", "arrow next" ], desc = "Toggle the current selection state" }, - { on = "", run = "toggle_all --state=on", desc = "Select all files" }, - { on = "", run = "toggle_all", desc = "Invert selection of all files" }, - - # Visual mode - { on = "", run = "visual_mode", desc = "Enter visual mode (selection mode)" }, - { on = "V", run = "visual_mode --unset", desc = "Enter visual mode (unset mode)" }, - - # Seeking - { on = "", run = "seek -5", desc = "Seek up 5 units in the preview" }, - { on = "", run = "seek 5", desc = "Seek down 5 units in the preview" }, - - # Spotting - { on = "", run = "spot", desc = "Spot hovered file" }, - - # Operation - { on = "e", run = "open", desc = "Open selected files" }, - { on = "E", run = "open --interactive", desc = "Open selected files interactively" }, - { on = "o", run = "open", desc = "Open selected files" }, - { on = "O", run = "open --interactive", desc = "Open selected files interactively" }, - { on = "", run = "open", desc = "Open selected files" }, - { on = "", run = "open --interactive", desc = "Open selected files interactively" }, - { on = [ "y", "y" ],run = "yank", desc = "Yank selected files (copy)" }, - { on = "x", run = "yank --cut", desc = "Yank selected files (cut)" }, - { on = [ "p", "p" ],run = "paste", desc = "Paste yanked files" }, - { on = [ "P", "P" ],run = "paste --force", desc = "Paste yanked files (overwrite if the destination exists)" }, - { on = "-", run = "link", desc = "Symlink the absolute path of yanked files" }, - { on = "_", run = "link --relative", desc = "Symlink the relative path of yanked files" }, - { on = "", run = "hardlink", desc = "Hardlink yanked files" }, - { on = "Y", run = "unyank", desc = "Cancel the yank status" }, - { on = "X", run = "unyank", desc = "Cancel the yank status" }, - { on = "d", run = "remove", desc = "Trash selected files" }, - { on = "D", run = "remove --permanently", desc = "Permanently delete selected files" }, - { on = ["M", "f"], run = "create", desc = "Create a file (ends with / for directories)" }, - { on = ["M", "d"], run = "create --dir", desc = "Create directories" }, - { on = ["M", "o"], run = "create --force", desc = "Create/overwrite a file" }, - { on = "i", run = "rename --cursor=before_ext", desc = "Rename selected file(s) with cursor before extension" }, - { on = "I", run = "rename --cursor=start", desc = "Rename selected file(s) with cursor at start" }, - { on = "", run = "rename --empty=ext", desc = "Rename selected file(s) extension only" }, - { on = "a", run = "rename --empty=dot_ext", desc = "Rename selected file(s) dot extension only" }, - { on = "A", run = "rename --cursor=end", desc = "Rename selected file(s) with cursor at end" }, - { on = "r", run = "rename --cursor=start --empty=stem", desc = "Rename selected file(s) stem only" }, - { on = "R", run = "rename --empty=all", desc = "Rename selected file(s) full name" }, - { on = "B", run = [ "escape --select", "toggle_all", "rename", "escape --select --search" ], desc = "Bulk reanme files/folders in cwd" }, - { on = ";", run = "shell --interactive", desc = "Run a shell command" }, - { on = ":", run = "shell --block --interactive", desc = "Run a shell command (block until finishes)" }, - { on = ".", run = "hidden toggle", desc = "Toggle the visibility of hidden files" }, - { on = [ "s", "f" ],run = "search --via=fd", desc = "Search files by name via fd" }, - { on = [ "S", "f" ],run = "search --via=rg", desc = "Search files by content via ripgrep" }, - { on = "", run = "escape --search", desc = "Cancel the ongoing search" }, - { on = "z", run = "plugin fzf", desc = "Jump to a file/directory via fzf" }, - { on = "Z", run = "plugin zoxide", desc = "Jump to a directory via zoxide" }, - - # Linemode - { on = [ "m", "s" ], run = "linemode size", desc = "Linemode: size" }, - { on = [ "m", "p" ], run = "linemode permissions", desc = "Linemode: permissions" }, - { on = [ "m", "b" ], run = "linemode btime", desc = "Linemode: btime" }, - { on = [ "m", "m" ], run = "linemode mtime", desc = "Linemode: mtime" }, - { on = [ "m", "o" ], run = "linemode owner", desc = "Linemode: owner" }, - { on = [ "m", "n" ], run = "linemode none", desc = "Linemode: none" }, - - # Copy - { on = [ "y", "p" ], run = "copy path", desc = "Copy the file path" }, - { on = [ "y", "d" ], run = "copy dirname", desc = "Copy the directory path" }, - { on = [ "y", "f" ], run = "copy filename", desc = "Copy the filename" }, - { on = [ "y", "n" ], run = "copy name_without_ext", desc = "Copy the filename without extension" }, - - # Filter - { on = "f", run = "filter --smart", desc = "Filter files" }, - - # Find - { on = "/", run = "find --smart", desc = "Find next file" }, - { on = "?", run = "find --previous --smart", desc = "Find previous file" }, - { on = "n", run = "find_arrow", desc = "Next found" }, - { on = "N", run = "find_arrow --previous", desc = "Previous found" }, - - # Sorting - { on = [ ",", "m" ], run = [ "sort mtime --reverse=no", "linemode mtime" ], desc = "Sort by modified time" }, - { on = [ ",", "M" ], run = [ "sort mtime --reverse", "linemode mtime" ], desc = "Sort by modified time (reverse)" }, - { on = [ ",", "b" ], run = [ "sort btime --reverse=no", "linemode btime" ], desc = "Sort by birth time" }, - { on = [ ",", "B" ], run = [ "sort btime --reverse", "linemode btime" ], desc = "Sort by birth time (reverse)" }, - { on = [ ",", "e" ], run = "sort extension --reverse=no", desc = "Sort by extension" }, - { on = [ ",", "E" ], run = "sort extension --reverse", desc = "Sort by extension (reverse)" }, - { on = [ ",", "a" ], run = "sort alphabetical --reverse=no", desc = "Sort alphabetically" }, - { on = [ ",", "A" ], run = "sort alphabetical --reverse", desc = "Sort alphabetically (reverse)" }, - { on = [ ",", "n" ], run = "sort natural --reverse=no", desc = "Sort naturally" }, - { on = [ ",", "N" ], run = "sort natural --reverse", desc = "Sort naturally (reverse)" }, - { on = [ ",", "s" ], run = [ "sort size --reverse=no", "linemode size" ], desc = "Sort by size" }, - { on = [ ",", "S" ], run = [ "sort size --reverse", "linemode size" ], desc = "Sort by size (reverse)" }, - { on = [ ",", "r" ], run = "sort random --reverse=no", desc = "Sort randomly" }, - - # Goto - { on = [ "g", "h" ], run = "cd ~", desc = "Go home" }, - # { on = [ "g", "c" ], run = "cd ~/.config", desc = "Go ~/.config" }, - # { on = [ "g", "d" ], run = "cd ~/Downloads", desc = "Go ~/Downloads" }, - { on = [ "g", "" ], run = "cd --interactive", desc = "Jump interactively" }, - { on = [ "g", "l" ], run = "follow", desc = "Follow hovered symlink" }, - - # Tabs - { on = "", run = "tab_create --current", desc = "Create a new tab with CWD" }, - - { on = "1", run = "tab_switch 0", desc = "Switch to first tab" }, - { on = "2", run = "tab_switch 1", desc = "Switch to second tab" }, - { on = "3", run = "tab_switch 2", desc = "Switch to third tab" }, - { on = "4", run = "tab_switch 3", desc = "Switch to fourth tab" }, - { on = "5", run = "tab_switch 4", desc = "Switch to fifth tab" }, - { on = "6", run = "tab_switch 5", desc = "Switch to sixth tab" }, - { on = "7", run = "tab_switch 6", desc = "Switch to seventh tab" }, - { on = "8", run = "tab_switch 7", desc = "Switch to eighth tab" }, - { on = "9", run = "tab_switch 8", desc = "Switch to ninth tab" }, - - { on = "[", run = "tab_switch -1 --relative", desc = "Switch to previous tab" }, - { on = "]", run = "tab_switch 1 --relative", desc = "Switch to next tab" }, - - { on = "{", run = "tab_swap -1", desc = "Swap current tab with previous tab" }, - { on = "}", run = "tab_swap 1", desc = "Swap current tab with next tab" }, - - # Tasks - { on = [ "t", "a" ], run = "tasks:show", desc = "Show task manager" }, - - # Help - { on = "~", run = "help", desc = "Open help" }, - { on = "", run = "help", desc = "Open help" }, -] - -# Plugins -[[mgr.prepend_keymap]] -on = "T" -run = "plugin toggle-pane min-preview" -desc = "Show or hide the preview pane" - -[[mgr.prepend_keymap]] -on = "T" -run = "plugin toggle-pane max-preview" -desc = "Maximize or restore the preview pane" - -[[mgr.prepend_keymap]] -on = "l" -run = "plugin smart-enter" -desc = "Enter the child directory, or open the file" - -[[mgr.prepend_keymap]] -on = [ "c", "h", "m" ] -run = "plugin chmod" -desc = "Chmod on selected files" - -[[mgr.prepend_keymap]] -on = "" -run = "plugin diff" -desc = "Diff the selected with the hovered file" - -[[mgr.prepend_keymap]] -on = "" -run = "plugin jump-to-char" -desc = "Jump to char" - -[[mgr.prepend_keymap]] -on = [ "b", "a" ] -run = "plugin mactag add" -desc = "Tag selected files" - -[[mgr.prepend_keymap]] -on = [ "b", "r" ] -run = "plugin mactag remove" -desc = "Untag selected files" - -[[mgr.prepend_keymap]] -on = [ "M", "t" ] -run = "plugin mount" -desc = "Mount" - -[[mgr.prepend_keymap]] -on = "F" -run = "plugin smart-filter" -desc = "Smart filter" - -[[mgr.prepend_keymap]] -on = [ "p", "P" ] -run = "plugin smart-paste" -desc = "Paste into the hovered directory or CWD" - -[[mgr.prepend_keymap]] -on = [ "s", "d" ] -run = "plugin sudo-demo" - -[[mgr.prepend_keymap]] -on = "+" -run = "plugin zoom 1" -desc = "Zoom in hovered file" - -[[mgr.prepend_keymap]] -on = "-" -run = "plugin zoom -1" -desc = "Zoom out hovered file" - -[[mgr.prepend_keymap]] -on = "K" -run = "plugin parent-arrow -1" - -[[mgr.prepend_keymap]] -on = "J" -run = "plugin parent-arrow 1" - -[[mgr.prepend_keymap]] -on = "" -run = 'shell -- qlmanage -p "$@"' - -[[mgr.prepend_keymap]] -on = "" -run = 'shell --block -- neomutt -a "$@"' - -[[mgr.prepend_keymap]] -on = [ "c", "p", "a" ] -run = "plugin compress" -desc = "Archive selected files" - -[[mgr.prepend_keymap]] -on = [ "c", "p", "p" ] -run = "plugin compress -p" -desc = "Archive selected files (password)" - -[[mgr.prepend_keymap]] -on = [ "c", "p", "h" ] -run = "plugin compress -ph" -desc = "Archive selected files (password+header)" - -[[mgr.prepend_keymap]] -on = [ "c", "p", "l" ] -run = "plugin compress -l" -desc = "Archive selected files (compression level)" - -[[mgr.prepend_keymap]] -on = [ "c", "p", "u" ] -run = "plugin compress -phl" -desc = "Archive selected files (password+header+level)" - -[tasks] - -keymap = [ - { on = "", run = "close", desc = "Close task manager" }, - { on = "", run = "close", desc = "Close task manager" }, - { on = "", run = "close", desc = "Close task manager" }, - { on = [ "t", "a" ], run = "close", desc = "Close task manager" }, - - { on = "k", run = "arrow prev", desc = "Previous task" }, - { on = "j", run = "arrow next", desc = "Next task" }, - - { on = "", run = "arrow prev", desc = "Previous task" }, - { on = "", run = "arrow next", desc = "Next task" }, - - { on = "", run = "inspect", desc = "Inspect the task" }, - { on = "x", run = "cancel", desc = "Cancel the task" }, - - # Help - { on = "~", run = "help", desc = "Open help" }, - { on = "", run = "help", desc = "Open help" }, -] - -[spot] - -keymap = [ - { on = "", run = "close", desc = "Close the spot" }, - { on = "", run = "close", desc = "Close the spot" }, - { on = "", run = "close", desc = "Close the spot" }, - { on = "", run = "close", desc = "Close the spot" }, - - { on = "k", run = "arrow prev", desc = "Previous line" }, - { on = "j", run = "arrow next", desc = "Next line" }, - { on = "h", run = "swipe prev", desc = "Swipe to previous file" }, - { on = "l", run = "swipe next", desc = "Swipe to next file" }, - - { on = "", run = "arrow prev", desc = "Previous line" }, - { on = "", run = "arrow next", desc = "Next line" }, - { on = "", run = "swipe prev", desc = "Swipe to previous file" }, - { on = "", run = "swipe next", desc = "Swipe to next file" }, - - # Copy - { on = [ "c", "c" ], run = "copy cell", desc = "Copy selected cell" }, - - # Help - { on = "~", run = "help", desc = "Open help" }, - { on = "", run = "help", desc = "Open help" }, -] - -[pick] - -keymap = [ - { on = "", run = "close", desc = "Cancel pick" }, - { on = "", run = "close", desc = "Cancel pick" }, - { on = "", run = "close", desc = "Cancel pick" }, - { on = "", run = "close --submit", desc = "Submit the pick" }, - - { on = "k", run = "arrow prev", desc = "Previous option" }, - { on = "j", run = "arrow next", desc = "Next option" }, - - { on = "", run = "arrow prev", desc = "Previous option" }, - { on = "", run = "arrow next", desc = "Next option" }, - - # Help - { on = "~", run = "help", desc = "Open help" }, - { on = "", run = "help", desc = "Open help" }, -] - -[input] - -keymap = [ - { on = "", run = "close", desc = "Cancel input" }, - { on = "", run = "close --submit", desc = "Submit input" }, - { on = "", run = "escape", desc = "Back to normal mode, or cancel input" }, - { on = "", run = "escape", desc = "Back to normal mode, or cancel input" }, - - # Mode - { on = "i", run = "insert", desc = "Enter insert mode" }, - { on = "I", run = [ "move first-char", "insert" ], desc = "Move to the BOL, and enter insert mode" }, - { on = "a", run = "insert --append", desc = "Enter append mode" }, - { on = "A", run = [ "move eol", "insert --append" ], desc = "Move to the EOL, and enter append mode" }, - { on = "v", run = "visual", desc = "Enter visual mode" }, - { on = "r", run = "replace", desc = "Replace a single character" }, - - # Selection - { on = "V", run = [ "move bol", "visual", "move eol" ], desc = "Select from BOL to EOL" }, - { on = "", run = [ "move eol", "visual", "move bol" ], desc = "Select from EOL to BOL" }, - { on = "", run = [ "move bol", "visual", "move eol" ], desc = "Select from BOL to EOL" }, - - # Character-wise movement - { on = "h", run = "move -1", desc = "Move back a character" }, - { on = "l", run = "move 1", desc = "Move forward a character" }, - { on = "", run = "move -1", desc = "Move back a character" }, - { on = "", run = "move 1", desc = "Move forward a character" }, - { on = "", run = "move -1", desc = "Move back a character" }, - { on = "", run = "move 1", desc = "Move forward a character" }, - - # Word-wise movement - { on = "b", run = "backward", desc = "Move back to the start of the current or previous word" }, - { on = "B", run = "backward --far", desc = "Move back to the start of the current or previous WORD" }, - { on = "w", run = "forward", desc = "Move forward to the start of the next word" }, - { on = "W", run = "forward --far", desc = "Move forward to the start of the next WORD" }, - { on = "e", run = "forward --end-of-word", desc = "Move forward to the end of the current or next word" }, - { on = "E", run = "forward --far --end-of-word", desc = "Move forward to the end of the current or next WORD" }, - { on = "", run = "backward", desc = "Move back to the start of the current or previous word" }, - { on = "", run = "forward --end-of-word", desc = "Move forward to the end of the current or next word" }, - - # Line-wise movement - { on = "0", run = "move bol", desc = "Move to the BOL" }, - { on = "$", run = "move eol", desc = "Move to the EOL" }, - { on = "_", run = "move first-char", desc = "Move to the first non-whitespace character" }, - { on = "^", run = "move first-char", desc = "Move to the first non-whitespace character" }, - { on = "", run = "move bol", desc = "Move to the BOL" }, - { on = "", run = "move eol", desc = "Move to the EOL" }, - { on = "", run = "move bol", desc = "Move to the BOL" }, - { on = "", run = "move eol", desc = "Move to the EOL" }, - - # Delete - { on = "", run = "backspace", desc = "Delete the character before the cursor" }, - { on = "", run = "backspace --under", desc = "Delete the character under the cursor" }, - { on = "", run = "backspace", desc = "Delete the character before the cursor" }, - { on = "", run = "backspace --under", desc = "Delete the character under the cursor" }, - - # Kill - { on = "", run = "kill bol", desc = "Kill backwards to the BOL" }, - { on = "", run = "kill eol", desc = "Kill forwards to the EOL" }, - { on = "", run = "kill backward", desc = "Kill backwards to the start of the current word" }, - { on = "", run = "kill forward", desc = "Kill forwards to the end of the current word" }, - - # Cut/Yank/Paste - { on = "d", run = "delete --cut", desc = "Cut selected characters" }, - { on = "D", run = [ "delete --cut", "move eol" ], desc = "Cut until EOL" }, - { on = "c", run = "delete --cut --insert", desc = "Cut selected characters, and enter insert mode" }, - { on = "C", run = [ "delete --cut --insert", "move eol" ], desc = "Cut until EOL, and enter insert mode" }, - { on = "s", run = [ "delete --cut --insert", "move 1" ], desc = "Cut current character, and enter insert mode" }, - { on = "S", run = [ "move bol", "delete --cut --insert", "move eol" ], desc = "Cut from BOL until EOL, and enter insert mode" }, - { on = "x", run = [ "delete --cut", "move 1 --in-operating" ], desc = "Cut current character" }, - { on = "y", run = "yank", desc = "Copy selected characters" }, - { on = "p", run = "paste", desc = "Paste copied characters after the cursor" }, - { on = "P", run = "paste --before", desc = "Paste copied characters before the cursor" }, - - # Undo/Redo - { on = "u", run = "undo", desc = "Undo the last operation" }, - { on = "", run = "redo", desc = "Redo the last operation" }, - - # Help - { on = "~", run = "help", desc = "Open help" }, - { on = "", run = "help", desc = "Open help" }, -] - -[confirm] - -keymap = [ - { on = "", run = "close", desc = "Cancel the confirm" }, - { on = "", run = "close", desc = "Cancel the confirm" }, - { on = "", run = "close", desc = "Cancel the confirm" }, - { on = "", run = "close --submit", desc = "Submit the confirm" }, - - { on = "n", run = "close", desc = "Cancel the confirm" }, - { on = "y", run = "close --submit", desc = "Submit the confirm" }, - - { on = "k", run = "arrow prev", desc = "Previous line" }, - { on = "j", run = "arrow next", desc = "Next line" }, - - { on = "", run = "arrow prev", desc = "Previous line" }, - { on = "", run = "arrow next", desc = "Next line" }, - - # Help - { on = "~", run = "help", desc = "Open help" }, - { on = "", run = "help", desc = "Open help" }, -] - -[cmp] - -keymap = [ - { on = "", run = "close", desc = "Cancel completion" }, - { on = "", run = "close --submit", desc = "Submit the completion" }, - { on = "", run = [ "close --submit", "input:close --submit" ], desc = "Complete and submit the input" }, - - { on = "", run = "arrow prev", desc = "Previous item" }, - { on = "", run = "arrow next", desc = "Next item" }, - - { on = "", run = "arrow prev", desc = "Previous item" }, - { on = "", run = "arrow next", desc = "Next item" }, - - { on = "", run = "arrow prev", desc = "Previous item" }, - { on = "", run = "arrow next", desc = "Next item" }, - - # Help - { on = "~", run = "help", desc = "Open help" }, - { on = "", run = "help", desc = "Open help" }, -] - -[help] - -keymap = [ - { on = "", run = "escape", desc = "Clear the filter, or hide the help" }, - { on = "", run = "escape", desc = "Clear the filter, or hide the help" }, - { on = "", run = "close", desc = "Hide the help" }, - - # Navigation - { on = "k", run = "arrow prev", desc = "Previous line" }, - { on = "j", run = "arrow next", desc = "Next line" }, - - { on = "", run = "arrow prev", desc = "Previous line" }, - { on = "", run = "arrow next", desc = "Next line" }, - - # Filtering - { on = "f", run = "filter", desc = "Filter help items" }, -] diff --git a/fedora/.config/yazi/plugins/chmod.yazi/README.md b/fedora/.config/yazi/plugins/chmod.yazi/README.md deleted file mode 100644 index b2ad136..0000000 --- a/fedora/.config/yazi/plugins/chmod.yazi/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# chmod.yazi - -Execute `chmod` on the selected files to change their mode. This plugin is only available on Unix platforms since it relies on [`chmod(2)`](https://man7.org/linux/man-pages/man2/chmod.2.html). - -https://github.com/yazi-rs/plugins/assets/17523360/7aa3abc2-d057-498c-8473-a6282c59c464 - -## Installation - -```sh -ya pkg add yazi-rs/plugins:chmod -``` - -## Usage - -Add this to your `~/.config/yazi/keymap.toml`: - -```toml -[[mgr.prepend_keymap]] -on = [ "c", "m" ] -run = "plugin chmod" -desc = "Chmod on selected files" -``` - -Make sure the c => m key is not used elsewhere. - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/fedora/.config/yazi/plugins/chmod.yazi/main.lua b/fedora/.config/yazi/plugins/chmod.yazi/main.lua deleted file mode 100644 index a50a864..0000000 --- a/fedora/.config/yazi/plugins/chmod.yazi/main.lua +++ /dev/null @@ -1,42 +0,0 @@ ---- @since 25.5.31 - -local selected_or_hovered = ya.sync(function() - local tab, paths = cx.active, {} - for _, u in pairs(tab.selected) do - paths[#paths + 1] = tostring(u) - end - if #paths == 0 and tab.current.hovered then - paths[1] = tostring(tab.current.hovered.url) - end - return paths -end) - -return { - entry = function() - ya.emit("escape", { visual = true }) - - local urls = selected_or_hovered() - if #urls == 0 then - return ya.notify { title = "Chmod", content = "No file selected", level = "warn", timeout = 5 } - end - - local value, event = ya.input { - title = "Chmod:", - pos = { "top-center", y = 3, w = 40 }, - position = { "top-center", y = 3, w = 40 }, -- TODO: remove - } - if event ~= 1 then - return - end - - local status, err = Command("chmod"):arg(value):arg(urls):spawn():wait() - if not status or not status.success then - ya.notify { - title = "Chmod", - content = string.format("Chmod on selected files failed, error: %s", status and status.code or err), - level = "error", - timeout = 5, - } - end - end, -} diff --git a/fedora/.config/yazi/plugins/compress.yazi/LICENSE b/fedora/.config/yazi/plugins/compress.yazi/LICENSE deleted file mode 100644 index 7ce7a2f..0000000 --- a/fedora/.config/yazi/plugins/compress.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Ciarรกn O'Brien - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/plugins/compress.yazi/README.md b/fedora/.config/yazi/plugins/compress.yazi/README.md deleted file mode 100644 index ae1f329..0000000 --- a/fedora/.config/yazi/plugins/compress.yazi/README.md +++ /dev/null @@ -1,173 +0,0 @@ -

๐Ÿ—œ๏ธ compress.yazi

-

- A blazing fast, flexible archive plugin for Yazi
- Effortlessly compress your files and folders with style! -

- ---- - -## ๐Ÿ“– Table of Contents - -- [Features](#-features) -- [Supported File Types](#-supported-file-types) -- [Installation](#%EF%B8%8F-installation) -- [Keymap Example](#-keymap-example) -- [Usage](#%EF%B8%8F-usage) -- [Flags](#%EF%B8%8F-flags) -- [Tips](#-tips) -- [Credits](#-credits) - ---- - -## ๐Ÿš€ Features - -- ๐Ÿ—‚๏ธ **Multi-format support:** zip, 7z, rar, tar, tar.gz, tar.xz, tar.bz2, tar.zst, tar.lz4, tar.lha -- ๐ŸŒ **Cross-platform:** Works on Unix & Windows -- ๐Ÿ”’ **Password protection:** Secure your archives (zip/7z/rar) -- ๐Ÿ›ก๏ธ **Header encryption:** Hide file lists (7z/rar) -- โšก **Compression level:** Choose your balance of speed vs. size -- ๐Ÿ›‘ **Overwrite safety:** Never lose files by accident -- ๐ŸŽฏ **Seamless Yazi integration:** Fast, native-like UX - ---- - -## ๐Ÿ“ฆ Supported File Types - -| Extension | Default Command | 7z Command | Bsdtar Command (Win10+ & Unix) | -| ------------- | ----------------- | -------------- | ------------------------------ | -| `.zip` | `zip -r` | `7z a -tzip` | `tar -caf` | -| `.7z` | `7z a` | `7z a` | | -| `.rar` | `rar a` | | | -| `.tar` | `tar rpf` | | `tar rpf` | -| `.tar.gz` | `tar rpf + gzip` | `7z a -tgzip` | `tar -czf` | -| `.tar.xz` | `tar rpf + xz` | `7z a -txz` | `tar -cJf` | -| `.tar.bz2` | `tar rpf + bzip2` | `7z a -tbzip2` | `tar -cjf` | -| `.tar.zst` | `tar rpf + zstd` | | `tar --zstd -cf` | -| `.tar.lz4` | `tar rpf + lz4` | | | -| `.tar.lha` | `tar rpf + lha` | | | - ---- - -## โšก๏ธ Installation - -```bash -# Unix -git clone https://github.com/KKV9/compress.yazi.git ~/.config/yazi/plugins/compress.yazi - -# Windows (CMD, not PowerShell!) -git clone https://github.com/KKV9/compress.yazi.git %AppData%\yazi\config\plugins\compress.yazi - -# Or with yazi plugin manager -ya pkg add KKV9/compress -``` - ---- - -### ๐Ÿ”ง Extras (Windows) - -To enable additional compression formats and features on Windows, follow these steps: - -1. **Install [7-Zip](https://www.7-zip.org/):** - Add `C:\Program Files\7-Zip` to your `PATH`. - This enables support for `.7z` archives and password-protected `.zip` files. - -2. **Alternative: Install [Nanazip](https://github.com/M2Team/NanaZip):** - A modern alternative to 7-Zip with similar functionality and extra features. - -3. **Install [WinRAR](https://www.win-rar.com/download.html):** - Add `C:\Program Files\WinRAR` to your `PATH`. - This enables support for `.rar` archives. - -4. **Install Additional Tools:** - To use formats like `lha`, `lz4`, `gzip`, etc., install their respective tools and ensure they are added to your `PATH`. - ---- - -## ๐ŸŽน Keymap Example - -Add this to your `keymap.toml`: - - -```toml -[[mgr.prepend_keymap]] -on = [ "c", "a", "a" ] -run = "plugin compress" -desc = "Archive selected files" - -[[mgr.prepend_keymap]] -on = [ "c", "a", "p" ] -run = "plugin compress -p" -desc = "Archive selected files (password)" - -[[mgr.prepend_keymap]] -on = [ "c", "a", "h" ] -run = "plugin compress -ph" -desc = "Archive selected files (password+header)" - -[[mgr.prepend_keymap]] -on = [ "c", "a", "l" ] -run = "plugin compress -l" -desc = "Archive selected files (compression level)" - -[[mgr.prepend_keymap]] -on = [ "c", "a", "u" ] -run = "plugin compress -phl" -desc = "Archive selected files (password+header+level)" -``` - ---- - -## ๐Ÿ› ๏ธ Usage - -1. **Select files/folders** in Yazi. -2. Press c a to open the archive dialog. -3. Choose: - - a for a standard archive - - p for password protection (zip/7z/rar) - - h to encrypt header (7z/rar) - - l to set compression level (all compression algorithims) - - u for all options together -4. **Type a name** for your archive (or leave blank for suggested name). -5. **Enter password** and/or **compression level** if prompted. -6. **Overwrite protect** if a file already exists, the new file will be given a suffix _#. -7. Enjoy your shiny new archive! - ---- - -## ๐Ÿณ๏ธโ€๐ŸŒˆ Flags - -- Combine flags for more power! -- when separating flags with spaces, make sure to single quote them (eg., `'-ph rar'`) -- `-p` Password protect (zip/7z/rar) -- `-h` Encrypt header (7z/rar) -- `-l` Set compression level (all compression algorithims) -- `` Specify a default extention (eg., `7z`, `tar.gz`) - -#### Combining multiple flags: -```toml -[[mgr.prepend_keymap]] -on = [ "c", "a", "7" ] -run = "plugin compress '-ph 7z'" -desc = "Archive selected files to 7z (password+header)" -[[mgr.prepend_keymap]] -on = [ "c", "a", "r" ] -run = "plugin compress '-p -l rar'" -desc = "Archive selected files to rar (password+level)" -``` - ---- - -## ๐Ÿ’ก Tips - -- The file extension **must** match a supported type. -- The required compression tool **must** be installed and in your `PATH` (7zip/rar etc.). -- If no extention is provided, the default extention (zip) will be appended automatically. - ---- - -## ๐Ÿ“ฃ Credits - -Made with โค๏ธ for [Yazi](https://github.com/sxyazi/yazi) by [KKV9](https://github.com/KKV9). -Contributions are welcome! Feel free to submit a pull request. - ---- diff --git a/fedora/.config/yazi/plugins/compress.yazi/main.lua b/fedora/.config/yazi/plugins/compress.yazi/main.lua deleted file mode 100644 index b695b3f..0000000 --- a/fedora/.config/yazi/plugins/compress.yazi/main.lua +++ /dev/null @@ -1,496 +0,0 @@ --- Check for windows -local is_windows = ya.target_family() == "windows" --- Define flags and strings -local is_password, is_encrypted, is_level, cmd_password, cmd_level, default_extension = false, false, false, "", "", "zip" - --- Function to check valid filename -local function is_valid_filename(name) - -- Trim whitespace from both ends - name = name:match("^%s*(.-)%s*$") - if name == "" then - return false - end - if is_windows then - -- Windows forbidden chars and reserved names - if name:find('[<>:"/\\|%?%*]') then - return false - end - else - -- Unix forbidden chars - if name:find("/") or name:find("%z") then - return false - end - end - return true -end - --- Function to send notifications -local function notify_error(message, urgency) - ya.notify( - { - title = "Archive", - content = message, - level = urgency, - timeout = 5 - } - ) -end - --- Function to check if command is available -local function is_command_available(cmd) - local stat_cmd - if is_windows then - stat_cmd = string.format("where %s > nul 2>&1", cmd) - else - stat_cmd = string.format("command -v %s >/dev/null 2>&1", cmd) - end - local cmd_exists = os.execute(stat_cmd) - if cmd_exists then - return true - else - return false - end -end - --- Function to change command arrays --> string -- Use first command available or first command -local function find_command_name(cmd_list) - for _, cmd in ipairs(cmd_list) do - if is_command_available(cmd) then - return cmd - end - end - return cmd_list[1] -- Return first command as fallback -end - --- Function to append filename to it's parent directory url -local function combine_url(path, file) - path, file = Url(path), Url(file) - return tostring(path:join(file)) -end - --- Function to make a table of selected or hovered files: path = filenames -local selected_or_hovered = - ya.sync( - function() - local tab, paths, names, path_fnames = cx.active, {}, {}, {} - for _, u in pairs(tab.selected) do - paths[#paths + 1] = tostring(u.parent) - names[#names + 1] = tostring(u.name) - end - if #paths == 0 and tab.current.hovered then - paths[1] = tostring(tab.current.hovered.url.parent) - names[1] = tostring(tab.current.hovered.name) - end - for idx, name in ipairs(names) do - if not path_fnames[paths[idx]] then - path_fnames[paths[idx]] = {} - end - table.insert(path_fnames[paths[idx]], name) - end - return path_fnames, names, tostring(tab.current.cwd) - end -) - --- Table of archive commands -local archive_commands = { - ["%.zip$"] = { - {command = "zip", args = {"-r"}, level_arg = "-", level_min = 0, level_max = 9, passwordable = true}, - { - command = {"7z", "7zz", "7za"}, - args = {"a", "-tzip"}, - level_arg = "-mx=", - level_min = 0, - level_max = 9, - passwordable = true - }, - { - command = {"tar", "bsdtar"}, - args = {"-caf"}, - level_arg = {"--option", "compression-level="}, - level_min = 1, - level_max = 9 - } - }, - ["%.7z$"] = { - { - command = {"7z", "7zz", "7za"}, - args = {"a"}, - level_arg = "-mx=", - level_min = 0, - level_max = 9, - header_arg = "-mhe=on", - passwordable = true - } - }, - ["%.rar$"] = { - { - command = "rar", - args = {"a"}, - level_arg = "-m", - level_min = 0, - level_max = 5, - header_arg = "-hp", - passwordable = true - } - }, - ["%.tar.gz$"] = { - {command = {"tar", "bsdtar"}, args = {"rpf"}, level_arg = "-", level_min = 1, level_max = 9, compress = "gzip"}, - { - command = {"tar", "bsdtar"}, - args = {"rpf"}, - level_arg = "-mx=", - level_min = 1, - level_max = 9, - compress = "7z", - compress_args = {"a", "-tgzip"} - }, - { - command = {"tar", "bsdtar"}, - args = {"-czf"}, - level_arg = {"--option", "gzip:compression-level="}, - level_min = 1, - level_max = 9 - } - }, - ["%.tar.xz$"] = { - {command = {"tar", "bsdtar"}, args = {"rpf"}, level_arg = "-", level_min = 1, level_max = 9, compress = "xz"}, - { - command = {"tar", "bsdtar"}, - args = {"rpf"}, - level_arg = "-mx=", - level_min = 1, - level_max = 9, - compress = "7z", - compress_args = {"a", "-txz"} - }, - { - command = {"tar", "bsdtar"}, - args = {"-cJf"}, - level_arg = {"--option", "xz:compression-level="}, - level_min = 1, - level_max = 9 - } - }, - ["%.tar.bz2$"] = { - {command = {"tar", "bsdtar"}, args = {"rpf"}, level_arg = "-", level_min = 1, level_max = 9, compress = "bzip2"}, - { - command = {"tar", "bsdtar"}, - args = {"rpf"}, - level_arg = "-mx=", - level_min = 1, - level_max = 9, - compress = "7z", - compress_args = {"a", "-tbzip2"} - }, - { - command = {"tar", "bsdtar"}, - args = {"-cjf"}, - level_arg = {"--option", "bzip2:compression-level="}, - level_min = 1, - level_max = 9 - } - }, - ["%.tar.zst$"] = { - { - command = {"tar", "bsdtar"}, - args = {"rpf"}, - level_arg = "-", - level_min = 1, - level_max = 22, - compress = "zstd", - compress_args = {"--ultra"} - } - }, - ["%.tar.lz4$"] = { - { - command = {"tar", "bsdtar"}, - args = {"rpf"}, - level_arg = "-", - level_min = 1, - level_max = 12, - compress = "lz4" - } - }, - ["%.tar.lha$"] = { - { - command = {"tar", "bsdtar"}, - args = {"rpf"}, - level_arg = "-o", - level_min = 5, - level_max = 7, - compress = "lha", - compress_args = {"-a"} - } - }, - ["%.tar$"] = { - {command = {"tar", "bsdtar"}, args = {"rpf"}} - } -} - -return { - entry = function(_, job) - -- Parse flags and default extension - if job.args ~= nil then - for _, arg in ipairs(job.args) do - if arg:match("^%-(%w+)$") then - -- Handle combined flags (e.g., -phl) - for flag in arg:sub(2):gmatch(".") do - if flag == "p" then - is_password = true - elseif flag == "h" then - is_encrypted = true - elseif flag == "l" then - is_level = true - end - end - elseif arg:match("^%w[%w\\.]*$") then - -- Handle default extension (e.g., 7z, zip) - if archive_commands["%." .. arg .. "$"] then - default_extension = arg - else - notify_error(string.format("Unsupported extension: %s", arg), "warn") - end - else - notify_error(string.format("Unknown argument: %s", arg), "warn") - end - end - end - - -- Exit visual mode - ya.emit("escape", {visual = true}) - -- Define file table and output_dir (pwd) - local path_fnames, fnames, output_dir = selected_or_hovered() - -- Get archive filename - local output_name, event = - ya.input( - { - title = "Create archive:", - position = {"top-center", y = 3, w = 40} - } - ) - if event ~= 1 then - return - end - - -- Determine the default name for the archive - local default_name = #fnames == 1 and fnames[1] or Url(output_dir).name - output_name = output_name == "" and string.format("%s.%s", default_name, default_extension) or output_name - - -- Add default extension if none is specified - if not output_name:match("%.%w+$") then - output_name = string.format("%s.%s", output_name, default_extension) - end - - -- Validate the final archive filename - if not is_valid_filename(output_name) then - notify_error("Invalid archive filename", "error") - return - end - - -- Match user input to archive command - local archive_cmd, - archive_args, - archive_compress, - archive_level_arg, - archive_level_min, - archive_level_max, - archive_header_arg, - archive_passwordable, - archive_compress_args - local matched_pattern = false - for pattern, cmd_list in pairs(archive_commands) do - if output_name:match(pattern) then - matched_pattern = true -- Mark that file extension is correct - for _, cmd in ipairs(cmd_list) do - -- Check if archive_cmd is available - local find_command = type(cmd.command) == "table" and find_command_name(cmd.command) or cmd.command - if is_command_available(find_command) then - -- Check if compress_cmd (if listed) is available - if cmd.compress == nil or is_command_available(cmd.compress) then - archive_cmd = find_command - archive_args = cmd.args - archive_compress = cmd.compress or "" - archive_level_arg = is_level and cmd.level_arg or "" - archive_level_min = cmd.level_min - archive_level_max = cmd.level_max - archive_header_arg = is_encrypted and cmd.header_arg or "" - archive_passwordable = cmd.passwordable or false - archive_compress_args = cmd.compress_args or {} - break - end - end - end - if archive_cmd then - break - end - end - end - - -- Check if no archive command is available for the extension - if not matched_pattern then - notify_error("Unsupported file extension", "error") - return - end - - -- Check if no suitable archive program was found - if not archive_cmd then - notify_error("Could not find a suitable archive program for the selected file extension", "error") - return - end - - -- Check if archive command has multiple names - if type(archive_cmd) == "table" then - archive_cmd = find_command_name(archive_cmd) - end - - -- Exit if archive command is not available - if not is_command_available(archive_cmd) then - notify_error(string.format("%s not available", archive_cmd), "error") - return - end - - -- Exit if compress command is not available - if archive_compress ~= "" and not is_command_available(archive_compress) then - notify_error(string.format("%s compression not available", archive_compress), "error") - return - end - - -- Add password arg if selected - if archive_passwordable and is_password then - local output_password, event = - ya.input( - { - title = "Enter password:", - obscure = true, - position = {"top-center", y = 3, w = 40} - } - ) - if event ~= 1 then - return - end - if output_password ~= "" then - cmd_password = "-P" .. output_password - if archive_cmd == "rar" and is_encrypted then - cmd_password = archive_header_arg .. output_password -- Add archive arg for rar - end - table.insert(archive_args, cmd_password) - end - end - - -- Add header arg if selected for 7z - if is_encrypted and archive_header_arg ~= "" and archive_cmd ~= "rar" then - table.insert(archive_args, archive_header_arg) - end - - -- Add level arg if selected - if archive_level_arg ~= "" and is_level then - local output_level, event = - ya.input( - { - title = string.format("Enter compression level (%s - %s)", archive_level_min, archive_level_max), - position = {"top-center", y = 3, w = 40} - } - ) - if event ~= 1 then - return - end - -- Validate user input for compression level - if - output_level ~= "" and tonumber(output_level) ~= nil and tonumber(output_level) >= archive_level_min and - tonumber(output_level) <= archive_level_max - then - cmd_level = - type(archive_level_arg) == "table" and archive_level_arg[#archive_level_arg] .. output_level or - archive_level_arg .. output_level - local target_args = archive_compress == "" and archive_args or archive_compress_args - if type(archive_level_arg) == "table" then - -- Insert each element of archive_level_arg (except last) into target_args at the correct position - for i = 1, #archive_level_arg - 1 do - table.insert(target_args, i, archive_level_arg[i]) - end - table.insert(target_args, #archive_level_arg, cmd_level) -- Add level at the end - else - -- Insert the compression level argument at the start if not a table - table.insert(target_args, 1, cmd_level) - end - else - notify_error("Invalid level specified. Using defaults.", "warn") - end - end - - -- Store the original output name for later use - local original_name = output_name - - -- If compression is needed, adjust the output name to exclude extensions like ".tar" - if archive_compress ~= "" then - output_name = output_name:match("(.*%.tar)") or output_name - end - - -- Create a temporary directory for intermediate files - local temp_dir_name = ".tmp_compress" - local temp_dir = combine_url(output_dir, temp_dir_name) - local temp_dir, _ = tostring(fs.unique_name(Url(temp_dir))) - - -- Attempt to create the temporary directory - local temp_dir_status, temp_dir_err = fs.create("dir_all", Url(temp_dir)) - if not temp_dir_status then - -- Notify the user if the temporary directory creation fails - notify_error(string.format("Failed to create temp directory, error code: %s", temp_dir_err), "error") - return - end - - -- Define the temporary output file path within the temporary directory - local temp_output_url = combine_url(temp_dir, output_name) - - -- Add files to the output archive - for filepath, filenames in pairs(path_fnames) do - -- Execute the archive command for each path and its respective files - local archive_status, archive_err = - Command(archive_cmd):arg(archive_args):arg(temp_output_url):arg(filenames):cwd(filepath):spawn():wait() - if not archive_status or not archive_status.success then - -- Notify the user if the archiving process fails and clean up the temporary directory - notify_error(string.format("Failed to create archive %s with '%s', error: %s", output_name, archive_cmd, archive_err), "error") - local cleanup_status, cleanup_err = fs.remove("dir_all", Url(temp_dir)) - if not cleanup_status then - notify_error(string.format("Failed to clean up temporary directory %s, error: %s", temp_dir, cleanup_err), "error") - end - return - end - end - - -- If compression is required, execute the compression command - if archive_compress ~= "" then - local compress_status, compress_err = - Command(archive_compress):arg(archive_compress_args):arg(temp_output_url):spawn():wait() - if not compress_status or not compress_status.success then - -- Notify the user if the compression process fails and clean up the temporary directory - notify_error(string.format("Failed to compress archive %s with '%s', error: %s", output_name, archive_compress, compress_err), "error") - local cleanup_status, cleanup_err = fs.remove("dir_all", Url(temp_dir)) - if not cleanup_status then - notify_error(string.format("Failed to clean up temporary directory %s, error: %s", temp_dir, cleanup_err), "error") - end - return - end - end - - -- Move the final file from the temporary directory to the output directory - local final_output_url, temp_url_processed = combine_url(output_dir, original_name), combine_url(temp_dir, original_name) - final_output_url, _ = tostring(fs.unique_name(Url(final_output_url))) - local move_status, move_err = os.rename(temp_url_processed, final_output_url) - if not move_status then - -- Notify the user if the move operation fails and clean up the temporary directory - notify_error(string.format("Failed to move %s to %s, error: %s", temp_url_processed, final_output_url, move_err), "error") - local cleanup_status, cleanup_err = fs.remove("dir_all", Url(temp_dir)) - if not cleanup_status then - notify_error(string.format("Failed to clean up temporary directory %s, error: %s", temp_dir, cleanup_err), "error") - end - return - end - - -- Cleanup the temporary directory after successful operation - local cleanup_status, cleanup_err = fs.remove("dir_all", Url(temp_dir)) - if not cleanup_status then - notify_error(string.format("Failed to clean up temporary directory %s, error: %s", temp_dir, cleanup_err), "error") - end - end -} diff --git a/fedora/.config/yazi/plugins/diff.yazi/README.md b/fedora/.config/yazi/plugins/diff.yazi/README.md deleted file mode 100644 index 1976541..0000000 --- a/fedora/.config/yazi/plugins/diff.yazi/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# diff.yazi - -Diff the selected file with the hovered file, create a living patch, and copy it to the clipboard. - -https://github.com/yazi-rs/plugins/assets/17523360/eff5e949-386a-44ea-82f9-4cb4a2c37aad - -## Installation - -```sh -ya pkg add yazi-rs/plugins:diff -``` - -## Usage - -Add this to your `~/.config/yazi/keymap.toml`: - -```toml -[[mgr.prepend_keymap]] -on = "" -run = "plugin diff" -desc = "Diff the selected with the hovered file" -``` - -Make sure the C + d key is not used elsewhere. - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/fedora/.config/yazi/plugins/diff.yazi/main.lua b/fedora/.config/yazi/plugins/diff.yazi/main.lua deleted file mode 100644 index 21dde6d..0000000 --- a/fedora/.config/yazi/plugins/diff.yazi/main.lua +++ /dev/null @@ -1,41 +0,0 @@ ---- @since 25.2.7 - -local function info(content) - return ya.notify { - title = "Diff", - content = content, - timeout = 5, - } -end - -local selected_url = ya.sync(function() - for _, u in pairs(cx.active.selected) do - return u - end -end) - -local hovered_url = ya.sync(function() - local h = cx.active.current.hovered - return h and h.url -end) - -return { - entry = function() - local a, b = selected_url(), hovered_url() - if not a then - return info("No file selected") - elseif not b then - return info("No file hovered") - end - - local output, err = Command("diff"):arg("-Naur"):arg(tostring(a)):arg(tostring(b)):output() - if not output then - return info("Failed to run diff, error: " .. err) - elseif output.stdout == "" then - return info("No differences found") - end - - ya.clipboard(output.stdout) - info("Diff copied to clipboard") - end, -} diff --git a/fedora/.config/yazi/plugins/folder-rules.yazi/main.lua b/fedora/.config/yazi/plugins/folder-rules.yazi/main.lua deleted file mode 100644 index 556f610..0000000 --- a/fedora/.config/yazi/plugins/folder-rules.yazi/main.lua +++ /dev/null @@ -1,12 +0,0 @@ -local function setup() - ps.sub("cd", function() - local cwd = cx.active.current.cwd - if cwd:ends_with("Downloads") then - ya.emit("sort", { "mtime", reverse = true, dir_first = false }) - else - ya.emit("sort", { "alphabetical", reverse = false, dir_first = true }) - end - end) -end - -return { setup = setup } diff --git a/fedora/.config/yazi/plugins/full-border.yazi/README.md b/fedora/.config/yazi/plugins/full-border.yazi/README.md deleted file mode 100644 index 269ca8e..0000000 --- a/fedora/.config/yazi/plugins/full-border.yazi/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# full-border.yazi - -Add a full border to Yazi to make it look fancier. - -![full-border](https://github.com/yazi-rs/plugins/assets/17523360/ef81b560-2465-4d36-abf2-5d21dcb7b987) - -## Installation - -```sh -ya pkg add yazi-rs/plugins:full-border -``` - -## Usage - -Add this to your `init.lua` to enable the plugin: - -```lua -require("full-border"):setup() -``` - -Or you can customize the border type: - -```lua -require("full-border"):setup { - -- Available values: ui.Border.PLAIN, ui.Border.ROUNDED - type = ui.Border.ROUNDED, -} -``` - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/fedora/.config/yazi/plugins/full-border.yazi/main.lua b/fedora/.config/yazi/plugins/full-border.yazi/main.lua deleted file mode 100644 index a917e1e..0000000 --- a/fedora/.config/yazi/plugins/full-border.yazi/main.lua +++ /dev/null @@ -1,43 +0,0 @@ ---- @since 25.2.26 - -local function setup(_, opts) - local type = opts and opts.type or ui.Border.ROUNDED - local old_build = Tab.build - - Tab.build = function(self, ...) - local bar = function(c, x, y) - if x <= 0 or x == self._area.w - 1 or th.mgr.border_symbol ~= "โ”‚" then - return ui.Bar(ui.Edge.TOP) - end - - return ui.Bar(ui.Edge.TOP) - :area( - ui.Rect { x = x, y = math.max(0, y), w = ya.clamp(0, self._area.w - x, 1), h = math.min(1, self._area.h) } - ) - :symbol(c) - end - - local c = self._chunks - self._chunks = { - c[1]:pad(ui.Pad.y(1)), - c[2]:pad(ui.Pad(1, c[3].w > 0 and 0 or 1, 1, c[1].w > 0 and 0 or 1)), - c[3]:pad(ui.Pad.y(1)), - } - - local style = th.mgr.border_style - self._base = ya.list_merge(self._base or {}, { - ui.Border(ui.Edge.ALL):area(self._area):type(type):style(style), - ui.Bar(ui.Edge.RIGHT):area(self._chunks[1]):style(style), - ui.Bar(ui.Edge.LEFT):area(self._chunks[3]):style(style), - - bar("โ”ฌ", c[1].right - 1, c[1].y), - bar("โ”ด", c[1].right - 1, c[1].bottom - 1), - bar("โ”ฌ", c[2].right, c[2].y), - bar("โ”ด", c[2].right, c[2].bottom - 1), - }) - - old_build(self, ...) - end -end - -return { setup = setup } diff --git a/fedora/.config/yazi/plugins/git.yazi/README.md b/fedora/.config/yazi/plugins/git.yazi/README.md deleted file mode 100644 index 96a87a8..0000000 --- a/fedora/.config/yazi/plugins/git.yazi/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# git.yazi - -Show the status of Git file changes as linemode in the file list. - -https://github.com/user-attachments/assets/34976be9-a871-4ffe-9d5a-c4cdd0bf4576 - -## Installation - -```sh -ya pkg add yazi-rs/plugins:git -``` - -## Setup - -Add the following to your `~/.config/yazi/init.lua`: - -```lua -require("git"):setup() -``` - -And register it as fetchers in your `~/.config/yazi/yazi.toml`: - -```toml -[[plugin.prepend_fetchers]] -id = "git" -name = "*" -run = "git" - -[[plugin.prepend_fetchers]] -id = "git" -name = "*/" -run = "git" -``` - -## Advanced - -> [!NOTE] -> The following configuration must be put before `require("git"):setup()` - -You can customize the [Style](https://yazi-rs.github.io/docs/plugins/layout#style) of the status sign with: - -- `th.git.modified` -- `th.git.added` -- `th.git.untracked` -- `th.git.ignored` -- `th.git.deleted` -- `th.git.updated` - -For example: - -```lua --- ~/.config/yazi/init.lua -th.git = th.git or {} -th.git.modified = ui.Style():fg("blue") -th.git.deleted = ui.Style():fg("red"):bold() -``` - -You can also customize the text of the status sign with: - -- `th.git.modified_sign` -- `th.git.added_sign` -- `th.git.untracked_sign` -- `th.git.ignored_sign` -- `th.git.deleted_sign` -- `th.git.updated_sign` - -For example: - -```lua --- ~/.config/yazi/init.lua -th.git = th.git or {} -th.git.modified_sign = "M" -th.git.deleted_sign = "D" -``` - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/fedora/.config/yazi/plugins/git.yazi/main.lua b/fedora/.config/yazi/plugins/git.yazi/main.lua deleted file mode 100644 index e6b3a36..0000000 --- a/fedora/.config/yazi/plugins/git.yazi/main.lua +++ /dev/null @@ -1,261 +0,0 @@ ---- @since 25.5.31 - -local WINDOWS = ya.target_family() == "windows" - --- The code of supported git status, --- also used to determine which status to show for directories when they contain different statuses --- see `bubble_up` ----@enum CODES -local CODES = { - excluded = 100, -- ignored directory - ignored = 6, -- ignored file - untracked = 5, - modified = 4, - added = 3, - deleted = 2, - updated = 1, - unknown = 0, -} - -local PATTERNS = { - { "!$", CODES.ignored }, - { "?$", CODES.untracked }, - { "[MT]", CODES.modified }, - { "[AC]", CODES.added }, - { "D", CODES.deleted }, - { "U", CODES.updated }, - { "[AD][AD]", CODES.updated }, -} - ----@param line string ----@return CODES, string -local function match(line) - local signs = line:sub(1, 2) - for _, p in ipairs(PATTERNS) do - local path, pattern, code = nil, p[1], p[2] - if signs:find(pattern) then - path = line:sub(4, 4) == '"' and line:sub(5, -2) or line:sub(4) - path = WINDOWS and path:gsub("/", "\\") or path - end - if not path then - elseif path:find("[/\\]$") then - -- Mark the ignored directory as `excluded`, so we can process it further within `propagate_down` - return code == CODES.ignored and CODES.excluded or code, path:sub(1, -2) - else - return code, path - end - ---@diagnostic disable-next-line: missing-return - end -end - ----@param cwd Url ----@return string? -local function root(cwd) - local is_worktree = function(url) - local file, head = io.open(tostring(url)), nil - if file then - head = file:read(8) - file:close() - end - return head == "gitdir: " - end - - repeat - local next = cwd:join(".git") - local cha = fs.cha(next) - if cha and (cha.is_dir or is_worktree(next)) then - return tostring(cwd) - end - cwd = cwd.parent - until not cwd -end - ----@param changed Changes ----@return Changes -local function bubble_up(changed) - local new, empty = {}, Url("") - for path, code in pairs(changed) do - if code ~= CODES.ignored then - local url = Url(path).parent - while url and url ~= empty do - local s = tostring(url) - new[s] = (new[s] or CODES.unknown) > code and new[s] or code - url = url.parent - end - end - end - return new -end - ----@param excluded string[] ----@param cwd Url ----@param repo Url ----@return Changes -local function propagate_down(excluded, cwd, repo) - local new, rel = {}, cwd:strip_prefix(repo) - for _, path in ipairs(excluded) do - if rel:starts_with(path) then - -- If `cwd` is a subdirectory of an excluded directory, also mark it as `excluded` - new[tostring(cwd)] = CODES.excluded - elseif cwd == repo:join(path).parent then - -- If `path` is a direct subdirectory of `cwd`, mark it as `ignored` - new[path] = CODES.ignored - else - -- Skipping, we only care about `cwd` itself and its direct subdirectories for maximum performance - end - end - return new -end - ----@param cwd string ----@param repo string ----@param changed Changes -local add = ya.sync(function(st, cwd, repo, changed) - ---@cast st State - - st.dirs[cwd] = repo - st.repos[repo] = st.repos[repo] or {} - for path, code in pairs(changed) do - if code == CODES.unknown then - st.repos[repo][path] = nil - elseif code == CODES.excluded then - -- Mark the directory with a special value `excluded` so that it can be distinguished during UI rendering - st.dirs[path] = CODES.excluded - else - st.repos[repo][path] = code - end - end - -- TODO: remove this - if ui.render then - ui.render() - else - ya.render() - end -end) - ----@param cwd string -local remove = ya.sync(function(st, cwd) - ---@cast st State - - local repo = st.dirs[cwd] - if not repo then - return - end - - -- TODO: remove this - if ui.render then - ui.render() - else - ya.render() - end - st.dirs[cwd] = nil - if not st.repos[repo] then - return - end - - for _, r in pairs(st.dirs) do - if r == repo then - return - end - end - st.repos[repo] = nil -end) - ----@param st State ----@param opts Options -local function setup(st, opts) - st.dirs = {} - st.repos = {} - - opts = opts or {} - opts.order = opts.order or 1500 - - local t = th.git or {} - local styles = { - [CODES.ignored] = t.ignored and ui.Style(t.ignored) or ui.Style():fg("darkgray"), - [CODES.untracked] = t.untracked and ui.Style(t.untracked) or ui.Style():fg("magenta"), - [CODES.modified] = t.modified and ui.Style(t.modified) or ui.Style():fg("yellow"), - [CODES.added] = t.added and ui.Style(t.added) or ui.Style():fg("green"), - [CODES.deleted] = t.deleted and ui.Style(t.deleted) or ui.Style():fg("red"), - [CODES.updated] = t.updated and ui.Style(t.updated) or ui.Style():fg("yellow"), - } - local signs = { - [CODES.ignored] = t.ignored_sign or "๏‘ด", - [CODES.untracked] = t.untracked_sign or "?", - [CODES.modified] = t.modified_sign or "๏‘™", - [CODES.added] = t.added_sign or "๏‘—", - [CODES.deleted] = t.deleted_sign or "๏‘˜", - [CODES.updated] = t.updated_sign or "๏‘™", - } - - Linemode:children_add(function(self) - local url = self._file.url - local repo = st.dirs[tostring(url.base)] - local code - if repo then - code = repo == CODES.excluded and CODES.ignored or st.repos[repo][tostring(url):sub(#repo + 2)] - end - - if not code or signs[code] == "" then - return "" - elseif self._file.is_hovered then - return ui.Line { " ", signs[code] } - else - return ui.Line { " ", ui.Span(signs[code]):style(styles[code]) } - end - end, opts.order) -end - ----@type UnstableFetcher -local function fetch(_, job) - local cwd = job.files[1].url.base - local repo = root(cwd) - if not repo then - remove(tostring(cwd)) - return true - end - - local paths = {} - for _, file in ipairs(job.files) do - paths[#paths + 1] = tostring(file.url) - end - - -- stylua: ignore - local output, err = Command("git") - :cwd(tostring(cwd)) - :arg({ "--no-optional-locks", "-c", "core.quotePath=", "status", "--porcelain", "-unormal", "--no-renames", "--ignored=matching" }) - :arg(paths) - :stdout(Command.PIPED) - :output() - if not output then - return true, Err("Cannot spawn `git` command, error: %s", err) - end - - local changed, excluded = {}, {} - for line in output.stdout:gmatch("[^\r\n]+") do - local code, path = match(line) - if code == CODES.excluded then - excluded[#excluded + 1] = path - else - changed[path] = code - end - end - - if job.files[1].cha.is_dir then - ya.dict_merge(changed, bubble_up(changed)) - end - ya.dict_merge(changed, propagate_down(excluded, cwd, Url(repo))) - - -- Reset the status of any files that don't appear in the output of `git status` to `unknown`, - -- so that cleaning up outdated statuses from `st.repos` - for _, path in ipairs(paths) do - local s = path:sub(#repo + 2) - changed[s] = changed[s] or CODES.unknown - end - - add(tostring(cwd), repo, changed) - - return false -end - -return { setup = setup, fetch = fetch } diff --git a/fedora/.config/yazi/plugins/git.yazi/types.lua b/fedora/.config/yazi/plugins/git.yazi/types.lua deleted file mode 100644 index 9936849..0000000 --- a/fedora/.config/yazi/plugins/git.yazi/types.lua +++ /dev/null @@ -1,12 +0,0 @@ ----@class State ----@field dirs table Mapping between a directory and its corresponding repository ----@field repos table Mapping between a repository and the status of each of its files - ----@class Options ----@field order number The order in which the status is displayed ----@field renamed boolean Whether to include renamed files in the status (or treat them as modified) - --- TODO: move this to `types.yazi` once it's get stable ----@alias UnstableFetcher fun(self: unknown, job: { files: File[] }): boolean, Error? - ----@alias Changes table diff --git a/fedora/.config/yazi/plugins/jump-to-char.yazi/README.md b/fedora/.config/yazi/plugins/jump-to-char.yazi/README.md deleted file mode 100644 index d24f2e7..0000000 --- a/fedora/.config/yazi/plugins/jump-to-char.yazi/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# jump-to-char.yazi - -Vim-like `f`, jump to the next file whose name starts with ``. - -https://github.com/yazi-rs/plugins/assets/17523360/aac9341c-b416-4e0c-aaba-889d48389869 - -## Installation - -```sh -ya pkg add yazi-rs/plugins:jump-to-char -``` - -## Usage - -Add this to your `~/.config/yazi/keymap.toml`: - -```toml -[[mgr.prepend_keymap]] -on = "f" -run = "plugin jump-to-char" -desc = "Jump to char" -``` - -Make sure the f key is not used elsewhere. - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/fedora/.config/yazi/plugins/jump-to-char.yazi/main.lua b/fedora/.config/yazi/plugins/jump-to-char.yazi/main.lua deleted file mode 100644 index 8a434f1..0000000 --- a/fedora/.config/yazi/plugins/jump-to-char.yazi/main.lua +++ /dev/null @@ -1,32 +0,0 @@ ---- @since 25.5.31 - -local AVAILABLE_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789." - -local changed = ya.sync(function(st, new) - local b = st.last ~= new - st.last = new - return b or not cx.active.finder -end) - -local escape = function(s) return s == "." and "\\." or s end - -return { - entry = function() - local cands = {} - for i = 1, #AVAILABLE_CHARS do - cands[#cands + 1] = { on = AVAILABLE_CHARS:sub(i, i) } - end - - local idx = ya.which { cands = cands, silent = true } - if not idx then - return - end - - local kw = escape(cands[idx].on) - if changed(kw) then - ya.emit("find_do", { "^" .. kw }) - else - ya.emit("find_arrow", {}) - end - end, -} diff --git a/fedora/.config/yazi/plugins/lsar.yazi/README.md b/fedora/.config/yazi/plugins/lsar.yazi/README.md deleted file mode 100644 index e944442..0000000 --- a/fedora/.config/yazi/plugins/lsar.yazi/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# lsar.yazi - -Previewing archive contents with `lsar`, which is something you might not want to use anyway. - -It was the default archive previewer before Yazi v0.3, and after then, it was replaced with a faster and more efficient `7zip` previewer. - -This plugin is here just in case you're still interested in the old behavior, -but we strongly discourage using it unless you encounter some issues with `7zip` when previewing CJK characters - `lsar` usually does a better job recognizing these characters. - -## Installation - -```sh -ya pkg add yazi-rs/plugins:lsar -``` - -## Usage - -Add this to your `~/.config/yazi/yazi.toml`: - -```toml -[[plugin.prepend_previewers]] -mime = "application/{,g}zip" -run = "lsar" - -[[plugin.prepend_previewers]] -mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}" -run = "lsar" -``` - -Make sure you have `unar` installed, and have `lsar` in your `$PATH`. You can install it with: - -```sh -# Arch Linux -sudo pacman -S unarchiver -# macOS -brew install unar -# Windows -scoop install unar -``` - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/fedora/.config/yazi/plugins/lsar.yazi/main.lua b/fedora/.config/yazi/plugins/lsar.yazi/main.lua deleted file mode 100644 index 69bc480..0000000 --- a/fedora/.config/yazi/plugins/lsar.yazi/main.lua +++ /dev/null @@ -1,43 +0,0 @@ ---- @since 25.5.31 - -local M = {} - -function M:peek(job) - local child, err = Command("lsar"):arg(tostring(job.file.url)):stdout(Command.PIPED):spawn() - if not child then - return ya.err("spawn `lsar` command failed: " .. err) - end - - -- Skip the first line which is the archive file itself - while true do - local _, event = child:read_line() - if event == 0 or event ~= 1 then - break - end - end - - local limit = job.area.h - local i, lines = 0, {} - repeat - local next, event = child:read_line() - if event ~= 0 then - break - end - - i = i + 1 - if i > job.skip then - lines[#lines + 1] = next - end - until i >= job.skip + limit - - child:start_kill() - if job.skip > 0 and i < job.skip + limit then - ya.emit("peek", { math.max(0, i - limit), only_if = job.file.url, upper_bound = true }) - else - ya.preview_widget(job, ui.Text(lines):area(job.area)) - end -end - -function M:seek(job) require("code"):seek(job) end - -return M diff --git a/fedora/.config/yazi/plugins/mactag.yazi/README.md b/fedora/.config/yazi/plugins/mactag.yazi/README.md deleted file mode 100644 index e5c060b..0000000 --- a/fedora/.config/yazi/plugins/mactag.yazi/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# mactag.yazi - -Bring macOS's awesome tagging feature to Yazi! The plugin it's only available for macOS just like the name says. - -Authors: [@AnirudhG07](https://github.com/AnirudhG07), and [@sxyazi](https://github.com/sxyazi) - -https://github.com/user-attachments/assets/7f26dc6d-67a5-4a85-a99e-4671ece9ae56 - -## Installation - -Install the plugin itself, and [jdberry/tag](https://github.com/jdberry/tag) used to tag files: - -```sh -ya pkg add yazi-rs/plugins:mactag -brew update && brew install tag -``` - -## Setup - -Add the following to your `~/.config/yazi/init.lua`: - -```lua -require("mactag"):setup { - -- Keys used to add or remove tags - keys = { - r = "Red", - o = "Orange", - y = "Yellow", - g = "Green", - b = "Blue", - p = "Purple", - }, - -- Colors used to display tags - colors = { - Red = "#ee7b70", - Orange = "#f5bd5c", - Yellow = "#fbe764", - Green = "#91fc87", - Blue = "#5fa3f8", - Purple = "#cb88f8", - }, -} -``` - -And register it as fetchers in your `~/.config/yazi/yazi.toml`: - -```toml -[[plugin.prepend_fetchers]] -id = "mactag" -name = "*" -run = "mactag" - -[[plugin.prepend_fetchers]] -id = "mactag" -name = "*/" -run = "mactag" -``` - -## Usage - -Besides displaying tags attached to files, you can also add or remove tags within Yazi using this plugin. - -Add following keybindings to your `~/.config/yazi/keymap.toml` to enable it: - -```toml -[[mgr.prepend_keymap]] -on = [ "b", "a" ] -run = "plugin mactag add" -desc = "Tag selected files" - -[[mgr.prepend_keymap]] -on = [ "b", "r" ] -run = "plugin mactag remove" -desc = "Untag selected files" -``` - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/fedora/.config/yazi/plugins/mactag.yazi/main.lua b/fedora/.config/yazi/plugins/mactag.yazi/main.lua deleted file mode 100644 index 309a46a..0000000 --- a/fedora/.config/yazi/plugins/mactag.yazi/main.lua +++ /dev/null @@ -1,105 +0,0 @@ ---- @since 25.5.31 - -local update = ya.sync(function(st, tags) - for path, tag in pairs(tags) do - st.tags[path] = #tag > 0 and tag or nil - end - -- TODO: remove this - if ui.render then - ui.render() - else - ya.render() - end -end) - -local selected_or_hovered = ya.sync(function() - local tab, urls = cx.active, {} - for _, u in pairs(tab.selected) do - urls[#urls + 1] = u - end - if #urls == 0 and tab.current.hovered then - urls[1] = tab.current.hovered.url - end - return urls -end) - -local function setup(st, opts) - st.tags = {} - st.keys = opts.keys - st.colors = opts.colors - - Linemode:children_add(function(self) - local url = tostring(self._file.url) - local spans = {} - for _, tag in ipairs(st.tags[url] or {}) do - if self._file.is_hovered then - spans[#spans + 1] = ui.Span(" โ—"):bg(st.colors[tag] or "reset") - else - spans[#spans + 1] = ui.Span(" โ—"):fg(st.colors[tag] or "reset") - end - end - return ui.Line(spans) - end, 500) -end - -local function fetch(_, job) - local paths = {} - for _, file in ipairs(job.files) do - paths[#paths + 1] = tostring(file.url) - end - - local output, err = Command("tag"):arg(paths):stdout(Command.PIPED):output() - if not output then - return true, Err("Cannot spawn `tag` command, error: %s", err) - end - - local i, tags = 1, {} - for line in output.stdout:gmatch("[^\r\n]+") do - if i > #paths then - break - end - tags[paths[i]] = tags[paths[i]] or {} - - local joint = line:match("\t(.+)$") or "" - for s in joint:gmatch("[^,]+") do - table.insert(tags[paths[i]], s) - end - i = i + 1 - end - - update(tags) - return true -end - -local cands = ya.sync(function(st) - local t = {} - for k, v in pairs(st.keys) do - t[#t + 1] = { on = k, desc = v } - end - return t -end) - -local function entry(self, job) - assert(job.args[1] == "add" or job.args[1] == "remove", "Invalid action") - ya.emit("escape", { visual = true }) - - local cands = cands() - local choice = ya.which { cands = cands } - if not choice then - return - end - - local t = { job.args[1] == "remove" and "-r" or "-a", cands[choice].desc } - local files = {} - for _, url in ipairs(selected_or_hovered()) do - t[#t + 1] = tostring(url) - files[#files + 1] = { url = url } - end - - local status = Command("tag"):arg(t):status() - if status.success then - fetch(self, { files = files }) - end -end - -return { setup = setup, fetch = fetch, entry = entry } diff --git a/fedora/.config/yazi/plugins/mime-ext.yazi/README.md b/fedora/.config/yazi/plugins/mime-ext.yazi/README.md deleted file mode 100644 index 3c2ee1f..0000000 --- a/fedora/.config/yazi/plugins/mime-ext.yazi/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# mime-ext.yazi - -A mime-type provider based on a file extension database, replacing the [builtin `file(1)`](https://github.com/sxyazi/yazi/blob/main/yazi-plugin/preset/plugins/mime.lua) to speed up mime-type retrieval at the expense of accuracy. - -See https://yazi-rs.github.io/docs/tips#make-yazi-even-faster for more information. - -## Installation - -```sh -ya pkg add yazi-rs/plugins:mime-ext -``` - -## Usage - -Add this to your `~/.config/yazi/yazi.toml`: - -```toml -[[plugin.prepend_fetchers]] -id = "mime" -name = "*" -run = "mime-ext" -prio = "high" -``` - -## Advanced - -You can also customize it in your `~/.config/yazi/init.lua` with: - -```lua -require("mime-ext"):setup { - -- Expand the existing filename database (lowercase), for example: - with_files = { - makefile = "text/makefile", - -- ... - }, - - -- Expand the existing extension database (lowercase), for example: - with_exts = { - mk = "text/makefile", - -- ... - }, - - -- If the mime-type is not in both filename and extension databases, - -- then fallback to Yazi's preset `mime` plugin, which uses `file(1)` - fallback_file1 = false, -} -``` - -## TODO - -- Add more file types (PRs welcome!). -- Compress mime-type tables. - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/fedora/.config/yazi/plugins/mime-ext.yazi/main.lua b/fedora/.config/yazi/plugins/mime-ext.yazi/main.lua deleted file mode 100644 index 06c0005..0000000 --- a/fedora/.config/yazi/plugins/mime-ext.yazi/main.lua +++ /dev/null @@ -1,1126 +0,0 @@ ---- @since 25.5.31 - -local FILES = { - [".envrc"] = "text/plain", - [".gitconfig"] = "text/plain", - [".gitignore"] = "text/plain", - [".luacheckrc"] = "text/lua", - [".npmrc"] = "text/plain", - [".styluaignore"] = "text/plain", - [".zshenv"] = "text/plain", - [".zshrc"] = "text/plain", - ["cargo.lock"] = "application/json", - ["flake.lock"] = "application/json", - license = "text/plain", -} - -local EXTS = { - ["123"] = "application/lotus-1-2-3", - ["3dml"] = "text/in3d.3dml", - ["3ds"] = "image/3ds", - ["3g2"] = "video/3gpp2", - ["3gp"] = "video/3gpp", - ["7z"] = "application/7z-compressed", - ["for"] = "text/fortran", - ["in"] = "text/plain", - ["n-gage"] = "application/nokia.n-gage.symbian.install", - ["sfd-hdstx"] = "application/hydrostatix.sof-data", - aab = "application/authorware-bin", - aac = "audio/aac", - aam = "application/authorware-map", - aas = "application/authorware-seg", - abw = "application/abiword", - ac = "application/pkix-attr-cert", - acc = "application/americandynamics.acc", - ace = "application/ace-compressed", - acu = "application/acucobol", - acutc = "application/acucorp", - adp = "audio/adpcm", - aep = "application/audiograph", - afm = "application/font-type1", - afp = "application/ibm.modcap", - ahead = "application/ahead.space", - ai = "application/postscript", - aif = "audio/aiff", - aifc = "audio/aiff", - aiff = "audio/aiff", - air = "application/adobe.air-application-installer-package+zip", - ait = "application/dvb.ait", - ami = "application/amiga.ami", - apk = "application/android.package-archive", - appcache = "text/cache-manifest", - application = "application/ms-application", - apr = "application/lotus-approach", - arc = "application/freearc", - asc = "application/pgp-signature", - asf = "video/ms-asf", - asm = "text/asm", - aso = "application/accpac.simply.aso", - ass = "text/ass", - asx = "video/ms-asf", - atc = "application/acucorp", - atom = "application/atom+xml", - atomcat = "application/atomcat+xml", - atomsvc = "application/atomsvc+xml", - atx = "application/antix.game-component", - au = "audio/basic", - avi = "video/msvideo", - avif = "image/avif", - aw = "application/applixware", - azf = "application/airzip.filesecure.azf", - azs = "application/airzip.filesecure.azs", - azw = "application/amazon.ebook", - bash = "text/shellscript", - bat = "application/msdownload", - bcpio = "application/bcpio", - bdf = "application/font-bdf", - bdm = "application/syncml.dm+wbxml", - bean = "text/plain", - beancount = "text/plain", - bed = "application/realvnc.bed", - bh2 = "application/fujitsu.oasysprs", - bin = "application/octet-stream", - blb = "application/blorb", - blorb = "application/blorb", - bmi = "application/bmi", - bmp = "image/bmp", - book = "application/framemaker", - box = "application/previewsystems.box", - boz = "application/bzip2", - bpk = "application/octet-stream", - btif = "image/prs.btif", - bz = "application/bzip", - bz2 = "application/bzip2", - c = "text/c", - c11amc = "application/cluetrust.cartomobile-config", - c11amz = "application/cluetrust.cartomobile-config-pkg", - c4d = "application/clonk.c4group", - c4f = "application/clonk.c4group", - c4g = "application/clonk.c4group", - c4p = "application/clonk.c4group", - c4u = "application/clonk.c4group", - cab = "application/ms-cab-compressed", - caf = "audio/caf", - cap = "application/tcpdump.pcap", - car = "application/curl.car", - cat = "application/ms-pki.seccat", - cb7 = "application/cbr", - cba = "application/cbr", - cbr = "application/cbr", - cbt = "application/cbr", - cbz = "application/cbr", - cc = "text/c", - cct = "application/director", - ccxml = "application/ccxml+xml", - cdbcmsg = "application/contact.cmsg", - cdf = "application/netcdf", - cdkey = "application/mediastation.cdkey", - cdmia = "application/cdmi-capability", - cdmic = "application/cdmi-container", - cdmid = "application/cdmi-domain", - cdmio = "application/cdmi-object", - cdmiq = "application/cdmi-queue", - cdx = "chemical/cdx", - cdxml = "application/chemdraw+xml", - cdy = "application/cinderella", - cer = "application/pkix-cert", - cfg = "text/plain", - cfs = "application/cfs-compressed", - cgm = "image/cgm", - chat = "application/chat", - chm = "application/ms-htmlhelp", - chrt = "application/kde.kchart", - cif = "chemical/cif", - cii = "application/anser-web-certificate-issue-initiation", - cil = "application/ms-artgalry", - cla = "application/claymore", - class = "application/java-vm", - clkk = "application/crick.clicker.keyboard", - clkp = "application/crick.clicker.palette", - clkt = "application/crick.clicker.template", - clkw = "application/crick.clicker.wordbank", - clkx = "application/crick.clicker", - clp = "application/msclip", - cmc = "application/cosmocaller", - cmdf = "chemical/cmdf", - cml = "chemical/cml", - cmp = "application/yellowriver-custom-menu", - cmx = "image/cmx", - cod = "application/rim.cod", - com = "application/msdownload", - conf = "text/plain", - cpio = "application/cpio", - cpp = "text/c", - cpt = "application/mac-compactpro", - crd = "application/mscardfile", - crl = "application/pkix-crl", - crt = "application/x509-ca-cert", - cryptonote = "application/rig.cryptonote", - csh = "application/csh", - csml = "chemical/csml", - csp = "application/commonspace", - css = "text/css", - cst = "application/director", - csv = "text/csv", - cu = "application/cu-seeme", - curl = "text/curl", - cww = "application/prs.cww", - cxt = "application/director", - cxx = "text/c", - dae = "model/collada+xml", - daf = "application/mobius.daf", - dart = "application/dart", - dataless = "application/fdsn.seed", - davmount = "application/davmount+xml", - dbk = "application/docbook+xml", - dcr = "application/director", - dcurl = "text/curl.dcurl", - dd2 = "application/oma.dd2+xml", - ddd = "application/fujixerox.ddd", - deb = "application/debian-package", - def = "text/plain", - deploy = "application/octet-stream", - der = "application/x509-ca-cert", - dfac = "application/dreamfactory", - dgc = "application/dgc-compressed", - dic = "text/c", - dir = "application/director", - dis = "application/mobius.dis", - dist = "application/octet-stream", - distz = "application/octet-stream", - djv = "image/djvu", - djvu = "image/djvu", - dll = "application/msdownload", - dmg = "application/apple-diskimage", - dmp = "application/tcpdump.pcap", - dms = "application/octet-stream", - dna = "application/dna", - doc = "application/msword", - docm = "application/ms-word.document.macroenabled.12", - docx = "application/openxmlformats-officedocument.wordprocessingml.document", - dot = "application/msword", - dotm = "application/ms-word.template.macroenabled.12", - dotx = "application/openxmlformats-officedocument.wordprocessingml.template", - dp = "application/osgi.dp", - dpg = "application/dpgraph", - dra = "audio/dra", - dsc = "text/prs.lines.tag", - dssc = "application/dssc+der", - dtb = "application/dtbook+xml", - dtd = "application/xml-dtd", - dts = "audio/dts", - dtshd = "audio/dts.hd", - dump = "application/octet-stream", - dvb = "video/dvb.file", - dvi = "application/dvi", - dwf = "model/dwf", - dwg = "image/dwg", - dxf = "image/dxf", - dxp = "application/spotfire.dxp", - dxr = "application/director", - ebuild = "application/gentoo.ebuild", - ecelp4800 = "audio/nuera.ecelp4800", - ecelp7470 = "audio/nuera.ecelp7470", - ecelp9600 = "audio/nuera.ecelp9600", - eclass = "application/gentoo.eclass", - ecma = "application/ecmascript", - edm = "application/novadigm.edm", - edx = "application/novadigm.edx", - efif = "application/picsel", - ei6 = "application/pg.osasli", - elc = "application/octet-stream", - emf = "application/msmetafile", - eml = "message/rfc822", - emma = "application/emma+xml", - emz = "application/msmetafile", - env = "text/plain", - eol = "audio/digital-winds", - eot = "application/ms-fontobject", - eps = "application/postscript", - epub = "application/epub+zip", - es3 = "application/eszigno3+xml", - esa = "application/osgi.subsystem", - esf = "application/epson.esf", - et3 = "application/eszigno3+xml", - etx = "text/setext", - eva = "application/eva", - evy = "application/envoy", - exe = "application/msdownload", - exi = "application/exi", - ext = "application/novadigm.ext", - ez = "application/andrew-inset", - ez2 = "application/ezpix-album", - ez3 = "application/ezpix-package", - f = "text/fortran", - f4v = "video/f4v", - f77 = "text/fortran", - f90 = "text/fortran", - fbs = "image/fastbidsheet", - fcdt = "application/adobe.formscentral.fcdt", - fcs = "application/isac.fcs", - fdf = "application/fdf", - fe_launch = "application/denovo.fcselayout-link", - fg5 = "application/fujitsu.oasysgp", - fgd = "application/director", - fh = "image/freehand", - fh4 = "image/freehand", - fh5 = "image/freehand", - fh7 = "image/freehand", - fhc = "image/freehand", - fig = "application/xfig", - fish = "text/shellscript", - flac = "audio/flac", - fli = "video/fli", - flo = "application/micrografx.flo", - flv = "video/flv", - flw = "application/kde.kivio", - flx = "text/fmi.flexstor", - fly = "text/fly", - fm = "application/framemaker", - fnc = "application/frogans.fnc", - fpx = "image/fpx", - frame = "application/framemaker", - fsc = "application/fsc.weblaunch", - fst = "image/fst", - ftc = "application/fluxtime.clip", - fti = "application/anser-web-funds-transfer-initiation", - fvt = "video/fvt", - fxp = "application/adobe.fxp", - fxpl = "application/adobe.fxp", - fzs = "application/fuzzysheet", - g2w = "application/geoplan", - g3 = "image/g3fax", - g3w = "application/geospace", - gac = "application/groove-account", - gam = "application/tads", - gbr = "application/rpki-ghostbusters", - gca = "application/gca-compressed", - gdl = "model/gdl", - geo = "application/dynageo", - gex = "application/geometry-explorer", - ggb = "application/geogebra.file", - ggs = "application/geogebra.slides", - ggt = "application/geogebra.tool", - ghf = "application/groove-help", - gif = "image/gif", - gim = "application/groove-identity-message", - gml = "application/gml+xml", - gmx = "application/gmx", - gnumeric = "application/gnumeric", - go = "text/go", - gph = "application/flographit", - gpx = "application/gpx+xml", - gqf = "application/grafeq", - gqs = "application/grafeq", - gram = "application/srgs", - gramps = "application/gramps-xml", - gre = "application/geometry-explorer", - grv = "application/groove-injector", - grxml = "application/srgs+xml", - gsf = "application/font-ghostscript", - gtar = "application/gtar", - gtm = "application/groove-tool-message", - gtw = "model/gtw", - gv = "text/graphviz", - gxf = "application/gxf", - gxt = "application/geonext", - h = "text/c", - h261 = "video/h261", - h263 = "video/h263", - h264 = "video/h264", - hal = "application/hal+xml", - hbci = "application/hbci", - hcl = "text/hcl", - hdf = "application/hdf", - hh = "text/c", - hlp = "application/winhlp", - hpgl = "application/hp-hpgl", - hpid = "application/hp-hpid", - hpp = "text/c", - hps = "application/hp-hps", - hqx = "application/mac-binhex40", - htke = "application/kenameaapp", - htm = "text/html", - html = "text/html", - hvd = "application/yamaha.hv-dic", - hvp = "application/yamaha.hv-voice", - hvs = "application/yamaha.hv-script", - i2g = "application/intergeo", - icc = "application/iccprofile", - ice = "conference/cooltalk", - icm = "application/iccprofile", - ico = "image/icon", - ics = "text/calendar", - ief = "image/ief", - ifb = "text/calendar", - ifm = "application/shana.informed.formdata", - iges = "model/iges", - igl = "application/igloader", - igm = "application/insors.igm", - igs = "model/iges", - igx = "application/micrografx.igx", - iif = "application/shana.informed.interchange", - imp = "application/accpac.simply.imp", - ims = "application/ms-ims", - ini = "text/plain", - ink = "application/inkml+xml", - inkml = "application/inkml+xml", - install = "application/install-instructions", - iota = "application/astraea-software.iota", - ipfix = "application/ipfix", - ipk = "application/shana.informed.package", - irm = "application/ibm.rights-management", - irp = "application/irepository.package+xml", - iso = "application/iso9660-image", - itp = "application/shana.informed.formtemplate", - ivp = "application/immervision-ivp", - ivu = "application/immervision-ivu", - jad = "text/sun.j2me.app-descriptor", - jam = "application/jam", - jar = "application/java-archive", - java = "text/java-source", - jisp = "application/jisp", - jlt = "application/hp-jlyt", - jnlp = "application/java-jnlp-file", - joda = "application/joost.joda-archive", - jpe = "image/jpeg", - jpeg = "image/jpeg", - jpg = "image/jpeg", - jpgm = "video/jpm", - jpgv = "video/jpeg", - jpm = "video/jpm", - js = "text/javascript", - json = "application/json", - jsonc = "application/json", - jsonml = "application/jsonml+json", - jsx = "text/jsx", - jxl = "image/jxl", - kar = "audio/midi", - karbon = "application/kde.karbon", - kfo = "application/kde.kformula", - kia = "application/kidspiration", - kml = "application/google-earth.kml+xml", - kmz = "application/google-earth.kmz", - kne = "application/kinar", - knp = "application/kinar", - kon = "application/kde.kontour", - kpr = "application/kde.kpresenter", - kpt = "application/kde.kpresenter", - kpxx = "application/ds-keypoint", - ksp = "application/kde.kspread", - ktr = "application/kahootz", - ktx = "image/ktx", - ktz = "application/kahootz", - kwd = "application/kde.kword", - kwt = "application/kde.kword", - lasxml = "application/las.las+xml", - latex = "application/latex", - lbd = "application/llamagraphics.life-balance.desktop", - lbe = "application/llamagraphics.life-balance.exchange+xml", - les = "application/hhe.lesson-player", - lha = "application/lzh-compressed", - link66 = "application/route66.link66+xml", - list = "text/plain", - list3820 = "application/ibm.modcap", - listafp = "application/ibm.modcap", - lnk = "application/ms-shortcut", - log = "text/plain", - lostxml = "application/lost+xml", - lrf = "application/octet-stream", - lrm = "application/ms-lrm", - ltf = "application/frogans.ltf", - lua = "text/lua", - lvp = "audio/lucent.voice", - lwp = "application/lotus-wordpro", - lzh = "application/lzh-compressed", - m13 = "application/msmediaview", - m14 = "application/msmediaview", - m1v = "video/mpeg", - m21 = "application/mp21", - m2a = "audio/mpeg", - m2t = "video/mp2t", - m2ts = "video/mp2t", - m2v = "video/mpeg", - m3a = "audio/mpeg", - m3u = "audio/mpegurl", - m3u8 = "application/apple.mpegurl", - m4a = "audio/mp4", - m4u = "video/mpegurl", - m4v = "video/m4v", - ma = "application/mathematica", - mads = "application/mads+xml", - mag = "application/ecowin.chart", - maker = "application/framemaker", - man = "text/troff", - mar = "application/octet-stream", - mathml = "application/mathml+xml", - mb = "application/mathematica", - mbk = "application/mobius.mbk", - mbox = "application/mbox", - mc1 = "application/medcalcdata", - mcd = "application/mcd", - mcurl = "text/curl.mcurl", - md = "text/markdown", - mdb = "application/msaccess", - mdi = "image/ms-modi", - me = "text/troff", - mesh = "model/mesh", - meta4 = "application/metalink4+xml", - metalink = "application/metalink+xml", - mets = "application/mets+xml", - mfm = "application/mfmp", - mft = "application/rpki-manifest", - mgp = "application/osgeo.mapguide.package", - mgz = "application/proteus.magazine", - mid = "audio/midi", - midi = "audio/midi", - mie = "application/mie", - mif = "application/mif", - mime = "message/rfc822", - mj2 = "video/mj2", - mjp2 = "video/mj2", - mjs = "text/javascript", - mk3d = "video/matroska", - mka = "audio/matroska", - mks = "video/matroska", - mkv = "video/matroska", - mlp = "application/dolby.mlp", - mmd = "application/chipnuts.karaoke-mmd", - mmf = "application/smaf", - mmr = "image/fujixerox.edmics-mmr", - mng = "video/mng", - mny = "application/msmoney", - mobi = "application/mobipocket-ebook", - mods = "application/mods+xml", - mov = "video/quicktime", - movie = "video/sgi-movie", - mp2 = "audio/mpeg", - mp21 = "application/mp21", - mp2a = "audio/mpeg", - mp3 = "audio/mpeg", - mp4 = "video/mp4", - mp4a = "audio/mp4", - mp4s = "application/mp4", - mp4v = "video/mp4", - mpc = "application/mophun.certificate", - mpe = "video/mpeg", - mpeg = "video/mpeg", - mpg = "video/mpeg", - mpg4 = "video/mp4", - mpga = "audio/mpeg", - mpkg = "application/apple.installer+xml", - mpm = "application/blueice.multipass", - mpn = "application/mophun.application", - mpp = "application/ms-project", - mpt = "application/ms-project", - mpy = "application/ibm.minipay", - mqy = "application/mobius.mqy", - mrc = "application/marc", - mrcx = "application/marcxml+xml", - ms = "text/troff", - mscml = "application/mediaservercontrol+xml", - mseed = "application/fdsn.mseed", - mseq = "application/mseq", - msf = "application/epson.msf", - msh = "model/mesh", - msi = "application/msdownload", - msl = "application/mobius.msl", - msty = "application/muvee.style", - mts = "video/mp2t", - mus = "application/musician", - musicxml = "application/recordare.musicxml+xml", - mvb = "application/msmediaview", - mwf = "application/mfer", - mxf = "application/mxf", - mxl = "application/recordare.musicxml", - mxml = "application/xv+xml", - mxs = "application/triscape.mxs", - mxu = "video/mpegurl", - n3 = "text/n3", - nb = "application/mathematica", - nbp = "application/wolfram.player", - nc = "application/netcdf", - ncx = "application/dtbncx+xml", - nfo = "text/nfo", - ngdat = "application/nokia.n-gage.data", - nitf = "application/nitf", - nix = "text/nix", - nlu = "application/neurolanguage.nlu", - nml = "application/enliven", - nnd = "application/noblenet-directory", - nns = "application/noblenet-sealer", - nnw = "application/noblenet-web", - npx = "image/net-fpx", - nsc = "application/conference", - nsf = "application/lotus-notes", - ntf = "application/nitf", - nzb = "application/nzb", - oa2 = "application/fujitsu.oasys2", - oa3 = "application/fujitsu.oasys3", - oas = "application/fujitsu.oasys", - obd = "application/msbinder", - obj = "application/tgif", - oda = "application/oda", - odb = "application/oasis.opendocument.database", - odc = "application/oasis.opendocument.chart", - odf = "application/oasis.opendocument.formula", - odft = "application/oasis.opendocument.formula-template", - odg = "application/oasis.opendocument.graphics", - odi = "application/oasis.opendocument.image", - odm = "application/oasis.opendocument.text-master", - odp = "application/oasis.opendocument.presentation", - ods = "application/oasis.opendocument.spreadsheet", - odt = "application/oasis.opendocument.text", - oga = "audio/ogg", - ogg = "audio/ogg", - ogv = "video/ogg", - ogx = "application/ogg", - omdoc = "application/omdoc+xml", - onepkg = "application/onenote", - onetmp = "application/onenote", - onetoc = "application/onenote", - onetoc2 = "application/onenote", - opf = "application/oebps-package+xml", - opml = "text/opml", - oprc = "application/palm", - opus = "audio/ogg", - org = "application/lotus-organizer", - osf = "application/yamaha.openscoreformat", - osfpvg = "application/yamaha.openscoreformat.osfpvg+xml", - otc = "application/oasis.opendocument.chart-template", - otf = "font/otf", - otg = "application/oasis.opendocument.graphics-template", - oth = "application/oasis.opendocument.text-web", - oti = "application/oasis.opendocument.image-template", - otp = "application/oasis.opendocument.presentation-template", - ots = "application/oasis.opendocument.spreadsheet-template", - ott = "application/oasis.opendocument.text-template", - oxps = "application/oxps", - oxt = "application/openofficeorg.extension", - p = "text/pascal", - p10 = "application/pkcs10", - p12 = "application/pkcs12", - p7b = "application/pkcs7-certificates", - p7c = "application/pkcs7-mime", - p7m = "application/pkcs7-mime", - p7r = "application/pkcs7-certreqresp", - p7s = "application/pkcs7-signature", - p8 = "application/pkcs8", - pas = "text/pascal", - patch = "text/diff", - paw = "application/pawaafile", - pbd = "application/powerbuilder6", - pbm = "image/portable-bitmap", - pcap = "application/tcpdump.pcap", - pcf = "application/font-pcf", - pcl = "application/hp-pcl", - pclxl = "application/hp-pclxl", - pct = "image/pict", - pcurl = "application/curl.pcurl", - pcx = "image/pcx", - pdb = "application/palm", - pdf = "application/pdf", - pfa = "application/font-type1", - pfb = "application/font-type1", - pfm = "application/font-type1", - pfr = "application/font-tdpfr", - pfx = "application/pkcs12", - pgm = "image/portable-graymap", - pgn = "application/chess-pgn", - pgp = "application/pgp-encrypted", - php = "text/php", - pic = "image/pict", - pkg = "application/octet-stream", - pki = "application/pkixcmp", - pkipath = "application/pkix-pkipath", - plb = "application/3gpp.pic-bw-large", - plc = "application/mobius.plc", - plf = "application/pocketlearn", - pls = "application/pls+xml", - pml = "application/ctc-posml", - png = "image/png", - pnm = "image/portable-anymap", - portpkg = "application/macports.portpkg", - pot = "application/ms-powerpoint", - potm = "application/ms-powerpoint.template.macroenabled.12", - potx = "application/openxmlformats-officedocument.presentationml.template", - ppam = "application/ms-powerpoint.addin.macroenabled.12", - ppd = "application/cups-ppd", - ppm = "image/portable-pixmap", - pps = "application/ms-powerpoint", - ppsm = "application/ms-powerpoint.slideshow.macroenabled.12", - ppsx = "application/openxmlformats-officedocument.presentationml.slideshow", - ppt = "application/ms-powerpoint", - pptm = "application/ms-powerpoint.presentation.macroenabled.12", - pptx = "application/openxmlformats-officedocument.presentationml.presentation", - pqa = "application/palm", - prc = "application/mobipocket-ebook", - pre = "application/lotus-freelance", - prf = "application/pics-rules", - ps = "application/postscript", - psb = "application/3gpp.pic-bw-small", - psd = "image/adobe.photoshop", - psf = "application/font-linux-psf", - pskcxml = "application/pskc+xml", - ptid = "application/pvi.ptid1", - pub = "application/mspublisher", - pvb = "application/3gpp.pic-bw-var", - pwn = "application/3m.post-it-notes", - py = "text/python", - pya = "audio/ms-playready.media.pya", - pyv = "video/ms-playready.media.pyv", - qam = "application/epson.quickanime", - qbo = "application/intu.qbo", - qfx = "application/intu.qfx", - qml = "text/qml", - qps = "application/publishare-delta-tree", - qt = "video/quicktime", - qwd = "application/quark.quarkxpress", - qwt = "application/quark.quarkxpress", - qxb = "application/quark.quarkxpress", - qxd = "application/quark.quarkxpress", - qxl = "application/quark.quarkxpress", - qxt = "application/quark.quarkxpress", - r = "text/r", - ra = "audio/pn-realaudio", - ram = "audio/pn-realaudio", - rar = "application/rar", - ras = "image/cmu-raster", - rb = "text/ruby", - rcprofile = "application/ipunplugged.rcprofile", - rdf = "application/rdf+xml", - rdz = "application/data-vision.rdz", - rep = "application/businessobjects", - res = "application/dtbresource+xml", - rgb = "image/rgb", - rif = "application/reginfo+xml", - rip = "audio/rip", - ris = "application/research-info-systems", - rl = "application/resource-lists+xml", - rlc = "image/fujixerox.edmics-rlc", - rld = "application/resource-lists-diff+xml", - rm = "application/rn-realmedia", - rmi = "audio/midi", - rmp = "audio/pn-realaudio-plugin", - rms = "application/jcp.javame.midlet-rms", - rmvb = "application/rn-realmedia-vbr", - rnc = "application/relax-ng-compact-syntax", - roa = "application/rpki-roa", - roff = "text/troff", - rp9 = "application/cloanto.rp9", - rpm = "application/rpm", - rpss = "application/nokia.radio-presets", - rpst = "application/nokia.radio-preset", - rq = "application/sparql-query", - rs = "text/rust", - rsd = "application/rsd+xml", - rss = "application/rss+xml", - rtf = "application/rtf", - rtx = "text/richtext", - s = "text/asm", - s3m = "audio/s3m", - saf = "application/yamaha.smaf-audio", - sbml = "application/sbml+xml", - sc = "application/ibm.secure-container", - scd = "application/msschedule", - scm = "application/lotus-screencam", - scq = "application/scvp-cv-request", - scs = "application/scvp-cv-response", - scss = "text/scss", - scurl = "text/curl.scurl", - sda = "application/stardivision.draw", - sdc = "application/stardivision.calc", - sdd = "application/stardivision.impress", - sdkd = "application/solent.sdkm+xml", - sdkm = "application/solent.sdkm+xml", - sdp = "application/sdp", - sdw = "application/stardivision.writer", - see = "application/seemail", - seed = "application/fdsn.seed", - sema = "application/sema", - semd = "application/semd", - semf = "application/semf", - ser = "application/java-serialized-object", - setpay = "application/set-payment-initiation", - setreg = "application/set-registration-initiation", - sfs = "application/spotfire.sfs", - sfv = "text/sfv", - sgi = "image/sgi", - sgl = "application/stardivision.writer-global", - sgm = "text/sgml", - sgml = "text/sgml", - sh = "text/shellscript", - shar = "application/shar", - shf = "application/shf+xml", - sid = "image/mrsid-image", - sig = "application/pgp-signature", - sil = "audio/silk", - silo = "model/mesh", - sis = "application/symbian.install", - sisx = "application/symbian.install", - sit = "application/stuffit", - sitx = "application/stuffitx", - skd = "application/koan", - skm = "application/koan", - skp = "application/koan", - skt = "application/koan", - sldm = "application/ms-powerpoint.slide.macroenabled.12", - sldx = "application/openxmlformats-officedocument.presentationml.slide", - slt = "application/epson.salt", - sm = "application/stepmania.stepchart", - smf = "application/stardivision.math", - smi = "application/smil+xml", - smil = "application/smil+xml", - smv = "video/smv", - smzip = "application/stepmania.package", - snd = "audio/basic", - snf = "application/font-snf", - so = "application/octet-stream", - spc = "application/pkcs7-certificates", - spf = "application/yamaha.smaf-phrase", - spl = "application/futuresplash", - spot = "text/in3d.spot", - spp = "application/scvp-vp-response", - spq = "application/scvp-vp-request", - spx = "audio/ogg", - sql = "application/sql", - src = "application/wais-source", - srt = "application/subrip", - sru = "application/sru+xml", - srx = "application/sparql-results+xml", - ssdl = "application/ssdl+xml", - sse = "application/kodak-descriptor", - ssf = "application/epson.ssf", - ssml = "application/ssml+xml", - st = "application/sailingtracker.track", - stc = "application/sun.xml.calc.template", - std = "application/sun.xml.draw.template", - stf = "application/wt.stf", - sti = "application/sun.xml.impress.template", - stk = "application/hyperstudio", - stl = "application/ms-pki.stl", - str = "application/pg.format", - stw = "application/sun.xml.writer.template", - sub = "text/dvb.subtitle", - sus = "application/sus-calendar", - susp = "application/sus-calendar", - sv4cpio = "application/sv4cpio", - sv4crc = "application/sv4crc", - svc = "application/dvb.service", - svd = "application/svd", - svg = "image/svg+xml", - svgz = "image/svg+xml", - swa = "application/director", - swf = "application/shockwave-flash", - swi = "application/aristanetworks.swi", - sxc = "application/sun.xml.calc", - sxd = "application/sun.xml.draw", - sxg = "application/sun.xml.writer.global", - sxi = "application/sun.xml.impress", - sxm = "application/sun.xml.math", - sxw = "application/sun.xml.writer", - t = "text/troff", - t3 = "application/t3vm-image", - taglet = "application/mynfc", - tao = "application/tao.intent-module-archive", - tar = "application/tar", - tcap = "application/3gpp2.tcap", - tcl = "application/tcl", - teacher = "application/smart.teacher", - tei = "application/tei+xml", - teicorpus = "application/tei+xml", - tex = "application/tex", - texi = "application/texinfo", - texinfo = "application/texinfo", - text = "text/plain", - tf = "text/hcl", - tfi = "application/thraud+xml", - tfm = "application/tex-tfm", - tfrc = "text/hcl", - tfstate = "application/json", - tfvars = "text/hcl", - tga = "image/tga", - thmx = "application/ms-officetheme", - tif = "image/tiff", - tiff = "image/tiff", - tmo = "application/tmobile-livetv", - toml = "text/toml", - torrent = "application/bittorrent", - tpl = "application/groove-tool-template", - tpt = "application/trid.tpt", - tr = "text/troff", - tra = "application/trueapp", - trm = "application/msterminal", - ts = "text/typescript", - tsd = "application/timestamped-data", - tsv = "text/tab-separated-values", - tsx = "text/tsx", - ttc = "font/collection", - ttf = "font/ttf", - ttl = "text/turtle", - twd = "application/simtech-mindmapper", - twds = "application/simtech-mindmapper", - txd = "application/genomatix.tuxedo", - txf = "application/mobius.txf", - txt = "text/plain", - u32 = "application/authorware-bin", - udeb = "application/debian-package", - ufd = "application/ufdl", - ufdl = "application/ufdl", - ulx = "application/glulx", - umj = "application/umajin", - unityweb = "application/unity", - uoml = "application/uoml+xml", - uri = "text/uri-list", - uris = "text/uri-list", - urls = "text/uri-list", - ustar = "application/ustar", - utz = "application/uiq.theme", - uu = "text/uuencode", - uva = "audio/dece.audio", - uvd = "application/dece.data", - uvf = "application/dece.data", - uvg = "image/dece.graphic", - uvh = "video/dece.hd", - uvi = "image/dece.graphic", - uvm = "video/dece.mobile", - uvp = "video/dece.pd", - uvs = "video/dece.sd", - uvt = "application/dece.ttml+xml", - uvu = "video/uvvu.mp4", - uvv = "video/dece.video", - uvva = "audio/dece.audio", - uvvd = "application/dece.data", - uvvf = "application/dece.data", - uvvg = "image/dece.graphic", - uvvh = "video/dece.hd", - uvvi = "image/dece.graphic", - uvvm = "video/dece.mobile", - uvvp = "video/dece.pd", - uvvs = "video/dece.sd", - uvvt = "application/dece.ttml+xml", - uvvu = "video/uvvu.mp4", - uvvv = "video/dece.video", - uvvx = "application/dece.unspecified", - uvvz = "application/dece.zip", - uvx = "application/dece.unspecified", - uvz = "application/dece.zip", - vcard = "text/vcard", - vcd = "application/cdlink", - vcf = "text/vcard", - vcg = "application/groove-vcard", - vcs = "text/vcalendar", - vcx = "application/vcx", - vis = "application/visionary", - viv = "video/vivo", - vob = "video/ms-vob", - vor = "application/stardivision.writer", - vox = "application/authorware-bin", - vrml = "model/vrml", - vsd = "application/visio", - vsf = "application/vsf", - vss = "application/visio", - vst = "application/visio", - vsw = "application/visio", - vtu = "model/vtu", - vxml = "application/voicexml+xml", - w3d = "application/director", - wad = "application/doom", - wasm = "application/wasm", - wav = "audio/wav", - wax = "audio/ms-wax", - wbmp = "image/wap.wbmp", - wbs = "application/criticaltools.wbs+xml", - wbxml = "application/wap.wbxml", - wcm = "application/ms-works", - wdb = "application/ms-works", - wdp = "image/ms-photo", - weba = "audio/webm", - webm = "video/webm", - webp = "image/webp", - wg = "application/pmi.widget", - wgt = "application/widget", - wks = "application/ms-works", - wm = "video/ms-wm", - wma = "audio/ms-wma", - wmd = "application/ms-wmd", - wmf = "application/msmetafile", - wml = "text/wap.wml", - wmlc = "application/wap.wmlc", - wmls = "text/wap.wmlscript", - wmlsc = "application/wap.wmlscriptc", - wmv = "video/ms-wmv", - wmx = "video/ms-wmx", - wmz = "application/ms-wmz", - woff = "font/woff", - woff2 = "font/woff2", - wpd = "application/wordperfect", - wpl = "application/ms-wpl", - wps = "application/ms-works", - wqd = "application/wqd", - wri = "application/mswrite", - wrl = "model/vrml", - wsdl = "application/wsdl+xml", - wspolicy = "application/wspolicy+xml", - wtb = "application/webturbo", - wvx = "video/ms-wvx", - x32 = "application/authorware-bin", - x3d = "model/x3d+xml", - x3db = "model/x3d+binary", - x3dbz = "model/x3d+binary", - x3dv = "model/x3d+vrml", - x3dvz = "model/x3d+vrml", - x3dz = "model/x3d+xml", - xaml = "application/xaml+xml", - xap = "application/silverlight-app", - xar = "application/xara", - xbap = "application/ms-xbap", - xbd = "application/fujixerox.docuworks.binder", - xbm = "image/xbitmap", - xdf = "application/xcap-diff+xml", - xdm = "application/syncml.dm+xml", - xdp = "application/adobe.xdp+xml", - xdssc = "application/dssc+xml", - xdw = "application/fujixerox.docuworks", - xenc = "application/xenc+xml", - xer = "application/patch-ops-error+xml", - xfdf = "application/adobe.xfdf", - xfdl = "application/xfdl", - xht = "application/xhtml+xml", - xhtml = "application/xhtml+xml", - xhvml = "application/xv+xml", - xif = "image/xiff", - xla = "application/ms-excel", - xlam = "application/ms-excel.addin.macroenabled.12", - xlc = "application/ms-excel", - xlf = "application/xliff+xml", - xlm = "application/ms-excel", - xls = "application/ms-excel", - xlsb = "application/ms-excel.sheet.binary.macroenabled.12", - xlsm = "application/ms-excel.sheet.macroenabled.12", - xlsx = "application/openxmlformats-officedocument.spreadsheetml.sheet", - xlt = "application/ms-excel", - xltm = "application/ms-excel.template.macroenabled.12", - xltx = "application/openxmlformats-officedocument.spreadsheetml.template", - xlw = "application/ms-excel", - xm = "audio/xm", - xml = "application/xml", - xo = "application/olpc-sugar", - xop = "application/xop+xml", - xpak = "application/gentoo.xpak", - xpi = "application/xpinstall", - xpl = "application/xproc+xml", - xpm = "image/xpixmap", - xpr = "application/is-xpr", - xps = "application/ms-xpsdocument", - xpw = "application/intercon.formnet", - xpx = "application/intercon.formnet", - xsl = "application/xml", - xslt = "application/xslt+xml", - xsm = "application/syncml+xml", - xspf = "application/xspf+xml", - xul = "application/mozilla.xul+xml", - xvm = "application/xv+xml", - xvml = "application/xv+xml", - xwd = "image/xwindowdump", - xyz = "chemical/xyz", - xz = "application/xz", - yaml = "text/yaml", - yang = "application/yang", - yin = "application/yin+xml", - yml = "text/yaml", - z1 = "application/zmachine", - z2 = "application/zmachine", - z3 = "application/zmachine", - z4 = "application/zmachine", - z5 = "application/zmachine", - z6 = "application/zmachine", - z7 = "application/zmachine", - z8 = "application/zmachine", - zaz = "application/zzazz.deck+xml", - zip = "application/zip", - zir = "application/zul", - zirz = "application/zul", - zmm = "application/handheld-entertainment+xml", - zsh = "text/shellscript", -} - -local options = ya.sync( - function(st) - return { - with_files = st.with_files, - with_exts = st.with_exts, - fallback_file1 = st.fallback_file1, - } - end -) - -local M = {} - -function M:setup(opts) - opts = opts or {} - - self.with_files = opts.with_files - self.with_exts = opts.with_exts - self.fallback_file1 = opts.fallback_file1 -end - -function M:fetch(job) - local opts = options() - local merged_files = ya.dict_merge(FILES, opts.with_files or {}) - local merged_exts = ya.dict_merge(EXTS, opts.with_exts or {}) - - local updates, unknown, state = {}, {}, {} - for i, file in ipairs(job.files) do - if file.cha.is_dummy then - state[i] = false - goto continue - end - - local mime - if file.cha.len == 0 then - mime = "inode/empty" - else - mime = merged_files[(file.url.name or ""):lower()] - mime = mime or merged_exts[(file.url.ext or ""):lower()] - end - - if mime then - updates[tostring(file.url)], state[i] = mime, true - elseif opts.fallback_file1 then - unknown[#unknown + 1] = file - else - updates[tostring(file.url)], state[i] = "application/octet-stream", true - end - ::continue:: - end - - if next(updates) then - ya.emit("update_mimes", { updates = updates }) - end - - if #unknown > 0 then - return self.fallback_builtin(job, unknown, state) - end - - return state -end - -function M.fallback_builtin(job, unknown, state) - local indices = {} - for i, f in ipairs(job.files) do - indices[f:hash()] = i - end - - local result = require("mime"):fetch(ya.dict_merge(job, { files = unknown })) - for i, f in ipairs(unknown) do - if type(result) == "table" then - state[indices[f:hash()]] = result[i] - else - state[indices[f:hash()]] = result - end - end - return state -end - -return M diff --git a/fedora/.config/yazi/plugins/mount.yazi/README.md b/fedora/.config/yazi/plugins/mount.yazi/README.md deleted file mode 100644 index b35881f..0000000 --- a/fedora/.config/yazi/plugins/mount.yazi/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# mount.yazi - -A mount manager for Yazi, providing disk mount, unmount, and eject functionality. - -Supported platforms: - -- Linux with [`udisksctl`](https://github.com/storaged-project/udisks), `lsblk` and `eject` both provided by [`util-linux`](https://github.com/util-linux/util-linux) -- macOS with `diskutil`, which is pre-installed - -https://github.com/user-attachments/assets/c6f780ab-458b-420f-85cf-2fc45fcfe3a2 - -## Installation - -```sh -ya pkg add yazi-rs/plugins:mount -``` - -## Usage - -Add this to your `~/.config/yazi/keymap.toml`: - -```toml -[[mgr.prepend_keymap]] -on = "M" -run = "plugin mount" -``` - -Available keybindings: - -| Key binding | Alternate key | Action | -| ------------ | ------------- | --------------------- | -| q | - | Quit the plugin | -| k | โ†‘ | Move up | -| j | โ†“ | Move down | -| l | โ†’ | Enter the mount point | -| m | - | Mount the partition | -| u | - | Unmount the partition | -| e | - | Eject the disk | - -## TODO - -- Custom keybindings -- Windows support (I don't use Windows myself, PRs welcome!) -- Support mount, unmount, and eject the entire disk - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/fedora/.config/yazi/plugins/mount.yazi/main.lua b/fedora/.config/yazi/plugins/mount.yazi/main.lua deleted file mode 100644 index 31c2e28..0000000 --- a/fedora/.config/yazi/plugins/mount.yazi/main.lua +++ /dev/null @@ -1,304 +0,0 @@ ---- @since 25.5.31 - -local toggle_ui = ya.sync(function(self) - if self.children then - Modal:children_remove(self.children) - self.children = nil - else - self.children = Modal:children_add(self, 10) - end - -- TODO: remove this - if ui.render then - ui.render() - else - ya.render() - end -end) - -local subscribe = ya.sync(function(self) - ps.unsub("mount") - ps.sub("mount", function() ya.emit("plugin", { self._id, "refresh" }) end) -end) - -local update_partitions = ya.sync(function(self, partitions) - self.partitions = partitions - self.cursor = math.max(0, math.min(self.cursor or 0, #self.partitions - 1)) - -- TODO: remove this - if ui.render then - ui.render() - else - ya.render() - end -end) - -local active_partition = ya.sync(function(self) return self.partitions[self.cursor + 1] end) - -local update_cursor = ya.sync(function(self, cursor) - if #self.partitions == 0 then - self.cursor = 0 - else - self.cursor = ya.clamp(0, self.cursor + cursor, #self.partitions - 1) - end - -- TODO: remove this - if ui.render then - ui.render() - else - ya.render() - end -end) - -local M = { - keys = { - { on = "q", run = "quit" }, - - { on = "k", run = "up" }, - { on = "j", run = "down" }, - { on = "l", run = { "enter", "quit" } }, - - { on = "", run = "up" }, - { on = "", run = "down" }, - { on = "", run = { "enter", "quit" } }, - - { on = "m", run = "mount" }, - { on = "u", run = "unmount" }, - { on = "e", run = "eject" }, - }, -} - -function M:new(area) - self:layout(area) - return self -end - -function M:layout(area) - local chunks = ui.Layout() - :constraints({ - ui.Constraint.Percentage(10), - ui.Constraint.Percentage(80), - ui.Constraint.Percentage(10), - }) - :split(area) - - local chunks = ui.Layout() - :direction(ui.Layout.HORIZONTAL) - :constraints({ - ui.Constraint.Percentage(10), - ui.Constraint.Percentage(80), - ui.Constraint.Percentage(10), - }) - :split(chunks[2]) - - self._area = chunks[2] -end - -function M:entry(job) - if job.args[1] == "refresh" then - return update_partitions(self.obtain()) - end - - toggle_ui() - update_partitions(self.obtain()) - subscribe() - - local tx1, rx1 = ya.chan("mpsc") - local tx2, rx2 = ya.chan("mpsc") - function producer() - while true do - local cand = self.keys[ya.which { cands = self.keys, silent = true }] or { run = {} } - for _, r in ipairs(type(cand.run) == "table" and cand.run or { cand.run }) do - tx1:send(r) - if r == "quit" then - toggle_ui() - return - end - end - end - end - - function consumer1() - repeat - local run = rx1:recv() - if run == "quit" then - tx2:send(run) - break - elseif run == "up" then - update_cursor(-1) - elseif run == "down" then - update_cursor(1) - elseif run == "enter" then - local active = active_partition() - if active and active.dist then - ya.emit("cd", { active.dist }) - end - else - tx2:send(run) - end - until not run - end - - function consumer2() - repeat - local run = rx2:recv() - if run == "quit" then - break - elseif run == "mount" then - self.operate("mount") - elseif run == "unmount" then - self.operate("unmount") - elseif run == "eject" then - self.operate("eject") - end - until not run - end - - ya.join(producer, consumer1, consumer2) -end - -function M:reflow() return { self } end - -function M:redraw() - local rows = {} - for _, p in ipairs(self.partitions or {}) do - if not p.sub then - rows[#rows + 1] = ui.Row { p.main } - elseif p.sub == "" then - rows[#rows + 1] = ui.Row { p.main, p.label or "", p.dist or "", p.fstype or "" } - else - rows[#rows + 1] = ui.Row { " " .. p.sub, p.label or "", p.dist or "", p.fstype or "" } - end - end - - return { - ui.Clear(self._area), - ui.Border(ui.Edge.ALL) - :area(self._area) - :type(ui.Border.ROUNDED) - :style(ui.Style():fg("blue")) - :title(ui.Line("Mount"):align(ui.Align.CENTER)), - ui.Table(rows) - :area(self._area:pad(ui.Pad(1, 2, 1, 2))) - :header(ui.Row({ "Src", "Label", "Dist", "FSType" }):style(ui.Style():bold())) - :row(self.cursor) - :row_style(ui.Style():fg("blue"):underline()) - :widths { - ui.Constraint.Length(20), - ui.Constraint.Length(20), - ui.Constraint.Percentage(70), - ui.Constraint.Length(10), - }, - } -end - -function M.obtain() - local tbl = {} - local last - for _, p in ipairs(fs.partitions()) do - local main, sub = M.split(p.src) - if main and last ~= main then - if p.src == main then - last, p.main, p.sub, tbl[#tbl + 1] = p.src, p.src, "", p - else - last, tbl[#tbl + 1] = main, { src = main, main = main, sub = "" } - end - end - if sub then - if tbl[#tbl].sub == "" and tbl[#tbl].main == main then - tbl[#tbl].sub = nil - end - p.main, p.sub, tbl[#tbl + 1] = main, sub, p - end - end - table.sort(M.fillin(tbl), function(a, b) - if a.main == b.main then - return (a.sub or "") < (b.sub or "") - else - return a.main > b.main - end - end) - return tbl -end - -function M.split(src) - local pats = { - { "^/dev/sd[a-z]", "%d+$" }, -- /dev/sda1 - { "^/dev/nvme%d+n%d+", "p%d+$" }, -- /dev/nvme0n1p1 - { "^/dev/mmcblk%d+", "p%d+$" }, -- /dev/mmcblk0p1 - { "^/dev/disk%d+", ".+$" }, -- /dev/disk1s1 - { "^/dev/sr%d+", ".+$" }, -- /dev/sr0 - } - for _, p in ipairs(pats) do - local main = src:match(p[1]) - if main then - return main, src:sub(#main + 1):match(p[2]) - end - end -end - -function M.fillin(tbl) - if ya.target_os() ~= "linux" then - return tbl - end - - local sources, indices = {}, {} - for i, p in ipairs(tbl) do - if p.sub and not p.fstype then - sources[#sources + 1], indices[p.src] = p.src, i - end - end - if #sources == 0 then - return tbl - end - - local output, err = Command("lsblk"):arg({ "-p", "-o", "name,fstype", "-J" }):arg(sources):output() - if err then - ya.dbg("Failed to fetch filesystem types for unmounted partitions: " .. err) - return tbl - end - - local t = ya.json_decode(output and output.stdout or "") - for _, p in ipairs(t and t.blockdevices or {}) do - tbl[indices[p.name]].fstype = p.fstype - end - return tbl -end - -function M.operate(type) - local active = active_partition() - if not active then - return - elseif not active.sub then - return -- TODO: mount/unmount main disk - end - - local output, err - if ya.target_os() == "macos" then - output, err = Command("diskutil"):arg({ type, active.src }):output() - end - if ya.target_os() == "linux" then - if type == "eject" and active.src:match("^/dev/sr%d+") then - Command("udisksctl"):arg({ "unmount", "-b", active.src }):status() - output, err = Command("eject"):arg({ "--traytoggle", active.src }):output() - elseif type == "eject" then - Command("udisksctl"):arg({ "unmount", "-b", active.src }):status() - output, err = Command("udisksctl"):arg({ "power-off", "-b", active.src }):output() - else - output, err = Command("udisksctl"):arg({ type, "-b", active.src }):output() - end - end - - if not output then - M.fail("Failed to %s `%s`: %s", type, active.src, err) - elseif not output.status.success then - M.fail("Failed to %s `%s`: %s", type, active.src, output.stderr) - end -end - -function M.fail(...) ya.notify { title = "Mount", content = string.format(...), timeout = 10, level = "error" } end - -function M:click() end - -function M:scroll() end - -function M:touch() end - -return M diff --git a/fedora/.config/yazi/plugins/office.yazi/LICENSE b/fedora/.config/yazi/plugins/office.yazi/LICENSE deleted file mode 100644 index fb5b1d6..0000000 --- a/fedora/.config/yazi/plugins/office.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 yazi-rs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/fedora/.config/yazi/plugins/office.yazi/README.md b/fedora/.config/yazi/plugins/office.yazi/README.md deleted file mode 100644 index c6fdf37..0000000 --- a/fedora/.config/yazi/plugins/office.yazi/README.md +++ /dev/null @@ -1,76 +0,0 @@ -
- -# office.yazi -### A plugin to preview office documents in Yazi a duck - -preview test - -## - -
- -## Installation -> [!TIP] -> Installing this plugin with `ya` will conveniently clone the plugin from GitHub, -> copy it to your plugins directory, and update the `package.toml` to lock its version [^1]. -> -> To install it with `ya` run: -> ```sh -> ya pkg add macydnah/office -> ``` - -> Or if you prefer a manual approach: -> ```sh -> ## For linux and MacOS -> git clone https://github.com/macydnah/office.yazi.git ~/.config/yazi/plugins/office.yazi -> -> ## For Windows -> git clone https://github.com/macydnah/office.yazi.git %AppData%\yazi\config\plugins\office.yazi -> ``` - -## Usage -In your `yazi.toml` add rules to preloaders[^2] and previewers[^3] to run `office` plugin with office documents. - -> [!NOTE] -> Your config may be different depending if you're *appending*, *prepending* or *overriding* default rules. -> If unsure, take a look at [Configuration](https://yazi-rs.github.io/docs/configuration/overview)[^4] -> and [Configuration mixing](https://yazi-rs.github.io/docs/configuration/overview#mixing)[^5] - -For a general usecase, you may use the following rules -```toml -[plugin] - -prepend_preloaders = [ - # Office Documents - { mime = "application/openxmlformats-officedocument.*", run = "office" }, - { mime = "application/oasis.opendocument.*", run = "office" }, - { mime = "application/ms-*", run = "office" }, - { mime = "application/msword", run = "office" }, - { name = "*.docx", run = "office" }, -] - -prepend_previewers = [ - # Office Documents - { mime = "application/openxmlformats-officedocument.*", run = "office" }, - { mime = "application/oasis.opendocument.*", run = "office" }, - { mime = "application/ms-*", run = "office" }, - { mime = "application/msword", run = "office" }, - { name = "*.docx", run = "office" }, -] -``` - -## Dependencies -> [!IMPORTANT] -> Make sure that these commands are installed in your system and can be found in `PATH`: -> -> - `libreoffice` -> - `pdftoppm` - -## License -office.yazi is licensed under the terms of the [MIT License](LICENSE) - -[^1]: [The official package manager for Yazi](https://yazi-rs.github.io/docs/cli) -[^2]: [Preloaders rules](https://yazi-rs.github.io/docs/configuration/yazi#plugin.preloaders) -[^3]: [Previewers rules](https://yazi-rs.github.io/docs/configuration/yazi#plugin.previewers) -[^4]: [Configuration](https://yazi-rs.github.io/docs/configuration/overview) -[^5]: [Configuration mixing](https://yazi-rs.github.io/docs/configuration/overview#mixing) diff --git a/fedora/.config/yazi/plugins/office.yazi/main.lua b/fedora/.config/yazi/plugins/office.yazi/main.lua deleted file mode 100644 index 3ec7385..0000000 --- a/fedora/.config/yazi/plugins/office.yazi/main.lua +++ /dev/null @@ -1,121 +0,0 @@ ---- @since 25.2.7 - -local M = {} - -function M:peek(job) - local start, cache = os.clock(), ya.file_cache(job) - if not cache then - return - end - - local ok, err = self:preload(job) - if not ok or err then - return - end - - ya.sleep(math.max(0, rt.preview.image_delay / 1000 + start - os.clock())) - ya.image_show(cache, job.area) - ya.preview_widgets(job, {}) -end - -function M:seek(job) - local h = cx.active.current.hovered - if h and h.url == job.file.url then - local step = ya.clamp(-1, job.units, 1) - ya.manager_emit("peek", { math.max(0, cx.active.preview.skip + step), only_if = job.file.url }) - end -end - -function M:doc2pdf(job) - local tmp = "/tmp/yazi-" .. ya.uid() .. "/" .. ya.hash("office.yazi") .. "/" - - --[[ For Future Reference: Regarding `libreoffice` as preconverter - 1. It prints errors to stdout (always, doesn't matter if it succeeded or it failed) - 2. Always writes the converted files to the filesystem, so no "Mario|Bros|Piping|Magic" for the data stream (https://ask.libreoffice.org/t/using-convert-to-output-to-stdout/38753) - 3. The `pdf:draw_pdf_Export` filter needs literal double quotes when defining its options (https://help.libreoffice.org/latest/en-US/text/shared/guide/pdf_params.html?&DbPAR=SHARED&System=UNIX#generaltext/shared/guide/pdf_params.xhp) - 3.1 Regarding double quotes and Lua strings, see https://www.lua.org/manual/5.1/manual.html#2.1 --]] - local libreoffice = Command("libreoffice") - :arg({ - "--headless", - "--convert-to", - "pdf:draw_pdf_Export:{" - .. '"PageRange":{' - .. '"type":"string",' - .. '"value":' - .. '"' - .. job.skip + 1 - .. '"' - .. "}" - .. "}", - "--outdir", - tmp, - tostring(job.file.url), - }) - :stdin(Command.NULL) - :stdout(Command.PIPED) - :stderr(Command.NULL) - :output() - - if not libreoffice.status.success then - ya.err( - libreoffice.stdout:match("LibreOffice .+"):gsub("%\n.*", "") - .. " " - .. libreoffice.stdout:match("Error .+"):gsub("%\n.*", "") - ) - return nil, Err("Failed to preconvert `%s` to a temporary PDF", job.file.name) - end - - local tmp = tmp .. job.file.name:gsub("%.[^%.]+$", ".pdf") - local read_permission = io.open(tmp, "r") - if not read_permission then - return nil, Err("Failed to read `%s`: make sure file exists and have read access", tmp) - end - read_permission:close() - - return tmp -end - -function M:preload(job) - local cache = ya.file_cache(job) - if not cache or fs.cha(cache) then - return true - end - - local tmp_pdf, err = self:doc2pdf(job) - if not tmp_pdf then - return true, Err(" " .. "%s", err) - end - - local output, err = Command("pdftoppm") - :arg({ - "-singlefile", - "-jpeg", - "-jpegopt", - "quality=" .. rt.preview.image_quality, - "-f", - 1, - tostring(tmp_pdf), - }) - :stdout(Command.PIPED) - :stderr(Command.PIPED) - :output() - - local rm_tmp_pdf, rm_err = fs.remove("file", Url(tmp_pdf)) - if not rm_tmp_pdf then - return true, Err("Failed to remove %s, error: %s", tmp_pdf, rm_err) - end - - if not output then - return true, Err("Failed to start `pdftoppm`, error: %s", err) - elseif not output.status.success then - local pages = tonumber(output.stderr:match("the last page %((%d+)%)")) or 0 - if job.skip > 0 and pages > 0 then - ya.mgr_emit("peek", { math.max(0, pages - 1), only_if = job.file.url, upper_bound = true }) - end - return true, Err("Failed to convert %s to image, stderr: %s", tmp_pdf, output.stderr) - end - - return fs.write(cache, output.stdout) -end - -return M diff --git a/fedora/.config/yazi/plugins/parent-arrow.yazi/main.lua b/fedora/.config/yazi/plugins/parent-arrow.yazi/main.lua deleted file mode 100644 index a4fd880..0000000 --- a/fedora/.config/yazi/plugins/parent-arrow.yazi/main.lua +++ /dev/null @@ -1,24 +0,0 @@ ---- @sync entry -local function entry(_, job) - local parent = cx.active.parent - if not parent then - return - end - - local offset = tonumber(job.args[1]) - if not offset then - return ya.err(job.args[1], "is not a number") - end - - local start = parent.cursor + 1 + offset - local end_ = offset < 0 and 1 or #parent.files - local step = offset < 0 and -1 or 1 - for i = start, end_, step do - local target = parent.files[i] - if target and target.cha.is_dir then - return ya.emit("cd", { target.url }) - end - end -end - -return { entry = entry } diff --git a/fedora/.config/yazi/plugins/piper.yazi/README.md b/fedora/.config/yazi/plugins/piper.yazi/README.md deleted file mode 100644 index 1cb238f..0000000 --- a/fedora/.config/yazi/plugins/piper.yazi/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# piper.yazi - -Pipe any shell command as a previewer. - -## Installation - -```sh -ya pkg add yazi-rs/plugins:piper -``` - -## Usage - -Piper is a general-purpose previewer - you can pass any shell command to `piper` and it will use the command's output as the preview content. - -It accepts a string parameter, which is the shell command to be executed, for example: - -```toml -# ~/.config/yazi/yazi.toml -[[plugin.prepend_previewers]] -name = "*" -run = 'piper -- echo "$1"' -``` - -This will set `piper` as the previewer for all file types and use `$1` (file path) as the preview content. - -## Variables - -Available variables: - -- `$w`: the width of the preview area. -- `$h`: the height of the preview area. -- `$1`: the path to the file being previewed. - -## Examples - -Here are some configuration examples: - -### Preview tarballs with [`tar`](https://man7.org/linux/man-pages/man1/tar.1.html) - -```toml -[[plugin.prepend_previewers]] -name = "*.tar*" -run = 'piper --format=url -- tar tf "$1"' -``` - -In this example, `--format=url` tells `piper` to parse the `tar` output as file URLs, so you'll be able to get a list of files with icons. - -### Preview CSV with [`bat`](https://github.com/sharkdp/bat) - -```toml -[[plugin.prepend_previewers]] -name = "*.csv" -run = 'piper -- bat -p --color=always "$1"' -``` - -Note that certain distributions might use a different name for `bat`, like Debian and Ubuntu uses `batcat` instead, so please adjust accordingly. - -### Preview Markdown with [`glow`](https://github.com/charmbracelet/glow) - -```toml -[[plugin.prepend_previewers]] -name = "*.md" -run = 'piper -- CLICOLOR_FORCE=1 glow -w=$w -s=dark "$1"' -``` - -Note that there's [a bug in Glow v2.0](https://github.com/charmbracelet/glow/issues/440#issuecomment-2307992634) that causes slight color differences between tty and non-tty environments. - -### Preview directory tree with [`eza`](https://github.com/eza-community/eza) - -```toml -[[plugin.prepend_previewers]] -name = "*/" -run = 'piper -- eza -TL=3 --color=always --icons=always --group-directories-first --no-quotes "$1"' -``` - -### Use [`hexyl`](https://github.com/sharkdp/hexyl) as fallback previewer - -Yazi defaults to using [`file -bL "$1"`](https://github.com/sxyazi/yazi/blob/main/yazi-plugin/preset/plugins/file.lua) if there's no matched previewer. - -This example uses `hexyl` as a fallback previewer instead of `file`. - -```toml -[[plugin.append_previewers]] -name = "*" -run = 'piper -- hexyl --border=none --terminal-width=$w "$1"' -``` - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/fedora/.config/yazi/plugins/piper.yazi/main.lua b/fedora/.config/yazi/plugins/piper.yazi/main.lua deleted file mode 100644 index aef08eb..0000000 --- a/fedora/.config/yazi/plugins/piper.yazi/main.lua +++ /dev/null @@ -1,70 +0,0 @@ ---- @since 25.5.31 - -local M = {} - -local function fail(job, s) ya.preview_widget(job, ui.Text.parse(s):area(job.area):wrap(ui.Wrap.YES)) end - -function M:peek(job) - local child, err = Command("sh") - :arg({ "-c", job.args[1], "sh", tostring(job.file.url) }) - :env("w", job.area.w) - :env("h", job.area.h) - :stdout(Command.PIPED) - :stderr(Command.PIPED) - :spawn() - - if not child then - return fail(job, "sh: " .. err) - end - - local limit = job.area.h - local i, outs, errs = 0, {}, {} - repeat - local next, event = child:read_line() - if event == 1 then - errs[#errs + 1] = next - elseif event ~= 0 then - break - end - - i = i + 1 - if i > job.skip then - outs[#outs + 1] = next - end - until i >= job.skip + limit - - child:start_kill() - if #errs > 0 then - fail(job, table.concat(errs, "")) - elseif job.skip > 0 and i < job.skip + limit then - ya.emit("peek", { math.max(0, i - limit), only_if = job.file.url, upper_bound = true }) - else - ya.preview_widget(job, M.format(job, outs)) - end -end - -function M:seek(job) require("code"):seek(job) end - -function M.format(job, lines) - local format = job.args.format - if format ~= "url" then - local s = table.concat(lines, ""):gsub("\r", ""):gsub("\t", string.rep(" ", rt.preview.tab_size)) - return ui.Text.parse(s):area(job.area) - end - - for i = 1, #lines do - lines[i] = lines[i]:gsub("[\r\n]+$", "") - - local icon = File({ - url = Url(lines[i]), - cha = Cha { kind = lines[i]:sub(-1) == "/" and 1 or 0 }, - }):icon() - - if icon then - lines[i] = ui.Line { ui.Span(" " .. icon.text .. " "):style(icon.style), lines[i] } - end - end - return ui.Text(lines):area(job.area) -end - -return M diff --git a/fedora/.config/yazi/plugins/smart-enter.yazi/README.md b/fedora/.config/yazi/plugins/smart-enter.yazi/README.md deleted file mode 100644 index 742f2e1..0000000 --- a/fedora/.config/yazi/plugins/smart-enter.yazi/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# smart-enter.yazi - -[`Open`][open] files or [`enter`][enter] directories all in one key! - -## Installation - -```sh -ya pkg add yazi-rs/plugins:smart-enter -``` - -## Usage - -Bind your l key to the plugin, in your `~/.config/yazi/keymap.toml`: - -```toml -[[mgr.prepend_keymap]] -on = "l" -run = "plugin smart-enter" -desc = "Enter the child directory, or open the file" -``` - -## Advanced - -By default, `--hovered` is passed to the [`open`][open] command, make the behavior consistent with [`enter`][enter] avoiding accidental triggers, -which means both will only target the currently hovered file. - -If you still want `open` to target multiple selected files, add this to your `~/.config/yazi/init.lua`: - -```lua -require("smart-enter"):setup { - open_multi = true, -} -``` - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. - -[open]: https://yazi-rs.github.io/docs/configuration/keymap/#mgr.open -[enter]: https://yazi-rs.github.io/docs/configuration/keymap/#mgr.enter diff --git a/fedora/.config/yazi/plugins/smart-enter.yazi/main.lua b/fedora/.config/yazi/plugins/smart-enter.yazi/main.lua deleted file mode 100644 index e9e2ec6..0000000 --- a/fedora/.config/yazi/plugins/smart-enter.yazi/main.lua +++ /dev/null @@ -1,11 +0,0 @@ ---- @since 25.5.31 ---- @sync entry - -local function setup(self, opts) self.open_multi = opts.open_multi end - -local function entry(self) - local h = cx.active.current.hovered - ya.emit(h and h.cha.is_dir and "enter" or "open", { hovered = not self.open_multi }) -end - -return { entry = entry, setup = setup } diff --git a/fedora/.config/yazi/plugins/smart-filter.yazi/README.md b/fedora/.config/yazi/plugins/smart-filter.yazi/README.md deleted file mode 100644 index 97be2ac..0000000 --- a/fedora/.config/yazi/plugins/smart-filter.yazi/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# smart-filter.yazi - -A Yazi plugin that makes filters smarter: continuous filtering, automatically enter unique directory, open file on submitting. - -https://github.com/yazi-rs/plugins/assets/17523360/72aaf117-1378-4f7e-93ba-d425a79deac5 - -## Installation - -```sh -ya pkg add yazi-rs/plugins:smart-filter -``` - -## Usage - -Add this to your `~/.config/yazi/keymap.toml`: - -```toml -[[mgr.prepend_keymap]] -on = "F" -run = "plugin smart-filter" -desc = "Smart filter" -``` - -Make sure the F key is not used elsewhere. - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/fedora/.config/yazi/plugins/smart-filter.yazi/main.lua b/fedora/.config/yazi/plugins/smart-filter.yazi/main.lua deleted file mode 100644 index 146e265..0000000 --- a/fedora/.config/yazi/plugins/smart-filter.yazi/main.lua +++ /dev/null @@ -1,51 +0,0 @@ ---- @since 25.5.31 - -local hovered = ya.sync(function() - local h = cx.active.current.hovered - if not h then - return {} - end - - return { - url = h.url, - is_dir = h.cha.is_dir, - unique = #cx.active.current.files == 1, - } -end) - -local function prompt() - return ya.input { - title = "Smart filter:", - pos = { "center", w = 50 }, - position = { "center", w = 50 }, -- TODO: remove - realtime = true, - debounce = 0.1, - } -end - -local function entry() - local input = prompt() - - while true do - local value, event = input:recv() - if event ~= 1 and event ~= 3 then - ya.emit("escape", { filter = true }) - break - end - - ya.emit("filter_do", { value, smart = true }) - - local h = hovered() - if h.unique and h.is_dir then - ya.emit("escape", { filter = true }) - ya.emit("enter", {}) - input = prompt() - elseif event == 1 then - ya.emit("escape", { filter = true }) - ya.emit(h.is_dir and "enter" or "open", { h.url }) - break - end - end -end - -return { entry = entry } diff --git a/fedora/.config/yazi/plugins/smart-paste.yazi/README.md b/fedora/.config/yazi/plugins/smart-paste.yazi/README.md deleted file mode 100644 index b32f475..0000000 --- a/fedora/.config/yazi/plugins/smart-paste.yazi/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# smart-paste.yazi - -Paste files into the hovered directory or to the CWD if hovering over a file. - -https://github.com/user-attachments/assets/b3f6348e-abbe-42fe-9a67-a96e68f11255 - -## Installation - -```sh -ya pkg add yazi-rs/plugins:smart-paste -``` - -## Usage - -Add this to your `~/.config/yazi/keymap.toml`: - -```toml -[[mgr.prepend_keymap]] -on = "p" -run = "plugin smart-paste" -desc = "Paste into the hovered directory or CWD" -``` - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/fedora/.config/yazi/plugins/smart-paste.yazi/main.lua b/fedora/.config/yazi/plugins/smart-paste.yazi/main.lua deleted file mode 100644 index 0837a4b..0000000 --- a/fedora/.config/yazi/plugins/smart-paste.yazi/main.lua +++ /dev/null @@ -1,14 +0,0 @@ ---- @since 25.5.31 ---- @sync entry -return { - entry = function() - local h = cx.active.current.hovered - if h and h.cha.is_dir then - ya.emit("enter", {}) - ya.emit("paste", {}) - ya.emit("leave", {}) - else - ya.emit("paste", {}) - end - end, -} diff --git a/fedora/.config/yazi/plugins/sudo-demo.yazi/README.md b/fedora/.config/yazi/plugins/sudo-demo.yazi/README.md deleted file mode 100644 index 8068691..0000000 --- a/fedora/.config/yazi/plugins/sudo-demo.yazi/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# sudo-demo.yazi - -Just an example showing how to use `sudo` in a Yazi plugin, and the plugin itself doesn't offer any features beyond logging a message. - -## Installation - -```sh -ya pkg add yazi-rs/plugins:sudo-demo -``` - -## Usage - -Add this to your `~/.config/yazi/keymap.toml`: - -```toml -[[mgr.prepend_keymap]] -on = "" -run = "plugin sudo-demo" -``` - -Press Ctrl + t to run the plugin, you should [see a message in the log](https://yazi-rs.github.io/docs/plugins/overview#logging). - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/fedora/.config/yazi/plugins/sudo-demo.yazi/main.lua b/fedora/.config/yazi/plugins/sudo-demo.yazi/main.lua deleted file mode 100644 index 599afe4..0000000 --- a/fedora/.config/yazi/plugins/sudo-demo.yazi/main.lua +++ /dev/null @@ -1,45 +0,0 @@ ---- @since 25.5.31 - ---- Verify if `sudo` is already authenticated ---- @return boolean -local function sudo_already() - local status = Command("sudo"):arg({ "--validate", "--non-interactive" }):status() - assert(status, "Failed to run `sudo --validate --non-interactive`") - return status.success -end - ---- Run a program with `sudo` privilege ---- @param program string ---- @param args table ---- @return Output|nil output ---- @return integer|nil err ---- nil: no error ---- 1: sudo failed -local function run_with_sudo(program, args) - local cmd = Command("sudo"):arg(program):arg(args) - if sudo_already() then - return cmd:output() - end - - local permit = ui.hide and ui.hide() or ya.hide() -- TODO: remove this - print(string.format("Sudo password required to run: `%s %s`", program, table.concat(args))) - local output = cmd:output() - permit:drop() - - if output.status.success or sudo_already() then - return output - end - return nil, 1 -end - -return { - entry = function() - local output = run_with_sudo("ls", { "-l" }) - if not output then - return ya.err("Failed to run `sudo ls -l`") - end - - ya.err("stdout", output.stdout) - ya.err("status.code", output.status.code) - end, -} diff --git a/fedora/.config/yazi/plugins/toggle-pane.yazi/README.md b/fedora/.config/yazi/plugins/toggle-pane.yazi/README.md deleted file mode 100644 index 3ef4095..0000000 --- a/fedora/.config/yazi/plugins/toggle-pane.yazi/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# toggle-pane.yazi - -Toggle the show, hide, and maximize states for different panes: parent, current, and preview. It respects the user's [`ratio` settings](https://yazi-rs.github.io/docs/configuration/yazi#mgr.ratio)! - -Assume the user's `ratio` is $$[A, B, C]$$, that is, $$\text{parent}=A, \text{current}=B, \text{preview}=C$$: - -- `min-parent`: Toggles between $$0$$ and $$A$$ - the parent is either completely hidden or showed with width $$A$$. -- `max-parent`: Toggles between $$A$$ and $$\infty$$ - the parent is either showed with width $$A$$ or fills the entire screen. -- `min-current`: Toggles between $$0$$ and $$B$$ - the current is either completely hidden or showed with width $$B$$. -- `max-current`: Toggles between $$B$$ and $$\infty$$ - the current is either showed with width $$B$$ or fills the entire screen. -- `min-preview`: Toggles between $$0$$ and $$C$$ - the preview is either completely hidden or showed with width $$C$$. -- `max-preview`: Toggles between $$C$$ and $$\infty$$ - the preview is either showed with width $$C$$ or fills the entire screen. -- `reset`: Resets to the user's configured `ratio`. - -## Installation - -```sh -ya pkg add yazi-rs/plugins:toggle-pane -``` - -## Usage - -Hide/Show preview: - -```toml -# keymap.toml -[[mgr.prepend_keymap]] -on = "T" -run = "plugin toggle-pane min-preview" -desc = "Show or hide the preview pane" -``` - -Maximize/Restore preview: - -```toml -# keymap.toml -[[mgr.prepend_keymap]] -on = "T" -run = "plugin toggle-pane max-preview" -desc = "Maximize or restore the preview pane" -``` - -You can replace `preview` with `current` or `parent` to toggle the other panes. - -## Advanced - -In addition to triggering the plugin with a keypress, you can also trigger it in your `init.lua` file: - -```lua -if os.getenv("NVIM") then - require("toggle-pane"):entry("min-preview") -end -``` - -In the example above, when it detects that you're [using Yazi in nvim](https://yazi-rs.github.io/docs/resources#vim), the preview is hidden by default โ€” you can always press `T` (or any key you've bound) to show it again. - -## Tips - -This plugin only maximizes the "available preview area", without actually changing the content size. - -This means that the appearance of your preview largely depends on the previewer you are using. -However, most previewers tend to make the most of the available space, so this usually isn't an issue. - -For image previews, you may want to tune up the [`max_width`][max-width] and [`max_height`][max-height] options in your `yazi.toml`: - -```toml -[preview] -# Change them to your desired values -max_width = 1000 -max_height = 1000 -``` - -[max-width]: https://yazi-rs.github.io/docs/configuration/yazi/#preview.max_width -[max-height]: https://yazi-rs.github.io/docs/configuration/yazi/#preview.max_height - -## License - -This plugin is MIT-licensed. For more information, check the [LICENSE](LICENSE) file. diff --git a/fedora/.config/yazi/plugins/toggle-pane.yazi/main.lua b/fedora/.config/yazi/plugins/toggle-pane.yazi/main.lua deleted file mode 100644 index 72bbf0e..0000000 --- a/fedora/.config/yazi/plugins/toggle-pane.yazi/main.lua +++ /dev/null @@ -1,45 +0,0 @@ ---- @since 25.5.31 ---- @sync entry - -local function entry(st, job) - local R = rt.mgr.ratio - job = type(job) == "string" and { args = { job } } or job - - st.parent = st.parent or R.parent - st.current = st.current or R.current - st.preview = st.preview or R.preview - - local act, to = string.match(job.args[1] or "", "(.-)-(.+)") - if act == "min" then - st[to] = st[to] == R[to] and 0 or R[to] - elseif act == "max" then - local max = st[to] == 65535 and R[to] or 65535 - st.parent = st.parent == 65535 and R.parent or st.parent - st.current = st.current == 65535 and R.current or st.current - st.preview = st.preview == 65535 and R.preview or st.preview - st[to] = max - end - - if not st.old then - st.old = Tab.layout - Tab.layout = function(self) - local all = st.parent + st.current + st.preview - self._chunks = ui.Layout() - :direction(ui.Layout.HORIZONTAL) - :constraints({ - ui.Constraint.Ratio(st.parent, all), - ui.Constraint.Ratio(st.current, all), - ui.Constraint.Ratio(st.preview, all), - }) - :split(self._area) - end - end - - if not act then - Tab.layout, st.old = st.old, nil - st.parent, st.current, st.preview = nil, nil, nil - end - ya.emit("app:resize", {}) -end - -return { entry = entry } diff --git a/fedora/.config/yazi/plugins/zoom.yazi/README.md b/fedora/.config/yazi/plugins/zoom.yazi/README.md deleted file mode 100644 index 9be8025..0000000 --- a/fedora/.config/yazi/plugins/zoom.yazi/README.md +++ /dev/null @@ -1,56 +0,0 @@ -> [!NOTE] -> The latest Yazi nightly build is required to use this plugin at the moment. - -# zoom.yazi - -Enlarge or shrink the preview image of a file, which is useful for magnifying small files for viewing. - -Supported formats: - -- Images - requires [ImageMagick](https://imagemagick.org/) (>= 7.1.1) - -Note that, the maximum size of enlarged images is limited by the [`max_width`][max_width] and [`max_height`][max_height] configuration options, so you may need to increase them as needed. - -https://github.com/user-attachments/assets/b28912b1-da63-43d3-a21f-b9e6767ed4a9 - -[max_width]: https://yazi-rs.github.io/docs/configuration/yazi#preview.max_width -[max_height]: https://yazi-rs.github.io/docs/configuration/yazi#preview.max_height - -## Installation - -```sh -ya pkg add yazi-rs/plugins:zoom -``` - -## Usage - -```toml -# keymap.toml -[[mgr.prepend_keymap]] -on = "+" -run = "plugin zoom 1" -desc = "Zoom in hovered file" - -[[mgr.prepend_keymap]] -on = "-" -run = "plugin zoom -1" -desc = "Zoom out hovered file" -``` - -## Advanced - -If you want to apply a default zoom parameter to image previews, you can specify it while setting this plugin up as a custom previewer, for example: - -```toml -[[plugin.prepend_previewers]] -mime = "image/{jpeg,png,webp}" -run = "zoom 5" -``` - -## TODO - -- [ ] Support more file types (e.g., videos, PDFs), PRs welcome! - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/fedora/.config/yazi/plugins/zoom.yazi/main.lua b/fedora/.config/yazi/plugins/zoom.yazi/main.lua deleted file mode 100644 index 8aea0cd..0000000 --- a/fedora/.config/yazi/plugins/zoom.yazi/main.lua +++ /dev/null @@ -1,119 +0,0 @@ ---- @since 25.6.11 - -local get = ya.sync(function(st, url) return st.last == url and st.level end) - -local save = ya.sync(function(st, url, new) - local h = cx.active.current.hovered - if h and h.url == url then - st.last, st.level = url, new - return true - end -end) - -local lock = ya.sync(function(st, url, old, new) - if st.last == url and st.level == old then - st.level = new - return true - end -end) - -local move = ya.sync(function(st) - local h = cx.active.current.hovered - if not h then - return - end - - if st.last ~= h.url then - st.last, st.level = Url(h.url), 0 - end - - return { url = h.url, level = st.level } -end) - -local function end_(job, err) - if not job.old_level then - ya.preview_widget(job, err and ui.Text(err):area(job.area):wrap(ui.Wrap.YES)) - elseif err then - ya.notify { title = "Zoom", content = tostring(err), timeout = 5, level = "error" } - end -end - -local function canvas(area) - local cw, ch = rt.term.cell_size() - if not cw then - return rt.preview.max_width, rt.preview.max_height - end - - return math.min(rt.preview.max_width, math.floor(area.w * cw)), - math.min(rt.preview.max_height, math.floor(area.h * ch)) -end - -local function peek(_, job) - local url = job.file.url - local info, err = ya.image_info(url) - if not info then - return end_(job, Err("Failed to get image info: %s", err)) - end - - local level = ya.clamp(-10, job.new_level or get(Url(url)) or tonumber(job.args[1]) or 0, 10) - local sync = function() - if job.old_level then - return lock(url, job.old_level, level) - else - return save(url, level) - end - end - - local max_w, max_h = canvas(job.area) - local min_w, min_h = math.min(max_w, info.w), math.min(max_h, info.h) - local new_w = min_w + math.floor(min_w * level * 0.1) - local new_h = min_h + math.floor(min_h * level * 0.1) - if new_w > max_w or new_h > max_h then - if job.old_level then - return sync() -- Image larger than available preview area after zooming - else - new_w, new_h = max_w, max_h -- Run as a previewer, render the image anyway - end - end - - local tmp = os.tmpname() - -- stylua: ignore - local status, err = Command("magick"):arg { - tostring(url), - "-auto-orient", "-strip", - "-sample", string.format("%dx%d", new_w, new_h), - "-quality", rt.preview.image_quality, - string.format("JPG:%s", tmp), - }:status() - - if not status then - end_(job, Err("Failed to run `magick` command: %s", err)) - elseif not status.success then - end_(job, Err("`magick` command exited with error code %d", status.code)) - elseif sync() then - ya.image_show(Url(tmp), job.area) - end - end_(job) -end - -local function entry(self, job) - local st = move() - if not st then - return - end - - local motion = tonumber(job.args[1]) or 0 - local new = ya.clamp(-10, st.level + motion, 10) - if new ~= st.level then - peek(self, { - area = ui.area("preview"), - args = {}, - file = { url = st.url }, -- FIXME: use `File` instead of a dummy file - skip = 0, - new_level = new, - old_level = st.level, - }) - end -end - -return { peek = peek, entry = entry } diff --git a/fedora/.config/yazi/theme.toml b/fedora/.config/yazi/theme.toml deleted file mode 100644 index efcc789..0000000 --- a/fedora/.config/yazi/theme.toml +++ /dev/null @@ -1,278 +0,0 @@ -# If the user's terminal is in dark mode, Yazi will load `theme-dark.toml` on startup; otherwise, `theme-light.toml`. -# You can override any parts of them that are not related to the dark/light mode in your own `theme.toml`. - -# If you want to dynamically override their content based on dark/light mode, you can specify two different flavors -# for dark and light modes under `[flavor]`, and do so in those flavors instead. -"$schema" = "https://yazi-rs.github.io/schemas/theme.json" - -# vim:fileencoding=utf-8:foldmethod=marker - -# : Manager {{{ - -[mgr] -cwd = { fg = "#9ccfd8" } - -# Hovered -hovered = { reversed = true } -preview_hovered = { underline = true } - -# Find -find_keyword = { fg = "#f6c177", bold = true, italic = true, underline = true } -find_position = { fg = "#c4a7e7", bg = "reset", bold = true, italic = true } - -# Symlink -symlink_target = { italic = true } - -# Marker -marker_copied = { fg = "#3e8fb0", bg = "#3e8fb0" } -marker_cut = { fg = "#eb6f92", bg = "#eb6f92" } -marker_marked = { fg = "#ea9a97", bg = "#ea9a97" } -marker_selected = { fg = "#f6c177", bg = "#f6c177" } - -# Count -count_copied = { fg = "#e0def4", bg = "#3e8fb0" } -count_cut = { fg = "#f0def4", bg = "#eb6f92" } -count_selected = { fg = "#232136", bg = "#f6c177" } - -# Border -border_symbol = "โ”‚" -border_style = { fg = "#56526e" } - -# Highlighting -syntect_theme = "" - -# : }}} - - -# : Tabs {{{ - -[tabs] -active = { fg = "#e0def4", bg = "#3e8fb0", bold = true } -inactive = { fg = "#3e8fb0", bg = "#e0def4" } -tab_width = 1 - -# Separator -sep_inner = { open = "", close = "" } -sep_outer = { open = "", close = "" } - -# : }}} - - -# : Mode {{{ - -[mode] -normal_main = { fg = "#232136", bg = "#9ccfd8", bold = true } -normal_alt = { fg = "#232136", bg = "#e0def4", bold = true } - -# Select mode -select_main = { fg = "#232136", bg = "#eb6f92", bold = true } -select_alt = { fg = "#232136", bg = "#e0def4", bold = true } - -# Unset mode -unset_main = { fg = "#232136", bg = "#eb6f92", bold = true } -unset_alt = { fg = "#232136", bg = "#e0def4", bold = true } - -# : }}} - - -# : Status bar {{{ - -[status] -overall = { } -sep_left = { open = "", close = "" } -sep_right = { open = "", close = "" } - -# Permissions -perm_sep = { fg = "#6e6a86" } -perm_type = { fg = "#c4a7e7" } -perm_read = { fg = "#f6c177" } -perm_write = { fg = "#eb6f92" } -perm_exec = { fg = "#9ccfd8" } - -# Progress -progress_label = { fg = "#e0def4", bold = true } -progress_normal = { fg = "#3e8fb0", bg = "#2a283e" } -progress_error = { fg = "#eb6f92", bg = "#2a283e" } - -# : }}} - - -# : Which {{{ - -[which] -cols = 3 -mask = { bg = "#2a273f" } -cand = { fg = "#9ccfd8" } -rest = { fg = "#6e6a86" } -desc = { fg = "#f6c177" } -separator = " ๎ชœ " -separator_style = { fg = "#6e6a86" } - -# : }}} - - -# : Confirmation {{{ - -[confirm] -border = { fg = "#56526e" } -title = { fg = "#eb6f92", bold = true } -content = { fg = "#fbf1c7" } -body = { fg = "#e0def4" } -list = { fg = "#e0def4" } -btn_yes = { fg = "#232136", bg = "#3e8fb0", bold = true } -btn_no = { fg = "#232136", bg = "#e0def4", bold = true } -btn_labels = [ " [y]es ", " (n)o " ] - -# : }}} - - -# : Spotter {{{ - -[spot] -border = { fg = "#56526e" } -title = { fg = "#9ccfd8", bold = true } - -# Table -tbl_col = { fg = "#9ccfd8" } -tbl_cell = { fg = "#232136", bg = "#f6c177", bold = true } - -# : }}} - - -# : Notification {{{ - -[notify] -title_info = { fg = "#3e8fb0" } -title_warn = { fg = "#f6c177" } -title_error = { fg = "#eb6f92" } - - -# : }}} - - -# : Picker {{{ - -[pick] -border = { fg = "#3e8fb0" } -active = { fg = "#c4a7e7", bold = true } -inactive = { fg = "#908caa"} - -# : }}} - - -# : Input {{{ - -[input] -border = { fg = "#3e8fb0" } -title = { bold = true } -value = { fg = "#e0def4"} -selected = { reversed = true } - -# : }}} - - -# : Completion {{{ - -[cmp] -border = { fg = "#3e8fb0" } -active = { bg = "#e0def4", fg = "#232136", bold = true } -inactive = { fg = "#908caa" } - - -# : }}} - - -# : Task manager {{{ - -[tasks] -border = { fg = "#3e8fb0" } -title = { bold = true} -hovered = { fg = "#c4a7e7", bold = true, reversed = true } - -# : }}} - - -# : Help menu {{{ - -[help] -on = { fg = "#9ccfd8" } -run = { fg = "#c4a7e7" } -desc = { fg = "#f6c177"} -hovered = { reversed = true, bold = true } -footer = { fg = "#232136", bg = "#e0def4" } - -# : }}} - - -# : File-specific styles {{{ - -[filetype] -rules = [ - # Images - { mime = "image/*", fg = "#c4a7e7" }, - { mime = "image/*", is = "link", fg = "#d8c9f0", italic = true }, - - # Media - { mime = "{audio,video}/*", fg = "#f6c177" }, - { mime = "{audio,video}/*", is = "link", fg = "#ffd393", italic = true }, - - # Archives - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#eb6f92" }, - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", is = "link", fg = "#f29aa6", italic = true }, - - # Documents - { mime = "application/{pdf,doc,rtf}", fg = "#ea9a97" }, - { mime = "application/{pdf,doc,rtf}", is = "link", fg = "#f0b8b0", italic = true }, - - # Office-like (vnd.*) - { mime = "application/vnd.*", fg = "#689d6a" }, - { mime = "application/vnd.*", is = "link", fg = "#7fcf96", italic = true }, - - # Special files - { name = "*", is = "orphan", fg = "#232136", bg = "#eb6f92" }, - { name = "*", is = "exec", fg = "#9ccfd8" }, - - # Symlink fallback - # { name = "*", is = "link", fg = "#b5e6ee", italic = true }, - # { name = "*/", is = "link", fg = "#6bd3ee", italic = true }, - - # Dummy files - { name = "*", is = "dummy", fg = "#232136", bg = "#eb6f92" }, - { name = "*/", is = "dummy", fg = "#232136", bg = "#eb6f92" }, - - # Fallback - { name = "*", fg = "#e0def4" }, - { name = "*/", fg = "#3e8fb0" } -] - -# : }}} - - -# : Flavor {{{ - -# [flavor] -# dark = "rose-pine-moon" -# light = "catppuccin-mocha" - -# : }}} - - -# ayu-dark -# catppuccin-frappe -# catppuccin-latte -# catppuccin-macchiato -# catppuccin-mocha -# dracula -# everforest-medium -# gruvbox-dark -# kanagawa-dragon -# kanagawa-lotus -# kanagawa -# rose-pine-moon -# rose-pine -# scripts -# tokyo-night -# vscode-dark-modern -# vscode-dark-plus -# vscode-light-modern -# vscode-light-plus diff --git a/fedora/.config/yazi/yazi.toml b/fedora/.config/yazi/yazi.toml deleted file mode 100644 index 17c7701..0000000 --- a/fedora/.config/yazi/yazi.toml +++ /dev/null @@ -1,278 +0,0 @@ -# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config. -# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas. -"$schema" = "https://yazi-rs.github.io/schemas/yazi.json" - -[mgr] -ratio = [ 1, 2, 4 ] -sort_by = "alphabetical" -sort_sensitive = false -sort_reverse = false -sort_dir_first = true -sort_translit = false -linemode = "none" -show_hidden = true -show_symlink = true -scrolloff = 5 -mouse_events = [ "click", "scroll" ] -title_format = "Yazi: {cwd}" - -[preview] -wrap = "no" -tab_size = 2 -max_width = 1200 -max_height = 1600 -cache_dir = "" -image_delay = 30 -image_filter = "lanczos3" -image_quality = 90 -ueberzug_scale = 1 -ueberzug_offset = [ 0, 0, 0, 0 ] - -[opener] -edit = [ - { run = '${EDITOR:-nvim} "$@"', desc = "$EDITOR", block = true, for = "unix" }, - { run = 'code %*', orphan = true, desc = "code", for = "windows" }, - { run = 'code -w %*', block = true, desc = "code (block)", for = "windows" }, -] -open = [ - { run = 'xdg-open "$1"', desc = "Open", for = "linux" }, - { run = 'open "$@"', desc = "Open", for = "macos" }, - { run = 'start "" "%1"', orphan = true, desc = "Open", for = "windows" }, - { run = 'termux-open "$1"', desc = "Open", for = "android" }, -] -reveal = [ - { run = 'xdg-open "$(dirname "$1")"', desc = "Reveal", for = "linux" }, - { run = 'open -R "$1"', desc = "Reveal", for = "macos" }, - { run = 'explorer /select,"%1"', orphan = true, desc = "Reveal", for = "windows" }, - { run = 'termux-open "$(dirname "$1")"', desc = "Reveal", for = "android" }, - { run = '''clear; exiftool "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show EXIF", for = "unix" }, -] -extract = [ - { run = 'ya pub extract --list "$@"', desc = "Extract here", for = "unix" }, - { run = 'ya pub extract --list %*', desc = "Extract here", for = "windows" }, -] -play = [ - { run = 'open -a IINA "$@"', orphan = true, for = "macos" }, - { run = 'mpv --force-window "$@"', orphan = true, for = "unix" }, - { run = 'mpv --force-window %*', orphan = true, for = "windows" }, - { run = '''mediainfo "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show media info", for = "unix" }, -] - -[[opener.set-wallpaper]] -run = ''' - osascript -e 'on run {img}' -e 'tell application "System Events" to set picture of every desktop to img' -e 'end run' "$0" -''' -for = "macos" -desc = "Set as wallpaper" - -[open] -rules = [ - # Folder - { name = "*/", use = [ "edit", "open", "reveal" ] }, - # Text - { mime = "text/*", use = [ "edit", "reveal" ] }, - # Image - { mime = "image/*", use = [ "open", "reveal" ] }, - # Media - { mime = "{audio,video}/*", use = [ "play", "reveal" ] }, - # Archive - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", use = [ "extract", "reveal" ] }, - # JSON - { mime = "application/{json,ndjson}", use = [ "edit", "reveal" ] }, - { mime = "*/javascript", use = [ "edit", "reveal" ] }, - # Empty file - { mime = "inode/empty", use = [ "edit", "reveal" ] }, - # Fallback - { name = "*", use = [ "edit", "open", "reveal" ] }, -] - -[[open.prepend_rules]] -mime = "image/*" -use = [ "set-wallpaper", "open" ] - -[tasks] -micro_workers = 10 -macro_workers = 10 -bizarre_retry = 3 -image_alloc = 536870912 # 512MB -image_bound = [ 20000, 20000 ] -suppress_preload = false - -[plugin] -fetchers = [ - # Mimetype - { id = "mime", name = "*", run = "mime", prio = "high" }, - { id = "git", name = "*", run = "git" }, - { id = "git", name = "*/", run = "git" }, - # { id = "mactag", name = "*", run = "mactag" }, - # { id = "mactag", name = "*/", run = "mactag" }, - { id = "mime", name = "*", run = "mime-ext", prio = "high" }, -] -spotters = [ - { name = "*/", run = "folder" }, - # Code - { mime = "text/*", run = "code" }, - { mime = "application/{mbox,javascript,wine-extension-ini}", run = "code" }, - # Image - { mime = "image/{avif,hei?,jxl}", run = "magick" }, - { mime = "image/svg+xml", run = "svg" }, - { mime = "image/*", run = "image" }, - # Video - { mime = "video/*", run = "video" }, - # Fallback - { name = "*", run = "file" }, -] -preloaders = [ - # Image - { mime = "image/{avif,hei?,jxl}", run = "magick" }, - { mime = "image/svg+xml", run = "svg" }, - { mime = "image/*", run = "image" }, - # Video - { mime = "video/*", run = "video" }, - # PDF - { mime = "application/pdf", run = "pdf" }, - # Font - { mime = "font/*", run = "font" }, - { mime = "application/ms-opentype", run = "font" }, -] -previewers = [ - { name = "*/", run = "folder" }, - # Code - { mime = "text/*", run = "code" }, - { mime = "application/{mbox,javascript,wine-extension-ini}", run = "code" }, - # JSON - { mime = "application/{json,ndjson}", run = "json" }, - # Image - { mime = "image/{avif,hei?,jxl}", run = "magick" }, - { mime = "image/svg+xml", run = "svg" }, - { mime = "image/*", run = "image" }, - # Video - { mime = "application/{octet-stream,vnd.rn-realmedia}", run = "video" }, - { mime = "{audio,video}/*", run = "video" }, - # PDF - { mime = "application/pdf", run = "pdf" }, - # Archive - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", run = "archive" }, - { mime = "application/{debian*-package,redhat-package-manager,rpm,android.package-archive}", run = "archive" }, - { name = "*.{AppImage,appimage}", run = "archive" }, - # Virtual Disk / Disk Image - { mime = "application/{iso9660-image,qemu-disk,ms-wim,apple-diskimage}", run = "archive" }, - { mime = "application/virtualbox-{vhd,vhdx}", run = "archive" }, - { name = "*.{img,fat,ext,ext2,ext3,ext4,squashfs,ntfs,hfs,hfsx}", run = "archive" }, - # Font - { mime = "font/*", run = "font" }, - { mime = "application/ms-opentype", run = "font" }, - # Empty file - { mime = "inode/empty", run = "empty" }, - # Fallback - { name = "*", run = "file" }, -] -prepend_preloaders = [ - { mime = "application/openxmlformats-officedocument.*", run = "office" }, - { mime = "application/oasis.opendocument.*", run = "office" }, - { mime = "application/ms-*", run = "office" }, - { mime = "application/msword", run = "office" }, - { name = "*.docx", run = "office" }, -] -prepend_previewers = [ - { mime = "*/xml", run = 'piper -- bat -p --theme ansi --terminal-width "$w" -f "$1"' }, - { mime = "application/*zip", run = 'piper -- atool --list -- "$1"' }, - { mime = "application/epub+zip", run = 'piper -- pandoc "$1" -t plain' }, - { mime = "application/json", run = 'piper -- bat -p --theme ansi --terminal-width "$w" -f "$1"' }, - { mime = "application/ms-*", run = "office" }, - { mime = "application/msword", run = "office" }, - { mime = "application/oasis.opendocument.*", run = "office" }, - # { mime = "application/octet-stream", run = 'piper -- mediainfo "$1"' }, - { mime = "application/openxmlformats-officedocument.*", run = "office" }, - { mime = "application/pgp-encrypted", run = 'piper -- gpg -d -- "$1"' }, - { mime = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", run = 'piper -- pandoc "$1" -t plain' }, - # { mime = "application/vnd.rn-realmedia", run = 'piper -- mediainfo "$1"' }, - { mime = "application/x-mobipocket-ebook", run = 'piper -- pandoc "$1" -t plain' }, - { mime = "application/x-ndjson", run = 'piper -- bat -p --theme ansi --terminal-width "$w" -f "$1"' }, - { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", run = "lsar" }, - { mime = "application/{,g}zip", run = "lsar" }, - { mime = "audio/*", run = 'piper -- mediainfo "$1"' }, - # { mime = "image/{jpeg,png,webp}", run = "zoom 5" }, - { mime = "text/*", run = 'piper -- bat -p --theme ansi --terminal-width "$w" -f "$1"' }, - { mime = "text/html", run = 'piper -- lynx -width="$w" -display_charset=utf-8 -dump "$1"' }, - { mime = "text/troff", run = 'piper -- man ./ "$1" | col -b' }, - # { mime = "video/*", run = 'piper -- mediainfo "$1"' }, - { name = "*.csv", run = 'piper -- bat -p --color=always "$1"' }, - { name = "*.docx", run = "office" }, - { name = "*.md", run = 'piper -- env CLICOLOR_FORCE=1 glow -w=$w -s=dark "$1"' }, - { name = "*.{odt,ods,odp,odg,ott,ots,otp}", run = 'piper -- odt2txt "$1"' }, - { name = "*.{tar,tar.gz,tar.bz2,tar.xz,zip,7z,rar,iso}", run = 'piper --format=url -- 7z l "$1"' }, - { name = "*/", run = 'piper -- eza -TL=3 --color=always --icons=always --group-directories-first --no-quotes "$1"' }, -] - -[input] -cursor_blink = false - -# cd -cd_title = "Change directory:" -cd_origin = "top-center" -cd_offset = [ 0, 2, 50, 3 ] - -# create -create_title = [ "Create:", "Create (dir):" ] -create_origin = "top-center" -create_offset = [ 0, 2, 50, 3 ] - -# rename -rename_title = "Rename:" -rename_origin = "hovered" -rename_offset = [ 0, 1, 50, 3 ] - -# filter -filter_title = "Filter:" -filter_origin = "top-center" -filter_offset = [ 0, 2, 50, 3 ] - -# find -find_title = [ "Find next:", "Find previous:" ] -find_origin = "top-center" -find_offset = [ 0, 2, 50, 3 ] - -# search -search_title = "Search via {n}:" -search_origin = "top-center" -search_offset = [ 0, 2, 50, 3 ] - -# shell -shell_title = [ "Shell:", "Shell (block):" ] -shell_origin = "top-center" -shell_offset = [ 0, 2, 50, 3 ] - -[confirm] -# trash -trash_title = "Trash {n} selected file{s}?" -trash_origin = "center" -trash_offset = [ 0, 0, 70, 20 ] - -# delete -delete_title = "Permanently delete {n} selected file{s}?" -delete_origin = "center" -delete_offset = [ 0, 0, 70, 20 ] - -# overwrite -overwrite_title = "Overwrite file?" -overwrite_content = "Will overwrite the following file:" -overwrite_origin = "center" -overwrite_offset = [ 0, 0, 50, 15 ] - -# quit -quit_title = "Quit?" -quit_content = "The following tasks are still running, are you sure you want to quit?" -quit_origin = "center" -quit_offset = [ 0, 0, 50, 15 ] - -[pick] -open_title = "Open with:" -open_origin = "hovered" -open_offset = [ 0, 1, 50, 7 ] - -[which] -sort_by = "none" -sort_sensitive = false -sort_reverse = false -sort_translit = false diff --git a/fedora/.config/zsh/.zshrc b/fedora/.config/zsh/.zshrc deleted file mode 100644 index 12fa76a..0000000 --- a/fedora/.config/zsh/.zshrc +++ /dev/null @@ -1,141 +0,0 @@ -#!/bin/zsh - -### --- Prompt --- ### -autoload -U colors && colors -autoload -Uz add-zsh-hook vcs_info -setopt prompt_subst -add-zsh-hook precmd vcs_info -PROMPT='%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%F{green}${vcs_info_msg_0_}%{$reset_color%}$%b ' -zstyle ':vcs_info:*' enable git -zstyle ':vcs_info:*' check-for-changes true -zstyle ':vcs_info:*' unstagedstr '*' -zstyle ':vcs_info:*' stagedstr '+' -zstyle ':vcs_info:git:*' formats "%{$fg[blue]%}(%{$fg[white]%}%b%{$fg[blue]%}:%r%{$fg[yellow]%}%u%m%{$fg[magenta]%}%c%{$fg[blue]%})" -zstyle ':vcs_info:git:*' actionformats "%{$fg[blue]%}(%{$fg[white]%}%b%{$fg[blue]%}:%r%{$reset_color%}|%{$fg[red]%}%a%u%c%{$fg[blue]%})" -zstyle ':vcs_info:git*+set-message:*' hooks git-untracked git-behind-upstream git-ahead-upstream git-diverged-upstream -+vi-git-untracked() { - if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == "true" ]] && \ - git status --porcelain | grep -m 1 "^??" &>/dev/null - then - hook_com[misc]+="%{$fg[yellow]%}%%" - fi -} -+vi-git-behind-upstream() { - if [[ $(git rev-list HEAD..$(git rev-parse --abbrev-ref @{upstream}) --count) -gt 0 ]]; then - hook_com[misc]+="%{$fg[red]%}<" - fi -} -+vi-git-ahead-upstream() { - if [[ $(git rev-list $(git rev-parse --abbrev-ref @{upstream})..HEAD --count) -gt 0 ]]; then - hook_com[misc]+="%{$fg[green]%}>" - fi -} -+vi-git-diverged-upstream() { - local ahead_count=$(git rev-list --count $(git rev-parse --abbrev-ref @{upstream})..HEAD 2>/dev/null) - local behind_count=$(git rev-list --count HEAD..$(git rev-parse --abbrev-ref @{upstream}) 2>/dev/null) - if [[ "$ahead_count" -gt 0 && "$behind_count" -gt 0 ]]; then - hook_com[misc]+="%{$fg[white]%}<>" - fi -} - - -### --- ZSH --- ### -# GnuPG -unset SSH_AGENT_PID -if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then - export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" - gpgconf --launch gpg-agent -fi -export GPG_TTY="$(tty)" -gpg-connect-agent updatestartuptty /bye >/dev/null - -# Options -stty -ixon # Disable Ctrl+S and Ctrl+Q flow control -setopt autocd -setopt extendedglob -setopt nomatch -setopt menucomplete -setopt interactive_comments -unsetopt bad_pattern - -# History in cache directory -HISTSIZE=10000000 -SAVEHIST=10000000 -HISTFILE="${XDG_DATA_HOME:-${HOME}/.local/share}/history/sh_history" -setopt inc_append_history -setopt appendhistory -setopt share_history -setopt hist_ignore_all_dups -setopt hist_ignore_space # ignores all commands starting with a blank space! Usefull for passwords - -# Style -ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS+=(vi-forward-char forward-char) -ZSH_AUTOSUGGEST_ACCEPT_WIDGETS=(${ZSH_AUTOSUGGEST_ACCEPT_WIDGETS:#(vi-forward-char|forward-char)}) -ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=60' -zstyle :bracketed-paste-magic paste-init pasteinit -zstyle :bracketed-paste-magic paste-finish pastefinish - - -### --- Autoload compinit and run it --- ### -autoload -Uz compinit # Autoload compinit -_comp_options+=(globdots) # Include hidden files in completion -compinit # Initialize completion system -zmodload zsh/complist # Load completion list module -zmodload -i zsh/parameter # Load last command output - -# _dotbare_completion_cmd -zstyle ':completion:*' menu select # selectable menu -zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]-_}={[:upper:][:lower:]_-}' 'r:|=*' 'l:|=* r:|=*' # case insensitive completion -zstyle ':completion:*' special-dirs true # Complete . and .. special directories -zstyle ':completion:*' list-colors '' # colorize completion lists -zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' # colorize kill list - -# fzf-tab -zstyle ':completion:*:git-checkout:*' sort false # disable sort when completing `git checkout` -zstyle ':completion:*:descriptions' format '[%d]' # set descriptions format to enable group support -zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} # set list-colors to enable filename colorizing -zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1 --color=always $realpath' # preview directory's content with exa when completing cd -zstyle ':fzf-tab:*' switch-group ',' '.' # switch group using `,` and `.` - - -### --- Load ZSH Configs, Aliases, Functions, and Shortcuts --- ### -# NOTE: the sequence of sourcing files is strict. Be careful to change the sequence. -[ -f "${ZDOTDIR:-${HOME}/.config/zsh}/git.zsh" ] && source "${ZDOTDIR:-${HOME}/.config/zsh}/git.zsh" -[ -f "${ZDOTDIR:-${HOME}/.config/zsh}/p10k.zsh" ] && source "${ZDOTDIR:-${HOME}/.config/zsh}/p10k.zsh" -[ -f "${ZDOTDIR:-${HOME}/.config/zsh}/autocomplete.zsh" ] && source "${ZDOTDIR:-${HOME}/.config/zsh}/autocomplete.zsh" -[ -f "${ZDOTDIR:-${HOME}/.config/zsh}/scripts.zsh" ] && source "${ZDOTDIR:-${HOME}/.config/zsh}/scripts.zsh" -[ -f "${ZDOTDIR:-${HOME}/.config/zsh}/keymaps.zsh" ] && source "${ZDOTDIR:-${HOME}/.config/zsh}/keymaps.zsh" -[ -f "${ZDOTDIR:-${HOME}/.config/zsh}/plugins.zsh" ] && source "${ZDOTDIR:-${HOME}/.config/zsh}/plugins.zsh" -[ -f "${ZDOTDIR:-${HOME}/.config/zsh}/packages.zsh" ] && source "${ZDOTDIR:-${HOME}/.config/zsh}/packages.zsh" -[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc" -[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/git-aliasrc" ] && source "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/git-aliasrc" -[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc" -[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutenvrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc" -[ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc" ] && source "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc" - - -### --- AVANTE --- ### -export AVANTE_ANTHROPIC_API_KEY="$(pass show api/claude/nvim | head -n1)" -export AVANTE_OPENAI_API_KEY="$(pass show api/chatGPT/nvim | head -n1)" -# export AVANTE_AZURE_OPENAI_API_KEY="$(pass show api/azure/nvim | head -n1)" -# export AVANTE_GEMINI_API_KEY="$(pass show api/gemini/nvim | head -n1)" -# export AVANTE_CO_API_KEY="$(pass show api/cohere/nvim | head -n1)" -# export AVANTE_AIHUBMIX_API_KEY="$(pass show api/aihubmix/nvim | head -n1)" -# export AVANTE_MOONSHOT_API_KEY="$(pass show api/moonshot/nvim | head -n1)" - - -### --- OPENAI --- ### -export OPENAI_API_KEY="$(pass show api/chatGPT/nvim | head -n1)" - - -## --- TMUX --- ### -if command -v tmux >/dev/null 2>&1 && [ -z "$TMUX" ]; then - terminal_count=$(pgrep -u "$USER" -ax "${TERMINAL:-st}" | grep -Ev 'ncmpcpp|newsboat|pulsemixer|spterm|splf|spcalc|stig|vimwikitodo' | wc -l) - if [ "$terminal_count" -le 1 ]; then - if ! tmux has-session 2>/dev/null; then - exec tmux new-session -s code - else - exec tmux attach-session - fi - fi -fi diff --git a/fedora/.config/zsh/autocomplete.zsh b/fedora/.config/zsh/autocomplete.zsh deleted file mode 100644 index 4763f71..0000000 --- a/fedora/.config/zsh/autocomplete.zsh +++ /dev/null @@ -1,70 +0,0 @@ -### --- Auto-completes aliases --- ### -# alias - normal aliases (completed with trailing space) -# balias - blank aliases (completed without space) -# ialias - ignored aliases (not completed) - - -# ignored aliases -typeset -a ialiases -ialiases=() - -ialias() { - alias $@ - args="$@" - args=${args%%\=*} - ialiases+=(${args##* }) -} - - -# blank aliases -typeset -a baliases -baliases=() - -balias() { - alias $@ - args="$@" - args=${args%%\=*} - baliases+=(${args##* }) -} - - -# functionality -expand-alias-space() { - [[ $LBUFFER =~ "\<(${(j:|:)baliases})\$" ]] && insertBlank=$? - if [[ ! $LBUFFER =~ "\<(${(j:|:)ialiases})\$" ]]; then - zle _expand_alias - zle expand-word - fi - zle self-insert - if [[ "$insertBlank" -eq 0 ]]; then - zle backward-delete-char - fi -} -zle -N expand-alias-space - - -# starts multiple args as programs in background -background() { - for ((i=2;i<=$#;i++)); do - ${@[1]} ${@[$i]} &> /dev/null & - done -} - - -# A function for expanding any aliases before accepting the line as is and executing the entered command -expand-alias-and-accept-line() { - expand-alias-space - # zle .backward-delete-char - zle .accept-line -} -# zle -N accept-line expand-alias-and-accept-line - - -bindkey '^ ' expand-alias-space # ctrl-space to bypass completion -bindkey ' ' magic-space -bindkey -M isearch ' ' magic-space - - -# file completion patterns -zstyle ':completion:*:*:nvim:*' file-patterns '^*.(pdf|odt|ods|doc|docx|xls|xlsx|odp|ppt|pptx|mp4|mkv|aux):source-files' '*:all-files' -zstyle ':completion:*:*:(build-workshop|build-document):*' file-patterns '*.mom' diff --git a/fedora/.config/zsh/git.zsh b/fedora/.config/zsh/git.zsh deleted file mode 100644 index e5633bf..0000000 --- a/fedora/.config/zsh/git.zsh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/zsh - -# Speed up git completion -# http://talkings.org/post/5236392664/zsh-and-slow-git-completion -__git_files () { - _wanted files expl 'local files' _files -} diff --git a/fedora/.config/zsh/keymaps.zsh b/fedora/.config/zsh/keymaps.zsh deleted file mode 100644 index 81b3027..0000000 --- a/fedora/.config/zsh/keymaps.zsh +++ /dev/null @@ -1,342 +0,0 @@ -#!/bin/zsh - -### --- CUSTOM FUNCTIONS --- ### -# man -function man-command-line() { pre_cmd "man"; } - -# sudo -function sudo-command-line() { pre_cmd "sudo"; } - -# clears the shell and displays the dir tree with level 2 -function clear-tree-2() { - clear - tree -L 2 - zle reset-prompt -} -zle -N clear-tree-2 - -# clears the shell and displays the dir tree with level 3 -function clear-tree-3() { clear && tree -L 3 && zle reset-prompt; } -zle -N clear-tree-3 - -# prints the current date in ISO 8601 -function print-current-date() { LBUFFER+=$(date -I); } -zle -N print-current-date - -# prints the current Unix timestamp -function print-unix-timestamp() { LBUFFER+=$(date +%s); } -zle -N print-unix-timestamp - -# git status -function git-status() { clear && git status && zle reset-prompt; } -zle -N git-status - -# appends the clipboard contents to the buffer -function vi-append-clip-selection() { char=${RBUFFER:0:1} && RBUFFER=${RBUFFER:1} && RBUFFER=$char$(clippaste)$RBUFFER; } - -# copy -function detect-clipboard() { - emulate -L zsh - - if [[ "${OSTYPE}" == darwin* ]] && (( ${+commands[pbcopy]} )) && (( ${+commands[pbpaste]} )); then - function clipcopy() { cat "${1:-/dev/stdin}" | pbcopy; } - function clippaste() { pbpaste; } - elif [[ "${OSTYPE}" == (cygwin|msys)* ]]; then - function clipcopy() { cat "${1:-/dev/stdin}" > /dev/clipboard; } - function clippaste() { cat /dev/clipboard; } - elif (( $+commands[clip.exe] )) && (( $+commands[powershell.exe] )); then - function clipcopy() { cat "${1:-/dev/stdin}" | clip.exe; } - function clippaste() { powershell.exe -noprofile -command Get-Clipboard; } - elif [ -n "${WAYLAND_DISPLAY:-}" ] && (( ${+commands[wl-copy]} )) && (( ${+commands[wl-paste]} )); then - function clipcopy() { cat "${1:-/dev/stdin}" | wl-copy &>/dev/null &|; } - function clippaste() { wl-paste --no-newline; } - elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xsel]} )); then - function clipcopy() { cat "${1:-/dev/stdin}" | xsel --clipboard --input; } - function clippaste() { xsel --clipboard --output; } - elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xclip]} )); then - function clipcopy() { cat "${1:-/dev/stdin}" | xclip -selection clipboard -in &>/dev/null &|; } - function clippaste() { xclip -out -selection clipboard; } - elif (( ${+commands[lemonade]} )); then - function clipcopy() { cat "${1:-/dev/stdin}" | lemonade copy; } - function clippaste() { lemonade paste; } - elif (( ${+commands[doitclient]} )); then - function clipcopy() { cat "${1:-/dev/stdin}" | doitclient wclip; } - function clippaste() { doitclient wclip -r; } - elif (( ${+commands[win32yank]} )); then - function clipcopy() { cat "${1:-/dev/stdin}" | win32yank -i; } - function clippaste() { win32yank -o; } - elif [[ $OSTYPE == linux-android* ]] && (( $+commands[termux-clipboard-set] )); then - function clipcopy() { cat "${1:-/dev/stdin}" | termux-clipboard-set; } - function clippaste() { termux-clipboard-get; } - elif [ -n "${TMUX:-}" ] && (( ${+commands[tmux]} )); then - function clipcopy() { tmux load-buffer "${1:--}"; } - function clippaste() { tmux save-buffer -; } - else - function _retry_clipboard_detection_or_fail() { - local clipcmd="${1}"; shift - if detect-clipboard; then - "${clipcmd}" "$@" - else - print "${clipcmd}: Platform $OSTYPE not supported or xclip/xsel not installed" >&2 - return 1 - fi - } - function clipcopy() { _retry_clipboard_detection_or_fail clipcopy "$@"; } - function clippaste() { _retry_clipboard_detection_or_fail clippaste "$@"; } - return 1 - fi -} - -function clipcopy clippaste { - unfunction clipcopy clippaste - detect-clipboard || true # let one retry - "$0" "$@" -} - -function copybuffer () { - if builtin which clipcopy &>/dev/null; then - printf "%s" "$BUFFER" | clipcopy - fi -} - -# Function to switch to the left tmux pane and maximize it -function tmux_left_pane() { - export TMUX_PANE_DIRECTION="right" - if [[ $TMUX_PANE_DIRECTION == "right" ]]; then - tmux select-pane -L # Move to the left (opposite of right) - elif [[ $TMUX_PANE_DIRECTION == "bottom" ]]; then - tmux select-pane -U # Move to the top (opposite of bottom) - fi - tmux resize-pane -Z -} - - -### --- GLOBAL --- ### -# emacs style -bindkey '^a' beginning-of-line -bindkey '^e' end-of-line - -# function key bindings -bindkey '^X^E' clear-tree-2 -bindkey '^X^W' clear-tree-3 -bindkey '^X^S' git-status -bindkey '^X^X^T' print-current-date -bindkey '^X^X^U' print-unix-timestamp - - -### --- VI-MODE --- ### -if [[ -f "${ZPLUGINDIR:-${HOME}/.local/bin/zsh}/zsh-vi-mode/zsh-vi-mode.plugin.zsh" ]]; then - ### --- ZSH-VI-MODE--- ### - # config - ZVM_INIT_MODE=sourcing - ZVM_VI_ESCAPE_BINDKEY=jk - ZVM_VI_INSERT_ESCAPE_BINDKEY=$ZVM_VI_ESCAPE_BINDKEY - ZVM_VI_VISUAL_ESCAPE_BINDKEY=$ZVM_VI_ESCAPE_BINDKEY - ZVM_VI_OPPEND_ESCAPE_BINDKEY=$ZVM_VI_ESCAPE_BINDKEY - ZVM_INSERT_MODE_CURSOR=$ZVM_CURSOR_BLINKING_BEAM - ZVM_NORMAL_MODE_CURSOR=$ZVM_CURSOR_BLOCK - ZVM_OPPEND_MODE_CURSOR=$ZVM_CURSOR_UNDERLINE - ZVM_LAZY_KEYBINDINGS=false - # ZVM_VI_HIGHLIGHT_BACKGROUND=#458588 - - - function zvm_bind_script() { - local keymap="$1" - local key="$2" - local script="$3" - - # Dynamically define a widget to run the script - eval "function run_script_${keymap}_${key//\^/}() { - zle -I - $script - zle reset-prompt - }" - - # Register the widget with zsh-vi-mode - zvm_define_widget "run_script_${keymap}_${key//\^/}" - zvm_bindkey "$keymap" "$key" "run_script_${keymap}_${key//\^/}" - } - - function zvm_after_init() { - ### --- KEY BINDINGS --- ### - # programs & scripts - bindkey -s '^B' '^ubc -lq\n' - bindkey -s '^D' '^ucdi\n' - bindkey -s '^F' '^ufzffiles\n' - bindkey -s '^G' '^ulf\n' - # bindkey -s '^G' '^uyazi\n' - bindkey -s '^N' '^ulastfiles\n' - bindkey -s '^O' '^utmo\n' - bindkey -s '^P' '^ufzfpass\n' - bindkey -s '^Q' '^uhtop\n' - bindkey -s '^T' '^usessionizer\n' - bindkey -s '^Y' '^ulfcd\n' - # bindkey -s '^Y' '^uyazicd\n' - bindkey -s '^Z' '^upd\n' - # bindkey -s '^_' '^u\n' - - # ctrl+x key bindings - zvm_bind_script viins '^X^A' 'ali' - zvm_bind_script viins '^X^B' 'gitopenbranch' - zvm_bind_script viins '^X^D' 'fD' - zvm_bind_script viins '^X^F' 'gitfiles' - zvm_bind_script viins '^X^G' 'rgafiles ' - zvm_bind_script viins '^X^L' 'gloac' - zvm_bind_script viins '^X^N' 'lastfiles -l' - # zvm_bind_script viins '^X^O' '^u\n' - zvm_bind_script viins '^X^Q' 'fpkill' - zvm_bind_script viins '^X^R' 'fgst' - zvm_bind_script viins '^X^T' 'gitstagedfiles' - zvm_bind_script viins '^X^U' 'gitupdate' - # zvm_bind_script viins '^X^]' '^u\n' - zvm_bind_script viins '^X^_' 'fzffns' - zvm_bind_script viins '^X^X^B' 'rbackup' - zvm_bind_script viins '^X^X^P' 'pcyr' - zvm_bind_script viins '^X^X^R' 'rbackup -r' - zvm_bind_script viins '^X^X^S' 'sshadd' - zvm_bind_script viins '^X^X^Y' 'yay -Syu && remaps' - - # widgets - zvm_define_widget sudo-command-line - zvm_bindkey vicmd '^S' sudo-command-line - zvm_bindkey viins '^S' sudo-command-line - zvm_define_widget insert_last_command_output - zvm_bindkey viins '^]' insert_last_command_output - zvm_define_widget tmux_left_pane - zvm_bindkey vicmd '^[\' tmux_left_pane - zvm_bindkey viins '^[\' tmux_left_pane - zvm_define_widget man-command-line - zvm_bindkey vicmd '^X^M' man-command-line - zvm_bindkey viins '^X^M' man-command-line - zvm_define_widget vi-append-clip-selection - zvm_bindkey viins "^X^P" vi-append-clip-selection - zvm_bindkey vicmd "^X^P" vi-append-clip-selection - zvm_define_widget copybuffer - zvm_bindkey viins "^X^Y" copybuffer - zvm_bindkey vicmd "^X^Y" copybuffer - } - - # key bindings (lazy) - # function zvm_after_lazy_keybindings() { - # - # } - - # Append a command directly - # Since the default initialization mode, this plugin will overwrite the previous key - # bindings, this causes the key bindings of other plugins (i.e. fzf, zsh-autocomplete, etc.) to fail. - # zvm_after_init_commands+=('[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh') - # function zvm_after_init() { - # [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh - # } -else - ### --- Built-in --- ### - # Cursor shape - bindkey -v # activate vim mode. - KEYTIMEOUT=5 - - # Change cursor shape for different vi modes. - function zle-keymap-select () { - case "$KEYMAP $1" in - vicmd*|*block) echo -ne '\e[1 q' ;; # block - viins*|main*|''|*beam) echo -ne '\e[5 q' ;; # beam - esac - } - zle -N zle-keymap-select - - function zle-line-init() { - zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere) - echo -ne "\e[5 q" - } - zle -N zle-line-init - echo -ne '\e[5 q' # Use beam shape cursor on startup. - function preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt. - - - ### --- VI-MODE KEY BINDINGS --- ### - bindkey -M menuselect 'h' vi-backward-char - bindkey -M menuselect 'l' vi-forward-char - bindkey -M menuselect 'k' vi-up-line-or-history - bindkey -M menuselect 'j' vi-down-line-or-history - bindkey -v '^?' backward-delete-char - bindkey '^[[P' delete-char - - # edit line in vim with ctrl-v in viins and ctrl-e in vicmd - autoload edit-command-line - zle -N edit-command-line - bindkey '^X^V' edit-command-line # ctrl-v - bindkey -M vicmd '^[[P' vi-delete-char # delete - bindkey -M vicmd '^e' edit-command-line # ctrl-e - bindkey -M visual '^[[P' vi-delete # delete - bindkey -M viins 'jk' vi-cmd-mode # normal mode - - # last command output - zle -N insert_last_command_output - bindkey -M viins '^]' insert_last_command_output - - # man - zle -N man-command-line - bindkey -M emacs '^X^M' man-command-line - bindkey -M vicmd '^X^M' man-command-line - bindkey -M viins '^X^M' man-command-line - - # sudo - zle -N sudo-command-line - bindkey -M emacs '^S' sudo-command-line - bindkey -M vicmd '^S' sudo-command-line - bindkey -M viins '^S' sudo-command-line - - # bind y/Y to yank until end of line/yank whole line - # bindkey -M vicmd y zsh-system-clipboard-vicmd-vi-yank-eol - # bindkey -M vicmd Y zsh-system-clipboard-vicmd-vi-yank-whole-line - - # appends the clipboard contents to the buffer - zle -N vi-append-clip-selection - bindkey -M emacs "^X^P" vi-append-clip-selection - bindkey -M viins "^X^P" vi-append-clip-selection - bindkey -M vicmd "^X^P" vi-append-clip-selection - - # copy buffer - zle -N copybuffer - bindkey -M emacs "^X^Y" copybuffer - bindkey -M viins "^X^Y" copybuffer - bindkey -M vicmd "^X^Y" copybuffer - - # Register the function as a ZLE widget - zle -N tmux_left_pane - bindkey -M vicmd '^[\' tmux_left_pane - bindkey -M viins '^[\' tmux_left_pane - - ### --- DEFAULT KEY BINDINGS --- ### - # programs & scripts - bindkey -s '^B' '^ubc -lq\n' - bindkey -s '^D' '^ucdi\n' - bindkey -s '^F' '^ufzffiles\n' - bindkey -s '^G' '^ulf\n' - bindkey -s '^N' '^ulastfiles\n' - bindkey -s '^O' '^utmo\n' - bindkey -s '^P' '^ufzfpass\n' - bindkey -s '^Q' '^uhtop\n' - bindkey -s '^T' '^usessionizer\n' - bindkey -s '^Y' '^ulfcd\n' - bindkey -s '^Z' '^upd\n' - bindkey -s '^_' '^ucht\n' - bindkey -s '^X^A' '^uali\n' - bindkey -s '^X^B' '^ugitopenbranch\n' - bindkey -s '^X^D' '^ufD\n' - bindkey -s '^X^F' '^ugitfiles\n' - bindkey -s '^X^G' '^urgafiles ' - bindkey -s '^X^L' '^ugloac\n' - bindkey -s '^X^N' '^ulastfiles -l\n' - # bindkey -s '^X^O' '^u\n' - bindkey -s '^X^Q' '^ufpkill\n' - bindkey -s '^X^R' '^ufgst\n' - bindkey -s '^X^T' '^ugitstagedfiles\n' - bindkey -s '^X^U' '^ugitupdate\n' - # bindkey -s '^X^]' '^u\n' - bindkey -s '^X^_' '^ufzffns\n' - bindkey -s '^X^X^B' '^urbackup\n' - bindkey -s '^X^X^P' '^upcyr\n' - bindkey -s '^X^X^R' '^urbackup -r\n' - bindkey -s '^X^X^S' '^usshadd\n' - bindkey -s '^X^X^Y' '^uyay -Syu && remaps\n' -fi diff --git a/fedora/.config/zsh/p10k.zsh b/fedora/.config/zsh/p10k.zsh deleted file mode 100644 index 604d76d..0000000 --- a/fedora/.config/zsh/p10k.zsh +++ /dev/null @@ -1,1721 +0,0 @@ -#!/bin/zsh - -# Generated by Powerlevel10k configuration wizard on 2024-03-06 at 08:21 CST. -# Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 52020. -# Wizard options: nerdfont-v3 + powerline, large icons, unicode, lean, 24h time, -# 2 lines, disconnected, no frame, sparse, many icons, fluent, transient_prompt, -# instant_prompt=verbose. -# Type `p10k configure` to generate another config. -# -# Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate -# your own config based on it. -# -# Tip: Looking for a nice color? Here's a one-liner to print colormap. -# -# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done - -# Temporarily change options. -'builtin' 'local' '-a' 'p10k_config_opts' -[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') -[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') -[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') -'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' - -() { - emulate -L zsh -o extended_glob - - # Unset all configuration options. This allows you to apply configuration changes without - # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. - unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' - - # Zsh >= 5.1 is required. - [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return - - # The list of segments shown on the left. Fill it with the most important segments. - typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( - # =========================[ Line #1 ]========================= - os_icon # os identifier - dir # current directory - vcs # git status - # =========================[ Line #2 ]========================= - newline # \n - prompt_char # prompt symbol - ) - - # The list of segments shown on the right. Fill it with less important segments. - # Right prompt on the last prompt line (where you are typing your commands) gets - # automatically hidden when the input line reaches it. Right prompt above the - # last prompt line gets hidden if it would overlap with left prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( - # =========================[ Line #1 ]========================= - status # exit code of the last command - command_execution_time # duration of the last command - background_jobs # presence of background jobs - direnv # direnv status (https://direnv.net/) - asdf # asdf version manager (https://github.com/asdf-vm/asdf) - virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) - anaconda # conda environment (https://conda.io/) - pyenv # python environment (https://github.com/pyenv/pyenv) - goenv # go environment (https://github.com/syndbg/goenv) - nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) - nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) - nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) - # node_version # node.js version - # go_version # go version (https://golang.org) - # rust_version # rustc version (https://www.rust-lang.org) - # dotnet_version # .NET version (https://dotnet.microsoft.com) - # php_version # php version (https://www.php.net/) - # laravel_version # laravel php framework version (https://laravel.com/) - # java_version # java version (https://www.java.com/) - # package # name@version from package.json (https://docs.npmjs.com/files/package.json) - rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv) - rvm # ruby version from rvm (https://rvm.io) - fvm # flutter version management (https://github.com/leoafarias/fvm) - luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) - jenv # java version from jenv (https://github.com/jenv/jenv) - plenv # perl version from plenv (https://github.com/tokuhirom/plenv) - perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew) - phpenv # php version from phpenv (https://github.com/phpenv/phpenv) - scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) - haskell_stack # haskell version from stack (https://haskellstack.org/) - kubecontext # current kubernetes context (https://kubernetes.io/) - terraform # terraform workspace (https://www.terraform.io) - # terraform_version # terraform version (https://www.terraform.io) - aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) - aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) - azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) - gcloud # google cloud cli account and project (https://cloud.google.com/) - google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) - toolbox # toolbox name (https://github.com/containers/toolbox) - context # user@hostname - nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) - ranger # ranger shell (https://github.com/ranger/ranger) - yazi # yazi shell (https://github.com/sxyazi/yazi) - nnn # nnn shell (https://github.com/jarun/nnn) - lf # lf shell (https://github.com/gokcehan/lf) - xplr # xplr shell (https://github.com/sayanarijit/xplr) - vim_shell # vim shell indicator (:sh) - midnight_commander # midnight commander shell (https://midnight-commander.org/) - nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) - chezmoi_shell # chezmoi shell (https://www.chezmoi.io/) - # vpn_ip # virtual private network indicator - load # CPU load - # disk_usage # disk usage - ram # free RAM - # swap # used swap - todo # todo items (https://github.com/todotxt/todo.txt-cli) - timewarrior # timewarrior tracking status (https://timewarrior.net/) - taskwarrior # taskwarrior task count (https://taskwarrior.org/) - per_directory_history # Oh My Zsh per-directory-history local/global indicator - # cpu_arch # CPU architecture - time # current time - # =========================[ Line #2 ]========================= - newline - # ip # ip address and bandwidth usage for a specified network interface - # public_ip # public IP address - proxy # system-wide http/https/ftp proxy - battery # internal battery - # wifi # wifi speed - # example # example user-defined segment (see prompt_example function below) - ) - - # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. - typeset -g POWERLEVEL9K_MODE=nerdfont-v3 - # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid - # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. - typeset -g POWERLEVEL9K_ICON_PADDING=moderate - - # Basic style options that define the overall look of your prompt. You probably don't want to - # change them. - typeset -g POWERLEVEL9K_BACKGROUND= # transparent background - typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace - typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space - typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol - - # When set to true, icons appear before content on both sides of the prompt. When set - # to false, icons go after content. If empty or not set, icons go before content in the left - # prompt and after content in the right prompt. - # - # You can also override it for a specific segment: - # - # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false - # - # Or for a specific segment in specific state: - # - # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false - typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=true - - # Add an empty line before each prompt. - typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true - - # Connect left prompt lines with these symbols. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX= - typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX= - typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX= - # Connect right prompt lines with these symbols. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX= - typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX= - typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX= - - # The left end of left prompt. - typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= - # The right end of right prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL= - - # Ruler, a.k.a. the horizontal line before each prompt. If you set it to true, you'll - # probably want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false above and - # POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' below. - typeset -g POWERLEVEL9K_SHOW_RULER=false - typeset -g POWERLEVEL9K_RULER_CHAR='โ”€' # reasonable alternative: 'ยท' - typeset -g POWERLEVEL9K_RULER_FOREGROUND=242 - - # Filler between left and right prompt on the first prompt line. You can set it to 'ยท' or 'โ”€' - # to make it easier to see the alignment between left and right prompt and to separate prompt - # from command output. It serves the same purpose as ruler (see above) without increasing - # the number of prompt lines. You'll probably want to set POWERLEVEL9K_SHOW_RULER=false - # if using this. You might also like POWERLEVEL9K_PROMPT_ADD_NEWLINE=false for more compact - # prompt. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' - if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then - # The color of the filler. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=242 - # Add a space between the end of left prompt and the filler. - typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=' ' - # Add a space between the filler and the start of right prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL=' ' - # Start filler from the edge of the screen if there are no left segments on the first line. - typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' - # End filler on the edge of the screen if there are no right segments on the first line. - typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' - fi - - #################################[ os_icon: os identifier ]################################## - # OS identifier color. - typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND= - # Custom icon. - # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='โญ' - - ################################[ prompt_char: prompt symbol ]################################ - # Green prompt symbol if the last command succeeded. - typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 - # Red prompt symbol if the last command failed. - typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196 - # Default prompt symbol. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='โฏ' - # Prompt symbol in command vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='๎˜ซ' - # Prompt symbol in visual vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' - # Prompt symbol in overwrite vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='โ–ถ' - typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true - # No line terminator if prompt_char is the last segment. - typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='' - # No line introducer if prompt_char is the first segment. - typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= - - ##################################[ dir: current directory ]################################## - # Default current directory color. - typeset -g POWERLEVEL9K_DIR_FOREGROUND=31 - # If directory is too long, shorten some of its segments to the shortest possible unique - # prefix. The shortened directory can be tab-completed to the original. - typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique - # Replace removed segment suffixes with this symbol. - typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= - # Color of the shortened directory segments. - typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=103 - # Color of the anchor directory segments. Anchor segments are never shortened. The first - # segment is always an anchor. - typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=39 - # Display anchor directory segments in bold. - typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true - # Don't shorten directories that contain any of these files. They are anchors. - local anchor_files=( - .bzr - .citc - .git - .hg - .node-version - .python-version - .go-version - .ruby-version - .lua-version - .java-version - .perl-version - .php-version - .tool-versions - .shorten_folder_marker - .svn - .terraform - CVS - Cargo.toml - composer.json - go.mod - package.json - stack.yaml - ) - typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" - # If set to "first" ("last"), remove everything before the first (last) subdirectory that contains - # files matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is - # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) - # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers - # and other directories don't. - # - # Optionally, "first" and "last" can be followed by ":" where is an integer. - # This moves the truncation point to the right (positive offset) or to the left (negative offset) - # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" - # respectively. - typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false - # Don't shorten this many last directory segments. They are anchors. - typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 - # Shorten directory if it's longer than this even if there is space for it. The value can - # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty, - # directory will be shortened only when prompt doesn't fit or when other parameters demand it - # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). - # If set to `0`, directory will always be shortened to its minimum length. - typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 - # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this - # many columns for typing commands. - typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 - # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least - # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands. - typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 - # If set to true, embed a hyperlink into the directory. Useful for quickly - # opening a directory in the file manager simply by clicking the link. - # Can also be handy when the directory is shortened, as it allows you to see - # the full directory that was used in previous commands. - typeset -g POWERLEVEL9K_DIR_HYPERLINK=false - - # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON - # and POWERLEVEL9K_DIR_CLASSES below. - typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 - - # The default icon shown next to non-writable and non-existent directories when - # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. - # typeset -g POWERLEVEL9K_LOCK_ICON='โญ' - - # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different - # directories. It must be an array with 3 * N elements. Each triplet consists of: - # - # 1. A pattern against which the current directory ($PWD) is matched. Matching is done with - # extended_glob option enabled. - # 2. Directory class for the purpose of styling. - # 3. An empty string. - # - # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. - # - # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories - # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_DIR_CLASSES=( - # '~/work(|/*)' WORK '' - # '~(|/*)' HOME '' - # '*' DEFAULT '') - # - # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one - # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or - # WORK_NON_EXISTENT. - # - # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an - # option to define custom colors and icons for different directory classes. - # - # # Styling for WORK. - # typeset -g POWERLEVEL9K_DIR_WORK_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=31 - # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=103 - # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=39 - # - # # Styling for WORK_NOT_WRITABLE. - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=31 - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=103 - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=39 - # - # # Styling for WORK_NON_EXISTENT. - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=31 - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=103 - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=39 - # - # If a styling parameter isn't explicitly defined for some class, it falls back to the classless - # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls - # back to POWERLEVEL9K_DIR_FOREGROUND. - # - # typeset -g POWERLEVEL9K_DIR_CLASSES=() - - # Custom prefix. - # typeset -g POWERLEVEL9K_DIR_PREFIX='%fin ' - - #####################################[ vcs: git status ]###################################### - # Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon. - typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 ' - - # Untracked files icon. It's really a question mark, your font isn't broken. - # Change the value of this parameter to show a different icon. - typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' - - # Formatter for Git status. - # - # Example output: master wip โ‡ฃ42โ‡ก42 *42 merge ~42 +42 !42 ?42. - # - # You can edit the function to customize how Git status looks. - # - # VCS_STATUS_* parameters are set by gitstatus plugin. See reference: - # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. - function my_git_formatter() { - emulate -L zsh - - if [[ -n $P9K_CONTENT ]]; then - # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from - # gitstatus plugin). VCS_STATUS_* parameters are not available in this case. - typeset -g my_git_format=$P9K_CONTENT - return - fi - - if (( $1 )); then - # Styling for up-to-date Git status. - local meta='%f' # default foreground - local clean='%76F' # green foreground - local modified='%178F' # yellow foreground - local untracked='%39F' # blue foreground - local conflicted='%196F' # red foreground - else - # Styling for incomplete and stale Git status. - local meta='%244F' # grey foreground - local clean='%244F' # grey foreground - local modified='%244F' # grey foreground - local untracked='%244F' # grey foreground - local conflicted='%244F' # grey foreground - fi - - local res - - if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then - local branch=${(V)VCS_STATUS_LOCAL_BRANCH} - # If local branch name is at most 32 characters long, show it in full. - # Otherwise show the first 12 โ€ฆ the last 12. - # Tip: To always show local branch name in full without truncation, delete the next line. - (( $#branch > 32 )) && branch[13,-13]="โ€ฆ" # <-- this line - res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" - fi - - if [[ -n $VCS_STATUS_TAG - # Show tag only if not on a branch. - # Tip: To always show tag, delete the next line. - && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line - ]]; then - local tag=${(V)VCS_STATUS_TAG} - # If tag name is at most 32 characters long, show it in full. - # Otherwise show the first 12 โ€ฆ the last 12. - # Tip: To always show tag name in full without truncation, delete the next line. - (( $#tag > 32 )) && tag[13,-13]="โ€ฆ" # <-- this line - res+="${meta}#${clean}${tag//\%/%%}" - fi - - # Display the current Git commit if there is no branch and no tag. - # Tip: To always display the current Git commit, delete the next line. - [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line - res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" - - # Show tracking branch name if it differs from local branch. - if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then - res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" - fi - - # Display "wip" if the latest commit's summary contains "wip" or "WIP". - if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then - res+=" ${modified}wip" - fi - - if (( VCS_STATUS_COMMITS_AHEAD || VCS_STATUS_COMMITS_BEHIND )); then - # โ‡ฃ42 if behind the remote. - (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}โ‡ฃ${VCS_STATUS_COMMITS_BEHIND}" - # โ‡ก42 if ahead of the remote; no leading space if also behind the remote: โ‡ฃ42โ‡ก42. - (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " - (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}โ‡ก${VCS_STATUS_COMMITS_AHEAD}" - elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then - # Tip: Uncomment the next line to display '=' if up to date with the remote. - # res+=" ${clean}=" - fi - - # โ‡ 42 if behind the push remote. - (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}โ‡ ${VCS_STATUS_PUSH_COMMITS_BEHIND}" - (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " - # โ‡ข42 if ahead of the push remote; no leading space if also behind: โ‡ 42โ‡ข42. - (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}โ‡ข${VCS_STATUS_PUSH_COMMITS_AHEAD}" - # *42 if have stashes. - (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}" - # 'merge' if the repo is in an unusual state. - [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" - # ~42 if have merge conflicts. - (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" - # +42 if have staged changes. - (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" - # !42 if have unstaged changes. - (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" - # ?42 if have untracked files. It's really a question mark, your font isn't broken. - # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon. - # Remove the next line if you don't want to see untracked files at all. - (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" - # "โ”€" if the number of unstaged files is unknown. This can happen due to - # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower - # than the number of files in the Git index, or due to bash.showDirtyState being set to false - # in the repository config. The number of staged and untracked files may also be unknown - # in this case. - (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}โ”€" - - typeset -g my_git_format=$res - } - functions -M my_git_formatter 2>/dev/null - - # Don't count the number of unstaged, untracked and conflicted files in Git repositories with - # more than this many files in the index. Negative value means infinity. - # - # If you are working in Git repositories with tens of millions of files and seeing performance - # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output - # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's - # config: `git config bash.showDirtyState false`. - typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 - - # Don't show Git status in prompt for repositories whose workdir matches this pattern. - # For example, if set to '~', the Git repository at $HOME/.git will be ignored. - # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. - typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' - - # Disable the default Git status formatting. - typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true - # Install our own Git status formatter. - typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter(1)))+${my_git_format}}' - typeset -g POWERLEVEL9K_VCS_LOADING_CONTENT_EXPANSION='${$((my_git_formatter(0)))+${my_git_format}}' - # Enable counters for staged, unstaged, etc. - typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 - - # Icon color. - typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_COLOR=76 - typeset -g POWERLEVEL9K_VCS_LOADING_VISUAL_IDENTIFIER_COLOR=244 - # Custom icon. - # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='โญ' - # Custom prefix. - typeset -g POWERLEVEL9K_VCS_PREFIX='%fon ' - - # Show status of repositories of these types. You can add svn and/or hg if you are - # using them. If you do, your prompt may become slow even when your current directory - # isn't in an svn or hg repository. - typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) - - # These settings are used for repositories other than Git or when gitstatusd fails and - # Powerlevel10k has to fall back to using vcs_info. - typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=76 - typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=76 - typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=178 - - ##########################[ status: exit code of the last command ]########################### - # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and - # style them independently from the regular OK and ERROR state. - typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true - - # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as - # it will signify success by turning green. - typeset -g POWERLEVEL9K_STATUS_OK=false - typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=70 - typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='โœ”' - - # Status when some part of a pipe command fails but the overall exit status is zero. It may look - # like this: 1|0. - typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true - typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=70 - typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='โœ”' - - # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as - # it will signify error by turning red. - typeset -g POWERLEVEL9K_STATUS_ERROR=false - typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=160 - typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='โœ˜' - - # Status when the last command was terminated by a signal. - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=160 - # Use terse signal names: "INT" instead of "SIGINT(2)". - typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='โœ˜' - - # Status when some part of a pipe command fails and the overall exit status is also non-zero. - # It may look like this: 1|0. - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=160 - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='โœ˜' - - ###################[ command_execution_time: duration of the last command ]################### - # Show duration of the last command if takes at least this many seconds. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 - # Show this many fractional digits. Zero means round to seconds. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 - # Execution time color. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=101 - # Duration format: 1d 2h 3m 4s. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' - # Custom icon. - # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='โญ' - # Custom prefix. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%ftook ' - - #######################[ background_jobs: presence of background jobs ]####################### - # Don't show the number of background jobs. - typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false - # Background jobs color. - typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=70 - # Custom icon. - # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='โญ' - - #######################[ direnv: direnv status (https://direnv.net/) ]######################## - # Direnv color. - typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=178 - # Custom icon. - # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### - # Default asdf color. Only used to display tools for which there is no color override (see below). - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND. - typeset -g POWERLEVEL9K_ASDF_FOREGROUND=66 - - # There are four parameters that can be used to hide asdf tools. Each parameter describes - # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at - # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to - # hide a tool, it gets shown. - # - # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and - # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands: - # - # asdf local python 3.8.1 - # asdf global python 3.8.1 - # - # After running both commands the current python version is 3.8.1 and its source is "local" as - # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, - # it'll hide python version in this case because 3.8.1 is the same as the global version. - # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't - # contain "local". - - # Hide tool versions that don't come from one of these sources. - # - # Available sources: - # - # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" - # - local `asdf current` says "set by /some/not/home/directory/file" - # - global `asdf current` says "set by /home/username/file" - # - # Note: If this parameter is set to (shell local global), it won't hide tools. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. - typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) - - # If set to false, hide tool versions that are the same as global. - # - # Note: The name of this parameter doesn't reflect its meaning at all. - # Note: If this parameter is set to true, it won't hide tools. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. - typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false - - # If set to false, hide tool versions that are equal to "system". - # - # Note: If this parameter is set to true, it won't hide tools. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. - typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true - - # If set to non-empty value, hide tools unless there is a file matching the specified file pattern - # in the current directory, or its parent directory, or its grandparent directory, and so on. - # - # Note: If this parameter is set to empty value, it won't hide tools. - # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB. - # - # Example: Hide nodejs version when there is no package.json and no *.js files in the current - # directory, in `..`, in `../..` and so on. - # - # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json' - typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= - - # Ruby version from asdf. - typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=168 - # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Python version from asdf. - typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=37 - # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Go version from asdf. - typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=37 - # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Node.js version from asdf. - typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=70 - # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Rust version from asdf. - typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=37 - # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar' - - # .NET Core version from asdf. - typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=134 - # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_ASDF_DOTNET_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Flutter version from asdf. - typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=38 - # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Lua version from asdf. - typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=32 - # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Java version from asdf. - typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=32 - # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Perl version from asdf. - typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=67 - # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Erlang version from asdf. - typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=125 - # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Elixir version from asdf. - typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=129 - # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Postgres version from asdf. - typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=31 - # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar' - - # PHP version from asdf. - typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=99 - # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Haskell version from asdf. - typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=172 - # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Julia version from asdf. - typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=70 - # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' - - ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### - # NordVPN connection indicator color. - typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39 - # Hide NordVPN connection indicator when not connected. - typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= - typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= - # Custom icon. - # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='โญ' - - #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## - # Ranger shell color. - typeset -g POWERLEVEL9K_RANGER_FOREGROUND=178 - # Custom icon. - # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ####################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]##################### - # Yazi shell color. - typeset -g POWERLEVEL9K_YAZI_FOREGROUND=178 - # Custom icon. - # typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### - # Nnn shell color. - typeset -g POWERLEVEL9K_NNN_FOREGROUND=72 - # Custom icon. - # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ######################[ lf: lf shell (https://github.com/gokcehan/lf) ]####################### - # lf shell color. - typeset -g POWERLEVEL9K_LF_FOREGROUND=72 - # Custom icon. - # typeset -g POWERLEVEL9K_LF_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## - # xplr shell color. - typeset -g POWERLEVEL9K_XPLR_FOREGROUND=72 - # Custom icon. - # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ###########################[ vim_shell: vim shell indicator (:sh) ]########################### - # Vim shell indicator color. - typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34 - # Custom icon. - # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### - # Midnight Commander shell color. - typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=178 - # Custom icon. - # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='โญ' - - #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## - # Nix shell color. - typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74 - - # Display the icon of nix_shell if PATH contains a subdirectory of /nix/store. - # typeset -g POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH=false - - # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. - # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= - - # Custom icon. - # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ##################[ chezmoi_shell: chezmoi shell (https://www.chezmoi.io/) ]################## - # chezmoi shell color. - typeset -g POWERLEVEL9K_CHEZMOI_SHELL_FOREGROUND=33 - # Custom icon. - # typeset -g POWERLEVEL9K_CHEZMOI_SHELL_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ##################################[ disk_usage: disk usage ]################################## - # Colors for different levels of disk usage. - typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=35 - typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=220 - typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=160 - # Thresholds for different levels of disk usage (percentage points). - typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 - typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 - # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent. - typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false - # Custom icon. - # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ######################################[ ram: free RAM ]####################################### - # RAM color. - typeset -g POWERLEVEL9K_RAM_FOREGROUND=66 - # Custom icon. - # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='โญ' - - #####################################[ swap: used swap ]###################################### - # Swap color. - typeset -g POWERLEVEL9K_SWAP_FOREGROUND=96 - # Custom icon. - # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ######################################[ load: CPU load ]###################################### - # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. - typeset -g POWERLEVEL9K_LOAD_WHICH=5 - # Load color when load is under 50%. - typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=66 - # Load color when load is between 50% and 70%. - typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=178 - # Load color when load is over 70%. - typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=166 - # Custom icon. - # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ - # Todo color. - typeset -g POWERLEVEL9K_TODO_FOREGROUND=110 - # Hide todo when the total number of tasks is zero. - typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true - # Hide todo when the number of tasks after filtering is zero. - typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false - - # Todo format. The following parameters are available within the expansion. - # - # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks. - # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering. - # - # These variables correspond to the last line of the output of `todo.sh -p ls`: - # - # TODO: 24 of 42 tasks shown - # - # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT. - # - # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' - - # Custom icon. - # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############ - # Timewarrior color. - typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=110 - # If the tracked task is longer than 24 characters, truncate and append "โ€ฆ". - # Tip: To always display tasks without truncation, delete the following parameter. - # Tip: To hide task names and display just the icon when time tracking is enabled, set the - # value of the following parameter to "". - typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+โ€ฆ}' - - # Custom icon. - # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## - # Taskwarrior color. - typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=74 - - # Taskwarrior segment format. The following parameters are available within the expansion. - # - # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. - # - P9K_TASKWARRIOR_OVERDUE_COUNT The number of overdue tasks: `task +OVERDUE count`. - # - # Zero values are represented as empty parameters. - # - # The default format: - # - # '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT' - # - # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT' - - # Custom icon. - # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ######[ per_directory_history: Oh My Zsh per-directory-history local/global indicator ]####### - # Color when using local/global history. - typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_FOREGROUND=135 - typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_FOREGROUND=130 - - # Tip: Uncomment the next two lines to hide "local"/"global" text and leave just the icon. - # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_CONTENT_EXPANSION='' - # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_CONTENT_EXPANSION='' - - # Custom icon. - # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ################################[ cpu_arch: CPU architecture ]################################ - # CPU architecture color. - typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=172 - - # Hide the segment when on a specific CPU architecture. - # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_CONTENT_EXPANSION= - # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_VISUAL_IDENTIFIER_EXPANSION= - - # Custom icon. - # typeset -g POWERLEVEL9K_CPU_ARCH_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ##################################[ context: user@hostname ]################################## - # Context color when running with privileges. - typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=178 - # Context color in SSH without privileges. - typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=180 - # Default context color (no privileges, no SSH). - typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=180 - - # Context format when running with privileges: bold user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n@%m' - # Context format when in SSH without privileges: user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m' - # Default context format (no privileges, no SSH): user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m' - - # Don't show context unless running with privileges or in SSH. - # Tip: Remove the next line to always show context. - typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= - - # Custom icon. - # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='โญ' - # Custom prefix. - typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%fwith ' - - ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### - # Python virtual environment color. - typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37 - # Don't show Python version next to the virtual environment name. - typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false - # If set to "false", won't show virtualenv if pyenv is already shown. - # If set to "if-different", won't show virtualenv if it's the same as pyenv. - typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false - # Separate environment name from Python version only with a space. - typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= - # Custom icon. - # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='โญ' - - #####################[ anaconda: conda environment (https://conda.io/) ]###################### - # Anaconda environment color. - typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=37 - - # Anaconda segment format. The following parameters are available within the expansion. - # - # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. - # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. - # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). - # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). - # - # CONDA_PROMPT_MODIFIER can be configured with the following command: - # - # conda config --set env_prompt '({default_env}) ' - # - # The last argument is a Python format string that can use the following variables: - # - # - prefix The same as CONDA_PREFIX. - # - default_env The same as CONDA_DEFAULT_ENV. - # - name The last segment of CONDA_PREFIX. - # - stacked_env Comma-separated list of names in the environment stack. The first element is - # always the same as default_env. - # - # Note: '({default_env}) ' is the default value of env_prompt. - # - # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER - # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former - # is empty. - typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' - - # Custom icon. - # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ - # Pyenv color. - typeset -g POWERLEVEL9K_PYENV_FOREGROUND=37 - # Hide python version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) - # If set to false, hide python version if it's the same as global: - # $(pyenv version-name) == $(pyenv global). - typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide python version if it's equal to "system". - typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true - - # Pyenv segment format. The following parameters are available within the expansion. - # - # - P9K_CONTENT Current pyenv environment (pyenv version-name). - # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). - # - # The default format has the following logic: - # - # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or - # starts with "$P9K_PYENV_PYTHON_VERSION/". - # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". - typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' - - # Custom icon. - # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ - # Goenv color. - typeset -g POWERLEVEL9K_GOENV_FOREGROUND=37 - # Hide go version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) - # If set to false, hide go version if it's the same as global: - # $(goenv version-name) == $(goenv global). - typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide go version if it's equal to "system". - typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## - # Nodenv color. - typeset -g POWERLEVEL9K_NODENV_FOREGROUND=70 - # Hide node version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) - # If set to false, hide node version if it's the same as global: - # $(nodenv version-name) == $(nodenv global). - typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide node version if it's equal to "system". - typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### - # Nvm color. - typeset -g POWERLEVEL9K_NVM_FOREGROUND=70 - # If set to false, hide node version if it's the same as default: - # $(nvm version current) == $(nvm version default). - typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false - # If set to false, hide node version if it's equal to "system". - typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ - # Nodeenv color. - typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=70 - # Don't show Node version next to the environment name. - typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false - # Separate environment name from Node version only with a space. - typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= - # Custom icon. - # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ##############################[ node_version: node.js version ]############################### - # Node version color. - typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=70 - # Show node version only when in a directory tree containing package.json. - typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='โญ' - - #######################[ go_version: go version (https://golang.org) ]######################## - # Go version color. - typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=37 - # Show go version only when in a go project subdirectory. - typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='โญ' - - #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## - # Rust version color. - typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=37 - # Show rust version only when in a rust project subdirectory. - typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ - # .NET version color. - typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=134 - # Show .NET version only when in a .NET project subdirectory. - typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='โญ' - - #####################[ php_version: php version (https://www.php.net/) ]###################### - # PHP version color. - typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=99 - # Show PHP version only when in a PHP project subdirectory. - typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]########### - # Laravel version color. - typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=161 - # Custom icon. - # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ####################[ java_version: java version (https://www.java.com/) ]#################### - # Java version color. - typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=32 - # Show java version only when in a java project subdirectory. - typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true - # Show brief version. - typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false - # Custom icon. - # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]#### - # Package color. - typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=117 - # Package format. The following parameters are available within the expansion. - # - # - P9K_PACKAGE_NAME The value of `name` field in package.json. - # - P9K_PACKAGE_VERSION The value of `version` field in package.json. - # - # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}' - # Custom icon. - # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='โญ' - - #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## - # Rbenv color. - typeset -g POWERLEVEL9K_RBENV_FOREGROUND=168 - # Hide ruby version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) - # If set to false, hide ruby version if it's the same as global: - # $(rbenv version-name) == $(rbenv global). - typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide ruby version if it's equal to "system". - typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='โญ' - - #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## - # Rvm color. - typeset -g POWERLEVEL9K_RVM_FOREGROUND=168 - # Don't show @gemset at the end. - typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false - # Don't show ruby- at the front. - typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false - # Custom icon. - # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ - # Fvm color. - typeset -g POWERLEVEL9K_FVM_FOREGROUND=38 - # Custom icon. - # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### - # Lua color. - typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=32 - # Hide lua version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) - # If set to false, hide lua version if it's the same as global: - # $(luaenv version-name) == $(luaenv global). - typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide lua version if it's equal to "system". - typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ - # Java color. - typeset -g POWERLEVEL9K_JENV_FOREGROUND=32 - # Hide java version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) - # If set to false, hide java version if it's the same as global: - # $(jenv version-name) == $(jenv global). - typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide java version if it's equal to "system". - typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ - # Perl color. - typeset -g POWERLEVEL9K_PLENV_FOREGROUND=67 - # Hide perl version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) - # If set to false, hide perl version if it's the same as global: - # $(plenv version-name) == $(plenv global). - typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide perl version if it's equal to "system". - typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############ - # Perlbrew color. - typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67 - # Show perlbrew version only when in a perl project subdirectory. - typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true - # Don't show "perl-" at the front. - typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false - # Custom icon. - # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ - # PHP color. - typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99 - # Hide php version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) - # If set to false, hide php version if it's the same as global: - # $(phpenv version-name) == $(phpenv global). - typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide php version if it's equal to "system". - typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='โญ' - - #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### - # Scala color. - typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=160 - # Hide scala version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) - # If set to false, hide scala version if it's the same as global: - # $(scalaenv version-name) == $(scalaenv global). - typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide scala version if it's equal to "system". - typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### - # Haskell color. - typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=172 - # Hide haskell version if it doesn't come from one of these sources. - # - # shell: version is set by STACK_YAML - # local: version is set by stack.yaml up the directory tree - # global: version is set by the implicit global project (~/.stack/global-project/stack.yaml) - typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) - # If set to false, hide haskell version if it's the same as in the implicit global project. - typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true - # Custom icon. - # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='โญ' - - #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# - # Show kubecontext only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl|sparkctl' - - # Kubernetes context classes for the purpose of using different colors, icons and expansions with - # different contexts. - # - # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current kubernetes context gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' DEFAULT) - # - # If your current kubernetes context is "deathray-testing/default", its class is TEST - # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=28 - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=134 - # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='โญ' - - # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext - # segment. Parameter expansions are very flexible and fast, too. See reference: - # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. - # - # Within the expansion the following parameters are always available: - # - # - P9K_CONTENT The content that would've been displayed if there was no content - # expansion defined. - # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the - # output of `kubectl config get-contexts`. - # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the - # output of `kubectl config get-contexts`. - # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE - # in the output of `kubectl config get-contexts`. If there is no - # namespace, the parameter is set to "default". - # - P9K_KUBECONTEXT_USER The current context's user. Corresponds to column AUTHINFO in the - # output of `kubectl config get-contexts`. - # - # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS), - # the following extra parameters are available: - # - # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks". - # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID. - # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone. - # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster. - # - # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example, - # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01": - # - # - P9K_KUBECONTEXT_CLOUD_NAME=gke - # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account - # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a - # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 - # - # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01": - # - # - P9K_KUBECONTEXT_CLOUD_NAME=eks - # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012 - # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1 - # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 - typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= - # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME. - POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' - # Append the current context's namespace if it's not "default". - POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' - - # Custom prefix. - typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%fat ' - - ################[ terraform: terraform workspace (https://www.terraform.io) ]################# - # Don't show terraform workspace if it's literally "default". - typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false - # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current terraform workspace gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' OTHER) - # - # If your current terraform workspace is "project_test", its class is TEST because "project_test" - # doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=28 - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' OTHER) - typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=38 - # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='โญ' - - #############[ terraform_version: terraform version (https://www.terraform.io) ]############## - # Terraform version color. - typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=38 - # Custom icon. - # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='โญ' - - #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# - # Show aws only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show aws. - typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|cdk|terraform|pulumi|terragrunt' - - # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current AWS profile gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_AWS_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' DEFAULT) - # - # If your current AWS profile is "company_test", its class is TEST - # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=28 - # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_AWS_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=208 - # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='โญ' - - # AWS segment format. The following parameters are available within the expansion. - # - # - P9K_AWS_PROFILE The name of the current AWS profile. - # - P9K_AWS_REGION The region associated with the current AWS profile. - typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' - - #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# - # AWS Elastic Beanstalk environment color. - typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=70 - # Custom icon. - # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## - # Show azure only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show azure. - typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' - - # POWERLEVEL9K_AZURE_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current azure account name gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_AZURE_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_AZURE_CLASSES defines the account class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_AZURE_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' OTHER) - # - # If your current azure account is "company_test", its class is TEST because "company_test" - # doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_AZURE_TEST_FOREGROUND=28 - # typeset -g POWERLEVEL9K_AZURE_TEST_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_AZURE_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_AZURE_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' OTHER) - - # Azure account name color. - typeset -g POWERLEVEL9K_AZURE_OTHER_FOREGROUND=32 - # Custom icon. - # typeset -g POWERLEVEL9K_AZURE_OTHER_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### - # Show gcloud only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show gcloud. - typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' - # Google cloud color. - typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=32 - - # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or - # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative - # enough. You can use the following parameters in the expansions. Each of them corresponds to the - # output of `gcloud` tool. - # - # Parameter | Source - # -------------------------|-------------------------------------------------------------------- - # P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)' - # P9K_GCLOUD_ACCOUNT | gcloud config get-value account - # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project - # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' - # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. - # - # Obtaining project name requires sending a request to Google servers. This can take a long time - # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud - # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets - # set and gcloud prompt segment transitions to state COMPLETE. - # - # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL - # and COMPLETE. You can also hide gcloud in state PARTIAL by setting - # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and - # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty. - typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' - typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' - - # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name - # this often. Negative value disables periodic polling. In this mode project name is retrieved - # only when the current configuration, account or project id changes. - typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60 - - # Custom icon. - # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='โญ' - - #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# - # Show google_app_cred only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show google_app_cred. - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' - - # Google application credentials classes for the purpose of using different colors, icons and - # expansions with different credentials. - # - # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first - # element in each pair defines a pattern against which the current kubernetes context gets - # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion - # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION - # parameters, you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order. - # The first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( - # '*:*prod*:*' PROD - # '*:*test*:*' TEST - # '*' DEFAULT) - # - # If your current Google application credentials is "service_account deathray-testing x@y.com", - # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=28 - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='โญ' - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID' - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( - # '*:*prod*:*' PROD # These values are examples that are unlikely - # '*:*test*:*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=32 - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='โญ' - - # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by - # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference: - # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. - # - # You can use the following parameters in the expansion. Each of them corresponds to one of the - # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS. - # - # Parameter | JSON key file field - # ---------------------------------+--------------- - # P9K_GOOGLE_APP_CRED_TYPE | type - # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id - # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email - # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' - - ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### - # Toolbox color. - typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=178 - # Don't display the name of the toolbox if it matches fedora-toolbox-*. - typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' - # Custom icon. - # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='โญ' - # Custom prefix. - typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%fin ' - - ###############################[ public_ip: public IP address ]############################### - # Public IP color. - typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=94 - # Custom icon. - # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ########################[ vpn_ip: virtual private network indicator ]######################### - # VPN IP color. - typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=81 - # When on VPN, show just an icon without the IP address. - # Tip: To display the private IP address when on VPN, remove the next line. - typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= - # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN - # to see the name of the interface. - typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*|(zt.*)' - # If set to true, show one segment per matching network interface. If set to false, show only - # one segment corresponding to the first matching network interface. - # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. - typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false - # Custom icon. - # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### - # IP color. - typeset -g POWERLEVEL9K_IP_FOREGROUND=38 - # The following parameters are accessible within the expansion: - # - # Parameter | Meaning - # ----------------------+------------------------------------------- - # P9K_IP_IP | IP address - # P9K_IP_INTERFACE | network interface - # P9K_IP_RX_BYTES | total number of bytes received - # P9K_IP_TX_BYTES | total number of bytes sent - # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt - # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt - # P9K_IP_RX_RATE | receive rate (since last prompt) - # P9K_IP_TX_RATE | send rate (since last prompt) - typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='$P9K_IP_IP${P9K_IP_RX_RATE:+ %70Fโ‡ฃ$P9K_IP_RX_RATE}${P9K_IP_TX_RATE:+ %215Fโ‡ก$P9K_IP_TX_RATE}' - # Show information for the first network interface whose name matches this regular expression. - # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. - typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' - # Custom icon. - # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='โญ' - - #########################[ proxy: system-wide http/https/ftp proxy ]########################## - # Proxy color. - typeset -g POWERLEVEL9K_PROXY_FOREGROUND=68 - # Custom icon. - # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='โญ' - - ################################[ battery: internal battery ]################################# - # Show battery in red when it's below this level and not connected to power supply. - typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 - typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=160 - # Show battery in green when it's charging or fully charged. - typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=70 - # Show battery in yellow when it's discharging. - typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=178 - # Battery pictograms going from low to high level of charge. - typeset -g POWERLEVEL9K_BATTERY_STAGES='\UF008E\UF007A\UF007B\UF007C\UF007D\UF007E\UF007F\UF0080\UF0081\UF0082\UF0079' - # Don't show the remaining time to charge/discharge. - typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false - - #####################################[ wifi: wifi speed ]##################################### - # WiFi color. - typeset -g POWERLEVEL9K_WIFI_FOREGROUND=68 - # Custom icon. - # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='โญ' - - # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). - # - # # Wifi colors and icons for different signal strength levels (low to high). - # typeset -g my_wifi_fg=(68 68 68 68 68) # <-- change these values - # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values - # - # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' - # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' - # - # The following parameters are accessible within the expansions: - # - # Parameter | Meaning - # ----------------------+--------------- - # P9K_WIFI_SSID | service set identifier, a.k.a. network name - # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown - # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second - # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 - # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 - # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) - - ####################################[ time: current time ]#################################### - # Current time color. - typeset -g POWERLEVEL9K_TIME_FOREGROUND=66 - # Format for the current time: 09:51:02. See `man 3 strftime`. - typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' - # If set to true, time will update when you hit enter. This way prompts for the past - # commands will contain the start times of their commands as opposed to the default - # behavior where they contain the end times of their preceding commands. - typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false - # Custom icon. - # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='โญ' - # Custom prefix. - typeset -g POWERLEVEL9K_TIME_PREFIX='%fat ' - - # Example of a user-defined prompt segment. Function prompt_example will be called on every - # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or - # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and orange text greeting the user. - # - # Type `p10k help segment` for documentation and a more sophisticated example. - function prompt_example() { - p10k segment -f 208 -i 'โญ' -t 'hello, %n' - } - - # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job - # is to generate the prompt segment for display in instant prompt. See - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. - # - # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function - # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k - # will replay these calls without actually calling instant_prompt_*. It is imperative that - # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this - # rule is not observed, the content of instant prompt will be incorrect. - # - # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If - # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt. - function instant_prompt_example() { - # Since prompt_example always makes the same `p10k segment` calls, we can call it from - # instant_prompt_example. This will give us the same `example` prompt segment in the instant - # and regular prompts. - prompt_example - } - - # User-defined prompt segments can be customized the same way as built-in segments. - # typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=208 - # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='โญ' - - # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt - # when accepting a command line. Supported values: - # - # - off: Don't change prompt when accepting a command line. - # - always: Trim down prompt when accepting a command line. - # - same-dir: Trim down prompt when accepting a command line unless this is the first command - # typed after changing current working directory. - typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always - - # Instant prompt mode. - # - # - off: Disable instant prompt. Choose this if you've tried instant prompt and found - # it incompatible with your zsh configuration files. - # - quiet: Enable instant prompt and don't print warnings when detecting console output - # during zsh initialization. Choose this if you've read and understood - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. - # - verbose: Enable instant prompt and print a warning when detecting console output during - # zsh initialization. Choose this if you've never tried instant prompt, haven't - # seen the warning, or if you are unsure what this all means. - typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose - - # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. - # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload - # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you - # really need it. - typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true - - # If p10k is already loaded, reload configuration. - # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. - (( ! $+functions[p10k] )) || p10k reload -} - -# Tell `p10k configure` which file it should overwrite. -typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} - -(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} -'builtin' 'unset' 'p10k_config_opts' diff --git a/fedora/.config/zsh/packages.zsh b/fedora/.config/zsh/packages.zsh deleted file mode 100644 index b3931f5..0000000 --- a/fedora/.config/zsh/packages.zsh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/zsh - -### --- Packages --- ### -typeset -A packages -packages=( - atuin "--disable-up-arrow" - batman "--export-env" - zoxide "--cmd cd --hook prompt" - tmuxdbussync "" -) - -### --- Eval Function --- ### -eval_packages() { - for package in ${(k)packages}; do - if command -v "$package" >/dev/null; then - local args=(${(s: :)packages[$package]}) - [[ ${#args[@]} -gt 0 ]] && eval "$($package init zsh ${args[@]})" || eval "$($package init zsh)" - fi - done -} - -### --- Init --- ### -eval_packages diff --git a/fedora/.config/zsh/plugins.zsh b/fedora/.config/zsh/plugins.zsh deleted file mode 100644 index f1ef0a9..0000000 --- a/fedora/.config/zsh/plugins.zsh +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/zsh - -[[ "$XDG_SCRIPTS_HOME" == "$HOME/.local/bin" ]] || return -[[ "$ZDOTDIR" == "$HOME/.config/zsh" ]] || return -[[ "$ZPLUGINDIR" == "$XDG_SCRIPTS_HOME/zsh" ]] || return - -### --- Plugins --- ### -plugins=( - "Aloxaf/fzf-tab" - # "jeffreytse/zsh-vi-mode" - "kutsan/zsh-system-clipboard" - # "MichaelAquilina/zsh-you-should-use" - # "marlonrichert/zsh-autocomplete" - "ohmyzsh/command-not-found" - #"ohmyzsh/sudo" - # "romkatv/powerlevel10k" - "wfxr/forgit" - "zdharma-continuum/fast-syntax-highlighting" - "zsh-users/zsh-autosuggestions" - "zsh-users/zsh-completions" -) - -### --- Source Plugins --- ### -# Check plugins -zsh_check_plugins() { - installed="true" - for plugin in "${plugins[@]}"; do - PLUGIN_NAME=$(echo "$plugin" | cut -d '/' -f 2) - [ "$ZPLUGINDIR" = "ohmyzsh" ] && ZPLUGINDIR="$PLUGIN_NAME" - PLUGIN_PATH="$ZPLUGINDIR/$PLUGIN_NAME" - [ -d "$PLUGIN_PATH" ] && zsh_source_plugin "$PLUGIN_NAME/$PLUGIN_NAME" || { installed="false"; break; } - done - [ "$installed" = "true" ] || zsh_add_plugins "${plugins[@]}" -} - -# Function to source plugin files -zsh_source_plugin() { - for file in "$@"; do - if [ -f "$ZPLUGINDIR/$file.plugin.zsh" ] && echo "$file" | grep -vq "command-not-found/command-not-found"; then - . "$ZPLUGINDIR/$file.plugin.zsh" - elif echo "$file" | grep -q "command-not-found/command-not-found"; then - . "$ZPLUGINDIR/command-not-found/command-not-found.plugin.zsh" - elif [ -z "$ZPLUGINDIR/$file.plugin.zsh" ] && [ -f "$ZPLUGINDIR/$file.zsh" ]; then - . "$ZPLUGINDIR/$file.zsh" - fi - [ -f "$ZPLUGINDIR/$file.zsh-theme" ] && . "$ZPLUGINDIR/$file.zsh-theme" && . "${XDG_CONFIG_HOME:-${HOME}/.config}/shell/p10k" - done -} - -# Function to add plugins -zsh_add_plugins() { - for plugin do - PLUGIN_NAME=$(echo "$plugin" | cut -d '/' -f 2) - PLUGIN_PATH="$ZPLUGINDIR/$PLUGIN_NAME" - - if [ -d "$PLUGIN_PATH" ]; then - zsh_source_plugin "$PLUGIN_NAME/$PLUGIN_NAME" - else - ORG_NAME=$(echo "$plugin" | cut -d '/' -f 1) - case "$ORG_NAME" in - "ohmyzsh") - [ ! -d "$ZPLUGINDIR/oh-my-zsh" ] && git clone --depth=1 https://github.com/ohmyzsh/ohmyzsh.git "$ZPLUGINDIR/oh-my-zsh" >/dev/null 2>&1 - - OHMYZSH_PLUGIN_PATH="$ZPLUGINDIR/oh-my-zsh/plugins/$PLUGIN_NAME" - cp -r "$OHMYZSH_PLUGIN_PATH" "$ZPLUGINDIR/" >/dev/null 2>&1 - rm -rf "$ZPLUGINDIR/oh-my-zsh" >/dev/null 2>&1 - ;; - *) - git clone "https://github.com/$plugin.git" "$PLUGIN_PATH" >/dev/null 2>&1 - ;; - esac - rm -rf "$PLUGIN_PATH/.git" - chmod +x "$PLUGIN_PATH" - fi - done -} - -# Function to sync plugins -zsh_sync_plugins() { - ACTIVE_PLUGINS=$(grep '^[[:space:]]*"[^"]\+"' ~/.config/zsh/plugins.zsh | sed 's|.*/\([^/"]*\)".*|\1|') - - for PLUGIN_DIR in "$ZPLUGINDIR"/*; do - if [ -d "$PLUGIN_DIR" ]; then - PLUGIN_NAME=$(basename "$PLUGIN_DIR") - - echo "$ACTIVE_PLUGINS" | grep -q "$PLUGIN_NAME" || { - echo "Removing unused plugin: $PLUGIN_NAME" - rm -rf "$PLUGIN_DIR" - } - fi - done -} - -# Function to update plugins -# Since .git folder in each plugin dir is removed, -# Delete all plugins and install them agian -# .git is searched in Neovim projects -alias zup=zsh_update_plugins -zsh_update_plugins() { - [ -d "$ZPLUGINDIR" ] && rm -rf "$ZPLUGINDIR" && zsh_check_plugins "${plugins[@]}" - zsh_sync_plugins -} - -zsh_check_plugins "${plugins[@]}" -zsh_sync_plugins diff --git a/fedora/.config/zsh/scripts.zsh b/fedora/.config/zsh/scripts.zsh deleted file mode 100644 index 5a47ffa..0000000 --- a/fedora/.config/zsh/scripts.zsh +++ /dev/null @@ -1,880 +0,0 @@ -#!/bin/zsh - -########################################################################################### -########################################################################################### -### --- ALIAS --- ### -# find aliases -alias ali=fzf_aliases -function fzf_aliases() { - local aliases=$(alias) - local max_length=$(echo "$aliases" | cut -d'=' -f1 | awk '{print length}' | sort -nr | head -n 1) - [ "$max_length" -gt 20 ] && max_length=20 - format_aliases() { - echo "$aliases" | while IFS= read -r line; do - alias_name=$(echo "$line" | cut -d'=' -f1) - alias_command=$(echo "$line" | cut -d'=' -f2- | sed "s/^'//;s/'$//") - printf "%-${max_length}s = %s\n" "$alias_name" "$alias_command" - done - } - alias_file="${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc" - selected_alias=$(format_aliases | fzf --header="select an alias") - # check if an alias was selected - if [ -n "$selected_alias" ]; then - # extract the alias name - alias_name=$(echo "$selected_alias" | cut -d'=' -f1 | xargs) - - # get the line number from the alias file - line_number=$(grep -n "^alias $alias_name=" "$alias_file" | cut -d':' -f1) - - # open nvim at the specified line - if [ -n "$line_number" ]; then - nvim "+$line_number" "$alias_file" - else - scripts_file="${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/7-scripts.zsh" - line_number=$(grep -n "^alias $alias_name=" "$scripts_file" | cut -d':' -f1) - nvim "+$line_number" "$scripts_file" - fi - fi -} - - -########################################################################################### -########################################################################################### -### --- CHEAT.SH --- ### -function cht() { - if [ -z "$1" ]; then - printf "Enter program name: " - read prog - curl cht.sh/"$prog" - else - curl cht.sh/"$1" - fi -} - - -########################################################################################### -########################################################################################### -### --- COLOR --- ### -# print color -alias pcol=print_col -function print_col() { - awk 'BEGIN{ -s="/\\/\\/\\/\\/\\"; s=s s s s s s s s; -for (colnum = 0; colnum<77; colnum++) { - r = 255-(colnum*255/76); - g = (colnum*510/76); - b = (colnum*255/76); - if (g>255) g = 510-g; - printf "\033[48;2;%d;%d;%dm", r,g,b; - printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b; - printf "%s\033[0m", substr(s,colnum+1,1); -} -printf "\n"; - }' -} -function colors() { - curl -s https://gist.githubusercontent.com/HaleTom/89ffe32783f89f403bba96bd7bcd1263/raw/ | zsh -} - - -########################################################################################### -########################################################################################### -### --- COMMAND OUTPUT --- ### -# print last command output -alias ilco=insert_last_command_output -function insert_last_command_output() { LBUFFER+="$(eval $history[$((HISTCMD-1))])"; } - - -########################################################################################### -########################################################################################### -### --- CONFIG --- ### -# fzf config -alias fcfg=fzf_config -function fzf_config() { - [ $# -gt 0 ] && zoxide query -i "$1" | xargs "${EDITOR}" && return - local file - file="$(zoxide query -l | fzf --cycle -1 -0 --no-sort +m)" && cd "${file}" || return 1 -} - - -########################################################################################### -########################################################################################### -### --- COPY --- ### -# copy file name to clipboard -alias cpfn=copy_filename -function copy_filename() { - if ! command -v xclip >/dev/null; then - echo "Error: 'xclip' is not installed." >&2 - return 1 - fi - - if ! command -v fzf >/dev/null; then - echo "Error: 'fzf' is not installed." >&2 - return 1 - fi - - local file="$1" - - # If no argument is provided, use fzf to select a file - if [ -z "$file" ]; then - file=$(fzf --cycle --preview "cat {}") - fi - - # Check if a file was found or selected - if [ -n "$file" ]; then - local filename=$(basename "$file") - echo -n "$filename" | xclip -selection clipboard - echo "Filename copied to clipboard: $filename" - else - echo "No file selected." - fi -} - -# copy file contents -alias cpfc=copy_contents -function copy_contents() { - if ! command -v xclip >/dev/null; then - echo "Error: 'xclip' is not installed." >&2 - return 1 - fi - - if ! command -v fzf >/dev/null; then - echo "Error: 'fzf' is not installed." >&2 - return 1 - fi - - local file="$1" - - # If no argument is provided, use fzf to select a file - if [ -z "$file" ]; then - file=$(fzf --cycle --preview "cat {}") - fi - - # Check if a file was found or selected - if [ -n "$file" ]; then - # Use `sed` to delete only the last newline character - cat "$file" | sed ':a;N;$!ba;s/\n$//' | xclip -selection clipboard - echo "Contents of '$file' copied to clipboard." - else - echo "No file selected." - fi -} - -# copy the current working directory path to the clipboard -alias cpcp=copy_current_path -function copy_current_path() { - if command -v xclip >/dev/null; then - printf "%s" "$PWD" | xclip -selection clipboard - printf "%s\n" "Current working directory '$(basename "$PWD")' path copied to clipboard." - else - printf "%s\n" "Error: 'xclip' command not found. Please install 'xclip' to use this function." - fi -} - -# copy file real path -alias cprp=copy_real_path -function copy_real_path() { - if ! command -v xclip >/dev/null; then - echo "Error: 'xclip' is not installed." >&2 - return 1 - fi - - if ! command -v fzf >/dev/null; then - echo "Error: 'fzf' is not installed." >&2 - return 1 - fi - - local file="$1" - - # If no argument is provided, use fzf to select a file - if [ -z "$file" ]; then - file=$(fzf --cycle --preview "cat {}") - fi - - # Check if a file was found or selected - if [ -n "$file" ]; then - local full_path=$(realpath "$file") - echo -n "$full_path" | xclip -selection clipboard - echo "File path copied to clipboard: $full_path" - else - echo "No file selected." - fi -} - - -########################################################################################### -########################################################################################### -### --- CREATE --- ### -# mkdir && cd -alias mc=mkcd -function mkcd() { mkdir -p "$@" && cd "$_"; } - -# create dir with current date -function mkdt () { mkdir -p ${1:+$1$prefix_separator}"$(date +%F)"; } - - -########################################################################################### -########################################################################################### -### --- DOCKER --- ### -# select a docker container to start and attach to -alias doca=docker_container_init -function docker_container_init() { - local cid - cid=$(docker ps -a | sed 1d | fzf --cycle -1 -q "$1" | awk '{print $1}') - - [ -n "$cid" ] && docker start "$cid" && docker attach "$cid" -} - -# select a running docker container to stop -alias docs=docker_stop -function docker_stop() { - local cid - cid=$(docker ps | sed 1d | fzf --cycle -q "$1" | awk '{print $1}') - - [ -n "$cid" ] && docker stop "$cid" -} - -# select a docker container or containers to remove -alias docrmc=docker_remove_containers -function docker_remove_containers() { docker ps -a | sed 1d | fzf --cycle -q "$1" --no-sort -m --tac | awk '{ print $1 }' | xargs -r docker rm; } - -# select a docker image or images to remove -alias docrmi=docker_remove_images -function docker_remove_images() { docker images | sed 1d | fzf --cycle -q "$1" --no-sort -m --tac | awk '{ print $3 }' | xargs -r docker rmi; } - - -########################################################################################### -########################################################################################### -### --- ECRYPTFS --- ### -# mount ecryptfs -alias emt=ecryptfs_mount -function ecryptfs_mount() { - ! mount | grep -q " $1 " && echo "$(pass show encryption/ecryptfs)" | sudo mount -t ecryptfs "$1" "$2" \ - -o ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_passthrough=no,ecryptfs_enable_filename_crypto=yes,ecryptfs_sig="$(sudo cat /root/.ecryptfs/sig-cache.txt)",ecryptfs_fnek_sig="$(sudo cat /root/.ecryptfs/sig-cache.txt)",passwd="$(pass show encryption/ecryptfs)" >/dev/null 2>&1 && - echo "'$2' folder is mounted!" -} - - -########################################################################################### -########################################################################################### -### --- GIT --- ### -# TheSiahxyz's git repos -alias gcggg=thesiahxyz_git -function thesiahxyz_git() { - choice=$(ssh "$THESIAH_GIT" "ls -a | grep -i \".*\\.git$\"" | fzf --cycle --prompt="๏‚› ๏ฒ " --height=50% --layout=reverse --border --exit-0) - [ -d "$HOME/Private/repos" ] || mkdir -p "$HOME/Private/repos" - [ -n "$choice" ] && [ -n "$1" ] && cd "$HOME/Private/repos" && git clone "${THESIAH_GIT:-git@${THESIAH:-thesiah.xyz}}":"$choice" "$1" || - [ -n "$choice" ] && cd "$HOME/Private/repos" && git clone "${THESIAH_GIT:-git@${THESIAH:-thesiah.xyz}}":"$choice" - cd - -} - - -########################################################################################### -########################################################################################### -### --- GOTO --- ### -# go to the path stored in the clipboard -alias cdp=cd_clipboard_path -function cd_clipboard_path() { - if command -v xclip >/dev/null; then - local target_dir - target_dir="$(xclip -o -sel clipboard)" - if [[ -d "${target_dir}" ]]; then - cd "${target_dir}" && printf "%s\n" "Changed directory to: ${target_dir}" - else - printf "%s\n" "Error: Invalid directory path or directory does not exist." - fi - else - printf "%s\n" "Error: 'xclip' command not found. Please install 'xclip' to use this function." - fi -} - -# fzf directory and go to the parent directory -alias fD=fzf_directory -function fzf_directory() { - dirs="$(find "$HOME" -type d \( -path "**/.git/*" -o -path "**/.cache/*" -o -path "**/yay/*" -o -path "$HOME/.local/bin/zsh" \) -prune -o -type d -print | fzf --multi)" - [ -d "$dirs" ] && cd "$dirs" && ls -A || opensessions "$dirs" -} - -# search scripts in ~/.local/bin -alias sscs=search_scripts -function search_scripts() { - choice="$(find ${HOME}/.local/bin -mindepth 1 -not -path "${HOME}/.local/bin/zsh" -not -path "${HOME}/.local/bin/zsh/*" -printf '%P\n' | fzf)" - [ -f "$HOME/.local/bin/$choice" ] && $EDITOR "$HOME/.local/bin/$choice" -} - -# check git status by directories in specific path -alias fgst=fetch_git_repos_status -function fetch_git_repos_status() { - SELECTED_DIRS=$(bash << 'EOF' - # Source the Git prompt script to get access to __git_ps1 - source /usr/share/git/completion/git-prompt.sh - - # Enable symbols for dirty state, untracked files, and branch ahead/behind - export GIT_PS1_SHOWDIRTYSTATE="auto" - export GIT_PS1_SHOWUNTRACKEDFILES="auto" - export GIT_PS1_SHOWUPSTREAM="auto" - - # Define an array of target directories - TARGET_DIRECTORIES=( - "$HOME/.dotfiles" - "$HOME/.local/share/.password-store" - "$HOME/.local/src/suckless" - ) - - # Check the directories under the paths. eg. ../repos/* - GIT_DIRS=("$HOME/Private/repos" "$HOME/Public/repos") - - # Append all subdirectories under GIT_DIRS that are Git repositories - for GIT_DIR in "${GIT_DIRS[@]}"; do - if [ -d "$GIT_DIR" ]; then - for SUBDIR in "$GIT_DIR"/*; do - if [ -d "$SUBDIR/.git" ]; then - TARGET_DIRECTORIES+=("$SUBDIR") - fi - done - fi - done - - # Create an array to store the output - OUTPUT=() - - # Function to colorize only the Git status symbols - colorize_git_status() { - local status="$1" - # Colorize the entire status with a single color - echo -e "\033[33m${status}\033[0m" # Apply yellow color to the status - } - - update_time() { - timestamp_file="${HOME}/.cache/gitreposupdate" - current_time=$(date +%s) - if [[ -f "$timestamp_file" ]] && (($(cat "$timestamp_file") > (current_time - 21600))); then - return 1 # No update needed - else - echo "$current_time" >"$timestamp_file" - return 0 # Update needed - fi - } - update_time && update=true || update=false - - # Loop through each directory and get the Git status - for DIR in "${TARGET_DIRECTORIES[@]}"; do - if [ -d "$DIR/.git" ]; then - cd "$DIR" || continue - - if $update; then - if [ "$(dirname $DIR)" = ".password-store" ]; then - pass git fetch >/dev/null 2>&1 - else - git fetch --all --prune --jobs=10 >/dev/null 2>&1 - fi - fi - - # Get Git branch and status using __git_ps1 - GIT_STATUS=$(__git_ps1 "%s") - - # Colorize the Git status - COLORED_GIT_STATUS=$(colorize_git_status "$GIT_STATUS") - - # Add formatted output with colored Git status and directory - OUTPUT+=("$(printf "%-20s %s" "$COLORED_GIT_STATUS" "$DIR")") - fi - done - - # Pass the output to fzf with multi-select enabled (-m) - SELECTED=$(printf "%s\n" "${OUTPUT[@]}" | fzf -m --ansi --layout=reverse) - - # Filter out lines that do not end with a valid directory path and are not empty - echo "$SELECTED" | awk '{if (NF > 1 && system("[ -d \""$NF"\" ]") == 0) print $NF}' -EOF - ) - [[ -z "${SELECTED_DIRS// }" ]] && return - if [[ "$(echo "$SELECTED_DIRS" | wc -l)" -eq 1 ]]; then - cd "$SELECTED_DIRS" - if [[ -n "$(git -C "$SELECTED_DIRS" status --porcelain)" ]]; then - git status --porcelain 2>/dev/null - fi - else - opensessions "$SELECTED_DIRS" - fi -} - - -########################################################################################### -########################################################################################### -### --- HELP --- ### -# help opt colored by bat -alias bathelp='bat --plain --language=help' -function help() { "$@" --help 2>&1 | bathelp; } - - -########################################################################################### -########################################################################################### -### --- KEYS --- ### -# list setxkbmap options -alias xkey=xset_options -function xset_options() { grep --color -E "$1" /usr/share/X11/xkb/rules/base.lst; } - -# print raw xev key events -alias keys=xev_raw_key_event -function xev_raw_key_event() { - xev -event keyboard | awk ' - /^KeyPress/,/^KeyRelease/ { - if ($0 ~ /keysym/) print $0 - }' -} - -# print aligned xev key events -alias key=xev_aligned_key_event -function xev_aligned_key_event() { - xev -event keyboard | awk ' - /^(KeyPress|KeyRelease)/ { - event_type = $1 - } - /keysym/ { - gsub(/\),$/, "", $7) - printf "%-12s %-3s %s\n", event_type, $4, $7 - }' -} - - -########################################################################################### -########################################################################################### -### --- KILL --- ### -# kill process -alias fpkill=fzf_kill_process -function fzf_kill_process() { - ps aux | grep -e "^$(whoami)" | - fzf --height 40% \ - --layout=reverse \ - --header-lines=1 \ - --prompt="Select process to kill: " \ - --preview 'echo {}' \ - --preview-window up:3:hidden:wrap \ - --bind 'F2:toggle-preview' | - awk '{print $2}' | - xargs -r bash -c ' - if ! kill -9 "$1" 2>/dev/null; then - echo "Regular kill failed. Attempting with sudo..." - sudo kill -9 "$1" || echo "Failed to kill process $1" >&2 - fi - ' -- -} - - -########################################################################################### -########################################################################################### -### --- LF --- ### -# open lf and cd to the file path -function lfcd () { - tmp="$(mktemp -uq)" - trap 'rm -f $tmp >/dev/null 2>&1 && trap - HUP INT QUIT TERM PWR EXIT' HUP INT QUIT TERM PWR EXIT - lf -last-dir-path="$tmp" "$@" - if [ -f "$tmp" ]; then - dir="$(cat "$tmp")" - [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" - fi -} - -########################################################################################### -########################################################################################### -### --- MAN --- ### -# color man page -function van() { - if [[ -z "$@" ]]; then - if command -v fzf >/dev/null 2>&1; then - local page=$(command man -k . | fzf --prompt='Man> ' --exit-0 | awk '{print $1}') - if [[ -n $page ]]; then - nvim +"Man $page | only" - fi - fi - else - nvim +"Man $@ | only" - fi -} -function ban() { - BAT_THEME="ansi" command batman "$@" - return $? -} - - -########################################################################################### -########################################################################################### -### --- NVIM --- ### -# rename nvim directory -alias ctn=rename_nvim_dir -function rename_nvim_dir() { - if [ $# -ne 2 ]; then - echo "Usage: ctn " - return 1 - fi - - local old_suffix="$1" - local new_suffix="$2" - local base_name="nvim" - - # Handle the case where the old suffix is '.' - [ "$old_suffix" = "." ] && old_suffix="" - [ "$new_suffix" = "." ] && new_suffix="" - - # Directories to be renamed - local directories=( - "$HOME/.config/$base_name" - "$HOME/.local/share/$base_name" - "$HOME/.local/state/$base_name" - "$HOME/.cache/$base_name" - ) - - for dir in "${directories[@]}"; do - if [ -d "$dir$old_suffix" ]; then - mv "$dir$old_suffix" "$dir$new_suffix" - echo "Renamed $dir$old_suffix to $dir$new_suffix" - else - echo "Directory $dir$old_suffix does not exist" - fi - done -} - -# change nvim config -alias cnf=change_nvim_config_dir -function change_nvim_config_dir() { - local base_dir="${XDG_DOTFILES_DIR:-$HOME/.dotfiles}/$(whereami)/.config" # Base directory for Neovim configs - local target_dir="${XDG_CONFIG_HOME:-$HOME/.config}/nvim" # Target directory for active Neovim config - local target_share="${XDG_DATA_HOME:-$HOME/.local/share}/nvim" # Neovim"s share directory - local target_state="${XDG_STATE_HOME:-$HOME/.local/state}/nvim" # Neovim"s state directory - local target_cache="${XDG_CACHE_HOME:-$HOME/.cache}/nvim" # Neovim"s cache directory - - # Explicitly list your configuration options - local configs=("Default" "TheSiahxyz" "AstroNvim" "LazyVim" "LunarVim" "NvChad") - local selected_dir=$(printf "%s\n" "${configs[@]}" | fzf --cycle --prompt="๎˜ซ Neovim Config ๏ฒ " --height 50% --layout=reverse --border --exit-0) - - # Check if a configuration was selected - [[ -z $selected_dir ]] && return 1 - - # Default configuration - if [[ $selected_dir == "Default" ]]; then - selected_dir="kickstart" - echo "Clearing the Neovim configuration directory..." - rm -rf "$target_dir" "$target_share" "$target_state" "$target_cache" &>/dev/null - echo "Switched to the base Neovim configuration." - return 0 - fi - - # Construct the full path of the selected configuration - local config_path="$base_dir/$selected_dir" - echo "$config_path" - - # Clear existing configurations if confirmed by the user - echo -n "This will overwrite existing configurations. Continue? (y/n) " - read reply - if [[ $reply =~ ^[Yy]$ ]]; then - echo "Clearing existing Neovim configurations..." - rm -rf "$target_dir" "$target_share" "$target_state" "$target_cache" &>/dev/null - mkdir -p "$target_dir" "$target_share" "$target_state" "$target_cache" &>/dev/null - else - echo "Operation cancelled." - return 2 - fi - - # Copy the selected configuration to the target directories - if [[ -d "$config_path" ]]; then - cp -r "$config_path/." "$target_dir" > /dev/null 2>&1 - echo "Successfully applied $selected_dir configuration." - shortcuts >/dev/null - else - echo "Configuration directory for $selected_dir does not exist." - return 3 - fi - - if [ "$whereami" = "ar" ]; then - chown -R "$USER:wheel" "/home/$USER/.config/nvim" - fi -} - -# run nvim with target config -alias vnf=nvim_target_config -function nvim_target_config() { - items=("Default" "TheSiahxyz" "AstroNvim" "LazyVim" "LunarVim" "NvChad") - config=$(printf "%s\n" "${items[@]}" | fzf --cycle --prompt="๎˜ซ Neovim Config ๏ฒ " --height=~50% --layout=reverse --border --exit-0) - [[ -z $config ]] && return 0 - [[ $config == "Default" ]] && config="kickstart" - NVIM_APPNAME=$config nvim $@ -} - - -########################################################################################### -########################################################################################### -### --- PASS --- ### -# otp -function pass_otp() { pass otp uri -q $1; } - -# otp insert -function pass_otp_insert() { pass otp insert $1; } - -# copy pass qr code -alias cpqr=pass_qr -function pass_qr() { qrencode -o "$1".png -t png -Sv 40 < "$1".pgp; } - - -########################################################################################### -########################################################################################### -### --- PASTE --- ### -if ls "${ZPLUGINDIR:-${XDG_SCRIPTS_HOME:-${HOME}/.local/bin}/zsh}/zsh-autosuggestions" >/dev/null 2>&1; then - autoload -Uz url-quote-magic - function pasteinit() { - OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]} - zle -N self-insert url-quote-magic - } - function pastefinish() { - zle -N self-insert $OLD_SELF_INSERT - } - zstyle :bracketed-paste-magic paste-init pasteinit - zstyle :bracketed-paste-magic paste-finish pastefinish -fi - - -########################################################################################### -########################################################################################### -### --- SDCV --- ### -function def() { - sdcv -n --utf8-output --color "$@" 2>&1 | \ - fold --width=$(tput cols) | \ - less --quit-if-one-screen -RX -} - - -########################################################################################### -########################################################################################### -### --- STOW --- ### -# run stow script from dotfiles repo -alias dstw=dotfeils_stw -function dotfiles_stw() { "${XDG_DOTFILES_DIR:-${HOME}/.dotfiles}/$(whereami)/.local/bin/stw"; } - - -########################################################################################### -########################################################################################### -### --- SUDO --- ### -# insert prefix at the beginning of the previous command -function __command_replace_buffer() { - local old=$1 new=$2 space=${2:+ } - if [[ $CURSOR -le ${#old} ]]; then - BUFFER="${new}${space}${BUFFER#$old }" - CURSOR=${#new} - else - LBUFFER="${new}${space}${LBUFFER#$old }" - fi -} - -# manipulate the previous command line -function pre_cmd() { - local prepend_command=$1 - local EDITOR=${SUDO_EDITOR:-${VISUAL:-$EDITOR}} - [[ -z $BUFFER ]] && LBUFFER="$(fc -ln -1)" - local WHITESPACE="" - - # Remove leading whitespace and store it for later restoration - if [[ ${LBUFFER:0:1} = " " ]]; then - WHITESPACE=" " - LBUFFER="${LBUFFER:1}" - fi - - # Main logic block - { - local cmd="${${(Az)BUFFER}[1]}" - local realcmd="${${(Az)aliases[$cmd]}[1]:-$cmd}" - local editorcmd="${${(Az)EDITOR}[1]}" - # Check if EDITOR is set, otherwise prepend the command and return - if [[ -z "$EDITOR" ]]; then - LBUFFER="$prepend_command $LBUFFER" - return - fi - # Check if the command is an editor command - is_editor_cmd=false - # Check if realcmd matches EDITOR, editorcmd, or their case variations - [[ "$realcmd" = (\$EDITOR|$editorcmd|${editorcmd:c}) || "${realcmd:c}" = ($editorcmd|${editorcmd:c}) ]] && is_editor_cmd=true - # Check if the real command's executable path matches the editor command - builtin which -a "$realcmd" | command grep -Fx -q "$editorcmd" && is_editor_cmd=true - # Execute the command replacement if it's an editor command - if $is_editor_cmd; then - __command_replace_buffer "$cmd" "$prepend_command -e" - return - fi - # Handle various command patterns in BUFFER - case "$BUFFER" in - $editorcmd\ *) __command_replace_buffer "$editorcmd" "$prepend_command -e" ;; - \$EDITOR\ *) __command_replace_buffer '$EDITOR' "$prepend_command -e" ;; - ${prepend_command}\ -e\ *) __command_replace_buffer "${prepend_command} -e" "$EDITOR" ;; - ${prepend_command}\ *) __command_replace_buffer "${prepend_command}" "" ;; - *) LBUFFER="$prepend_command $LBUFFER" ;; - esac - } always { - # Cleanup code: restore leading whitespace and update the command line - LBUFFER="${WHITESPACE}${LBUFFER}" - zle && zle redisplay # Only run redisplay if zle is enabled - } -} - - -########################################################################################### -########################################################################################### -### --- TMUX --- ### -# tmux init -alias tit=tmux_init -function tmux_init() { - ! tmux has-session -t "$TERMINAL" 2>/dev/null && tmux new-session -d -s "$TERMINAL" -c "$HOME" - [[ -n "$TMUX" ]] && tmux switch-client -t "$TERMINAL" || tmux attach-session -t "$TERMINAL" -} - -# cd tmux session -alias cds=cd_session_path -function cd_session_path() { cd "$(tmux display-message -p '#{session_path}')"; } - -# kill tmux session -alias tmk='kill_tmux_sessions' -function kill_tmux_sessions() { - local sessions - sessions="$(tmux ls | fzf --cycle --exit-0 --multi)" || return $? - local i - for i in "${(f@)sessions}" - do - [[ $i =~ '([^:]*):.*' ]] && { - echo "Killing $match[1]" - tmux kill-session -t "$match[1]" - } - done -} - -# switch tmux session -alias tms='switch_tmux_session' -function switch_tmux_session() { - local session - session=$(tmux list-sessions -F "#{session_name}" \ - | fzf --cycle --query="$1" --select-1 --exit-0) && - tmux switch-client -t "$session" -} - - -########################################################################################### -########################################################################################### -### --- VIRTUAL ENV --- ### -# create venvs -alias createv=create_venv -function create_venv() { - local env_dir="${XDG_DATA_HOME:-${HOME}/.local/share}/venvs/${1:-venv}" - local requirements_path="${XDG_DATA_HOME:-${HOME}/.local/share}/venvs" - - # Check if the environment already exists - # Create the virtual environment - echo "Creating new virtual environment in '$env_dir'..." - python3 -m venv $env_dir - - # Activate the virtual environment - source $env_dir/bin/activate - - # Optional: Install any default packages - pip3 install --upgrade pip >/dev/null 2>&1 - - if [ -f "$requirements_path/default-requirements.txt" ]; then - echo "Installing packages from '$requirements_path/default-requirements.txt'..." - pip3 install -r "$requirements_path/default-requirements.txt" >/dev/null 2>&1 - fi - - if [ -f "$requirements_path/captured-requirements.txt" ]; then - echo "Installing packages from '$requirements_path/captured-requirements.txt'..." - pip3 install -r "$requirements_path/captured-requirements.txt" >/dev/null 2>&1 - fi - - echo "Virtual environment '${1:-venv}' created and activated!" -} - -# activate or switch venvs -alias actv=active_venv -function active_venv() { - local venv="$1" - if [[ -z "$venv" ]]; then - venv=$(find "$XDG_DATA_HOME/venvs" -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | fzf) - fi - source "$XDG_DATA_HOME/venvs/$venv/bin/activate" - python -m ensurepip --upgrade >/dev/null 2>&1 - python -m pip install --upgrade pip >/dev/null 2>&1 - jupyter kernel --kernel=$venv -} - -# list venvs -alias listv=list_venv -function list_venv() { - local venvs_dir="${XDG_DATA_HOME:-${HOME}/.local/share}/venvs" - local venvs=("$venvs_dir"/*) - - if [ ${#venvs[@]} -eq 0 ]; then - echo "No venvs" - return 0 - fi - - echo "venvs list:" - for venv in "${venvs[@]}"; do - if [ -d "$venv" ]; then - echo " ๓ฐข” $(basename "$venv")" - fi - done -} - -# deactivate venv -alias deactv=deactive_venv -function deactive_venv() { - if [[ "$VIRTUAL_ENV" != "" ]]; then - if [[ ! -f "${XDG_DATA_HOME:-${HOME}/.local/share}/venvs/requirements.txt" ]]; then - pip3 freeze > "${XDG_DATA_HOME:-${HOME}/.local/share}/venvs/captured-requirements.txt" - fi - deactivate - echo "Virtual environment deactivated and all installed packages captured" - else - echo "No virtual environment is active." - fi -} - -# delete venv -alias delv=delete_venv -function delete_venv() { - local venv="$1" - local env_dir="${XDG_DATA_HOME:-${HOME}/.local/share}/venvs" - - if [[ -z $venv ]]; then - local options=($(find "$env_dir" -maxdepth 1 -mindepth 1 -type d -exec basename {} \;)) - options+=("Delete All") - - # Prompt user to select virtual environments or choose to delete all - local selected_envs=$(printf "%s\n" "${options[@]}" | fzf --cycle --prompt="venvs ๏ฒ " --height=~50% --layout=reverse --border --multi --exit-0) - - if [[ -z $selected_envs ]]; then - echo "No venvs selected" - return 0 - elif [[ $selected_envs == *"Delete All"* ]]; then - rm -rf "$env_dir"/* - echo "All venvs deleted" - else - # Loop through selected environments and delete each - local env - while IFS= read -r env; do - rm -rf "$env_dir/$env" - echo "$env deleted" - done <<< "$selected_envs" - fi - else - rm -rf "$env_dir/$venv" - echo "$venv deleted" - fi -} - - -########################################################################################### -########################################################################################### -### --- YAZI --- ### -# open yazi and cd to the file path -function yazicd() { - local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd - yazi "$@" --cwd-file="$tmp" - IFS= read -r -d '' cwd < "$tmp" - [ -n "$cwd" ] && [ "$cwd" != "$PWD" ] && builtin cd -- "$cwd" - rm -f -- "$tmp" -} diff --git a/fedora/.local/bin/bat b/fedora/.local/bin/bat deleted file mode 100755 index f9846c7..0000000 Binary files a/fedora/.local/bin/bat and /dev/null differ diff --git a/fedora/.local/bin/bmshortcuts b/fedora/.local/bin/bmshortcuts deleted file mode 100755 index af4ad58..0000000 --- a/fedora/.local/bin/bmshortcuts +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh - -bmdirs="${XDG_CONFIG_HOME:-${HOME}/.config}/shell/bm-dirs" -bmfiles="${XDG_CONFIG_HOME:-${HOME}/.config}/shell/bm-files" - -# Output locations. Unactivated progs should go to /dev/null. -shell_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/shell/shortcutrc" -shell_env_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc" -zsh_named_dirs="${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc" -command -v lf && lf_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/lf/shortcutrc" || lf_shortcuts="/dev/null" -command -v vim && vim_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/vim/shortcuts.vim" || vim_shortcuts="/dev/null" -command -v nvim && nvim_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/nvim/shortcuts.lua" || nvim_shortcuts="/dev/null" -if command -v yazi; then - yazi_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/yazi/keymap.toml" - yazi_shortcuts_tmp="$yazi_shortcuts.tmp" -else - yazi_shortcuts="/dev/null" - yazi_shortcuts_tmp="/dev/null" -fi -command -v ranger && ranger_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/ranger/shortcuts.conf" || ranger_shortcuts="/dev/null" -command -v qutebrowser && qute_shortcuts="$HOME/.qutebrowser/shortcuts.py" || qute_shortcuts="/dev/null" -command -v fish && fish_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/fish/shortcuts.fish" || fish_shortcuts="/dev/null" -command -v vifm && vifm_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/vifm/shortcuts.rc" || vifm_shortcuts="/dev/null" - -# Remove, prepare files -rm -f "$lf_shortcuts" "$ranger_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" "$vim_shortcuts" "$nvim_shortcuts" "$yazi_shortcuts" 2>/dev/null -printf "# vim: filetype=sh\\n" >"$fish_shortcuts" -printf "# vim: filetype=sh\\nalias " >"$shell_shortcuts" -printf "# vim: filetype=sh\\n" >"$shell_env_shortcuts" -printf "\" vim: filetype=vim\\n" >"$vifm_shortcuts" -[ -f "$HOME/.config/yazi/keymap-default.toml" ] && cp "$HOME/.config/yazi/keymap-default.toml" "$yazi_shortcuts" - -# Format the `directories` file in the correct syntax and sent it to all three configs. -eval "echo \"$(cat "$bmdirs")\"" | - awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); - printf(\"%s=\42cd %s && ls -A\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; - printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" ; - printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; - printf(\"abbr %s \42cd %s; and ls -A\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ; - printf(\"map g%s :cd %s\nmap t%s :cd %s\nmap M%s :cd %s:mo\nmap Y%s :cd %s:co \n\",\$1,\$2, \$1, \$2, \$1, \$2, \$1, \$2) >> \"$vifm_shortcuts\" ; - printf(\"config.bind(',,%s', \42set downloads.location.directory %s ;; hint links download\42) \n\",\$1,\$2) >> \"$qute_shortcuts\" ; - printf(\"map g%s cd %s\nmap t%s tab_new %s\nmap m%s shell mv -v %%s %s\nmap Y%s shell cp -rv %%s %s \n\",\$1,\$2,\$1,\$2, \$1, \$2, \$1, \$2) >> \"$ranger_shortcuts\" ; - printf(\"map %s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ; - printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" ; - printf(\"nmap %s :Explore %s\n\",\$1,\$2) >> \"$vim_shortcuts\" ; - desc_path = \$2; gsub(\"^/home/$USER/\",\"~/\",desc_path); - printf(\"vim.keymap.set('c', ';%s', '%s', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, desc_path) >> \"$nvim_shortcuts\" ; - printf(\"vim.keymap.set('n', '%s', 'Explore %s', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, desc_path) >> \"$nvim_shortcuts\" ; - printf(\"vim.keymap.set('n', '%s', function() require('mini.files').open('%s') end, { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, desc_path) >> \"$nvim_shortcuts\" ; - desc_path = \$2; gsub(\"^/home/$USER/\",\"~/\",desc_path); - key_array = \"\"; for(i=1; i<=length(\$1); i++) { if(i==1) key_array = \"\\\"\" substr(\$1,i,1) \"\\\"\"; else key_array = key_array \", \\\"\" substr(\$1,i,1) \"\\\"\" } - printf(\"\\t{ on = [ %s ], run = \\\"cd %s\\\", desc = \\\"Go to %s\\\" },\\n\",key_array,\$2,desc_path) >> \"$yazi_shortcuts_tmp\"}" - -# Format the `files` file in the correct syntax and sent it to both configs. -eval "echo \"$(cat "$bmfiles")\"" | - awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); - printf(\"%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; - printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" ; - printf(\"v%s=\42\$EDITOR2 %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; - printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; - printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ; - printf(\"abbr v%s \42\$EDITOR2 %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ; - printf(\"map %s :e %s \n\",\$1,\$2) >> \"$vifm_shortcuts\" ; - printf(\"map %s shell \$EDITOR %s \n\",\$1,\$2) >> \"$ranger_shortcuts\" ; - printf(\"map v%s shell \$EDITOR2 %s \n\",\$1,\$2) >> \"$ranger_shortcuts\" ; - printf(\"map %s \$\$EDITOR \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ; - printf(\"map v%s \$\$EDITOR2 \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ; - printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" ; - printf(\"nmap %s :e %s\n\",\$1,\$2) >> \"$vim_shortcuts\" ; - desc_path = \$2; gsub(\"^/home/$USER/\",\"~/\",desc_path); - printf(\"vim.keymap.set('c', ';%s', '%s', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, desc_path) >> \"$nvim_shortcuts\" ; - printf(\"vim.keymap.set('n', '%s', 'e %s', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, desc_path) >> \"$nvim_shortcuts\" ; - desc_path = \$2; gsub(\"^/home/$USER/\",\"~/\",desc_path); - key_array = \"\"; for(i=1; i<=length(\$1); i++) { if(i==1) key_array = \"\\\"\" substr(\$1,i,1) \"\\\"\"; else key_array = key_array \", \\\"\" substr(\$1,i,1) \"\\\"\" } - printf(\"\\t{ on = [ %s ], run = [ 'reveal %s', 'open' ], desc = \\\"Open %s\\\" },\\n\", key_array, \$2, desc_path) >> \"$yazi_shortcuts_tmp\" }" - -# Merge bookmarks into keymap-default.toml -if [ -f "$yazi_shortcuts_tmp" ]; then - # Find the line with the closing bracket in the [mgr] section - line_num=$(grep -n "^]" "$yazi_shortcuts" | head -1 | cut -d: -f1) - - # Create the merged file - head -n $((line_num - 1)) "$yazi_shortcuts" >"$yazi_shortcuts.new" - echo "" >>"$yazi_shortcuts.new" - echo " # Custom bookmarks" >>"$yazi_shortcuts.new" - cat "$yazi_shortcuts_tmp" >>"$yazi_shortcuts.new" - echo "]" >>"$yazi_shortcuts.new" - tail -n +$((line_num + 1)) "$yazi_shortcuts" >>"$yazi_shortcuts.new" - - # Replace the original file - mv "$yazi_shortcuts.new" "$yazi_shortcuts" - rm -f "$yazi_shortcuts_tmp" -fi diff --git a/fedora/.local/bin/chafa b/fedora/.local/bin/chafa deleted file mode 100755 index 89b4c96..0000000 Binary files a/fedora/.local/bin/chafa and /dev/null differ diff --git a/fedora/.local/bin/eza b/fedora/.local/bin/eza deleted file mode 100755 index 0d40b22..0000000 Binary files a/fedora/.local/bin/eza and /dev/null differ diff --git a/fedora/.local/bin/fzf b/fedora/.local/bin/fzf deleted file mode 100755 index 0e89dac..0000000 Binary files a/fedora/.local/bin/fzf and /dev/null differ diff --git a/fedora/.local/bin/fzf-preview.sh b/fedora/.local/bin/fzf-preview.sh deleted file mode 100755 index 5f99697..0000000 --- a/fedora/.local/bin/fzf-preview.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env bash -# -# The purpose of this script is to demonstrate how to preview a file or an -# image in the preview window of fzf. -# -# Dependencies: -# - https://github.com/sharkdp/bat -# - https://github.com/hpjansson/chafa -# - https://iterm2.com/utilities/imgcat - -if [[ $# -ne 1 ]]; then - >&2 echo "usage: $0 FILENAME[:LINENO][:IGNORED]" - exit 1 -fi - -file=${1/#\~\//$HOME/} - -center=0 -if [[ ! -r $file ]]; then - if [[ $file =~ ^(.+):([0-9]+)\ *$ ]] && [[ -r ${BASH_REMATCH[1]} ]]; then - file=${BASH_REMATCH[1]} - center=${BASH_REMATCH[2]} - elif [[ $file =~ ^(.+):([0-9]+):[0-9]+\ *$ ]] && [[ -r ${BASH_REMATCH[1]} ]]; then - file=${BASH_REMATCH[1]} - center=${BASH_REMATCH[2]} - fi -fi - -type=$(file --brief --dereference --mime -- "$file") - -if [[ ! $type =~ image/ ]]; then - if [[ $type =~ =binary ]]; then - file "$1" - exit - fi - - # Sometimes bat is installed as batcat. - if command -v batcat > /dev/null; then - batname="batcat" - elif command -v bat > /dev/null; then - batname="bat" - else - cat "$1" - exit - fi - - ${batname} --style="${BAT_STYLE:-numbers}" --color=always --pager=never --highlight-line="${center:-0}" -- "$file" - exit -fi - -dim=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES} -if [[ $dim == x ]]; then - dim=$(stty size < /dev/tty | awk '{print $2 "x" $1}') -elif ! [[ $KITTY_WINDOW_ID ]] && ((FZF_PREVIEW_TOP + FZF_PREVIEW_LINES == $(stty size < /dev/tty | awk '{print $1}'))); then - # Avoid scrolling issue when the Sixel image touches the bottom of the screen - # * https://github.com/junegunn/fzf/issues/2544 - dim=${FZF_PREVIEW_COLUMNS}x$((FZF_PREVIEW_LINES - 1)) -fi - -# 1. Use icat (from Kitty) if kitten is installed -if [[ $KITTY_WINDOW_ID ]] || [[ $GHOSTTY_RESOURCES_DIR ]] && command -v kitten > /dev/null; then - # 1. 'memory' is the fastest option but if you want the image to be scrollable, - # you have to use 'stream'. - # - # 2. The last line of the output is the ANSI reset code without newline. - # This confuses fzf and makes it render scroll offset indicator. - # So we remove the last line and append the reset code to its previous line. - kitten icat --clear --transfer-mode=memory --unicode-placeholder --stdin=no --place="$dim@0x0" "$file" | sed '$d' | sed $'$s/$/\e[m/' - -# 2. Use chafa with Sixel output -elif command -v chafa > /dev/null; then - chafa -s "$dim" "$file" - # Add a new line character so that fzf can display multiple images in the preview window - echo - -# 3. If chafa is not found but imgcat is available, use it on iTerm2 -elif command -v imgcat > /dev/null; then - # NOTE: We should use https://iterm2.com/utilities/it2check to check if the - # user is running iTerm2. But for the sake of simplicity, we just assume - # that's the case here. - imgcat -W "${dim%%x*}" -H "${dim##*x}" "$file" - -# 4. Cannot find any suitable method to preview the image -else - file "$file" -fi diff --git a/fedora/.local/bin/fzf-tmux b/fedora/.local/bin/fzf-tmux deleted file mode 100755 index e73a908..0000000 --- a/fedora/.local/bin/fzf-tmux +++ /dev/null @@ -1,257 +0,0 @@ -#!/usr/bin/env bash -# fzf-tmux: starts fzf in a tmux pane -# usage: fzf-tmux [LAYOUT OPTIONS] [--] [FZF OPTIONS] - -fail() { - >&2 echo "$1" - exit 2 -} - -fzf="$(command which fzf)" || fzf="$(dirname "$0")/fzf" -[[ -x $fzf ]] || fail 'fzf executable not found' - -args=() -opt="" -skip="" -swap="" -close="" -term="" -[[ -n $LINES ]] && lines=$LINES || lines=$(tput lines) || lines=$(tmux display-message -p "#{pane_height}") -[[ -n $COLUMNS ]] && columns=$COLUMNS || columns=$(tput cols) || columns=$(tmux display-message -p "#{pane_width}") - -tmux_version=$(tmux -V | sed 's/[^0-9.]//g') -tmux_32=$(awk '{print ($1 >= 3.2)}' <<< "$tmux_version" 2> /dev/null || bc -l <<< "$tmux_version >= 3.2") - -help() { - >&2 echo 'usage: fzf-tmux [LAYOUT OPTIONS] [--] [FZF OPTIONS] - - LAYOUT OPTIONS: - (default layout: -d 50%) - - Popup window (requires tmux 3.2 or above): - -p [WIDTH[%][,HEIGHT[%]]] (default: 50%) - -w WIDTH[%] - -h HEIGHT[%] - -x COL - -y ROW - - Split pane: - -u [HEIGHT[%]] Split above (up) - -d [HEIGHT[%]] Split below (down) - -l [WIDTH[%]] Split left - -r [WIDTH[%]] Split right -' - exit -} - -while [[ $# -gt 0 ]]; do - arg="$1" - shift - [[ -z $skip ]] && case "$arg" in - -) - term=1 - ;; - --help) - help - ;; - --version) - echo "fzf-tmux (with fzf $("$fzf" --version))" - exit - ;; - -p* | -w* | -h* | -x* | -y* | -d* | -u* | -r* | -l*) - if [[ $arg =~ ^-[pwhxy] ]]; then - [[ $opt =~ "-E" ]] || opt="-E" - elif [[ $arg =~ ^.[lr] ]]; then - opt="-h" - if [[ $arg =~ ^.l ]]; then - opt="$opt -d" - swap="; swap-pane -D ; select-pane -L" - close="; tmux swap-pane -D" - fi - else - opt="" - if [[ $arg =~ ^.u ]]; then - opt="$opt -d" - swap="; swap-pane -D ; select-pane -U" - close="; tmux swap-pane -D" - fi - fi - if [[ ${#arg} -gt 2 ]]; then - size="${arg:2}" - else - if [[ $1 =~ ^[0-9%,]+$ ]] || [[ $1 =~ ^[A-Z]$ ]]; then - size="$1" - shift - else - continue - fi - fi - - if [[ $arg =~ ^-p ]]; then - if [[ -n $size ]]; then - w=${size%%,*} - h=${size##*,} - opt="$opt -w$w -h$h" - fi - elif [[ $arg =~ ^-[whxy] ]]; then - opt="$opt ${arg:0:2}$size" - elif [[ $size =~ %$ ]]; then - size=${size:0:${#size}-1} - if [[ $tmux_32 == 1 ]]; then - if [[ -n $swap ]]; then - opt="$opt -l $((100 - size))%" - else - opt="$opt -l $size%" - fi - else - if [[ -n $swap ]]; then - opt="$opt -p $((100 - size))" - else - opt="$opt -p $size" - fi - fi - else - if [[ -n $swap ]]; then - if [[ $arg =~ ^.l ]]; then - max=$columns - else - max=$lines - fi - size=$((max - size)) - [[ $size -lt 0 ]] && size=0 - opt="$opt -l $size" - else - opt="$opt -l $size" - fi - fi - ;; - --) - # "--" can be used to separate fzf-tmux options from fzf options to - # avoid conflicts - skip=1 - continue - ;; - *) - args+=("$arg") - ;; - esac - [[ -n $skip ]] && args+=("$arg") -done - -if [[ -z $TMUX ]]; then - "$fzf" "${args[@]}" - exit $? -fi - -# * --height option is not allowed -# * CTRL-Z is also disabled -# * fzf-tmux script is not compatible with --tmux option in fzf 0.53.0 or later -args=("${args[@]}" "--no-height" "--bind=ctrl-z:ignore" "--no-tmux") - -# Handle zoomed tmux pane without popup options by moving it to a temp window -if [[ ! $opt =~ "-E" ]] && tmux list-panes -F '#F' | grep -q Z; then - zoomed_without_popup=1 - original_window=$(tmux display-message -p "#{window_id}") - tmp_window=$(tmux new-window -d -P -F "#{window_id}" "bash -c 'while :; do for c in \\| / - '\\;' do sleep 0.2; printf \"\\r\$c fzf-tmux is running\\r\"; done; done'") - tmux swap-pane -t $tmp_window \; select-window -t $tmp_window -fi - -set -e - -# Clean up named pipes on exit -id=$RANDOM -argsf="${TMPDIR:-/tmp}/fzf-args-$id" -fifo1="${TMPDIR:-/tmp}/fzf-fifo1-$id" -fifo2="${TMPDIR:-/tmp}/fzf-fifo2-$id" -fifo3="${TMPDIR:-/tmp}/fzf-fifo3-$id" -if tmux_win_opts=$(tmux show-options -p remain-on-exit \; show-options -p synchronize-panes 2> /dev/null); then - tmux_win_opts=($(sed '/ off/d; s/synchronize-panes/set-option -p synchronize-panes/; s/remain-on-exit/set-option -p remain-on-exit/; s/$/ \\;/' <<< "$tmux_win_opts")) - tmux_off_opts='; set-option -p synchronize-panes off ; set-option -p remain-on-exit off' -else - tmux_win_opts=($(tmux show-window-options remain-on-exit \; show-window-options synchronize-panes | sed '/ off/d; s/^/set-window-option /; s/$/ \\;/')) - tmux_off_opts='; set-window-option synchronize-panes off ; set-window-option remain-on-exit off' -fi -cleanup() { - \rm -f $argsf $fifo1 $fifo2 $fifo3 - - # Restore tmux window options - if [[ ${#tmux_win_opts[@]} -gt 1 ]]; then - eval "tmux ${tmux_win_opts[*]}" - fi - - # Remove temp window if we were zoomed without popup options - if [[ -n $zoomed_without_popup ]]; then - tmux display-message -p "#{window_id}" > /dev/null - tmux swap-pane -t $original_window \; \ - select-window -t $original_window \; \ - kill-window -t $tmp_window \; \ - resize-pane -Z - fi - - if [[ $# -gt 0 ]]; then - trap - EXIT - exit 130 - fi -} -trap 'cleanup 1' SIGUSR1 -trap 'cleanup' EXIT - -envs="export TERM=$TERM " -if [[ $opt =~ "-E" ]]; then - if [[ $tmux_version == 3.2 ]]; then - FZF_DEFAULT_OPTS="--margin 0,1 $FZF_DEFAULT_OPTS" - elif [[ $tmux_32 == 1 ]]; then - FZF_DEFAULT_OPTS="--border $FZF_DEFAULT_OPTS" - opt="-B $opt" - else - echo "fzf-tmux: tmux 3.2 or above is required for popup mode" >&2 - exit 2 - fi -fi -envs="$envs FZF_DEFAULT_COMMAND=$(printf %q "$FZF_DEFAULT_COMMAND")" -envs="$envs FZF_DEFAULT_OPTS=$(printf %q "$FZF_DEFAULT_OPTS")" -envs="$envs FZF_DEFAULT_OPTS_FILE=$(printf %q "$FZF_DEFAULT_OPTS_FILE")" -[[ -n $RUNEWIDTH_EASTASIAN ]] && envs="$envs RUNEWIDTH_EASTASIAN=$(printf %q "$RUNEWIDTH_EASTASIAN")" -[[ -n $BAT_THEME ]] && envs="$envs BAT_THEME=$(printf %q "$BAT_THEME")" -echo "$envs;" > "$argsf" - -# Build arguments to fzf -opts=$(printf "%q " "${args[@]}") - -pppid=$$ -echo -n "trap 'kill -SIGUSR1 -$pppid' EXIT SIGINT SIGTERM;" >> $argsf -close="; trap - EXIT SIGINT SIGTERM $close" - -export TMUX=$(cut -d , -f 1,2 <<< "$TMUX") -mkfifo -m o+w $fifo2 -if [[ $opt =~ "-E" ]]; then - cat $fifo2 & - if [[ -n $term ]] || [[ -t 0 ]]; then - cat <<< "\"$fzf\" $opts > $fifo2; out=\$? $close; exit \$out" >> $argsf - else - mkfifo $fifo1 - cat <<< "\"$fzf\" $opts < $fifo1 > $fifo2; out=\$? $close; exit \$out" >> $argsf - cat <&0 > $fifo1 & - fi - - tmux popup -d "$PWD" $opt "bash $argsf" > /dev/null 2>&1 - exit $? -fi - -mkfifo -m o+w $fifo3 -if [[ -n $term ]] || [[ -t 0 ]]; then - cat <<< "\"$fzf\" $opts > $fifo2; echo \$? > $fifo3 $close" >> $argsf -else - mkfifo $fifo1 - cat <<< "\"$fzf\" $opts < $fifo1 > $fifo2; echo \$? > $fifo3 $close" >> $argsf - cat <&0 > $fifo1 & -fi -tmux \ - split-window -c "$PWD" $opt "bash -c 'exec -a fzf bash $argsf'" $swap \ - $tmux_off_opts \ - > /dev/null 2>&1 || { - "$fzf" "${args[@]}" - exit $? -} -cat $fifo2 -exit "$(cat $fifo3)" diff --git a/fedora/.local/bin/fzffiles b/fedora/.local/bin/fzffiles index 97047e9..58af9d0 100755 --- a/fedora/.local/bin/fzffiles +++ b/fedora/.local/bin/fzffiles @@ -1,6 +1,5 @@ #!/bin/sh -# The set -e option instructs sh to immediately exit if any command has a non-zero exit status set -e # Set new line and tab for word splitting @@ -8,49 +7,47 @@ IFS=' ' # Get the list of selected files with key bindings for specific paths -files=$(fzf-tmux \ +files=$(fzf \ --header "^a pwd ^b public ^d .dotfiles ^f configs ^g git ^h home ^k desktop ^r scripts ^s suckless ^u staged files ^v private ^/ help" \ --preview "selection={}; - clean=\$(printf '%s' \"\$selection\" | sed -e 's/^๐Ÿ“„ //' -e 's/^โœ๏ธ //' -e 's/^โœ… //' -e 's/^โŒ //' -e 's/^๐Ÿ”€ //' -e 's/^โ“ //'); + clean=\$(printf '%s' \"\$selection\" | sed -e 's/^๐Ÿ“„ //' -e 's/^โœ //' -e 's/^โœ… //' -e 's/^โŒ //' -e 's/^๐Ÿ”€ //' -e 's/^โ“ //'); [ -z \"\$clean\" ] && { echo 'No selection'; exit 0; } target=\$(readlink -f \"\$clean\" 2>/dev/null || printf '%s' \"\$clean\"); - if [ -z \"\$target\" ]; then - echo 'Could not resolve path'; - exit 0; - fi + if [ -z \"\$target\" ]; then echo 'Could not resolve path'; exit 0; fi; + mime=\$(file --mime-type -b \"\$target\" 2>/dev/null); + case \"\$mime\" in + image/*) + echo \"[image preview disabled] \$target\"; + file -h \"\$target\"; + exit 0;; + esac; if [ -f \"\$target\" ]; then dir=\$(dirname \"\$target\"); if git_root=\$(git -C \"\$dir\" rev-parse --show-toplevel 2>/dev/null); then rel=\${target#\"\$git_root\"/}; diff_output=\$(git -C \"\$git_root\" diff --color -- \"\$rel\"); - if [ -n \"\$diff_output\" ]; then - printf '%s\n' \"\$diff_output\" - exit 0 - fi + if [ -n \"\$diff_output\" ]; then printf '%s\n' \"\$diff_output\"; exit 0; fi; diff_output=\$(git -C \"\$git_root\" diff --color --cached -- \"\$rel\"); - if [ -n \"\$diff_output\" ]; then - printf '%s\n' \"\$diff_output\" - exit 0 - fi - fi - fi + if [ -n \"\$diff_output\" ]; then printf '%s\n' \"\$diff_output\"; exit 0; fi; + fi; + fi; if [ -d \"\$target\" ]; then - exa --color=always --long --all --header --icons --git \"\$target\" + eza --color=always --long --all --header --icons --git \"\$target\"; elif [ -f \"\$target\" ]; then - bat --color=always --style=header,grid --line-range=:500 \"\$target\" + bat --color=always --style=header,grid --line-range=:500 \"\$target\"; else - file -h \"\$target\" + file -h \"\$target\"; fi" \ --reverse \ --query="$1" \ --multi \ --exit-0 \ --prompt " ๐Ÿ’ก " \ - --bind "ctrl-a:change-prompt( โšก )+reload(fd -H -L -t f -E .Trash -E .git -E .cache . $PWD)" \ - --bind "ctrl-b:change-prompt( ๐ŸŒŽ )+reload(fd -H -L -t f -E .Trash -E .git -E .cache . ${XDG_PUBLICSHARE_DIR:-${HOME}/Public})" \ - --bind "ctrl-d:change-prompt( โš™๏ธ )+reload(fd -H -L -t f -E .Trash -E .git -E .cache . ${XDG_DOTFILES_DIR:-${HOME}/.dotfiles})" \ - --bind "ctrl-f:change-prompt( ๐Ÿ—‚๏ธ )+reload(fd -H -L -t f -E .Trash -E .git -E .cache . ${XDG_CONFIG_HOME:-${HOME}/.config})" \ - --bind "ctrl-g:change-prompt( ๏‡’ )+reload(fd -H -L -t f -E .Trash -E .git -E .cache . $HOME/Private/repos $HOME/Public/repos)" \ + --bind "ctrl-a:change-prompt( โšก )+reload(fd -H -L -t f -E .Trash -E .git -E .cache -E node_modules -E .next -E dist -E build -E coverage -E target -E vendor -E .venv -E venv . $PWD)" \ + --bind "ctrl-b:change-prompt( ๐ŸŒŽ )+reload(fd -H -L -t f -E .Trash -E .git -E .cache -E node_modules -E .next -E dist -E build -E coverage -E target -E vendor -E .venv -E venv . ${XDG_PUBLICSHARE_DIR:-${HOME}/Public})" \ + --bind "ctrl-d:change-prompt( โš™๏ธ )+reload(fd -H -L -t f -E .Trash -E .git -E .cache -E node_modules -E .next -E dist -E build -E coverage -E target -E vendor -E .venv -E venv . ${XDG_DOTFILES_DIR:-${HOME}/.dotfiles})" \ + --bind "ctrl-f:change-prompt( ๐Ÿ—‚๏ธ )+reload(fd -H -L -t f -E .Trash -E .git -E .cache -E node_modules -E .next -E dist -E build -E coverage -E target -E vendor -E .venv -E venv . ${XDG_CONFIG_HOME:-${HOME}/.config})" \ + --bind "ctrl-g:change-prompt( )+reload(fd -H -L -t f -E .Trash -E .git -E .cache . $HOME/Private/repos $HOME/Public/repos)" \ --bind "ctrl-h:change-prompt( ๐Ÿ  )+reload(fd -H -L -t f -E .Trash -E .git -E .cache . $HOME)" \ --bind "ctrl-k:change-prompt( ๐Ÿ–ฅ๏ธ )+reload(fd -H -L -t f -E .Trash -E .git -E .cache . ${XDG_DESKTOP_DIR:-${HOME}/Desktop})" \ --bind "ctrl-r:change-prompt( ๐Ÿ‘Ÿ )+reload(fd -H -L -t f -E .Trash -E .git -E .cache -E zsh . ${XDG_SCRIPTS_HOME:-${HOME}/.local/bin})" \ @@ -65,7 +62,7 @@ files=$(fzf-tmux \ else if (staged == \"!\" && unstaged == \"!\") icon=\"โŒ\"; else if (staged != \" \" && staged != \"?\" && unstaged != \" \" && unstaged != \"?\") icon=\"๐Ÿ”€\"; else if (staged != \" \" && staged != \"?\") icon=\"โœ…\"; - else if (unstaged != \" \") icon=\"โœ๏ธ\"; + else if (unstaged != \" \") icon=\"โœ\"; else icon=\"โ“\"; print icon \" \" root \"/\" file }'; else echo 'This is not a git repository.'; fi)" \ @@ -85,7 +82,7 @@ files=$(fzf-tmux \ # Check if any files were selected, and exit if not [ -z "$files" ] && exit 0 -files=$(printf '%s\n' "$files" | sed -e 's/^๐Ÿ“„ //' -e 's/^โœ๏ธ //' -e 's/^โœ… //' -e 's/^โŒ //' -e 's/^๐Ÿ”€ //' -e 's/^โ“ //') +files=$(printf '%s\n' "$files" | sed -e 's/^๐Ÿ“„ //' -e 's/^โœ //' -e 's/^โœ… //' -e 's/^โŒ //' -e 's/^๐Ÿ”€ //' -e 's/^โ“ //') if [ -d "$files" ]; then absolute_files=$(realpath $files) diff --git a/fedora/.local/bin/fzffns b/fedora/.local/bin/fzffns deleted file mode 100755 index c919723..0000000 --- a/fedora/.local/bin/fzffns +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh - -# Print all functions and comments in a readable format -# Set the filename of the script containing the functions -file="${ZDOTDIR:-${XDG_CONFIG_HOME:-${HOME}/.config}/zsh}/scripts.zsh" - -# Initialize an empty variable to hold functions, aliases, and comments -functions="" - -# Parse the file for function names, aliases, and comments -while IFS= read -r line || [ -n "$line" ]; do - case "$line" in - \#*) - if [ "$(printf '%s' "$line" | cut -c 2)" != "#" ] && [ "$(printf '%s' "$line" | cut -c 2)" != "!" ]; then - # Remove the '#' from the comment line - comment=$(printf '%s' "$line" | sed 's/^# //') - - # Read the next line to check for alias or function definition - IFS= read -r next_line || break - - # Check if it's an alias definition - if echo "$next_line" | grep -q '^alias '; then - alias_name=$(echo "$next_line" | sed -n 's/^alias \([a-zA-Z0-9_]*\)=.*$/\1/p') - - # Read another line to get the function definition - IFS= read -r func_line || break - f_name=$(printf '%s' "$func_line" | sed -n 's/^function \([^(]*\)().*$/\1/p') - - if [ -n "$f_name" ]; then - functions="$functions$f_name|$alias_name|$comment\n" - fi - - # Check if it's a function definition - elif echo "$next_line" | grep -q '^function '; then - f_name=$(printf '%s' "$next_line" | sed -n 's/^function \([^(]*\)().*$/\1/p') - if [ -n "$f_name" ]; then - functions="$functions$f_name||$comment\n" - fi - fi - fi - ;; - esac -done <"$file" - -# Sort the functions alphabetically by name -sorted=$(printf '%b' "$functions" | sort) - -# Print out the sorted functions with aliases and comments in a readable format -formatted=$(printf '%b' "$sorted" | while IFS='|' read -r f_name alias_name comment; do - if [ -n "$alias_name" ]; then - printf 'fn: %-30s - %s (alias: %s)\n' "$f_name" "$comment" "$alias_name" - else - printf 'fn: %-30s - %s\n' "$f_name" "$comment" - fi -done) - -# Use fzf to select a function -selected=$(printf '%b' "$formatted" | fzf-tmux --header "Select a function:" --reverse) - -# Check if a function was selected -if [ -n "$selected" ]; then - # Extract the function name - f_name=$(echo "$selected" | cut -d ' ' -f 2 | sed 's/[[:space:]]\+//g') - - # Get the line number of the function definition - line_number=$(grep -n "^function $f_name(" "$file" | cut -d ':' -f 1) - - # Open the function in nvim at the specific line number - if [ -n "$line_number" ]; then - nvim "+$line_number" "$file" - else - echo "Function '$f_name' not found in $file." - fi -fi diff --git a/fedora/.local/bin/fzfpass b/fedora/.local/bin/fzfpass deleted file mode 100755 index 5190f8e..0000000 --- a/fedora/.local/bin/fzfpass +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh - -set -e - -usage() { - echo "Find pass gpg files in Password-Store using fzf." - echo "" - echo "Usage: ${0##*/} [-h|--help]" - echo "" - echo "Options:" - echo " -h, --help : Show this message" - echo "" - echo "Shortcuts:" - echo " return - echo password and copy to clipboard (wayland only)" - echo " ctrl+a - new password (named as per the prompt)" - echo " ctrl+e - edit selected password" - echo " ctrl+g - regenerate selected password" - echo " ctrl+r - rename selected password" - echo " ctrl+x - delete selected password" - echo " tab - tab complete" - echo " esc/ctrl+c - exit" - exit 0 -} - -if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then - usage -fi - -passdir=${PASSWORD_STORE_DIR:-$HOME/.local/share/.password-store} -cd "$passdir" - -# Unlock the password for this session -pass show "$(tree -Ffi | grep '.gpg' | sed 's/.gpg$//g' | sed 's/^..//' | head -n 1)" >/dev/null - -# Main fzf session -passfile=$( - tree -Ffi | grep '.gpg' | sed 's/.gpg$//g' | sed 's/^..//' | - fzf-tmux \ - --header="๐Ÿ”‘ Password Manager" \ - --reverse \ - --no-mouse \ - --preview="pass {}" \ - --header="๐Ÿ”‘ ^a: Generate | ^e: Edit | ^g: Generate (no symbol) | ^r: Rename | ^s: Generate (symbol) | ^x: Delete | tab: Replace" \ - --bind="ctrl-a:execute(if [ -z {q} ]; then read -p \"Can't generate empty password. Press enter to continue...\"; else pass generate -n {q} < /dev/tty > /dev/tty 2>&1 && pass edit {q} < /dev/tty > /dev/tty 2>&1; fi)+reload(tree -Ffi | grep '.gpg' | sed 's/.gpg$//g')" \ - --bind="ctrl-e:execute(pass edit {} < /dev/tty > /dev/tty 2>&1)+reload(tree -Ffi | grep '.gpg' | sed 's/.gpg$//g')" \ - --bind="ctrl-r:execute(bash -c ' -echo -n \"Enter new name for {}: \" > /dev/tty; -read new_name < /dev/tty; -if [ -n \"\$new_name\" ]; then - pass mv {} \"\$new_name\" || echo \"Rename failed.\" > /dev/tty; -else - echo \"No name entered. Rename aborted.\" > /dev/tty; -fi' < /dev/tty > /dev/tty 2>&1)+reload(tree -Ffi | grep '.gpg' | sed 's/.gpg$//g')" \ - --bind="ctrl-g:execute(if [ -z {} ]; then read -p \"Can't generate empty password. Press enter to continue...\"; else pass generate -in {} < /dev/tty > /dev/tty 2>&1 && pass edit {} < /dev/tty > /dev/tty 2>&1; fi)+reload(tree -Ffi | grep '.gpg' | sed 's/.gpg$//g')" \ - --bind="ctrl-s:execute(if [ -z {} ]; then read -p \"Can't generate empty password. Press enter to continue...\"; else pass generate -i {} < /dev/tty > /dev/tty 2>&1 && pass edit {} < /dev/tty > /dev/tty 2>&1; fi)+reload(tree -Ffi | grep '.gpg' | sed 's/.gpg$//g')" \ - --bind="ctrl-x:execute(pass rm {} < /dev/tty > /dev/tty 2>&1)+reload(tree -Ffi | grep '.gpg' | sed 's/.gpg$//g')" \ - --bind="tab:replace-query" -) - -show_passdata=false - -if [ "$1" = "-i" ]; then - show_passdata=true - shift -fi - -if [ "$show_passdata" = true ]; then - passdata="$(pass "$passfile")" - echo "$passdata" -else - password="$(pass show "$passfile" | head -n 1)" - echo "$password" - - if [ -n "$password" ]; then - case "$(uname)" in - Darwin*) - printf "%s" "$password" | pbcopy # Use pbcopy on macOS - ;; - Linux*) - printf "%s" "$password" | xclip -selection clipboard # Use xclip on Linux - ;; - *) - echo "Unsupported operating system" - ;; - esac - sleep 0.1 - fi -fi diff --git a/fedora/.local/bin/htop-vim/.editorconfig b/fedora/.local/bin/htop-vim/.editorconfig deleted file mode 100644 index dd881dd..0000000 --- a/fedora/.local/bin/htop-vim/.editorconfig +++ /dev/null @@ -1,17 +0,0 @@ -# EditorConfig configuration for htop -# http://EditorConfig.org - -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file, utf-8 charset -[*] -end_of_line = lf -insert_final_newline = true -charset = utf-8 - -# match C source and header files, set indent to three spaces -[*.{c,h}] -indent_style = space -indent_size = 3 -trim_trailing_whitespace = true diff --git a/fedora/.local/bin/htop-vim/.gitignore b/fedora/.local/bin/htop-vim/.gitignore deleted file mode 100644 index 50f3bd1..0000000 --- a/fedora/.local/bin/htop-vim/.gitignore +++ /dev/null @@ -1,56 +0,0 @@ -# the binaries: -htop -pcp-htop - -# all object files -*.o - -# skip all backups -*.bak -*~ -.*.sw? - -# skip coverage files -*.gcda -*/*.gcda -*.gcno -*/*.gcno -*.h.gch -*/.dirstamp - -# automake/autoconf related files -.deps/ -Makefile -Makefile.in -INSTALL -aclocal.m4 -autom4te.cache/ -compile -conf*/ -config.guess -config.h -config.h.in -config.log -config.status -config.cache -config.sub -configure -depcomp -htop.1 -pcp-htop.5 -install-sh -libtool -ltmain.sh -m4/ -missing -stamp-h1 - -# files related to valgrind/callgrind -callgrind.out.* - -# IDE workspace configurations -/.idea/ -/.vscode/ - -# Language Servers -/.cache/clangd/ diff --git a/fedora/.local/bin/htop-vim/.travis.yml b/fedora/.local/bin/htop-vim/.travis.yml deleted file mode 100644 index f62e42f..0000000 --- a/fedora/.local/bin/htop-vim/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: c - -compiler: - - clang - - gcc - -os: - - freebsd - -script: - - ./autogen.sh - - ./configure --enable-werror - - make -k - - make distcheck DISTCHECK_CONFIGURE_FLAGS=--enable-werror - - sudo make install - - make installcheck diff --git a/fedora/.local/bin/htop-vim/AUTHORS b/fedora/.local/bin/htop-vim/AUTHORS deleted file mode 100644 index a4cc7c6..0000000 --- a/fedora/.local/bin/htop-vim/AUTHORS +++ /dev/null @@ -1,11 +0,0 @@ -Originally authored by: - Hisham H. Muhammad - -Currently maintained by the htop dev team: - Benny Baumann - Christian Gรถttsche - Daniel Lange - Nathan Scott - -For the full list of contributors see: - git log --format="%aN" | sort -u diff --git a/fedora/.local/bin/htop-vim/Action.c b/fedora/.local/bin/htop-vim/Action.c deleted file mode 100644 index 99a8a1f..0000000 --- a/fedora/.local/bin/htop-vim/Action.c +++ /dev/null @@ -1,868 +0,0 @@ -/* -htop - Action.c -(C) 2015 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "Action.h" - -#include -#include -#include - -#include "CRT.h" -#include "CategoriesPanel.h" -#include "CommandScreen.h" -#include "DynamicColumn.h" -#include "EnvScreen.h" -#include "FunctionBar.h" -#include "Hashtable.h" -#include "IncSet.h" -#include "InfoScreen.h" -#include "ListItem.h" -#include "Macros.h" -#include "MainPanel.h" -#include "OpenFilesScreen.h" -#include "Process.h" -#include "ProcessLocksScreen.h" -#include "ProvideCurses.h" -#include "Scheduling.h" -#include "ScreenManager.h" -#include "SignalsPanel.h" -#include "TraceScreen.h" -#include "Vector.h" -#include "XUtils.h" - -#if (defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY)) -#include "Affinity.h" -#include "AffinityPanel.h" -#endif - - -Object* Action_pickFromVector(State* st, Panel* list, int x, bool followProcess) { - MainPanel* mainPanel = st->mainPanel; - Header* header = st->header; - - int y = ((Panel*)mainPanel)->y; - ScreenManager* scr = ScreenManager_new(header, st->settings, st, false); - scr->allowFocusChange = false; - ScreenManager_add(scr, list, x); - ScreenManager_add(scr, (Panel*)mainPanel, -1); - Panel* panelFocus; - int ch; - bool unfollow = false; - int pid = followProcess ? MainPanel_selectedPid(mainPanel) : -1; - if (followProcess && header->pl->following == -1) { - header->pl->following = pid; - unfollow = true; - } - ScreenManager_run(scr, &panelFocus, &ch, NULL); - if (unfollow) { - header->pl->following = -1; - } - ScreenManager_delete(scr); - Panel_move((Panel*)mainPanel, 0, y); - Panel_resize((Panel*)mainPanel, COLS, LINES - y - 1); - if (panelFocus == list && ch == 13) { - if (followProcess) { - const Process* selected = (const Process*)Panel_getSelected((Panel*)mainPanel); - if (selected && selected->pid == pid) - return Panel_getSelected(list); - - beep(); - } else { - return Panel_getSelected(list); - } - } - - return NULL; -} - -// ---------------------------------------- - -static void Action_runSetup(State* st) { - ScreenManager* scr = ScreenManager_new(st->header, st->settings, st, true); - CategoriesPanel_new(scr, st->settings, st->header, st->pl); - ScreenManager_run(scr, NULL, NULL, "Setup"); - ScreenManager_delete(scr); - if (st->settings->changed) { - CRT_setMouse(st->settings->enableMouse); - Header_writeBackToSettings(st->header); - } -} - -static bool changePriority(MainPanel* panel, int delta) { - bool anyTagged; - bool ok = MainPanel_foreachProcess(panel, Process_changePriorityBy, (Arg) { .i = delta }, &anyTagged); - if (!ok) - beep(); - return anyTagged; -} - -static void addUserToVector(ht_key_t key, void* userCast, void* panelCast) { - const char* user = userCast; - Panel* panel = panelCast; - Panel_add(panel, (Object*) ListItem_new(user, key)); -} - -bool Action_setUserOnly(const char* userName, uid_t* userId) { - const struct passwd* user = getpwnam(userName); - if (user) { - *userId = user->pw_uid; - return true; - } - *userId = (uid_t)-1; - return false; -} - -static void tagAllChildren(Panel* panel, Process* parent) { - parent->tag = true; - pid_t ppid = parent->pid; - for (int i = 0; i < Panel_size(panel); i++) { - Process* p = (Process*) Panel_get(panel, i); - if (!p->tag && Process_isChildOf(p, ppid)) { - tagAllChildren(panel, p); - } - } -} - -static bool expandCollapse(Panel* panel) { - Process* p = (Process*) Panel_getSelected(panel); - if (!p) - return false; - - p->showChildren = !p->showChildren; - return true; -} - -static bool collapseIntoParent(Panel* panel) { - const Process* p = (Process*) Panel_getSelected(panel); - if (!p) - return false; - - pid_t ppid = Process_getParentPid(p); - for (int i = 0; i < Panel_size(panel); i++) { - Process* q = (Process*) Panel_get(panel, i); - if (q->pid == ppid) { - q->showChildren = false; - Panel_setSelected(panel, i); - return true; - } - } - return false; -} - -Htop_Reaction Action_setSortKey(Settings* settings, ProcessField sortKey) { - ScreenSettings_setSortKey(settings->ss, sortKey); - return HTOP_REFRESH | HTOP_SAVE_SETTINGS | HTOP_UPDATE_PANELHDR | HTOP_KEEP_FOLLOWING; -} - -// ---------------------------------------- - -static Htop_Reaction actionSetSortColumn(State* st) { - Htop_Reaction reaction = HTOP_OK; - Panel* sortPanel = Panel_new(0, 0, 0, 0, Class(ListItem), true, FunctionBar_newEnterEsc("Sort ", "Cancel ")); - Panel_setHeader(sortPanel, "Sort by"); - const Settings* settings = st->settings; - const ProcessField* fields = settings->ss->fields; - Hashtable* dynamicColumns = settings->dynamicColumns; - for (int i = 0; fields[i]; i++) { - char* name = NULL; - if (fields[i] >= LAST_PROCESSFIELD) { - DynamicColumn* column = Hashtable_get(dynamicColumns, fields[i]); - if (!column) - continue; - name = xStrdup(column->caption ? column->caption : column->name); - } else { - name = String_trim(Process_fields[fields[i]].name); - } - Panel_add(sortPanel, (Object*) ListItem_new(name, fields[i])); - if (fields[i] == ScreenSettings_getActiveSortKey(settings->ss)) - Panel_setSelected(sortPanel, i); - - free(name); - } - const ListItem* field = (const ListItem*) Action_pickFromVector(st, sortPanel, 14, false); - if (field) { - reaction |= Action_setSortKey(st->settings, field->key); - } - Object_delete(sortPanel); - - st->pl->needsSort = true; - - return reaction | HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR; -} - -static Htop_Reaction actionSortByPID(State* st) { - return Action_setSortKey(st->settings, PID); -} - -static Htop_Reaction actionSortByMemory(State* st) { - return Action_setSortKey(st->settings, PERCENT_MEM); -} - -static Htop_Reaction actionSortByCPU(State* st) { - return Action_setSortKey(st->settings, PERCENT_CPU); -} - -static Htop_Reaction actionSortByTime(State* st) { - return Action_setSortKey(st->settings, TIME); -} - -static Htop_Reaction actionToggleKernelThreads(State* st) { - st->settings->hideKernelThreads = !st->settings->hideKernelThreads; - st->settings->lastUpdate++; - - return HTOP_RECALCULATE | HTOP_SAVE_SETTINGS | HTOP_KEEP_FOLLOWING; -} - -static Htop_Reaction actionToggleUserlandThreads(State* st) { - st->settings->hideUserlandThreads = !st->settings->hideUserlandThreads; - st->settings->lastUpdate++; - - return HTOP_RECALCULATE | HTOP_SAVE_SETTINGS | HTOP_KEEP_FOLLOWING; -} - -static Htop_Reaction actionToggleRunningInContainer(State* st) { - st->settings->hideRunningInContainer = !st->settings->hideRunningInContainer; - st->settings->lastUpdate++; - - return HTOP_RECALCULATE | HTOP_SAVE_SETTINGS | HTOP_KEEP_FOLLOWING; -} - -static Htop_Reaction actionToggleProgramPath(State* st) { - st->settings->showProgramPath = !st->settings->showProgramPath; - st->settings->lastUpdate++; - - return HTOP_REFRESH | HTOP_SAVE_SETTINGS | HTOP_KEEP_FOLLOWING; -} - -static Htop_Reaction actionToggleMergedCommand(State* st) { - st->settings->showMergedCommand = !st->settings->showMergedCommand; - st->settings->lastUpdate++; - - return HTOP_REFRESH | HTOP_SAVE_SETTINGS | HTOP_KEEP_FOLLOWING | HTOP_UPDATE_PANELHDR; -} - -static Htop_Reaction actionToggleTreeView(State* st) { - ScreenSettings* ss = st->settings->ss; - ss->treeView = !ss->treeView; - - if (!ss->allBranchesCollapsed) - ProcessList_expandTree(st->pl); - return HTOP_REFRESH | HTOP_SAVE_SETTINGS | HTOP_KEEP_FOLLOWING | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR; -} - -static Htop_Reaction actionToggleHideMeters(State* st) { - st->hideMeters = !st->hideMeters; - return HTOP_RESIZE | HTOP_KEEP_FOLLOWING; -} - -static Htop_Reaction actionExpandOrCollapseAllBranches(State* st) { - ScreenSettings* ss = st->settings->ss; - if (!ss->treeView) { - return HTOP_OK; - } - ss->allBranchesCollapsed = !ss->allBranchesCollapsed; - if (ss->allBranchesCollapsed) - ProcessList_collapseAllBranches(st->pl); - else - ProcessList_expandTree(st->pl); - return HTOP_REFRESH | HTOP_SAVE_SETTINGS; -} - -static Htop_Reaction actionIncFilter(State* st) { - IncSet* inc = (st->mainPanel)->inc; - IncSet_activate(inc, INC_FILTER, (Panel*)st->mainPanel); - st->pl->incFilter = IncSet_filter(inc); - return HTOP_REFRESH | HTOP_KEEP_FOLLOWING; -} - -static Htop_Reaction actionIncSearch(State* st) { - IncSet_reset(st->mainPanel->inc, INC_SEARCH); - IncSet_activate(st->mainPanel->inc, INC_SEARCH, (Panel*)st->mainPanel); - return HTOP_REFRESH | HTOP_KEEP_FOLLOWING; -} - -static Htop_Reaction actionHigherPriority(State* st) { - if (Settings_isReadonly()) - return HTOP_OK; - - bool changed = changePriority(st->mainPanel, -1); - return changed ? HTOP_REFRESH : HTOP_OK; -} - -static Htop_Reaction actionLowerPriority(State* st) { - if (Settings_isReadonly()) - return HTOP_OK; - - bool changed = changePriority(st->mainPanel, 1); - return changed ? HTOP_REFRESH : HTOP_OK; -} - -static Htop_Reaction actionInvertSortOrder(State* st) { - ScreenSettings_invertSortOrder(st->settings->ss); - st->pl->needsSort = true; - return HTOP_REFRESH | HTOP_SAVE_SETTINGS | HTOP_KEEP_FOLLOWING | HTOP_UPDATE_PANELHDR; -} - -static Htop_Reaction actionExpandOrCollapse(State* st) { - if (!st->settings->ss->treeView) - return HTOP_OK; - - bool changed = expandCollapse((Panel*)st->mainPanel); - return changed ? HTOP_RECALCULATE : HTOP_OK; -} - -static Htop_Reaction actionCollapseIntoParent(State* st) { - if (!st->settings->ss->treeView) { - return HTOP_OK; - } - bool changed = collapseIntoParent((Panel*)st->mainPanel); - return changed ? HTOP_RECALCULATE : HTOP_OK; -} - -static Htop_Reaction actionExpandCollapseOrSortColumn(State* st) { - return st->settings->ss->treeView ? actionExpandOrCollapse(st) : actionSetSortColumn(st); -} - -static Htop_Reaction actionNextScreen(State* st) { - Settings* settings = st->settings; - settings->ssIndex++; - if (settings->ssIndex == settings->nScreens) { - settings->ssIndex = 0; - } - settings->ss = settings->screens[settings->ssIndex]; - return HTOP_UPDATE_PANELHDR | HTOP_REFRESH; -} - -static Htop_Reaction actionPrevScreen(State* st) { - Settings* settings = st->settings; - if (settings->ssIndex == 0) { - settings->ssIndex = settings->nScreens - 1; - } else { - settings->ssIndex--; - } - settings->ss = settings->screens[settings->ssIndex]; - return HTOP_UPDATE_PANELHDR | HTOP_REFRESH; -} - -Htop_Reaction Action_setScreenTab(Settings* settings, int x) { - int s = 2; - for (unsigned int i = 0; i < settings->nScreens; i++) { - if (x < s) { - return 0; - } - const char* name = settings->screens[i]->name; - int len = strlen(name); - if (x <= s + len + 1) { - settings->ssIndex = i; - settings->ss = settings->screens[i]; - return HTOP_UPDATE_PANELHDR | HTOP_REFRESH; - } - s += len + 3; - } - return 0; -} - -static Htop_Reaction actionQuit(ATTR_UNUSED State* st) { - return HTOP_QUIT; -} - -static Htop_Reaction actionSetAffinity(State* st) { - if (Settings_isReadonly()) - return HTOP_OK; - - if (st->pl->activeCPUs == 1) - return HTOP_OK; - -#if (defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY)) - const Process* p = (const Process*) Panel_getSelected((Panel*)st->mainPanel); - if (!p) - return HTOP_OK; - - Affinity* affinity1 = Affinity_get(p, st->pl); - if (!affinity1) - return HTOP_OK; - - int width; - Panel* affinityPanel = AffinityPanel_new(st->pl, affinity1, &width); - Affinity_delete(affinity1); - - const void* set = Action_pickFromVector(st, affinityPanel, width, true); - if (set) { - Affinity* affinity2 = AffinityPanel_getAffinity(affinityPanel, st->pl); - bool ok = MainPanel_foreachProcess(st->mainPanel, Affinity_set, (Arg) { .v = affinity2 }, NULL); - if (!ok) - beep(); - Affinity_delete(affinity2); - } - Object_delete(affinityPanel); - return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR; -#else - return HTOP_OK; -#endif - -} - -#ifdef SCHEDULER_SUPPORT -static Htop_Reaction actionSetSchedPolicy(State* st) { - if (Settings_isReadonly()) - return HTOP_KEEP_FOLLOWING; - - static int preSelectedPolicy = SCHEDULINGPANEL_INITSELECTEDPOLICY; - static int preSelectedPriority = SCHEDULINGPANEL_INITSELECTEDPRIORITY; - - Panel* schedPanel = Scheduling_newPolicyPanel(preSelectedPolicy); - - const ListItem* policy; - for(;;) { - policy = (const ListItem*) Action_pickFromVector(st, schedPanel, 18, true); - - if (!policy || policy->key != -1) - break; - - Scheduling_togglePolicyPanelResetOnFork(schedPanel); - } - - if (policy) { - preSelectedPolicy = policy->key; - - Panel* prioPanel = Scheduling_newPriorityPanel(policy->key, preSelectedPriority); - if (prioPanel) { - const ListItem* prio = (const ListItem*) Action_pickFromVector(st, prioPanel, 14, true); - if (prio) - preSelectedPriority = prio->key; - - Panel_delete((Object*) prioPanel); - } - - SchedulingArg v = { .policy = preSelectedPolicy, .priority = preSelectedPriority }; - - bool ok = MainPanel_foreachProcess(st->mainPanel, Scheduling_setPolicy, (Arg) { .v = &v }, NULL); - if (!ok) - beep(); - } - - Panel_delete((Object*)schedPanel); - - return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_KEEP_FOLLOWING; -} -#endif /* SCHEDULER_SUPPORT */ - -static Htop_Reaction actionKill(State* st) { - if (Settings_isReadonly()) - return HTOP_OK; - - static int preSelectedSignal = SIGNALSPANEL_INITSELECTEDSIGNAL; - - Panel* signalsPanel = SignalsPanel_new(preSelectedSignal); - const ListItem* sgn = (ListItem*) Action_pickFromVector(st, signalsPanel, 14, true); - if (sgn && sgn->key != 0) { - preSelectedSignal = sgn->key; - Panel_setHeader((Panel*)st->mainPanel, "Sending..."); - Panel_draw((Panel*)st->mainPanel, false, true, true, State_hideFunctionBar(st)); - refresh(); - MainPanel_foreachProcess(st->mainPanel, Process_sendSignal, (Arg) { .i = sgn->key }, NULL); - napms(500); - } - Panel_delete((Object*)signalsPanel); - return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR; -} - -static Htop_Reaction actionFilterByUser(State* st) { - Panel* usersPanel = Panel_new(0, 0, 0, 0, Class(ListItem), true, FunctionBar_newEnterEsc("Show ", "Cancel ")); - Panel_setHeader(usersPanel, "Show processes of:"); - UsersTable_foreach(st->ut, addUserToVector, usersPanel); - Vector_insertionSort(usersPanel->items); - ListItem* allUsers = ListItem_new("All users", -1); - Panel_insert(usersPanel, 0, (Object*) allUsers); - const ListItem* picked = (ListItem*) Action_pickFromVector(st, usersPanel, 19, false); - if (picked) { - if (picked == allUsers) { - st->pl->userId = (uid_t)-1; - } else { - Action_setUserOnly(ListItem_getRef(picked), &(st->pl->userId)); - } - } - Panel_delete((Object*)usersPanel); - return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR; -} - -Htop_Reaction Action_follow(State* st) { - st->pl->following = MainPanel_selectedPid(st->mainPanel); - Panel_setSelectionColor((Panel*)st->mainPanel, PANEL_SELECTION_FOLLOW); - return HTOP_KEEP_FOLLOWING; -} - -static Htop_Reaction actionSetup(State* st) { - Action_runSetup(st); - return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR | HTOP_RESIZE; -} - -static Htop_Reaction actionLsof(State* st) { - if (Settings_isReadonly()) - return HTOP_OK; - - const Process* p = (Process*) Panel_getSelected((Panel*)st->mainPanel); - if (!p) - return HTOP_OK; - - OpenFilesScreen* ofs = OpenFilesScreen_new(p); - InfoScreen_run((InfoScreen*)ofs); - OpenFilesScreen_delete((Object*)ofs); - clear(); - CRT_enableDelay(); - return HTOP_REFRESH | HTOP_REDRAW_BAR; -} - -static Htop_Reaction actionShowLocks(State* st) { - const Process* p = (Process*) Panel_getSelected((Panel*)st->mainPanel); - if (!p) - return HTOP_OK; - ProcessLocksScreen* pls = ProcessLocksScreen_new(p); - InfoScreen_run((InfoScreen*)pls); - ProcessLocksScreen_delete((Object*)pls); - clear(); - CRT_enableDelay(); - return HTOP_REFRESH | HTOP_REDRAW_BAR; -} - -static Htop_Reaction actionStrace(State* st) { - if (Settings_isReadonly()) - return HTOP_OK; - - const Process* p = (Process*) Panel_getSelected((Panel*)st->mainPanel); - if (!p) - return HTOP_OK; - - TraceScreen* ts = TraceScreen_new(p); - bool ok = TraceScreen_forkTracer(ts); - if (ok) { - InfoScreen_run((InfoScreen*)ts); - } - TraceScreen_delete((Object*)ts); - clear(); - CRT_enableDelay(); - return HTOP_REFRESH | HTOP_REDRAW_BAR; -} - -static Htop_Reaction actionTag(State* st) { - Process* p = (Process*) Panel_getSelected((Panel*)st->mainPanel); - if (!p) - return HTOP_OK; - - Process_toggleTag(p); - Panel_onKey((Panel*)st->mainPanel, KEY_DOWN); - return HTOP_OK; -} - -static Htop_Reaction actionRedraw(ATTR_UNUSED State* st) { - clear(); - return HTOP_REFRESH | HTOP_REDRAW_BAR; -} - -static Htop_Reaction actionTogglePauseProcessUpdate(State* st) { - st->pauseProcessUpdate = !st->pauseProcessUpdate; - return HTOP_REFRESH | HTOP_REDRAW_BAR; -} - -static const struct { - const char* key; - bool roInactive; - const char* info; -} helpLeft[] = { - { .key = " #: ", .roInactive = false, .info = "hide/show header meters" }, - { .key = " Tab: ", .roInactive = false, .info = "switch to next screen tab" }, - { .key = " hjkl: ", .roInactive = false, .info = "scroll process list" }, - { .key = " Digits: ", .roInactive = false, .info = "incremental PID search" }, - { .key = " F3 /: ", .roInactive = false, .info = "incremental name search" }, - { .key = " F4 \\: ", .roInactive = false, .info = "incremental name filtering" }, - { .key = " F5 t: ", .roInactive = false, .info = "tree view" }, - { .key = " p: ", .roInactive = false, .info = "toggle program path" }, - { .key = " m: ", .roInactive = false, .info = "toggle merged command" }, - { .key = " Z: ", .roInactive = false, .info = "pause/resume process updates" }, - { .key = " u: ", .roInactive = false, .info = "show processes of a single user" }, - { .key = " H: ", .roInactive = false, .info = "hide/show user process threads" }, - { .key = " K: ", .roInactive = false, .info = "hide/show kernel threads" }, - { .key = " F: ", .roInactive = false, .info = "cursor follows process" }, - { .key = " + - *: ", .roInactive = false, .info = "expand/collapse tree/toggle all" }, - { .key = "N P M T: ", .roInactive = false, .info = "sort by PID, CPU%, MEM% or TIME" }, - { .key = " I: ", .roInactive = false, .info = "invert sort order" }, - { .key = " F6 > .: ", .roInactive = false, .info = "select sort column" }, - { .key = NULL, .info = NULL } -}; - -static const struct { - const char* key; - bool roInactive; - const char* info; -} helpRight[] = { - { .key = " S-Tab: ", .roInactive = false, .info = "switch to previous screen tab" }, - { .key = " Space: ", .roInactive = false, .info = "tag process" }, - { .key = " c: ", .roInactive = false, .info = "tag process and its children" }, - { .key = " U: ", .roInactive = false, .info = "untag all processes" }, - { .key = " F9 x: ", .roInactive = true, .info = "kill process/tagged processes" }, - { .key = " F7 ]: ", .roInactive = true, .info = "higher priority (root only)" }, - { .key = " F8 [: ", .roInactive = true, .info = "lower priority (+ nice)" }, -#if (defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY)) - { .key = " a: ", .roInactive = true, .info = "set CPU affinity" }, -#endif - { .key = " e: ", .roInactive = false, .info = "show process environment" }, - { .key = " i: ", .roInactive = true, .info = "set IO priority" }, - { .key = " L: ", .roInactive = true, .info = "list open files with lsof" }, - { .key = " X: ", .roInactive = false, .info = "list file locks of process" }, - { .key = " s: ", .roInactive = true, .info = "trace syscalls with strace" }, - { .key = " w: ", .roInactive = false, .info = "wrap process command in multiple lines" }, -#ifdef SCHEDULER_SUPPORT - { .key = " Y: ", .roInactive = true, .info = "set scheduling policy" }, -#endif - { .key = " F2 C S: ", .roInactive = false, .info = "setup" }, - { .key = " F1 ?: ", .roInactive = false, .info = "show this help screen" }, - { .key = " F10 q: ", .roInactive = false, .info = "quit" }, - { .key = NULL, .info = NULL } -}; - -static inline void addattrstr( int attr, const char* str) { - attrset(attr); - addstr(str); -} - -static Htop_Reaction actionHelp(State* st) { - clear(); - attrset(CRT_colors[HELP_BOLD]); - - for (int i = 0; i < LINES - 1; i++) - mvhline(i, 0, ' ', COLS); - - int line = 0; - - mvaddstr(line++, 0, "htop " VERSION " - " COPYRIGHT); - mvaddstr(line++, 0, "Released under the GNU GPLv2+. See 'man' page for more info."); - - attrset(CRT_colors[DEFAULT_COLOR]); - line++; - mvaddstr(line++, 0, "CPU usage bar: "); - -#define addbartext(attr, prefix, text) \ - do { \ - addattrstr(CRT_colors[DEFAULT_COLOR], prefix); \ - addattrstr(attr, text); \ - } while(0) - - addattrstr(CRT_colors[BAR_BORDER], "["); - addbartext(CRT_colors[CPU_NICE_TEXT], "", "low"); - addbartext(CRT_colors[CPU_NORMAL], "/", "normal"); - addbartext(CRT_colors[CPU_SYSTEM], "/", "kernel"); - if (st->settings->detailedCPUTime) { - addbartext(CRT_colors[CPU_IRQ], "/", "irq"); - addbartext(CRT_colors[CPU_SOFTIRQ], "/", "soft-irq"); - addbartext(CRT_colors[CPU_STEAL], "/", "steal"); - addbartext(CRT_colors[CPU_GUEST], "/", "guest"); - addbartext(CRT_colors[CPU_IOWAIT], "/", "io-wait"); - addbartext(CRT_colors[BAR_SHADOW], " ", "used%"); - } else { - addbartext(CRT_colors[CPU_GUEST], "/", "guest"); - addbartext(CRT_colors[BAR_SHADOW], " ", "used%"); - } - addattrstr(CRT_colors[BAR_BORDER], "]"); - - attrset(CRT_colors[DEFAULT_COLOR]); - mvaddstr(line++, 0, "Memory bar: "); - addattrstr(CRT_colors[BAR_BORDER], "["); - addbartext(CRT_colors[MEMORY_USED], "", "used"); - addbartext(CRT_colors[MEMORY_BUFFERS_TEXT], "/", "buffers"); - addbartext(CRT_colors[MEMORY_SHARED], "/", "shared"); - addbartext(CRT_colors[MEMORY_CACHE], "/", "cache"); - addbartext(CRT_colors[BAR_SHADOW], " ", "used"); - addbartext(CRT_colors[BAR_SHADOW], "/", "total"); - addattrstr(CRT_colors[BAR_BORDER], "]"); - - attrset(CRT_colors[DEFAULT_COLOR]); - mvaddstr(line++, 0, "Swap bar: "); - addattrstr(CRT_colors[BAR_BORDER], "["); - addbartext(CRT_colors[SWAP], "", "used"); -#ifdef HTOP_LINUX - addbartext(CRT_colors[SWAP_CACHE], "/", "cache"); -#else - addbartext(CRT_colors[SWAP_CACHE], " ", ""); -#endif - addbartext(CRT_colors[BAR_SHADOW], " ", "used"); - addbartext(CRT_colors[BAR_SHADOW], "/", "total"); - addattrstr(CRT_colors[BAR_BORDER], "]"); - - line++; - -#undef addbartext - - attrset(CRT_colors[DEFAULT_COLOR]); - mvaddstr(line++, 0, "Type and layout of header meters are configurable in the setup screen."); - if (CRT_colorScheme == COLORSCHEME_MONOCHROME) { - mvaddstr(line, 0, "In monochrome, meters display as different chars, in order: |#*@$%&."); - } - line++; - -#define addattrstatestr(attr, state, desc) \ - do { \ - addattrstr(attr, state); \ - addattrstr(CRT_colors[DEFAULT_COLOR], ": " desc); \ - } while(0) - - mvaddstr(line, 0, "Process state: "); - addattrstatestr(CRT_colors[PROCESS_RUN_STATE], "R", "running; "); - addattrstatestr(CRT_colors[PROCESS_SHADOW], "S", "sleeping; "); - addattrstatestr(CRT_colors[PROCESS_RUN_STATE], "t", "traced/stopped; "); - addattrstatestr(CRT_colors[PROCESS_D_STATE], "Z", "zombie; "); - addattrstatestr(CRT_colors[PROCESS_D_STATE], "D", "disk sleep"); - attrset(CRT_colors[DEFAULT_COLOR]); - -#undef addattrstatestr - - line += 2; - - const bool readonly = Settings_isReadonly(); - - int item; - for (item = 0; helpLeft[item].key; item++) { - attrset((helpLeft[item].roInactive && readonly) ? CRT_colors[HELP_SHADOW] : CRT_colors[DEFAULT_COLOR]); - mvaddstr(line + item, 10, helpLeft[item].info); - attrset((helpLeft[item].roInactive && readonly) ? CRT_colors[HELP_SHADOW] : CRT_colors[HELP_BOLD]); - mvaddstr(line + item, 1, helpLeft[item].key); - if (String_eq(helpLeft[item].key, " H: ")) { - attrset((helpLeft[item].roInactive && readonly) ? CRT_colors[HELP_SHADOW] : CRT_colors[PROCESS_THREAD]); - mvaddstr(line + item, 33, "threads"); - } else if (String_eq(helpLeft[item].key, " K: ")) { - attrset((helpLeft[item].roInactive && readonly) ? CRT_colors[HELP_SHADOW] : CRT_colors[PROCESS_THREAD]); - mvaddstr(line + item, 27, "threads"); - } - } - int leftHelpItems = item; - - for (item = 0; helpRight[item].key; item++) { - attrset((helpRight[item].roInactive && readonly) ? CRT_colors[HELP_SHADOW] : CRT_colors[HELP_BOLD]); - mvaddstr(line + item, 41, helpRight[item].key); - attrset((helpRight[item].roInactive && readonly) ? CRT_colors[HELP_SHADOW] : CRT_colors[DEFAULT_COLOR]); - mvaddstr(line + item, 50, helpRight[item].info); - } - line += MAXIMUM(leftHelpItems, item); - line++; - - attrset(CRT_colors[HELP_BOLD]); - mvaddstr(line++, 0, "Press any key to return."); - attrset(CRT_colors[DEFAULT_COLOR]); - refresh(); - CRT_readKey(); - clear(); - - return HTOP_RECALCULATE | HTOP_REDRAW_BAR | HTOP_KEEP_FOLLOWING; -} - -static Htop_Reaction actionUntagAll(State* st) { - for (int i = 0; i < Panel_size((Panel*)st->mainPanel); i++) { - Process* p = (Process*) Panel_get((Panel*)st->mainPanel, i); - p->tag = false; - } - return HTOP_REFRESH; -} - -static Htop_Reaction actionTagAllChildren(State* st) { - Process* p = (Process*) Panel_getSelected((Panel*)st->mainPanel); - if (!p) - return HTOP_OK; - - tagAllChildren((Panel*)st->mainPanel, p); - return HTOP_OK; -} - -static Htop_Reaction actionShowEnvScreen(State* st) { - Process* p = (Process*) Panel_getSelected((Panel*)st->mainPanel); - if (!p) - return HTOP_OK; - - EnvScreen* es = EnvScreen_new(p); - InfoScreen_run((InfoScreen*)es); - EnvScreen_delete((Object*)es); - clear(); - CRT_enableDelay(); - return HTOP_REFRESH | HTOP_REDRAW_BAR; -} - -static Htop_Reaction actionShowCommandScreen(State* st) { - Process* p = (Process*) Panel_getSelected((Panel*)st->mainPanel); - if (!p) - return HTOP_OK; - - CommandScreen* cmdScr = CommandScreen_new(p); - InfoScreen_run((InfoScreen*)cmdScr); - CommandScreen_delete((Object*)cmdScr); - clear(); - CRT_enableDelay(); - return HTOP_REFRESH | HTOP_REDRAW_BAR; -} - -void Action_setBindings(Htop_Action* keys) { - keys[' '] = actionTag; - keys['#'] = actionToggleHideMeters; - keys['*'] = actionExpandOrCollapseAllBranches; - keys['+'] = actionExpandOrCollapse; - keys[','] = actionSetSortColumn; - keys['-'] = actionExpandOrCollapse; - keys['.'] = actionSetSortColumn; - keys['/'] = actionIncSearch; - keys['<'] = actionSetSortColumn; - keys['='] = actionExpandOrCollapse; - keys['>'] = actionSetSortColumn; - keys['?'] = actionHelp; - keys['C'] = actionSetup; - keys['F'] = Action_follow; - keys['H'] = actionToggleUserlandThreads; - keys['I'] = actionInvertSortOrder; - keys['K'] = actionToggleKernelThreads; - keys['L'] = actionLsof; - keys['M'] = actionSortByMemory; - keys['N'] = actionSortByPID; - keys['O'] = actionToggleRunningInContainer; - keys['P'] = actionSortByCPU; - keys['S'] = actionSetup; - keys['T'] = actionSortByTime; - keys['U'] = actionUntagAll; -#ifdef SCHEDULER_SUPPORT - keys['Y'] = actionSetSchedPolicy; -#endif - keys['X'] = actionShowLocks; - keys['Z'] = actionTogglePauseProcessUpdate; - keys['['] = actionLowerPriority; - keys['\014'] = actionRedraw; // Ctrl+L - keys['\177'] = actionCollapseIntoParent; - keys['\\'] = actionIncFilter; - keys[']'] = actionHigherPriority; - keys['a'] = actionSetAffinity; - keys['c'] = actionTagAllChildren; - keys['e'] = actionShowEnvScreen; - keys['m'] = actionToggleMergedCommand; - keys['p'] = actionToggleProgramPath; - keys['q'] = actionQuit; - keys['s'] = actionStrace; - keys['t'] = actionToggleTreeView; - keys['u'] = actionFilterByUser; - keys['w'] = actionShowCommandScreen; - keys['x'] = actionKill; - keys[KEY_F(1)] = actionHelp; - keys[KEY_F(2)] = actionSetup; - keys[KEY_F(3)] = actionIncSearch; - keys[KEY_F(4)] = actionIncFilter; - keys[KEY_F(5)] = actionToggleTreeView; - keys[KEY_F(6)] = actionSetSortColumn; - keys[KEY_F(7)] = actionHigherPriority; - keys[KEY_F(8)] = actionLowerPriority; - keys[KEY_F(9)] = actionKill; - keys[KEY_F(10)] = actionQuit; - keys[KEY_F(18)] = actionExpandCollapseOrSortColumn; - keys['o'] = actionExpandCollapseOrSortColumn; - keys[KEY_RECLICK] = actionExpandOrCollapse; - keys[KEY_SHIFT_TAB] = actionPrevScreen; - keys['\t'] = actionNextScreen; -} diff --git a/fedora/.local/bin/htop-vim/Action.h b/fedora/.local/bin/htop-vim/Action.h deleted file mode 100644 index 09b68bd..0000000 --- a/fedora/.local/bin/htop-vim/Action.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef HEADER_Action -#define HEADER_Action -/* -htop - Action.h -(C) 2015 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include -#include - -#include "Header.h" -#include "Object.h" -#include "Panel.h" -#include "Process.h" -#include "ProcessList.h" -#include "Settings.h" -#include "UsersTable.h" - - -typedef enum { - HTOP_OK = 0x00, - HTOP_REFRESH = 0x01, - HTOP_RECALCULATE = 0x02 | HTOP_REFRESH, - HTOP_SAVE_SETTINGS = 0x04, - HTOP_KEEP_FOLLOWING = 0x08, - HTOP_QUIT = 0x10, - HTOP_REDRAW_BAR = 0x20, - HTOP_UPDATE_PANELHDR = 0x40 | HTOP_REFRESH, - HTOP_RESIZE = 0x80 | HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR, -} Htop_Reaction; - -struct MainPanel_; // IWYU pragma: keep - -typedef struct State_ { - Settings* settings; - UsersTable* ut; - ProcessList* pl; - struct MainPanel_* mainPanel; - Header* header; - bool pauseProcessUpdate; - bool hideProcessSelection; - bool hideMeters; -} State; - -static inline bool State_hideFunctionBar(const State* st) { - return st->settings->hideFunctionBar == 2 || (st->settings->hideFunctionBar == 1 && st->hideProcessSelection); -} - -typedef Htop_Reaction (*Htop_Action)(State* st); - -Object* Action_pickFromVector(State* st, Panel* list, int x, bool followProcess); - -bool Action_setUserOnly(const char* userName, uid_t* userId); - -Htop_Reaction Action_setSortKey(Settings* settings, ProcessField sortKey); - -Htop_Reaction Action_setScreenTab(Settings* settings, int x); - -Htop_Reaction Action_follow(State* st); - -void Action_setBindings(Htop_Action* keys); - -#endif diff --git a/fedora/.local/bin/htop-vim/Affinity.c b/fedora/.local/bin/htop-vim/Affinity.c deleted file mode 100644 index dc6a7fb..0000000 --- a/fedora/.local/bin/htop-vim/Affinity.c +++ /dev/null @@ -1,115 +0,0 @@ -/* -htop - Affinity.c -(C) 2004-2011 Hisham H. Muhammad -(C) 2020 Red Hat, Inc. All Rights Reserved. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "Affinity.h" - -#include - -#include "XUtils.h" - -#if defined(HAVE_LIBHWLOC) -#include -#include -#ifdef __linux__ -#define HTOP_HWLOC_CPUBIND_FLAG HWLOC_CPUBIND_THREAD -#else -#define HTOP_HWLOC_CPUBIND_FLAG HWLOC_CPUBIND_PROCESS -#endif -#elif defined(HAVE_AFFINITY) -#include -#endif - - -Affinity* Affinity_new(ProcessList* pl) { - Affinity* this = xCalloc(1, sizeof(Affinity)); - this->size = 8; - this->cpus = xCalloc(this->size, sizeof(unsigned int)); - this->pl = pl; - return this; -} - -void Affinity_delete(Affinity* this) { - free(this->cpus); - free(this); -} - -void Affinity_add(Affinity* this, unsigned int id) { - if (this->used == this->size) { - this->size *= 2; - this->cpus = xRealloc(this->cpus, sizeof(unsigned int) * this->size); - } - this->cpus[this->used] = id; - this->used++; -} - - -#if defined(HAVE_LIBHWLOC) - -Affinity* Affinity_get(const Process* proc, ProcessList* pl) { - hwloc_cpuset_t cpuset = hwloc_bitmap_alloc(); - bool ok = (hwloc_get_proc_cpubind(pl->topology, proc->pid, cpuset, HTOP_HWLOC_CPUBIND_FLAG) == 0); - Affinity* affinity = NULL; - if (ok) { - affinity = Affinity_new(pl); - if (hwloc_bitmap_last(cpuset) == -1) { - for (unsigned int i = 0; i < pl->existingCPUs; i++) { - Affinity_add(affinity, i); - } - } else { - int id; - hwloc_bitmap_foreach_begin(id, cpuset) - Affinity_add(affinity, (unsigned)id); - hwloc_bitmap_foreach_end(); - } - } - hwloc_bitmap_free(cpuset); - return affinity; -} - -bool Affinity_set(Process* proc, Arg arg) { - Affinity* this = arg.v; - hwloc_cpuset_t cpuset = hwloc_bitmap_alloc(); - for (unsigned int i = 0; i < this->used; i++) { - hwloc_bitmap_set(cpuset, this->cpus[i]); - } - bool ok = (hwloc_set_proc_cpubind(this->pl->topology, proc->pid, cpuset, HTOP_HWLOC_CPUBIND_FLAG) == 0); - hwloc_bitmap_free(cpuset); - return ok; -} - -#elif defined(HAVE_AFFINITY) - -Affinity* Affinity_get(const Process* proc, ProcessList* pl) { - cpu_set_t cpuset; - bool ok = (sched_getaffinity(proc->pid, sizeof(cpu_set_t), &cpuset) == 0); - if (!ok) - return NULL; - - Affinity* affinity = Affinity_new(pl); - for (unsigned int i = 0; i < pl->existingCPUs; i++) { - if (CPU_ISSET(i, &cpuset)) { - Affinity_add(affinity, i); - } - } - return affinity; -} - -bool Affinity_set(Process* proc, Arg arg) { - Affinity* this = arg.v; - cpu_set_t cpuset; - CPU_ZERO(&cpuset); - for (unsigned int i = 0; i < this->used; i++) { - CPU_SET(this->cpus[i], &cpuset); - } - bool ok = (sched_setaffinity(proc->pid, sizeof(unsigned long), &cpuset) == 0); - return ok; -} - -#endif diff --git a/fedora/.local/bin/htop-vim/Affinity.h b/fedora/.local/bin/htop-vim/Affinity.h deleted file mode 100644 index 5e7bfe2..0000000 --- a/fedora/.local/bin/htop-vim/Affinity.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef HEADER_Affinity -#define HEADER_Affinity -/* -htop - Affinity.h -(C) 2004-2011 Hisham H. Muhammad -(C) 2020 Red Hat, Inc. All Rights Reserved. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "ProcessList.h" - -#if defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY) -#include - -#include "Object.h" -#include "Process.h" -#endif - - -#if defined(HAVE_LIBHWLOC) && defined(HAVE_AFFINITY) -#error hwloc and affinity support are mutual exclusive. -#endif - - -typedef struct Affinity_ { - ProcessList* pl; - unsigned int size; - unsigned int used; - unsigned int* cpus; -} Affinity; - -Affinity* Affinity_new(ProcessList* pl); - -void Affinity_delete(Affinity* this); - -void Affinity_add(Affinity* this, unsigned int id); - -#if defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY) - -Affinity* Affinity_get(const Process* proc, ProcessList* pl); - -bool Affinity_set(Process* proc, Arg arg); - -#endif /* HAVE_LIBHWLOC || HAVE_AFFINITY */ - -#endif diff --git a/fedora/.local/bin/htop-vim/AffinityPanel.c b/fedora/.local/bin/htop-vim/AffinityPanel.c deleted file mode 100644 index b724397..0000000 --- a/fedora/.local/bin/htop-vim/AffinityPanel.c +++ /dev/null @@ -1,442 +0,0 @@ -/* -htop - AffinityPanel.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "AffinityPanel.h" - -#include -#include -#include -#include - -#include "CRT.h" -#include "FunctionBar.h" -#include "Object.h" -#include "ProvideCurses.h" -#include "RichString.h" -#include "Settings.h" -#include "Vector.h" -#include "XUtils.h" - -#ifdef HAVE_LIBHWLOC -#include -#include -#endif - - -typedef struct MaskItem_ { - Object super; - char* text; - char* indent; /* used also as an condition whether this is a tree node */ - int value; /* tri-state: 0 - off, 1 - some set, 2 - all set */ - int sub_tree; /* tri-state: 0 - no sub-tree, 1 - open sub-tree, 2 - closed sub-tree */ - Vector* children; - #ifdef HAVE_LIBHWLOC - bool ownCpuset; - hwloc_bitmap_t cpuset; - #else - int cpu; - #endif -} MaskItem; - -static void MaskItem_delete(Object* cast) { - MaskItem* this = (MaskItem*) cast; - free(this->text); - free(this->indent); - Vector_delete(this->children); - #ifdef HAVE_LIBHWLOC - if (this->ownCpuset) - hwloc_bitmap_free(this->cpuset); - #endif - free(this); -} - -static void MaskItem_display(const Object* cast, RichString* out) { - const MaskItem* this = (const MaskItem*)cast; - assert (this != NULL); - RichString_appendAscii(out, CRT_colors[CHECK_BOX], "["); - if (this->value == 2) { - RichString_appendAscii(out, CRT_colors[CHECK_MARK], "x"); - } else if (this->value == 1) { - RichString_appendAscii(out, CRT_colors[CHECK_MARK], "o"); - } else { - RichString_appendAscii(out, CRT_colors[CHECK_MARK], " "); - } - RichString_appendAscii(out, CRT_colors[CHECK_BOX], "]"); - RichString_appendAscii(out, CRT_colors[CHECK_TEXT], " "); - if (this->indent) { - RichString_appendWide(out, CRT_colors[PROCESS_TREE], this->indent); - RichString_appendWide(out, CRT_colors[PROCESS_TREE], - this->sub_tree == 2 - ? CRT_treeStr[TREE_STR_OPEN] - : CRT_treeStr[TREE_STR_SHUT]); - RichString_appendAscii(out, CRT_colors[CHECK_TEXT], " "); - } - RichString_appendWide(out, CRT_colors[CHECK_TEXT], this->text); -} - -static const ObjectClass MaskItem_class = { - .display = MaskItem_display, - .delete = MaskItem_delete -}; - -#ifdef HAVE_LIBHWLOC - -static MaskItem* MaskItem_newMask(const char* text, const char* indent, hwloc_bitmap_t cpuset, bool owner) { - MaskItem* this = AllocThis(MaskItem); - this->text = xStrdup(text); - this->indent = xStrdup(indent); /* nonnull for tree node */ - this->value = 0; - this->ownCpuset = owner; - this->cpuset = cpuset; - this->sub_tree = hwloc_bitmap_weight(cpuset) > 1 ? 1 : 0; - this->children = Vector_new(Class(MaskItem), true, DEFAULT_SIZE); - return this; -} - -#endif - -static MaskItem* MaskItem_newSingleton(const char* text, int cpu, bool isSet) { - MaskItem* this = AllocThis(MaskItem); - this->text = xStrdup(text); - this->indent = NULL; /* not a tree node */ - this->sub_tree = 0; - this->children = Vector_new(Class(MaskItem), true, DEFAULT_SIZE); - - #ifdef HAVE_LIBHWLOC - this->ownCpuset = true; - this->cpuset = hwloc_bitmap_alloc(); - hwloc_bitmap_set(this->cpuset, cpu); - #else - this->cpu = cpu; - #endif - this->value = isSet ? 2 : 0; - - return this; -} - -typedef struct AffinityPanel_ { - Panel super; - ProcessList* pl; - bool topoView; - Vector* cpuids; - unsigned width; - - #ifdef HAVE_LIBHWLOC - MaskItem* topoRoot; - hwloc_const_cpuset_t allCpuset; - hwloc_bitmap_t workCpuset; - #endif -} AffinityPanel; - -static void AffinityPanel_delete(Object* cast) { - AffinityPanel* this = (AffinityPanel*) cast; - Panel* super = (Panel*) this; - Panel_done(super); - Vector_delete(this->cpuids); - #ifdef HAVE_LIBHWLOC - hwloc_bitmap_free(this->workCpuset); - MaskItem_delete((Object*) this->topoRoot); - #endif - free(this); -} - -#ifdef HAVE_LIBHWLOC - -static void AffinityPanel_updateItem(AffinityPanel* this, MaskItem* item) { - Panel* super = (Panel*) this; - - item->value = hwloc_bitmap_isincluded(item->cpuset, this->workCpuset) ? 2 : - hwloc_bitmap_intersects(item->cpuset, this->workCpuset) ? 1 : 0; - - Panel_add(super, (Object*) item); -} - -static void AffinityPanel_updateTopo(AffinityPanel* this, MaskItem* item) { - AffinityPanel_updateItem(this, item); - - if (item->sub_tree == 2) - return; - - for (int i = 0; i < Vector_size(item->children); i++) - AffinityPanel_updateTopo(this, (MaskItem*) Vector_get(item->children, i)); -} - -#endif - -static void AffinityPanel_update(AffinityPanel* this, bool keepSelected) { - Panel* super = (Panel*) this; - - FunctionBar_setLabel(super->currentBar, KEY_F(3), this->topoView ? "Collapse/Expand" : ""); - - int oldSelected = Panel_getSelectedIndex(super); - Panel_prune(super); - - #ifdef HAVE_LIBHWLOC - if (this->topoView) { - AffinityPanel_updateTopo(this, this->topoRoot); - } else { - for (int i = 0; i < Vector_size(this->cpuids); i++) { - AffinityPanel_updateItem(this, (MaskItem*) Vector_get(this->cpuids, i)); - } - } - #else - Panel_splice(super, this->cpuids); - #endif - - if (keepSelected) - Panel_setSelected(super, oldSelected); - - super->needsRedraw = true; -} - -static HandlerResult AffinityPanel_eventHandler(Panel* super, int ch) { - AffinityPanel* this = (AffinityPanel*) super; - HandlerResult result = IGNORED; - MaskItem* selected = (MaskItem*) Panel_getSelected(super); - bool keepSelected = true; - - switch (ch) { - case KEY_MOUSE: - case KEY_RECLICK: - case ' ': - #ifdef HAVE_LIBHWLOC - if (selected->value == 2) { - /* Item was selected, so remove this mask from the top cpuset. */ - hwloc_bitmap_andnot(this->workCpuset, this->workCpuset, selected->cpuset); - selected->value = 0; - } else { - /* Item was not or only partial selected, so set all bits from this object - in the top cpuset. */ - hwloc_bitmap_or(this->workCpuset, this->workCpuset, selected->cpuset); - selected->value = 2; - } - #else - selected->value = selected->value ? 0 : 2; /* toggle between 0 and 2 */ - #endif - - result = HANDLED; - break; - - #ifdef HAVE_LIBHWLOC - - case KEY_F(1): - hwloc_bitmap_copy(this->workCpuset, this->allCpuset); - result = HANDLED; - break; - - case KEY_F(2): - this->topoView = !this->topoView; - keepSelected = false; - - result = HANDLED; - break; - - case KEY_F(3): - case '-': - case '+': - if (selected->sub_tree) - selected->sub_tree = 1 + !(selected->sub_tree - 1); /* toggle between 1 and 2 */ - - result = HANDLED; - break; - - #endif - - case 0x0a: - case 0x0d: - case KEY_ENTER: - result = BREAK_LOOP; - break; - } - - if (HANDLED == result) - AffinityPanel_update(this, keepSelected); - - return result; -} - -#ifdef HAVE_LIBHWLOC - -static MaskItem* AffinityPanel_addObject(AffinityPanel* this, hwloc_obj_t obj, unsigned indent, MaskItem* parent) { - const char* type_name = hwloc_obj_type_string(obj->type); - const char* index_prefix = "#"; - unsigned depth = obj->depth; - unsigned index = obj->logical_index; - size_t off = 0, left = 10 * depth; - char buf[64], indent_buf[left + 1]; - - if (obj->type == HWLOC_OBJ_PU) { - index = Settings_cpuId(this->pl->settings, obj->os_index); - type_name = "CPU"; - index_prefix = ""; - } - - indent_buf[0] = '\0'; - if (depth > 0) { - for (unsigned i = 1; i < depth; i++) { - xSnprintf(&indent_buf[off], left, "%s ", (indent & (1U << i)) ? CRT_treeStr[TREE_STR_VERT] : " "); - size_t len = strlen(&indent_buf[off]); - off += len; - left -= len; - } - xSnprintf(&indent_buf[off], left, "%s", - obj->next_sibling ? CRT_treeStr[TREE_STR_RTEE] : CRT_treeStr[TREE_STR_BEND]); - // Uncomment when further appending to indent_buf - //size_t len = strlen(&indent_buf[off]); - //off += len; - //left -= len; - } - - xSnprintf(buf, sizeof(buf), "%s %s%u", type_name, index_prefix, index); - - MaskItem* item = MaskItem_newMask(buf, indent_buf, obj->complete_cpuset, false); - if (parent) - Vector_add(parent->children, item); - - if (item->sub_tree && parent && parent->sub_tree == 1) { - /* if obj is fully included or fully excluded, collapse the item */ - hwloc_bitmap_t result = hwloc_bitmap_alloc(); - hwloc_bitmap_and(result, obj->complete_cpuset, this->workCpuset); - int weight = hwloc_bitmap_weight(result); - hwloc_bitmap_free(result); - if (weight == 0 || weight == (hwloc_bitmap_weight(this->workCpuset) + hwloc_bitmap_weight(obj->complete_cpuset))) { - item->sub_tree = 2; - } - } - - /* "[x] " + "|- " * depth + ("- ")?(if root node) + name */ - unsigned width = 4 + 3 * depth + (2 * !depth) + strlen(buf); - if (width > this->width) { - this->width = width; - } - - return item; -} - -static MaskItem* AffinityPanel_buildTopology(AffinityPanel* this, hwloc_obj_t obj, unsigned indent, MaskItem* parent) { - MaskItem* item = AffinityPanel_addObject(this, obj, indent, parent); - if (obj->next_sibling) { - indent |= (1U << obj->depth); - } else { - indent &= ~(1U << obj->depth); - } - - for (unsigned i = 0; i < obj->arity; i++) { - AffinityPanel_buildTopology(this, obj->children[i], indent, item); - } - - return parent == NULL ? item : NULL; -} - -#endif - -const PanelClass AffinityPanel_class = { - .super = { - .extends = Class(Panel), - .delete = AffinityPanel_delete - }, - .eventHandler = AffinityPanel_eventHandler -}; - -static const char* const AffinityPanelFunctions[] = { - "Set ", - "Cancel ", - #ifdef HAVE_LIBHWLOC - "All", - "Topology", - " ", - #endif - NULL -}; -static const char* const AffinityPanelKeys[] = {"Enter", "Esc", "F1", "F2", "F3"}; -static const int AffinityPanelEvents[] = {13, 27, KEY_F(1), KEY_F(2), KEY_F(3)}; - -Panel* AffinityPanel_new(ProcessList* pl, const Affinity* affinity, int* width) { - AffinityPanel* this = AllocThis(AffinityPanel); - Panel* super = (Panel*) this; - Panel_init(super, 1, 1, 1, 1, Class(MaskItem), false, FunctionBar_new(AffinityPanelFunctions, AffinityPanelKeys, AffinityPanelEvents)); - - this->pl = pl; - /* defaults to 15, this also includes the gap between the panels, - * but this will be added by the caller */ - this->width = 14; - - this->cpuids = Vector_new(Class(MaskItem), true, DEFAULT_SIZE); - - #ifdef HAVE_LIBHWLOC - this->topoView = pl->settings->topologyAffinity; - #else - this->topoView = false; - #endif - - #ifdef HAVE_LIBHWLOC - this->allCpuset = hwloc_topology_get_complete_cpuset(pl->topology); - this->workCpuset = hwloc_bitmap_alloc(); - #endif - - Panel_setHeader(super, "Use CPUs:"); - - unsigned int curCpu = 0; - for (unsigned int i = 0; i < pl->existingCPUs; i++) { - if (!ProcessList_isCPUonline(this->pl, i)) - continue; - - char number[16]; - xSnprintf(number, 9, "CPU %d", Settings_cpuId(pl->settings, i)); - unsigned cpu_width = 4 + strlen(number); - if (cpu_width > this->width) { - this->width = cpu_width; - } - - bool isSet = false; - if (curCpu < affinity->used && affinity->cpus[curCpu] == i) { - #ifdef HAVE_LIBHWLOC - hwloc_bitmap_set(this->workCpuset, i); - #endif - isSet = true; - curCpu++; - } - - MaskItem* cpuItem = MaskItem_newSingleton(number, i, isSet); - Vector_add(this->cpuids, (Object*) cpuItem); - } - - #ifdef HAVE_LIBHWLOC - this->topoRoot = AffinityPanel_buildTopology(this, hwloc_get_root_obj(pl->topology), 0, NULL); - #endif - - if (width) { - *width = this->width; - } - - AffinityPanel_update(this, false); - - return super; -} - -Affinity* AffinityPanel_getAffinity(Panel* super, ProcessList* pl) { - const AffinityPanel* this = (AffinityPanel*) super; - Affinity* affinity = Affinity_new(pl); - - #ifdef HAVE_LIBHWLOC - int i; - hwloc_bitmap_foreach_begin(i, this->workCpuset) - Affinity_add(affinity, (unsigned)i); - hwloc_bitmap_foreach_end(); - #else - for (int i = 0; i < Vector_size(this->cpuids); i++) { - const MaskItem* item = (const MaskItem*)Vector_get(this->cpuids, i); - if (item->value) { - Affinity_add(affinity, item->cpu); - } - } - #endif - - return affinity; -} diff --git a/fedora/.local/bin/htop-vim/AffinityPanel.h b/fedora/.local/bin/htop-vim/AffinityPanel.h deleted file mode 100644 index 87b1b85..0000000 --- a/fedora/.local/bin/htop-vim/AffinityPanel.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef HEADER_AffinityPanel -#define HEADER_AffinityPanel -/* -htop - AffinityPanel.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Affinity.h" -#include "Panel.h" -#include "ProcessList.h" - - -extern const PanelClass AffinityPanel_class; - -Panel* AffinityPanel_new(ProcessList* pl, const Affinity* affinity, int* width); - -Affinity* AffinityPanel_getAffinity(Panel* super, ProcessList* pl); - -#endif diff --git a/fedora/.local/bin/htop-vim/AvailableColumnsPanel.c b/fedora/.local/bin/htop-vim/AvailableColumnsPanel.c deleted file mode 100644 index b8c09c7..0000000 --- a/fedora/.local/bin/htop-vim/AvailableColumnsPanel.c +++ /dev/null @@ -1,122 +0,0 @@ -/* -htop - AvailableColumnsPanel.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "AvailableColumnsPanel.h" - -#include -#include -#include -#include - -#include "ColumnsPanel.h" -#include "DynamicColumn.h" -#include "FunctionBar.h" -#include "Hashtable.h" -#include "ListItem.h" -#include "Object.h" -#include "Process.h" -#include "ProvideCurses.h" -#include "XUtils.h" - - -static const char* const AvailableColumnsFunctions[] = {" ", " ", " ", " ", "Add ", " ", " ", " ", " ", "Done ", NULL}; - -static void AvailableColumnsPanel_delete(Object* object) { - Panel* super = (Panel*) object; - AvailableColumnsPanel* this = (AvailableColumnsPanel*) object; - Panel_done(super); - free(this); -} - -static void AvailableColumnsPanel_insert(AvailableColumnsPanel* this, int at, int key) { - const char* name; - if (key >= LAST_PROCESSFIELD) - name = DynamicColumn_init(key); - else - name = Process_fields[key].name; - Panel_insert(this->columns, at, (Object*) ListItem_new(name, key)); -} - -static HandlerResult AvailableColumnsPanel_eventHandler(Panel* super, int ch) { - AvailableColumnsPanel* this = (AvailableColumnsPanel*) super; - HandlerResult result = IGNORED; - - switch (ch) { - case 13: - case KEY_ENTER: - case KEY_F(5): - { - const ListItem* selected = (ListItem*) Panel_getSelected(super); - if (!selected) - break; - - int at = Panel_getSelectedIndex(this->columns); - AvailableColumnsPanel_insert(this, at, selected->key); - Panel_setSelected(this->columns, at + 1); - ColumnsPanel_update(this->columns); - result = HANDLED; - break; - } - default: - { - if (0 < ch && ch < 255 && isgraph((unsigned char)ch)) - result = Panel_selectByTyping(super, ch); - break; - } - } - return result; -} - -const PanelClass AvailableColumnsPanel_class = { - .super = { - .extends = Class(Panel), - .delete = AvailableColumnsPanel_delete - }, - .eventHandler = AvailableColumnsPanel_eventHandler -}; - -static void AvailableColumnsPanel_addDynamicColumn(ht_key_t key, void* value, void* data) { - const DynamicColumn* column = (const DynamicColumn*) value; - Panel* super = (Panel*) data; - const char* title = column->caption ? column->caption : column->heading; - if (!title) - title = column->name; // fallback to the only mandatory field - char description[256]; - xSnprintf(description, sizeof(description), "%s - %s", title, column->description); - Panel_add(super, (Object*) ListItem_new(description, key)); -} - -// Handle DynamicColumns entries in the AvailableColumnsPanel -static void AvailableColumnsPanel_addDynamicColumns(Panel* super, Hashtable* dynamicColumns) { - assert(dynamicColumns); - Hashtable_foreach(dynamicColumns, AvailableColumnsPanel_addDynamicColumn, super); -} - -// Handle remaining Platform Meter entries in the AvailableColumnsPanel -static void AvailableColumnsPanel_addPlatformColumn(Panel* super) { - for (int i = 1; i < LAST_PROCESSFIELD; i++) { - if (i != COMM && Process_fields[i].description) { - char description[256]; - xSnprintf(description, sizeof(description), "%s - %s", Process_fields[i].name, Process_fields[i].description); - Panel_add(super, (Object*) ListItem_new(description, i)); - } - } -} - -AvailableColumnsPanel* AvailableColumnsPanel_new(Panel* columns, Hashtable* dynamicColumns) { - AvailableColumnsPanel* this = AllocThis(AvailableColumnsPanel); - Panel* super = (Panel*) this; - FunctionBar* fuBar = FunctionBar_new(AvailableColumnsFunctions, NULL, NULL); - Panel_init(super, 1, 1, 1, 1, Class(ListItem), true, fuBar); - - Panel_setHeader(super, "Available Columns"); - AvailableColumnsPanel_addPlatformColumn(super); - AvailableColumnsPanel_addDynamicColumns(super, dynamicColumns); - - this->columns = columns; - return this; -} diff --git a/fedora/.local/bin/htop-vim/AvailableColumnsPanel.h b/fedora/.local/bin/htop-vim/AvailableColumnsPanel.h deleted file mode 100644 index aca5906..0000000 --- a/fedora/.local/bin/htop-vim/AvailableColumnsPanel.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef HEADER_AvailableColumnsPanel -#define HEADER_AvailableColumnsPanel -/* -htop - AvailableColumnsPanel.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Hashtable.h" -#include "Panel.h" - - -typedef struct AvailableColumnsPanel_ { - Panel super; - Panel* columns; -} AvailableColumnsPanel; - -extern const PanelClass AvailableColumnsPanel_class; - -AvailableColumnsPanel* AvailableColumnsPanel_new(Panel* columns, Hashtable* dynamicColumns); - -#endif diff --git a/fedora/.local/bin/htop-vim/AvailableMetersPanel.c b/fedora/.local/bin/htop-vim/AvailableMetersPanel.c deleted file mode 100644 index c7ab89b..0000000 --- a/fedora/.local/bin/htop-vim/AvailableMetersPanel.c +++ /dev/null @@ -1,171 +0,0 @@ -/* -htop - AvailableMetersPanel.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "AvailableMetersPanel.h" - -#include -#include -#include - -#include "CPUMeter.h" -#include "DynamicMeter.h" -#include "FunctionBar.h" -#include "Hashtable.h" -#include "Header.h" -#include "ListItem.h" -#include "Macros.h" -#include "Meter.h" -#include "MetersPanel.h" -#include "Object.h" -#include "Platform.h" -#include "ProvideCurses.h" -#include "XUtils.h" - - -static void AvailableMetersPanel_delete(Object* object) { - Panel* super = (Panel*) object; - AvailableMetersPanel* this = (AvailableMetersPanel*) object; - Panel_done(super); - free(this->meterPanels); - free(this); -} - -static inline void AvailableMetersPanel_addMeter(Header* header, MetersPanel* panel, const MeterClass* type, unsigned int param, size_t column) { - const Meter* meter = Header_addMeterByClass(header, type, param, column); - Panel_add((Panel*)panel, (Object*) Meter_toListItem(meter, false)); - Panel_setSelected((Panel*)panel, Panel_size((Panel*)panel) - 1); - MetersPanel_setMoving(panel, true); -} - -static HandlerResult AvailableMetersPanel_eventHandler(Panel* super, int ch) { - AvailableMetersPanel* this = (AvailableMetersPanel*) super; - Header* header = this->header; - - const ListItem* selected = (ListItem*) Panel_getSelected(super); - if (!selected) - return IGNORED; - - unsigned int param = selected->key & 0xffff; - int type = selected->key >> 16; - HandlerResult result = IGNORED; - bool update = false; - - switch (ch) { - case KEY_F(5): - case 'l': - case 'L': - { - AvailableMetersPanel_addMeter(header, this->meterPanels[0], Platform_meterTypes[type], param, 0); - result = HANDLED; - update = true; - break; - } - case 0x0a: - case 0x0d: - case KEY_ENTER: - case KEY_F(6): - case 'r': - case 'R': - { - AvailableMetersPanel_addMeter(header, this->meterPanels[this->columns - 1], Platform_meterTypes[type], param, this->columns - 1); - result = (KEY_LEFT << 16) | SYNTH_KEY; - update = true; - break; - } - } - if (update) { - this->settings->changed = true; - this->settings->lastUpdate++; - Header_calculateHeight(header); - Header_updateData(header); - Header_draw(header); - ScreenManager_resize(this->scr); - } - return result; -} - -const PanelClass AvailableMetersPanel_class = { - .super = { - .extends = Class(Panel), - .delete = AvailableMetersPanel_delete - }, - .eventHandler = AvailableMetersPanel_eventHandler -}; - -// Handle (&CPUMeter_class) entries in the AvailableMetersPanel -static void AvailableMetersPanel_addCPUMeters(Panel* super, const MeterClass* type, const ProcessList* pl) { - if (pl->existingCPUs > 1) { - Panel_add(super, (Object*) ListItem_new("CPU average", 0)); - for (unsigned int i = 1; i <= pl->existingCPUs; i++) { - char buffer[50]; - xSnprintf(buffer, sizeof(buffer), "%s %d", type->uiName, Settings_cpuId(pl->settings, i - 1)); - Panel_add(super, (Object*) ListItem_new(buffer, i)); - } - } else { - Panel_add(super, (Object*) ListItem_new(type->uiName, 1)); - } -} - -typedef struct { - Panel* super; - unsigned int id; - unsigned int offset; -} DynamicIterator; - -static void AvailableMetersPanel_addDynamicMeter(ATTR_UNUSED ht_key_t key, void* value, void* data) { - const DynamicMeter* meter = (const DynamicMeter*)value; - DynamicIterator* iter = (DynamicIterator*)data; - unsigned int identifier = (iter->offset << 16) | iter->id; - const char* label = meter->description ? meter->description : meter->caption; - if (!label) - label = meter->name; /* last fallback to name, guaranteed set */ - Panel_add(iter->super, (Object*) ListItem_new(label, identifier)); - iter->id++; -} - -// Handle (&DynamicMeter_class) entries in the AvailableMetersPanel -static void AvailableMetersPanel_addDynamicMeters(Panel* super, const ProcessList* pl, unsigned int offset) { - DynamicIterator iter = { .super = super, .id = 1, .offset = offset }; - assert(pl->dynamicMeters != NULL); - Hashtable_foreach(pl->dynamicMeters, AvailableMetersPanel_addDynamicMeter, &iter); -} - -// Handle remaining Platform Meter entries in the AvailableMetersPanel -static void AvailableMetersPanel_addPlatformMeter(Panel* super, const MeterClass* type, unsigned int offset) { - const char* label = type->description ? type->description : type->uiName; - Panel_add(super, (Object*) ListItem_new(label, offset << 16)); -} - -AvailableMetersPanel* AvailableMetersPanel_new(Settings* settings, Header* header, size_t columns, MetersPanel** meterPanels, ScreenManager* scr, const ProcessList* pl) { - AvailableMetersPanel* this = AllocThis(AvailableMetersPanel); - Panel* super = (Panel*) this; - FunctionBar* fuBar = FunctionBar_newEnterEsc("Add ", "Done "); - Panel_init(super, 1, 1, 1, 1, Class(ListItem), true, fuBar); - - this->settings = settings; - this->header = header; - this->columns = columns; - this->meterPanels = meterPanels; - this->scr = scr; - - Panel_setHeader(super, "Available meters"); - // Platform_meterTypes[0] should be always (&CPUMeter_class) which we will - // handle separately in the code below. Likewise, identifiers for Dynamic - // Meters are handled separately - similar to CPUs, this allows generation - // of multiple different Meters (also using 'param' to distinguish them). - for (unsigned int i = 1; Platform_meterTypes[i]; i++) { - const MeterClass* type = Platform_meterTypes[i]; - assert(type != &CPUMeter_class); - if (type == &DynamicMeter_class) - AvailableMetersPanel_addDynamicMeters(super, pl, i); - else - AvailableMetersPanel_addPlatformMeter(super, type, i); - } - AvailableMetersPanel_addCPUMeters(super, &CPUMeter_class, pl); - - return this; -} diff --git a/fedora/.local/bin/htop-vim/AvailableMetersPanel.h b/fedora/.local/bin/htop-vim/AvailableMetersPanel.h deleted file mode 100644 index 1c0555a..0000000 --- a/fedora/.local/bin/htop-vim/AvailableMetersPanel.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef HEADER_AvailableMetersPanel -#define HEADER_AvailableMetersPanel -/* -htop - AvailableMetersPanel.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include - -#include "Header.h" -#include "MetersPanel.h" -#include "Panel.h" -#include "ProcessList.h" -#include "ScreenManager.h" -#include "Settings.h" - - -typedef struct AvailableMetersPanel_ { - Panel super; - ScreenManager* scr; - - Settings* settings; - Header* header; - size_t columns; - MetersPanel** meterPanels; -} AvailableMetersPanel; - -extern const PanelClass AvailableMetersPanel_class; - -AvailableMetersPanel* AvailableMetersPanel_new(Settings* settings, Header* header, size_t columns, MetersPanel** meterPanels, ScreenManager* scr, const ProcessList* pl); - -#endif diff --git a/fedora/.local/bin/htop-vim/BatteryMeter.c b/fedora/.local/bin/htop-vim/BatteryMeter.c deleted file mode 100644 index 33d17b7..0000000 --- a/fedora/.local/bin/htop-vim/BatteryMeter.c +++ /dev/null @@ -1,68 +0,0 @@ -/* -htop - BatteryMeter.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. - -This meter written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com). -*/ - -#include "BatteryMeter.h" - -#include - -#include "CRT.h" -#include "Object.h" -#include "Platform.h" -#include "XUtils.h" - - -static const int BatteryMeter_attributes[] = { - BATTERY -}; - -static void BatteryMeter_updateValues(Meter* this) { - ACPresence isOnAC; - double percent; - - Platform_getBattery(&percent, &isOnAC); - - if (isnan(percent)) { - this->values[0] = NAN; - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "N/A"); - return; - } - - this->values[0] = percent; - - const char* text; - switch (isOnAC) { - case AC_PRESENT: - text = this->mode == TEXT_METERMODE ? " (Running on A/C)" : "(A/C)"; - break; - case AC_ABSENT: - text = this->mode == TEXT_METERMODE ? " (Running on battery)" : "(bat)"; - break; - case AC_ERROR: - default: - text = ""; - break; - } - - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%.1f%%%s", percent, text); -} - -const MeterClass BatteryMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete - }, - .updateValues = BatteryMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 1, - .total = 100.0, - .attributes = BatteryMeter_attributes, - .name = "Battery", - .uiName = "Battery", - .caption = "Battery: " -}; diff --git a/fedora/.local/bin/htop-vim/BatteryMeter.h b/fedora/.local/bin/htop-vim/BatteryMeter.h deleted file mode 100644 index d0818b7..0000000 --- a/fedora/.local/bin/htop-vim/BatteryMeter.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef HEADER_BatteryMeter -#define HEADER_BatteryMeter -/* -htop - BatteryMeter.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. - -This meter written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com). -*/ - -#include "Meter.h" - - -typedef enum ACPresence_ { - AC_ABSENT, - AC_PRESENT, - AC_ERROR -} ACPresence; - -extern const MeterClass BatteryMeter_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/CONTRIBUTING.md b/fedora/.local/bin/htop-vim/CONTRIBUTING.md deleted file mode 100644 index dd759c2..0000000 --- a/fedora/.local/bin/htop-vim/CONTRIBUTING.md +++ /dev/null @@ -1,45 +0,0 @@ -Contributing Guide -================== - -Thank you so much for taking the time to contribute in to htop! - -Bug Reports ------------ - -Bug reports should be posted in the [Github issue -tracker](https://github.com/htop-dev/htop/issues). -Bug reports are extremely important since it's impossible for us to test -htop in every possible system, distribution and scenario. Your feedback -is what keeps the tool stable and always improving! Thank you! - -Pull Requests -------------- - -Code contributions are most welcome! Just [fork the -repo](https://github.com/htop-dev/htop) and send a [pull -request](https://github.com/htop-dev/htop/pulls). Help is especially -appreciated for support of platforms other than Linux. If proposing new -features, please be mindful that htop is a system tool that needs to keep a -small footprint and perform well on systems under stress -- so unfortunately -we can't accept every new feature proposed, as we need to keep the tool slim -and maintainable. Great ideas backed by a PR are always carefully considered -for inclusion though! Also, PRs containing bug fixes and portability tweaks -are always included, please send those in! - -Feature Requests ----------------- - -Please label Github issues that are feature requests with one of the `feature request` -labels. If you can't do this yourself, don't worry. The friendly folks from the -core team will distribute and fixup Github labels as part of the regular reviews. - -Style Guide ------------ - -To make working with the code easier a set of guidelines have evolved in -the past that new contributions should try to follow. While they are not set -in stone and always up for changes should the need arise they still provide -a first orientation to go by when contributing to this repository. - -The details of the coding style as well as what to take care about with your -contributions can be found in our [style guide](docs/styleguide.md). diff --git a/fedora/.local/bin/htop-vim/COPYING b/fedora/.local/bin/htop-vim/COPYING deleted file mode 100644 index d159169..0000000 --- a/fedora/.local/bin/htop-vim/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/fedora/.local/bin/htop-vim/CPUMeter.c b/fedora/.local/bin/htop-vim/CPUMeter.c deleted file mode 100644 index ba00595..0000000 --- a/fedora/.local/bin/htop-vim/CPUMeter.c +++ /dev/null @@ -1,617 +0,0 @@ -/* -htop - CPUMeter.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "CPUMeter.h" - -#include -#include -#include - -#include "CRT.h" -#include "Object.h" -#include "Platform.h" -#include "ProcessList.h" -#include "RichString.h" -#include "Settings.h" -#include "XUtils.h" - - -static const int CPUMeter_attributes[] = { - CPU_NICE, - CPU_NORMAL, - CPU_SYSTEM, - CPU_IRQ, - CPU_SOFTIRQ, - CPU_STEAL, - CPU_GUEST, - CPU_IOWAIT -}; - -typedef struct CPUMeterData_ { - unsigned int cpus; - Meter** meters; -} CPUMeterData; - -static void CPUMeter_init(Meter* this) { - unsigned int cpu = this->param; - if (cpu == 0) { - Meter_setCaption(this, "Avg"); - } else if (this->pl->activeCPUs > 1) { - char caption[10]; - xSnprintf(caption, sizeof(caption), "%3u", Settings_cpuId(this->pl->settings, cpu - 1)); - Meter_setCaption(this, caption); - } -} - -// Custom uiName runtime logic to include the param (processor) -static void CPUMeter_getUiName(const Meter* this, char* buffer, size_t length) { - if (this->param > 0) - xSnprintf(buffer, length, "%s %u", Meter_uiName(this), this->param); - else - xSnprintf(buffer, length, "%s", Meter_uiName(this)); -} - -static void CPUMeter_updateValues(Meter* this) { - memset(this->values, 0, sizeof(double) * CPU_METER_ITEMCOUNT); - - unsigned int cpu = this->param; - if (cpu > this->pl->existingCPUs) { - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "absent"); - return; - } - - double percent = Platform_setCPUValues(this, cpu); - if (isnan(percent)) { - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "offline"); - return; - } - - char cpuUsageBuffer[8] = { 0 }; - char cpuFrequencyBuffer[16] = { 0 }; - char cpuTemperatureBuffer[16] = { 0 }; - - if (this->pl->settings->showCPUUsage) { - xSnprintf(cpuUsageBuffer, sizeof(cpuUsageBuffer), "%.1f%%", percent); - } - - if (this->pl->settings->showCPUFrequency) { - double cpuFrequency = this->values[CPU_METER_FREQUENCY]; - if (isnan(cpuFrequency)) { - xSnprintf(cpuFrequencyBuffer, sizeof(cpuFrequencyBuffer), "N/A"); - } else { - xSnprintf(cpuFrequencyBuffer, sizeof(cpuFrequencyBuffer), "%4uMHz", (unsigned)cpuFrequency); - } - } - - #ifdef BUILD_WITH_CPU_TEMP - if (this->pl->settings->showCPUTemperature) { - double cpuTemperature = this->values[CPU_METER_TEMPERATURE]; - if (isnan(cpuTemperature)) - xSnprintf(cpuTemperatureBuffer, sizeof(cpuTemperatureBuffer), "N/A"); - else if (this->pl->settings->degreeFahrenheit) - xSnprintf(cpuTemperatureBuffer, sizeof(cpuTemperatureBuffer), "%3d%sF", (int)(cpuTemperature * 9 / 5 + 32), CRT_degreeSign); - else - xSnprintf(cpuTemperatureBuffer, sizeof(cpuTemperatureBuffer), "%d%sC", (int)cpuTemperature, CRT_degreeSign); - } - #endif - - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%s%s%s%s%s", - cpuUsageBuffer, - (cpuUsageBuffer[0] && (cpuFrequencyBuffer[0] || cpuTemperatureBuffer[0])) ? " " : "", - cpuFrequencyBuffer, - (cpuFrequencyBuffer[0] && cpuTemperatureBuffer[0]) ? " " : "", - cpuTemperatureBuffer); -} - -static void CPUMeter_display(const Object* cast, RichString* out) { - char buffer[50]; - int len; - const Meter* this = (const Meter*)cast; - - if (this->param > this->pl->existingCPUs) { - RichString_appendAscii(out, CRT_colors[METER_SHADOW], " absent"); - return; - } - - if (this->curItems == 0) { - RichString_appendAscii(out, CRT_colors[METER_SHADOW], " offline"); - return; - } - - len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_NORMAL]); - RichString_appendAscii(out, CRT_colors[METER_TEXT], ":"); - RichString_appendnAscii(out, CRT_colors[CPU_NORMAL], buffer, len); - if (this->pl->settings->detailedCPUTime) { - len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_KERNEL]); - RichString_appendAscii(out, CRT_colors[METER_TEXT], "sy:"); - RichString_appendnAscii(out, CRT_colors[CPU_SYSTEM], buffer, len); - len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_NICE]); - RichString_appendAscii(out, CRT_colors[METER_TEXT], "ni:"); - RichString_appendnAscii(out, CRT_colors[CPU_NICE_TEXT], buffer, len); - len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_IRQ]); - RichString_appendAscii(out, CRT_colors[METER_TEXT], "hi:"); - RichString_appendnAscii(out, CRT_colors[CPU_IRQ], buffer, len); - len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_SOFTIRQ]); - RichString_appendAscii(out, CRT_colors[METER_TEXT], "si:"); - RichString_appendnAscii(out, CRT_colors[CPU_SOFTIRQ], buffer, len); - if (!isnan(this->values[CPU_METER_STEAL])) { - len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_STEAL]); - RichString_appendAscii(out, CRT_colors[METER_TEXT], "st:"); - RichString_appendnAscii(out, CRT_colors[CPU_STEAL], buffer, len); - } - if (!isnan(this->values[CPU_METER_GUEST])) { - len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_GUEST]); - RichString_appendAscii(out, CRT_colors[METER_TEXT], "gu:"); - RichString_appendnAscii(out, CRT_colors[CPU_GUEST], buffer, len); - } - len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_IOWAIT]); - RichString_appendAscii(out, CRT_colors[METER_TEXT], "wa:"); - RichString_appendnAscii(out, CRT_colors[CPU_IOWAIT], buffer, len); - } else { - len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_KERNEL]); - RichString_appendAscii(out, CRT_colors[METER_TEXT], "sys:"); - RichString_appendnAscii(out, CRT_colors[CPU_SYSTEM], buffer, len); - len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_NICE]); - RichString_appendAscii(out, CRT_colors[METER_TEXT], "low:"); - RichString_appendnAscii(out, CRT_colors[CPU_NICE_TEXT], buffer, len); - if (!isnan(this->values[CPU_METER_IRQ])) { - len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_IRQ]); - RichString_appendAscii(out, CRT_colors[METER_TEXT], "vir:"); - RichString_appendnAscii(out, CRT_colors[CPU_GUEST], buffer, len); - } - } - - if (this->pl->settings->showCPUFrequency) { - char cpuFrequencyBuffer[10]; - double cpuFrequency = this->values[CPU_METER_FREQUENCY]; - if (isnan(cpuFrequency)) { - len = xSnprintf(cpuFrequencyBuffer, sizeof(cpuFrequencyBuffer), "N/A "); - } else { - len = xSnprintf(cpuFrequencyBuffer, sizeof(cpuFrequencyBuffer), "%4uMHz ", (unsigned)cpuFrequency); - } - RichString_appendAscii(out, CRT_colors[METER_TEXT], "freq: "); - RichString_appendnWide(out, CRT_colors[METER_VALUE], cpuFrequencyBuffer, len); - } - - #ifdef BUILD_WITH_CPU_TEMP - if (this->pl->settings->showCPUTemperature) { - char cpuTemperatureBuffer[10]; - double cpuTemperature = this->values[CPU_METER_TEMPERATURE]; - if (isnan(cpuTemperature)) { - len = xSnprintf(cpuTemperatureBuffer, sizeof(cpuTemperatureBuffer), "N/A"); - } else if (this->pl->settings->degreeFahrenheit) { - len = xSnprintf(cpuTemperatureBuffer, sizeof(cpuTemperatureBuffer), "%5.1f%sF", cpuTemperature * 9 / 5 + 32, CRT_degreeSign); - } else { - len = xSnprintf(cpuTemperatureBuffer, sizeof(cpuTemperatureBuffer), "%5.1f%sC", cpuTemperature, CRT_degreeSign); - } - RichString_appendAscii(out, CRT_colors[METER_TEXT], "temp:"); - RichString_appendnWide(out, CRT_colors[METER_VALUE], cpuTemperatureBuffer, len); - } - #endif -} - -static void AllCPUsMeter_getRange(const Meter* this, int* start, int* count) { - const CPUMeterData* data = this->meterData; - unsigned int cpus = data->cpus; - switch (Meter_name(this)[0]) { - default: - case 'A': // All - *start = 0; - *count = cpus; - break; - case 'L': // First Half - *start = 0; - *count = (cpus + 1) / 2; - break; - case 'R': // Second Half - *start = (cpus + 1) / 2; - *count = cpus / 2; - break; - } -} - -static void AllCPUsMeter_updateValues(Meter* this) { - CPUMeterData* data = this->meterData; - Meter** meters = data->meters; - int start, count; - AllCPUsMeter_getRange(this, &start, &count); - for (int i = 0; i < count; i++) - Meter_updateValues(meters[i]); -} - -static void CPUMeterCommonInit(Meter* this, int ncol) { - unsigned int cpus = this->pl->existingCPUs; - CPUMeterData* data = this->meterData; - if (!data) { - data = this->meterData = xMalloc(sizeof(CPUMeterData)); - data->cpus = cpus; - data->meters = xCalloc(cpus, sizeof(Meter*)); - } - Meter** meters = data->meters; - int start, count; - AllCPUsMeter_getRange(this, &start, &count); - for (int i = 0; i < count; i++) { - if (!meters[i]) - meters[i] = Meter_new(this->pl, start + i + 1, (const MeterClass*) Class(CPUMeter)); - - Meter_init(meters[i]); - } - - if (this->mode == 0) - this->mode = BAR_METERMODE; - - int h = Meter_modes[this->mode]->h; - this->h = h * ((count + ncol - 1) / ncol); -} - -static void CPUMeterCommonUpdateMode(Meter* this, int mode, int ncol) { - CPUMeterData* data = this->meterData; - Meter** meters = data->meters; - this->mode = mode; - int h = Meter_modes[mode]->h; - int start, count; - AllCPUsMeter_getRange(this, &start, &count); - for (int i = 0; i < count; i++) { - Meter_setMode(meters[i], mode); - } - this->h = h * ((count + ncol - 1) / ncol); -} - -static void AllCPUsMeter_done(Meter* this) { - CPUMeterData* data = this->meterData; - Meter** meters = data->meters; - int start, count; - AllCPUsMeter_getRange(this, &start, &count); - for (int i = 0; i < count; i++) - Meter_delete((Object*)meters[i]); - free(data->meters); - free(data); -} - -static void SingleColCPUsMeter_init(Meter* this) { - CPUMeterCommonInit(this, 1); -} - -static void SingleColCPUsMeter_updateMode(Meter* this, int mode) { - CPUMeterCommonUpdateMode(this, mode, 1); -} - -static void DualColCPUsMeter_init(Meter* this) { - CPUMeterCommonInit(this, 2); -} - -static void DualColCPUsMeter_updateMode(Meter* this, int mode) { - CPUMeterCommonUpdateMode(this, mode, 2); -} - -static void QuadColCPUsMeter_init(Meter* this) { - CPUMeterCommonInit(this, 4); -} - -static void QuadColCPUsMeter_updateMode(Meter* this, int mode) { - CPUMeterCommonUpdateMode(this, mode, 4); -} - -static void OctoColCPUsMeter_init(Meter* this) { - CPUMeterCommonInit(this, 8); -} - -static void OctoColCPUsMeter_updateMode(Meter* this, int mode) { - CPUMeterCommonUpdateMode(this, mode, 8); -} - -static void CPUMeterCommonDraw(Meter* this, int x, int y, int w, int ncol) { - CPUMeterData* data = this->meterData; - Meter** meters = data->meters; - int start, count; - AllCPUsMeter_getRange(this, &start, &count); - int colwidth = (w - ncol) / ncol + 1; - int diff = (w - (colwidth * ncol)); - int nrows = (count + ncol - 1) / ncol; - for (int i = 0; i < count; i++) { - int d = (i / nrows) > diff ? diff : (i / nrows); // dynamic spacer - int xpos = x + ((i / nrows) * colwidth) + d; - int ypos = y + ((i % nrows) * meters[0]->h); - meters[i]->draw(meters[i], xpos, ypos, colwidth); - } -} - -static void DualColCPUsMeter_draw(Meter* this, int x, int y, int w) { - CPUMeterCommonDraw(this, x, y, w, 2); -} - -static void QuadColCPUsMeter_draw(Meter* this, int x, int y, int w) { - CPUMeterCommonDraw(this, x, y, w, 4); -} - -static void OctoColCPUsMeter_draw(Meter* this, int x, int y, int w) { - CPUMeterCommonDraw(this, x, y, w, 8); -} - - -static void SingleColCPUsMeter_draw(Meter* this, int x, int y, int w) { - CPUMeterData* data = this->meterData; - Meter** meters = data->meters; - int start, count; - AllCPUsMeter_getRange(this, &start, &count); - for (int i = 0; i < count; i++) { - meters[i]->draw(meters[i], x, y, w); - y += meters[i]->h; - } -} - - -const MeterClass CPUMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = CPUMeter_display - }, - .updateValues = CPUMeter_updateValues, - .getUiName = CPUMeter_getUiName, - .defaultMode = BAR_METERMODE, - .maxItems = CPU_METER_ITEMCOUNT, - .total = 100.0, - .attributes = CPUMeter_attributes, - .name = "CPU", - .uiName = "CPU", - .caption = "CPU", - .init = CPUMeter_init -}; - -const MeterClass AllCPUsMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = CPUMeter_display - }, - .updateValues = AllCPUsMeter_updateValues, - .defaultMode = CUSTOM_METERMODE, - .total = 100.0, - .attributes = CPUMeter_attributes, - .name = "AllCPUs", - .uiName = "CPUs (1/1)", - .description = "CPUs (1/1): all CPUs", - .caption = "CPU", - .draw = SingleColCPUsMeter_draw, - .init = SingleColCPUsMeter_init, - .updateMode = SingleColCPUsMeter_updateMode, - .done = AllCPUsMeter_done -}; - -const MeterClass AllCPUs2Meter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = CPUMeter_display - }, - .updateValues = AllCPUsMeter_updateValues, - .defaultMode = CUSTOM_METERMODE, - .isMultiColumn = true, - .total = 100.0, - .attributes = CPUMeter_attributes, - .name = "AllCPUs2", - .uiName = "CPUs (1&2/2)", - .description = "CPUs (1&2/2): all CPUs in 2 shorter columns", - .caption = "CPU", - .draw = DualColCPUsMeter_draw, - .init = DualColCPUsMeter_init, - .updateMode = DualColCPUsMeter_updateMode, - .done = AllCPUsMeter_done -}; - -const MeterClass LeftCPUsMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = CPUMeter_display - }, - .updateValues = AllCPUsMeter_updateValues, - .defaultMode = CUSTOM_METERMODE, - .isMultiColumn = true, - .total = 100.0, - .attributes = CPUMeter_attributes, - .name = "LeftCPUs", - .uiName = "CPUs (1/2)", - .description = "CPUs (1/2): first half of list", - .caption = "CPU", - .draw = SingleColCPUsMeter_draw, - .init = SingleColCPUsMeter_init, - .updateMode = SingleColCPUsMeter_updateMode, - .done = AllCPUsMeter_done -}; - -const MeterClass RightCPUsMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = CPUMeter_display - }, - .updateValues = AllCPUsMeter_updateValues, - .defaultMode = CUSTOM_METERMODE, - .isMultiColumn = true, - .total = 100.0, - .attributes = CPUMeter_attributes, - .name = "RightCPUs", - .uiName = "CPUs (2/2)", - .description = "CPUs (2/2): second half of list", - .caption = "CPU", - .draw = SingleColCPUsMeter_draw, - .init = SingleColCPUsMeter_init, - .updateMode = SingleColCPUsMeter_updateMode, - .done = AllCPUsMeter_done -}; - -const MeterClass LeftCPUs2Meter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = CPUMeter_display - }, - .updateValues = AllCPUsMeter_updateValues, - .defaultMode = CUSTOM_METERMODE, - .isMultiColumn = true, - .total = 100.0, - .attributes = CPUMeter_attributes, - .name = "LeftCPUs2", - .uiName = "CPUs (1&2/4)", - .description = "CPUs (1&2/4): first half in 2 shorter columns", - .caption = "CPU", - .draw = DualColCPUsMeter_draw, - .init = DualColCPUsMeter_init, - .updateMode = DualColCPUsMeter_updateMode, - .done = AllCPUsMeter_done -}; - -const MeterClass RightCPUs2Meter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = CPUMeter_display - }, - .updateValues = AllCPUsMeter_updateValues, - .defaultMode = CUSTOM_METERMODE, - .isMultiColumn = true, - .total = 100.0, - .attributes = CPUMeter_attributes, - .name = "RightCPUs2", - .uiName = "CPUs (3&4/4)", - .description = "CPUs (3&4/4): second half in 2 shorter columns", - .caption = "CPU", - .draw = DualColCPUsMeter_draw, - .init = DualColCPUsMeter_init, - .updateMode = DualColCPUsMeter_updateMode, - .done = AllCPUsMeter_done -}; - -const MeterClass AllCPUs4Meter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = CPUMeter_display - }, - .updateValues = AllCPUsMeter_updateValues, - .defaultMode = CUSTOM_METERMODE, - .isMultiColumn = true, - .total = 100.0, - .attributes = CPUMeter_attributes, - .name = "AllCPUs4", - .uiName = "CPUs (1&2&3&4/4)", - .description = "CPUs (1&2&3&4/4): all CPUs in 4 shorter columns", - .caption = "CPU", - .draw = QuadColCPUsMeter_draw, - .init = QuadColCPUsMeter_init, - .updateMode = QuadColCPUsMeter_updateMode, - .done = AllCPUsMeter_done -}; - -const MeterClass LeftCPUs4Meter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = CPUMeter_display - }, - .updateValues = AllCPUsMeter_updateValues, - .defaultMode = CUSTOM_METERMODE, - .isMultiColumn = true, - .total = 100.0, - .attributes = CPUMeter_attributes, - .name = "LeftCPUs4", - .uiName = "CPUs (1-4/8)", - .description = "CPUs (1-4/8): first half in 4 shorter columns", - .caption = "CPU", - .draw = QuadColCPUsMeter_draw, - .init = QuadColCPUsMeter_init, - .updateMode = QuadColCPUsMeter_updateMode, - .done = AllCPUsMeter_done -}; - -const MeterClass RightCPUs4Meter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = CPUMeter_display - }, - .updateValues = AllCPUsMeter_updateValues, - .defaultMode = CUSTOM_METERMODE, - .isMultiColumn = true, - .total = 100.0, - .attributes = CPUMeter_attributes, - .name = "RightCPUs4", - .uiName = "CPUs (5-8/8)", - .description = "CPUs (5-8/8): second half in 4 shorter columns", - .caption = "CPU", - .draw = QuadColCPUsMeter_draw, - .init = QuadColCPUsMeter_init, - .updateMode = QuadColCPUsMeter_updateMode, - .done = AllCPUsMeter_done -}; - -const MeterClass AllCPUs8Meter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = CPUMeter_display - }, - .updateValues = AllCPUsMeter_updateValues, - .defaultMode = CUSTOM_METERMODE, - .isMultiColumn = true, - .total = 100.0, - .attributes = CPUMeter_attributes, - .name = "AllCPUs8", - .uiName = "CPUs (1-8/8)", - .description = "CPUs (1-8/8): all CPUs in 8 shorter columns", - .caption = "CPU", - .draw = OctoColCPUsMeter_draw, - .init = OctoColCPUsMeter_init, - .updateMode = OctoColCPUsMeter_updateMode, - .done = AllCPUsMeter_done -}; - -const MeterClass LeftCPUs8Meter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = CPUMeter_display - }, - .updateValues = AllCPUsMeter_updateValues, - .defaultMode = CUSTOM_METERMODE, - .isMultiColumn = true, - .total = 100.0, - .attributes = CPUMeter_attributes, - .name = "LeftCPUs8", - .uiName = "CPUs (1-8/16)", - .description = "CPUs (1-8/16): first half in 8 shorter columns", - .caption = "CPU", - .draw = OctoColCPUsMeter_draw, - .init = OctoColCPUsMeter_init, - .updateMode = OctoColCPUsMeter_updateMode, - .done = AllCPUsMeter_done -}; - -const MeterClass RightCPUs8Meter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = CPUMeter_display - }, - .updateValues = AllCPUsMeter_updateValues, - .defaultMode = CUSTOM_METERMODE, - .isMultiColumn = true, - .total = 100.0, - .attributes = CPUMeter_attributes, - .name = "RightCPUs8", - .uiName = "CPUs (9-16/16)", - .description = "CPUs (9-16/16): second half in 8 shorter columns", - .caption = "CPU", - .draw = OctoColCPUsMeter_draw, - .init = OctoColCPUsMeter_init, - .updateMode = OctoColCPUsMeter_updateMode, - .done = AllCPUsMeter_done -}; diff --git a/fedora/.local/bin/htop-vim/CPUMeter.h b/fedora/.local/bin/htop-vim/CPUMeter.h deleted file mode 100644 index 7f2ddb1..0000000 --- a/fedora/.local/bin/htop-vim/CPUMeter.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef HEADER_CPUMeter -#define HEADER_CPUMeter -/* -htop - CPUMeter.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Meter.h" - - -typedef enum { - CPU_METER_NICE = 0, - CPU_METER_NORMAL = 1, - CPU_METER_KERNEL = 2, - CPU_METER_IRQ = 3, - CPU_METER_SOFTIRQ = 4, - CPU_METER_STEAL = 5, - CPU_METER_GUEST = 6, - CPU_METER_IOWAIT = 7, - CPU_METER_FREQUENCY = 8, - CPU_METER_TEMPERATURE = 9, - CPU_METER_ITEMCOUNT = 10, // number of entries in this enum -} CPUMeterValues; - -extern const MeterClass CPUMeter_class; - -extern const MeterClass AllCPUsMeter_class; - -extern const MeterClass AllCPUs2Meter_class; - -extern const MeterClass LeftCPUsMeter_class; - -extern const MeterClass RightCPUsMeter_class; - -extern const MeterClass LeftCPUs2Meter_class; - -extern const MeterClass RightCPUs2Meter_class; - -extern const MeterClass AllCPUs4Meter_class; - -extern const MeterClass LeftCPUs4Meter_class; - -extern const MeterClass RightCPUs4Meter_class; - -extern const MeterClass AllCPUs8Meter_class; - -extern const MeterClass LeftCPUs8Meter_class; - -extern const MeterClass RightCPUs8Meter_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/CRT.c b/fedora/.local/bin/htop-vim/CRT.c deleted file mode 100644 index e35608b..0000000 --- a/fedora/.local/bin/htop-vim/CRT.c +++ /dev/null @@ -1,1228 +0,0 @@ -/* -htop - CRT.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "CRT.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ProvideCurses.h" -#include "XUtils.h" - -#if !defined(NDEBUG) && defined(HAVE_MEMFD_CREATE) -#include -#endif - -#if defined(HAVE_LIBUNWIND_H) && defined(HAVE_LIBUNWIND) -# define PRINT_BACKTRACE -# define UNW_LOCAL_ONLY -# include -# if defined(HAVE_DLADDR) -# include -# endif -#elif defined(HAVE_EXECINFO_H) -# define PRINT_BACKTRACE -# include -#endif - - -#define ColorIndex(i,j) ((7-(i))*8+(j)) - -#define ColorPair(i,j) COLOR_PAIR(ColorIndex(i,j)) - -#define Black COLOR_BLACK -#define Red COLOR_RED -#define Green COLOR_GREEN -#define Yellow COLOR_YELLOW -#define Blue COLOR_BLUE -#define Magenta COLOR_MAGENTA -#define Cyan COLOR_CYAN -#define White COLOR_WHITE - -#define ColorPairGrayBlack ColorPair(Magenta,Magenta) -#define ColorIndexGrayBlack ColorIndex(Magenta,Magenta) - -#define ColorPairWhiteDefault ColorPair(Red, Red) -#define ColorIndexWhiteDefault ColorIndex(Red, Red) - -static const char* const CRT_treeStrAscii[LAST_TREE_STR] = { - [TREE_STR_VERT] = "|", - [TREE_STR_RTEE] = "`", - [TREE_STR_BEND] = "`", - [TREE_STR_TEND] = ",", - [TREE_STR_OPEN] = "+", - [TREE_STR_SHUT] = "-", - [TREE_STR_ASC] = "+", - [TREE_STR_DESC] = "-", -}; - -#ifdef HAVE_LIBNCURSESW - -static const char* const CRT_treeStrUtf8[LAST_TREE_STR] = { - [TREE_STR_VERT] = "\xe2\x94\x82", // โ”‚ - [TREE_STR_RTEE] = "\xe2\x94\x9c", // โ”œ - [TREE_STR_BEND] = "\xe2\x94\x94", // โ”” - [TREE_STR_TEND] = "\xe2\x94\x8c", // โ”Œ - [TREE_STR_OPEN] = "+", // +, TODO use ๐Ÿฎฏ 'BOX DRAWINGS LIGHT HORIZONTAL - // WITH VERTICAL STROKE' (U+1FBAF, "\xf0\x9f\xae\xaf") when - // Unicode 13 is common - [TREE_STR_SHUT] = "\xe2\x94\x80", // โ”€ - [TREE_STR_ASC] = "\xe2\x96\xb3", // โ–ณ - [TREE_STR_DESC] = "\xe2\x96\xbd", // โ–ฝ -}; - -bool CRT_utf8 = false; - -#endif - -const char* const* CRT_treeStr = CRT_treeStrAscii; - -static const Settings* CRT_crashSettings; -static const int* CRT_delay; - -const char* CRT_degreeSign; - -static const char* initDegreeSign(void) { -#ifdef HAVE_LIBNCURSESW - if (CRT_utf8) - return "\xc2\xb0"; - - static char buffer[4]; - // this might fail if the current locale does not support wide characters - int r = snprintf(buffer, sizeof(buffer), "%lc", 176); - if (r > 0) - return buffer; -#endif - - return ""; -} - -const int* CRT_colors; - -static int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = { - [COLORSCHEME_DEFAULT] = { - [RESET_COLOR] = ColorPair(White, Black), - [DEFAULT_COLOR] = ColorPair(White, Black), - [FUNCTION_BAR] = ColorPair(Black, Cyan), - [FUNCTION_KEY] = ColorPair(White, Black), - [PANEL_HEADER_FOCUS] = ColorPair(Black, Green), - [PANEL_HEADER_UNFOCUS] = ColorPair(Black, Green), - [PANEL_SELECTION_FOCUS] = ColorPair(Black, Cyan), - [PANEL_SELECTION_FOLLOW] = ColorPair(Black, Yellow), - [PANEL_SELECTION_UNFOCUS] = ColorPair(Black, White), - [FAILED_SEARCH] = ColorPair(Red, Cyan), - [FAILED_READ] = A_BOLD | ColorPair(Red, Black), - [PAUSED] = A_BOLD | ColorPair(Yellow, Cyan), - [UPTIME] = A_BOLD | ColorPair(Cyan, Black), - [BATTERY] = A_BOLD | ColorPair(Cyan, Black), - [LARGE_NUMBER] = A_BOLD | ColorPair(Red, Black), - [METER_SHADOW] = A_BOLD | ColorPairGrayBlack, - [METER_TEXT] = ColorPair(Cyan, Black), - [METER_VALUE] = A_BOLD | ColorPair(Cyan, Black), - [METER_VALUE_ERROR] = A_BOLD | ColorPair(Red, Black), - [METER_VALUE_IOREAD] = ColorPair(Green, Black), - [METER_VALUE_IOWRITE] = A_BOLD | ColorPair(Blue, Black), - [METER_VALUE_NOTICE] = A_BOLD | ColorPair(White, Black), - [METER_VALUE_OK] = ColorPair(Green, Black), - [METER_VALUE_WARN] = A_BOLD | ColorPair(Yellow, Black), - [LED_COLOR] = ColorPair(Green, Black), - [TASKS_RUNNING] = A_BOLD | ColorPair(Green, Black), - [PROCESS] = A_NORMAL, - [PROCESS_SHADOW] = A_BOLD | ColorPairGrayBlack, - [PROCESS_TAG] = A_BOLD | ColorPair(Yellow, Black), - [PROCESS_MEGABYTES] = ColorPair(Cyan, Black), - [PROCESS_GIGABYTES] = ColorPair(Green, Black), - [PROCESS_BASENAME] = A_BOLD | ColorPair(Cyan, Black), - [PROCESS_TREE] = ColorPair(Cyan, Black), - [PROCESS_RUN_STATE] = ColorPair(Green, Black), - [PROCESS_D_STATE] = A_BOLD | ColorPair(Red, Black), - [PROCESS_HIGH_PRIORITY] = ColorPair(Red, Black), - [PROCESS_LOW_PRIORITY] = ColorPair(Green, Black), - [PROCESS_NEW] = ColorPair(Black, Green), - [PROCESS_TOMB] = ColorPair(Black, Red), - [PROCESS_THREAD] = ColorPair(Green, Black), - [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Green, Black), - [PROCESS_COMM] = ColorPair(Magenta, Black), - [PROCESS_THREAD_COMM] = A_BOLD | ColorPair(Blue, Black), - [PROCESS_PRIV] = ColorPair(Magenta, Black), - [BAR_BORDER] = A_BOLD, - [BAR_SHADOW] = A_BOLD | ColorPairGrayBlack, - [SWAP] = ColorPair(Red, Black), - [SWAP_CACHE] = ColorPair(Yellow, Black), - [GRAPH_1] = A_BOLD | ColorPair(Cyan, Black), - [GRAPH_2] = ColorPair(Cyan, Black), - [MEMORY_USED] = ColorPair(Green, Black), - [MEMORY_BUFFERS] = A_BOLD | ColorPair(Blue, Black), - [MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Blue, Black), - [MEMORY_CACHE] = ColorPair(Yellow, Black), - [MEMORY_SHARED] = ColorPair(Magenta, Black), - [HUGEPAGE_1] = ColorPair(Green, Black), - [HUGEPAGE_2] = ColorPair(Yellow, Black), - [HUGEPAGE_3] = ColorPair(Red, Black), - [HUGEPAGE_4] = A_BOLD | ColorPair(Blue, Black), - [LOAD_AVERAGE_FIFTEEN] = ColorPair(Cyan, Black), - [LOAD_AVERAGE_FIVE] = A_BOLD | ColorPair(Cyan, Black), - [LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(White, Black), - [LOAD] = A_BOLD, - [HELP_BOLD] = A_BOLD | ColorPair(Cyan, Black), - [HELP_SHADOW] = A_BOLD | ColorPairGrayBlack, - [CLOCK] = A_BOLD, - [DATE] = A_BOLD, - [DATETIME] = A_BOLD, - [CHECK_BOX] = ColorPair(Cyan, Black), - [CHECK_MARK] = A_BOLD, - [CHECK_TEXT] = A_NORMAL, - [HOSTNAME] = A_BOLD, - [CPU_NICE] = A_BOLD | ColorPair(Blue, Black), - [CPU_NICE_TEXT] = A_BOLD | ColorPair(Blue, Black), - [CPU_NORMAL] = ColorPair(Green, Black), - [CPU_SYSTEM] = ColorPair(Red, Black), - [CPU_IOWAIT] = A_BOLD | ColorPairGrayBlack, - [CPU_IRQ] = ColorPair(Yellow, Black), - [CPU_SOFTIRQ] = ColorPair(Magenta, Black), - [CPU_STEAL] = ColorPair(Cyan, Black), - [CPU_GUEST] = ColorPair(Cyan, Black), - [PANEL_EDIT] = ColorPair(White, Blue), - [SCREENS_OTH_BORDER] = ColorPair(Blue, Blue), - [SCREENS_OTH_TEXT] = ColorPair(Black, Blue), - [SCREENS_CUR_BORDER] = ColorPair(Green, Green), - [SCREENS_CUR_TEXT] = ColorPair(Black, Green), - [PRESSURE_STALL_THREEHUNDRED] = ColorPair(Cyan, Black), - [PRESSURE_STALL_SIXTY] = A_BOLD | ColorPair(Cyan, Black), - [PRESSURE_STALL_TEN] = A_BOLD | ColorPair(White, Black), - [ZFS_MFU] = A_BOLD | ColorPair(Blue, Black), - [ZFS_MRU] = ColorPair(Yellow, Black), - [ZFS_ANON] = ColorPair(Magenta, Black), - [ZFS_HEADER] = ColorPair(Cyan, Black), - [ZFS_OTHER] = ColorPair(Magenta, Black), - [ZFS_COMPRESSED] = A_BOLD | ColorPair(Blue, Black), - [ZFS_RATIO] = ColorPair(Magenta, Black), - [ZRAM] = ColorPair(Yellow, Black), - [DYNAMIC_GRAY] = ColorPairGrayBlack, - [DYNAMIC_DARKGRAY] = A_BOLD | ColorPairGrayBlack, - [DYNAMIC_RED] = ColorPair(Red, Black), - [DYNAMIC_GREEN] = ColorPair(Green, Black), - [DYNAMIC_BLUE] = A_BOLD | ColorPair(Blue, Black), - [DYNAMIC_CYAN] = ColorPair(Cyan, Black), - [DYNAMIC_MAGENTA] = ColorPair(Magenta, Black), - [DYNAMIC_YELLOW] = ColorPair(Yellow, Black), - [DYNAMIC_WHITE] = ColorPair(White, Black), - }, - [COLORSCHEME_MONOCHROME] = { - [RESET_COLOR] = A_NORMAL, - [DEFAULT_COLOR] = A_NORMAL, - [FUNCTION_BAR] = A_REVERSE, - [FUNCTION_KEY] = A_NORMAL, - [PANEL_HEADER_FOCUS] = A_REVERSE, - [PANEL_HEADER_UNFOCUS] = A_REVERSE, - [PANEL_SELECTION_FOCUS] = A_REVERSE, - [PANEL_SELECTION_FOLLOW] = A_REVERSE, - [PANEL_SELECTION_UNFOCUS] = A_BOLD, - [FAILED_SEARCH] = A_REVERSE | A_BOLD, - [FAILED_READ] = A_BOLD, - [PAUSED] = A_BOLD | A_REVERSE, - [UPTIME] = A_BOLD, - [BATTERY] = A_BOLD, - [LARGE_NUMBER] = A_BOLD, - [METER_SHADOW] = A_DIM, - [METER_TEXT] = A_NORMAL, - [METER_VALUE] = A_BOLD, - [METER_VALUE_ERROR] = A_BOLD, - [METER_VALUE_IOREAD] = A_NORMAL, - [METER_VALUE_IOWRITE] = A_NORMAL, - [METER_VALUE_NOTICE] = A_BOLD, - [METER_VALUE_OK] = A_NORMAL, - [METER_VALUE_WARN] = A_BOLD, - [LED_COLOR] = A_NORMAL, - [TASKS_RUNNING] = A_BOLD, - [PROCESS] = A_NORMAL, - [PROCESS_SHADOW] = A_DIM, - [PROCESS_TAG] = A_BOLD, - [PROCESS_MEGABYTES] = A_BOLD, - [PROCESS_GIGABYTES] = A_BOLD, - [PROCESS_BASENAME] = A_BOLD, - [PROCESS_TREE] = A_BOLD, - [PROCESS_RUN_STATE] = A_BOLD, - [PROCESS_D_STATE] = A_BOLD, - [PROCESS_HIGH_PRIORITY] = A_BOLD, - [PROCESS_LOW_PRIORITY] = A_DIM, - [PROCESS_NEW] = A_BOLD, - [PROCESS_TOMB] = A_DIM, - [PROCESS_THREAD] = A_BOLD, - [PROCESS_THREAD_BASENAME] = A_REVERSE, - [PROCESS_COMM] = A_BOLD, - [PROCESS_THREAD_COMM] = A_REVERSE, - [PROCESS_PRIV] = A_BOLD, - [BAR_BORDER] = A_BOLD, - [BAR_SHADOW] = A_DIM, - [SWAP] = A_BOLD, - [SWAP_CACHE] = A_NORMAL, - [GRAPH_1] = A_BOLD, - [GRAPH_2] = A_NORMAL, - [MEMORY_USED] = A_BOLD, - [MEMORY_BUFFERS] = A_NORMAL, - [MEMORY_BUFFERS_TEXT] = A_NORMAL, - [MEMORY_CACHE] = A_NORMAL, - [MEMORY_SHARED] = A_NORMAL, - [HUGEPAGE_1] = A_BOLD, - [HUGEPAGE_2] = A_NORMAL, - [HUGEPAGE_3] = A_REVERSE | A_BOLD, - [HUGEPAGE_4] = A_REVERSE, - [LOAD_AVERAGE_FIFTEEN] = A_DIM, - [LOAD_AVERAGE_FIVE] = A_NORMAL, - [LOAD_AVERAGE_ONE] = A_BOLD, - [LOAD] = A_BOLD, - [HELP_BOLD] = A_BOLD, - [HELP_SHADOW] = A_DIM, - [CLOCK] = A_BOLD, - [DATE] = A_BOLD, - [DATETIME] = A_BOLD, - [CHECK_BOX] = A_BOLD, - [CHECK_MARK] = A_NORMAL, - [CHECK_TEXT] = A_NORMAL, - [HOSTNAME] = A_BOLD, - [CPU_NICE] = A_NORMAL, - [CPU_NICE_TEXT] = A_NORMAL, - [CPU_NORMAL] = A_BOLD, - [CPU_SYSTEM] = A_BOLD, - [CPU_IOWAIT] = A_NORMAL, - [CPU_IRQ] = A_BOLD, - [CPU_SOFTIRQ] = A_BOLD, - [CPU_STEAL] = A_DIM, - [CPU_GUEST] = A_DIM, - [PANEL_EDIT] = A_BOLD, - [SCREENS_OTH_BORDER] = A_DIM, - [SCREENS_OTH_TEXT] = A_DIM, - [SCREENS_CUR_BORDER] = A_REVERSE, - [SCREENS_CUR_TEXT] = A_REVERSE, - [PRESSURE_STALL_THREEHUNDRED] = A_DIM, - [PRESSURE_STALL_SIXTY] = A_NORMAL, - [PRESSURE_STALL_TEN] = A_BOLD, - [ZFS_MFU] = A_NORMAL, - [ZFS_MRU] = A_NORMAL, - [ZFS_ANON] = A_DIM, - [ZFS_HEADER] = A_BOLD, - [ZFS_OTHER] = A_DIM, - [ZFS_COMPRESSED] = A_BOLD, - [ZFS_RATIO] = A_BOLD, - [ZRAM] = A_NORMAL, - [DYNAMIC_GRAY] = A_DIM, - [DYNAMIC_DARKGRAY] = A_DIM, - [DYNAMIC_RED] = A_BOLD, - [DYNAMIC_GREEN] = A_NORMAL, - [DYNAMIC_BLUE] = A_NORMAL, - [DYNAMIC_CYAN] = A_BOLD, - [DYNAMIC_MAGENTA] = A_NORMAL, - [DYNAMIC_YELLOW] = A_NORMAL, - [DYNAMIC_WHITE] = A_BOLD, - }, - [COLORSCHEME_BLACKONWHITE] = { - [RESET_COLOR] = ColorPair(Black, White), - [DEFAULT_COLOR] = ColorPair(Black, White), - [FUNCTION_BAR] = ColorPair(Black, Cyan), - [FUNCTION_KEY] = ColorPair(Black, White), - [PANEL_HEADER_FOCUS] = ColorPair(Black, Green), - [PANEL_HEADER_UNFOCUS] = ColorPair(Black, Green), - [PANEL_SELECTION_FOCUS] = ColorPair(Black, Cyan), - [PANEL_SELECTION_FOLLOW] = ColorPair(Black, Yellow), - [PANEL_SELECTION_UNFOCUS] = ColorPair(Blue, White), - [FAILED_SEARCH] = ColorPair(Red, Cyan), - [FAILED_READ] = ColorPair(Red, White), - [PAUSED] = A_BOLD | ColorPair(Yellow, Cyan), - [UPTIME] = ColorPair(Yellow, White), - [BATTERY] = ColorPair(Yellow, White), - [LARGE_NUMBER] = ColorPair(Red, White), - [METER_SHADOW] = ColorPair(Blue, White), - [METER_TEXT] = ColorPair(Blue, White), - [METER_VALUE] = ColorPair(Black, White), - [METER_VALUE_ERROR] = A_BOLD | ColorPair(Red, White), - [METER_VALUE_IOREAD] = ColorPair(Green, White), - [METER_VALUE_IOWRITE] = ColorPair(Yellow, White), - [METER_VALUE_NOTICE] = A_BOLD | ColorPair(Yellow, White), - [METER_VALUE_OK] = ColorPair(Green, White), - [METER_VALUE_WARN] = A_BOLD | ColorPair(Yellow, White), - [LED_COLOR] = ColorPair(Green, White), - [TASKS_RUNNING] = ColorPair(Green, White), - [PROCESS] = ColorPair(Black, White), - [PROCESS_SHADOW] = A_BOLD | ColorPair(Black, White), - [PROCESS_TAG] = ColorPair(White, Blue), - [PROCESS_MEGABYTES] = ColorPair(Blue, White), - [PROCESS_GIGABYTES] = ColorPair(Green, White), - [PROCESS_BASENAME] = ColorPair(Blue, White), - [PROCESS_TREE] = ColorPair(Green, White), - [PROCESS_RUN_STATE] = ColorPair(Green, White), - [PROCESS_D_STATE] = A_BOLD | ColorPair(Red, White), - [PROCESS_HIGH_PRIORITY] = ColorPair(Red, White), - [PROCESS_LOW_PRIORITY] = ColorPair(Green, White), - [PROCESS_NEW] = ColorPair(White, Green), - [PROCESS_TOMB] = ColorPair(White, Red), - [PROCESS_THREAD] = ColorPair(Blue, White), - [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue, White), - [PROCESS_COMM] = ColorPair(Magenta, White), - [PROCESS_THREAD_COMM] = ColorPair(Green, White), - [PROCESS_PRIV] = ColorPair(Magenta, White), - [BAR_BORDER] = ColorPair(Blue, White), - [BAR_SHADOW] = ColorPair(Black, White), - [SWAP] = ColorPair(Red, White), - [SWAP_CACHE] = ColorPair(Yellow, White), - [GRAPH_1] = A_BOLD | ColorPair(Blue, White), - [GRAPH_2] = ColorPair(Blue, White), - [MEMORY_USED] = ColorPair(Green, White), - [MEMORY_BUFFERS] = ColorPair(Cyan, White), - [MEMORY_BUFFERS_TEXT] = ColorPair(Cyan, White), - [MEMORY_CACHE] = ColorPair(Yellow, White), - [MEMORY_SHARED] = ColorPair(Magenta, White), - [HUGEPAGE_1] = ColorPair(Green, White), - [HUGEPAGE_2] = ColorPair(Yellow, White), - [HUGEPAGE_3] = ColorPair(Red, White), - [HUGEPAGE_4] = ColorPair(Blue, White), - [LOAD_AVERAGE_FIFTEEN] = ColorPair(Black, White), - [LOAD_AVERAGE_FIVE] = ColorPair(Black, White), - [LOAD_AVERAGE_ONE] = ColorPair(Black, White), - [LOAD] = ColorPair(Black, White), - [HELP_BOLD] = ColorPair(Blue, White), - [HELP_SHADOW] = A_BOLD | ColorPair(Black, White), - [CLOCK] = ColorPair(Black, White), - [DATE] = ColorPair(Black, White), - [DATETIME] = ColorPair(Black, White), - [CHECK_BOX] = ColorPair(Blue, White), - [CHECK_MARK] = ColorPair(Black, White), - [CHECK_TEXT] = ColorPair(Black, White), - [HOSTNAME] = ColorPair(Black, White), - [CPU_NICE] = ColorPair(Cyan, White), - [CPU_NICE_TEXT] = ColorPair(Cyan, White), - [CPU_NORMAL] = ColorPair(Green, White), - [CPU_SYSTEM] = ColorPair(Red, White), - [CPU_IOWAIT] = A_BOLD | ColorPair(Black, White), - [CPU_IRQ] = ColorPair(Blue, White), - [CPU_SOFTIRQ] = ColorPair(Blue, White), - [CPU_STEAL] = ColorPair(Cyan, White), - [CPU_GUEST] = ColorPair(Cyan, White), - [PANEL_EDIT] = ColorPair(White, Blue), - [SCREENS_OTH_BORDER] = A_BOLD | ColorPair(Black, White), - [SCREENS_OTH_TEXT] = A_BOLD | ColorPair(Black, White), - [SCREENS_CUR_BORDER] = ColorPair(Green, Green), - [SCREENS_CUR_TEXT] = ColorPair(Black, Green), - [PRESSURE_STALL_THREEHUNDRED] = ColorPair(Black, White), - [PRESSURE_STALL_SIXTY] = ColorPair(Black, White), - [PRESSURE_STALL_TEN] = ColorPair(Black, White), - [ZFS_MFU] = ColorPair(Cyan, White), - [ZFS_MRU] = ColorPair(Yellow, White), - [ZFS_ANON] = ColorPair(Magenta, White), - [ZFS_HEADER] = ColorPair(Yellow, White), - [ZFS_OTHER] = ColorPair(Magenta, White), - [ZFS_COMPRESSED] = ColorPair(Cyan, White), - [ZFS_RATIO] = ColorPair(Magenta, White), - [ZRAM] = ColorPair(Yellow, White), - [DYNAMIC_GRAY] = ColorPair(Black, White), - [DYNAMIC_DARKGRAY] = A_BOLD | ColorPair(Black, White), - [DYNAMIC_RED] = ColorPair(Red, White), - [DYNAMIC_GREEN] = ColorPair(Green, White), - [DYNAMIC_BLUE] = ColorPair(Blue, White), - [DYNAMIC_CYAN] = ColorPair(Yellow, White), - [DYNAMIC_MAGENTA] = ColorPair(Magenta, White), - [DYNAMIC_YELLOW] = ColorPair(Yellow, White), - [DYNAMIC_WHITE] = A_BOLD | ColorPair(Black, White), - }, - [COLORSCHEME_LIGHTTERMINAL] = { - [RESET_COLOR] = ColorPair(Black, Black), - [DEFAULT_COLOR] = ColorPair(Black, Black), - [FUNCTION_BAR] = ColorPair(Black, Cyan), - [FUNCTION_KEY] = ColorPair(Black, Black), - [PANEL_HEADER_FOCUS] = ColorPair(Black, Green), - [PANEL_HEADER_UNFOCUS] = ColorPair(Black, Green), - [PANEL_SELECTION_FOCUS] = ColorPair(Black, Cyan), - [PANEL_SELECTION_FOLLOW] = ColorPair(Black, Yellow), - [PANEL_SELECTION_UNFOCUS] = ColorPair(Blue, Black), - [FAILED_SEARCH] = ColorPair(Red, Cyan), - [FAILED_READ] = ColorPair(Red, Black), - [PAUSED] = A_BOLD | ColorPair(Yellow, Cyan), - [UPTIME] = ColorPair(Yellow, Black), - [BATTERY] = ColorPair(Yellow, Black), - [LARGE_NUMBER] = ColorPair(Red, Black), - [METER_SHADOW] = A_BOLD | ColorPairGrayBlack, - [METER_TEXT] = ColorPair(Blue, Black), - [METER_VALUE] = ColorPair(Black, Black), - [METER_VALUE_ERROR] = A_BOLD | ColorPair(Red, Black), - [METER_VALUE_IOREAD] = ColorPair(Green, Black), - [METER_VALUE_IOWRITE] = ColorPair(Yellow, Black), - [METER_VALUE_NOTICE] = A_BOLD | ColorPairWhiteDefault, - [METER_VALUE_OK] = ColorPair(Green, Black), - [METER_VALUE_WARN] = A_BOLD | ColorPair(Yellow, Black), - [LED_COLOR] = ColorPair(Green, Black), - [TASKS_RUNNING] = ColorPair(Green, Black), - [PROCESS] = ColorPair(Black, Black), - [PROCESS_SHADOW] = A_BOLD | ColorPairGrayBlack, - [PROCESS_TAG] = ColorPair(White, Blue), - [PROCESS_MEGABYTES] = ColorPair(Blue, Black), - [PROCESS_GIGABYTES] = ColorPair(Green, Black), - [PROCESS_BASENAME] = ColorPair(Green, Black), - [PROCESS_TREE] = ColorPair(Blue, Black), - [PROCESS_RUN_STATE] = ColorPair(Green, Black), - [PROCESS_D_STATE] = A_BOLD | ColorPair(Red, Black), - [PROCESS_HIGH_PRIORITY] = ColorPair(Red, Black), - [PROCESS_LOW_PRIORITY] = ColorPair(Green, Black), - [PROCESS_NEW] = ColorPair(Black, Green), - [PROCESS_TOMB] = ColorPair(Black, Red), - [PROCESS_THREAD] = ColorPair(Blue, Black), - [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue, Black), - [PROCESS_COMM] = ColorPair(Magenta, Black), - [PROCESS_THREAD_COMM] = ColorPair(Yellow, Black), - [PROCESS_PRIV] = ColorPair(Magenta, Black), - [BAR_BORDER] = ColorPair(Blue, Black), - [BAR_SHADOW] = ColorPairGrayBlack, - [SWAP] = ColorPair(Red, Black), - [SWAP_CACHE] = ColorPair(Yellow, Black), - [GRAPH_1] = A_BOLD | ColorPair(Cyan, Black), - [GRAPH_2] = ColorPair(Cyan, Black), - [MEMORY_USED] = ColorPair(Green, Black), - [MEMORY_BUFFERS] = ColorPair(Cyan, Black), - [MEMORY_BUFFERS_TEXT] = ColorPair(Cyan, Black), - [MEMORY_CACHE] = ColorPair(Yellow, Black), - [MEMORY_SHARED] = ColorPair(Magenta, Black), - [HUGEPAGE_1] = ColorPair(Green, Black), - [HUGEPAGE_2] = ColorPair(Yellow, Black), - [HUGEPAGE_3] = ColorPair(Red, Black), - [HUGEPAGE_4] = ColorPair(Blue, Black), - [LOAD_AVERAGE_FIFTEEN] = ColorPair(Black, Black), - [LOAD_AVERAGE_FIVE] = ColorPair(Black, Black), - [LOAD_AVERAGE_ONE] = ColorPair(Black, Black), - [LOAD] = ColorPairWhiteDefault, - [HELP_BOLD] = ColorPair(Blue, Black), - [HELP_SHADOW] = A_BOLD | ColorPairGrayBlack, - [CLOCK] = ColorPairWhiteDefault, - [DATE] = ColorPairWhiteDefault, - [DATETIME] = ColorPairWhiteDefault, - [CHECK_BOX] = ColorPair(Blue, Black), - [CHECK_MARK] = ColorPair(Black, Black), - [CHECK_TEXT] = ColorPair(Black, Black), - [HOSTNAME] = ColorPairWhiteDefault, - [CPU_NICE] = ColorPair(Cyan, Black), - [CPU_NICE_TEXT] = ColorPair(Cyan, Black), - [CPU_NORMAL] = ColorPair(Green, Black), - [CPU_SYSTEM] = ColorPair(Red, Black), - [CPU_IOWAIT] = A_BOLD | ColorPair(Black, Black), - [CPU_IRQ] = A_BOLD | ColorPair(Blue, Black), - [CPU_SOFTIRQ] = ColorPair(Blue, Black), - [CPU_STEAL] = ColorPair(Black, Black), - [CPU_GUEST] = ColorPair(Black, Black), - [PANEL_EDIT] = ColorPair(White, Blue), - [SCREENS_OTH_BORDER] = ColorPair(Blue, Black), - [SCREENS_OTH_TEXT] = ColorPair(Blue, Black), - [SCREENS_CUR_BORDER] = ColorPair(Green, Green), - [SCREENS_CUR_TEXT] = ColorPair(Black, Green), - [PRESSURE_STALL_THREEHUNDRED] = ColorPair(Black, Black), - [PRESSURE_STALL_SIXTY] = ColorPair(Black, Black), - [PRESSURE_STALL_TEN] = ColorPair(Black, Black), - [ZFS_MFU] = ColorPair(Cyan, Black), - [ZFS_MRU] = ColorPair(Yellow, Black), - [ZFS_ANON] = A_BOLD | ColorPair(Magenta, Black), - [ZFS_HEADER] = ColorPair(Black, Black), - [ZFS_OTHER] = A_BOLD | ColorPair(Magenta, Black), - [ZFS_COMPRESSED] = ColorPair(Cyan, Black), - [ZFS_RATIO] = A_BOLD | ColorPair(Magenta, Black), - [ZRAM] = ColorPair(Yellow, Black), - [DYNAMIC_GRAY] = ColorPairGrayBlack, - [DYNAMIC_DARKGRAY] = A_BOLD | ColorPairGrayBlack, - [DYNAMIC_RED] = ColorPair(Red, Black), - [DYNAMIC_GREEN] = ColorPair(Green, Black), - [DYNAMIC_BLUE] = ColorPair(Blue, Black), - [DYNAMIC_CYAN] = ColorPair(Cyan, Black), - [DYNAMIC_MAGENTA] = ColorPair(Magenta, Black), - [DYNAMIC_YELLOW] = ColorPair(Yellow, Black), - [DYNAMIC_WHITE] = ColorPairWhiteDefault, - }, - [COLORSCHEME_MIDNIGHT] = { - [RESET_COLOR] = ColorPair(White, Blue), - [DEFAULT_COLOR] = ColorPair(White, Blue), - [FUNCTION_BAR] = ColorPair(Black, Cyan), - [FUNCTION_KEY] = A_NORMAL, - [PANEL_HEADER_FOCUS] = ColorPair(Black, Cyan), - [PANEL_HEADER_UNFOCUS] = ColorPair(Black, Cyan), - [PANEL_SELECTION_FOCUS] = ColorPair(Black, White), - [PANEL_SELECTION_FOLLOW] = ColorPair(Black, Yellow), - [PANEL_SELECTION_UNFOCUS] = A_BOLD | ColorPair(Yellow, Blue), - [FAILED_SEARCH] = ColorPair(Red, Cyan), - [FAILED_READ] = A_BOLD | ColorPair(Red, Blue), - [PAUSED] = A_BOLD | ColorPair(Yellow, Cyan), - [UPTIME] = A_BOLD | ColorPair(Yellow, Blue), - [BATTERY] = A_BOLD | ColorPair(Yellow, Blue), - [LARGE_NUMBER] = A_BOLD | ColorPair(Red, Blue), - [METER_SHADOW] = ColorPair(Cyan, Blue), - [METER_TEXT] = ColorPair(Cyan, Blue), - [METER_VALUE] = A_BOLD | ColorPair(Cyan, Blue), - [METER_VALUE_ERROR] = A_BOLD | ColorPair(Red, Blue), - [METER_VALUE_IOREAD] = ColorPair(Green, Blue), - [METER_VALUE_IOWRITE] = ColorPair(Black, Blue), - [METER_VALUE_NOTICE] = A_BOLD | ColorPair(White, Blue), - [METER_VALUE_OK] = ColorPair(Green, Blue), - [METER_VALUE_WARN] = A_BOLD | ColorPair(Yellow, Black), - [LED_COLOR] = ColorPair(Green, Blue), - [TASKS_RUNNING] = A_BOLD | ColorPair(Green, Blue), - [PROCESS] = ColorPair(White, Blue), - [PROCESS_SHADOW] = A_BOLD | ColorPair(Black, Blue), - [PROCESS_TAG] = A_BOLD | ColorPair(Yellow, Blue), - [PROCESS_MEGABYTES] = ColorPair(Cyan, Blue), - [PROCESS_GIGABYTES] = ColorPair(Green, Blue), - [PROCESS_BASENAME] = A_BOLD | ColorPair(Cyan, Blue), - [PROCESS_TREE] = ColorPair(Cyan, Blue), - [PROCESS_RUN_STATE] = ColorPair(Green, Blue), - [PROCESS_D_STATE] = A_BOLD | ColorPair(Red, Blue), - [PROCESS_HIGH_PRIORITY] = ColorPair(Red, Blue), - [PROCESS_LOW_PRIORITY] = ColorPair(Green, Blue), - [PROCESS_NEW] = ColorPair(Blue, Green), - [PROCESS_TOMB] = ColorPair(Blue, Red), - [PROCESS_THREAD] = ColorPair(Green, Blue), - [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Green, Blue), - [PROCESS_COMM] = ColorPair(Magenta, Blue), - [PROCESS_THREAD_COMM] = ColorPair(Black, Blue), - [PROCESS_PRIV] = ColorPair(Magenta, Blue), - [BAR_BORDER] = A_BOLD | ColorPair(Yellow, Blue), - [BAR_SHADOW] = ColorPair(Cyan, Blue), - [SWAP] = ColorPair(Red, Blue), - [SWAP_CACHE] = A_BOLD | ColorPair(Yellow, Blue), - [GRAPH_1] = A_BOLD | ColorPair(Cyan, Blue), - [GRAPH_2] = ColorPair(Cyan, Blue), - [MEMORY_USED] = A_BOLD | ColorPair(Green, Blue), - [MEMORY_BUFFERS] = A_BOLD | ColorPair(Cyan, Blue), - [MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Cyan, Blue), - [MEMORY_CACHE] = A_BOLD | ColorPair(Yellow, Blue), - [MEMORY_SHARED] = A_BOLD | ColorPair(Magenta, Blue), - [HUGEPAGE_1] = A_BOLD | ColorPair(Green, Blue), - [HUGEPAGE_2] = A_BOLD | ColorPair(Yellow, Blue), - [HUGEPAGE_3] = A_BOLD | ColorPair(Red, Blue), - [HUGEPAGE_4] = A_BOLD | ColorPair(White, Blue), - [LOAD_AVERAGE_FIFTEEN] = A_BOLD | ColorPair(Black, Blue), - [LOAD_AVERAGE_FIVE] = A_NORMAL | ColorPair(White, Blue), - [LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(White, Blue), - [LOAD] = A_BOLD | ColorPair(White, Blue), - [HELP_BOLD] = A_BOLD | ColorPair(Cyan, Blue), - [HELP_SHADOW] = A_BOLD | ColorPair(Black, Blue), - [CLOCK] = ColorPair(White, Blue), - [DATE] = ColorPair(White, Blue), - [DATETIME] = ColorPair(White, Blue), - [CHECK_BOX] = ColorPair(Cyan, Blue), - [CHECK_MARK] = A_BOLD | ColorPair(White, Blue), - [CHECK_TEXT] = A_NORMAL | ColorPair(White, Blue), - [HOSTNAME] = ColorPair(White, Blue), - [CPU_NICE] = A_BOLD | ColorPair(Cyan, Blue), - [CPU_NICE_TEXT] = A_BOLD | ColorPair(Cyan, Blue), - [CPU_NORMAL] = A_BOLD | ColorPair(Green, Blue), - [CPU_SYSTEM] = A_BOLD | ColorPair(Red, Blue), - [CPU_IOWAIT] = A_BOLD | ColorPair(Black, Blue), - [CPU_IRQ] = A_BOLD | ColorPair(Black, Blue), - [CPU_SOFTIRQ] = ColorPair(Black, Blue), - [CPU_STEAL] = ColorPair(White, Blue), - [CPU_GUEST] = ColorPair(White, Blue), - [PANEL_EDIT] = ColorPair(White, Blue), - [SCREENS_OTH_BORDER] = A_BOLD | ColorPair(Yellow, Blue), - [SCREENS_OTH_TEXT] = ColorPair(Cyan, Blue), - [SCREENS_CUR_BORDER] = ColorPair(Cyan, Cyan), - [SCREENS_CUR_TEXT] = ColorPair(Black, Cyan), - [PRESSURE_STALL_THREEHUNDRED] = A_BOLD | ColorPair(Black, Blue), - [PRESSURE_STALL_SIXTY] = A_NORMAL | ColorPair(White, Blue), - [PRESSURE_STALL_TEN] = A_BOLD | ColorPair(White, Blue), - [ZFS_MFU] = A_BOLD | ColorPair(White, Blue), - [ZFS_MRU] = A_BOLD | ColorPair(Yellow, Blue), - [ZFS_ANON] = A_BOLD | ColorPair(Magenta, Blue), - [ZFS_HEADER] = A_BOLD | ColorPair(Yellow, Blue), - [ZFS_OTHER] = A_BOLD | ColorPair(Magenta, Blue), - [ZFS_COMPRESSED] = A_BOLD | ColorPair(White, Blue), - [ZFS_RATIO] = A_BOLD | ColorPair(Magenta, Blue), - [ZRAM] = A_BOLD | ColorPair(Yellow, Blue), - [DYNAMIC_GRAY] = ColorPairGrayBlack, - [DYNAMIC_DARKGRAY] = A_BOLD | ColorPairGrayBlack, - [DYNAMIC_RED] = ColorPair(Red, Blue), - [DYNAMIC_GREEN] = ColorPair(Green, Blue), - [DYNAMIC_BLUE] = ColorPair(Black, Blue), - [DYNAMIC_CYAN] = ColorPair(Cyan, Blue), - [DYNAMIC_MAGENTA] = ColorPair(Magenta, Blue), - [DYNAMIC_YELLOW] = ColorPair(Yellow, Blue), - [DYNAMIC_WHITE] = ColorPair(White, Blue), - }, - [COLORSCHEME_BLACKNIGHT] = { - [RESET_COLOR] = ColorPair(Cyan, Black), - [DEFAULT_COLOR] = ColorPair(Cyan, Black), - [FUNCTION_BAR] = ColorPair(Black, Green), - [FUNCTION_KEY] = ColorPair(Cyan, Black), - [PANEL_HEADER_FOCUS] = ColorPair(Black, Green), - [PANEL_HEADER_UNFOCUS] = ColorPair(Black, Green), - [PANEL_SELECTION_FOCUS] = ColorPair(Black, Cyan), - [PANEL_SELECTION_FOLLOW] = ColorPair(Black, Yellow), - [PANEL_SELECTION_UNFOCUS] = ColorPair(Black, White), - [FAILED_SEARCH] = ColorPair(Red, Green), - [FAILED_READ] = A_BOLD | ColorPair(Red, Black), - [PAUSED] = A_BOLD | ColorPair(Yellow, Green), - [UPTIME] = ColorPair(Green, Black), - [BATTERY] = ColorPair(Green, Black), - [LARGE_NUMBER] = A_BOLD | ColorPair(Red, Black), - [METER_SHADOW] = A_BOLD | ColorPairGrayBlack, - [METER_TEXT] = ColorPair(Cyan, Black), - [METER_VALUE] = ColorPair(Green, Black), - [METER_VALUE_ERROR] = A_BOLD | ColorPair(Red, Black), - [METER_VALUE_IOREAD] = ColorPair(Green, Black), - [METER_VALUE_IOWRITE] = ColorPair(Blue, Black), - [METER_VALUE_NOTICE] = A_BOLD | ColorPair(White, Black), - [METER_VALUE_OK] = ColorPair(Green, Black), - [METER_VALUE_WARN] = A_BOLD | ColorPair(Yellow, Black), - [LED_COLOR] = ColorPair(Green, Black), - [TASKS_RUNNING] = A_BOLD | ColorPair(Green, Black), - [PROCESS] = ColorPair(Cyan, Black), - [PROCESS_SHADOW] = A_BOLD | ColorPairGrayBlack, - [PROCESS_TAG] = A_BOLD | ColorPair(Yellow, Black), - [PROCESS_MEGABYTES] = A_BOLD | ColorPair(Green, Black), - [PROCESS_GIGABYTES] = A_BOLD | ColorPair(Yellow, Black), - [PROCESS_BASENAME] = A_BOLD | ColorPair(Green, Black), - [PROCESS_TREE] = ColorPair(Cyan, Black), - [PROCESS_THREAD] = ColorPair(Green, Black), - [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue, Black), - [PROCESS_COMM] = ColorPair(Magenta, Black), - [PROCESS_THREAD_COMM] = ColorPair(Yellow, Black), - [PROCESS_RUN_STATE] = ColorPair(Green, Black), - [PROCESS_D_STATE] = A_BOLD | ColorPair(Red, Black), - [PROCESS_HIGH_PRIORITY] = ColorPair(Red, Black), - [PROCESS_LOW_PRIORITY] = ColorPair(Green, Black), - [PROCESS_NEW] = ColorPair(Black, Green), - [PROCESS_TOMB] = ColorPair(Black, Red), - [PROCESS_PRIV] = ColorPair(Magenta, Black), - [BAR_BORDER] = A_BOLD | ColorPair(Green, Black), - [BAR_SHADOW] = ColorPair(Cyan, Black), - [SWAP] = ColorPair(Red, Black), - [SWAP_CACHE] = ColorPair(Yellow, Black), - [GRAPH_1] = A_BOLD | ColorPair(Green, Black), - [GRAPH_2] = ColorPair(Green, Black), - [MEMORY_USED] = ColorPair(Green, Black), - [MEMORY_BUFFERS] = ColorPair(Blue, Black), - [MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Blue, Black), - [MEMORY_CACHE] = ColorPair(Yellow, Black), - [MEMORY_SHARED] = ColorPair(Magenta, Black), - [HUGEPAGE_1] = ColorPair(Green, Black), - [HUGEPAGE_2] = ColorPair(Yellow, Black), - [HUGEPAGE_3] = ColorPair(Red, Black), - [HUGEPAGE_4] = ColorPair(Blue, Black), - [LOAD_AVERAGE_FIFTEEN] = ColorPair(Green, Black), - [LOAD_AVERAGE_FIVE] = ColorPair(Green, Black), - [LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(Green, Black), - [LOAD] = A_BOLD, - [HELP_BOLD] = A_BOLD | ColorPair(Cyan, Black), - [HELP_SHADOW] = A_BOLD | ColorPairGrayBlack, - [CLOCK] = ColorPair(Green, Black), - [CHECK_BOX] = ColorPair(Green, Black), - [CHECK_MARK] = A_BOLD | ColorPair(Green, Black), - [CHECK_TEXT] = ColorPair(Cyan, Black), - [HOSTNAME] = ColorPair(Green, Black), - [CPU_NICE] = ColorPair(Blue, Black), - [CPU_NICE_TEXT] = A_BOLD | ColorPair(Blue, Black), - [CPU_NORMAL] = ColorPair(Green, Black), - [CPU_SYSTEM] = ColorPair(Red, Black), - [CPU_IOWAIT] = ColorPair(Yellow, Black), - [CPU_IRQ] = A_BOLD | ColorPair(Blue, Black), - [CPU_SOFTIRQ] = ColorPair(Blue, Black), - [CPU_STEAL] = ColorPair(Cyan, Black), - [CPU_GUEST] = ColorPair(Cyan, Black), - [PANEL_EDIT] = ColorPair(White, Cyan), - [SCREENS_OTH_BORDER] = ColorPair(White, Black), - [SCREENS_OTH_TEXT] = ColorPair(Cyan, Black), - [SCREENS_CUR_BORDER] = A_BOLD | ColorPair(White, Black), - [SCREENS_CUR_TEXT] = A_BOLD | ColorPair(Green, Black), - [PRESSURE_STALL_THREEHUNDRED] = ColorPair(Green, Black), - [PRESSURE_STALL_SIXTY] = ColorPair(Green, Black), - [PRESSURE_STALL_TEN] = A_BOLD | ColorPair(Green, Black), - [ZFS_MFU] = ColorPair(Blue, Black), - [ZFS_MRU] = ColorPair(Yellow, Black), - [ZFS_ANON] = ColorPair(Magenta, Black), - [ZFS_HEADER] = ColorPair(Yellow, Black), - [ZFS_OTHER] = ColorPair(Magenta, Black), - [ZFS_COMPRESSED] = ColorPair(Blue, Black), - [ZFS_RATIO] = ColorPair(Magenta, Black), - [ZRAM] = ColorPair(Yellow, Black), - [DYNAMIC_GRAY] = ColorPairGrayBlack, - [DYNAMIC_DARKGRAY] = A_BOLD | ColorPairGrayBlack, - [DYNAMIC_RED] = ColorPair(Red, Black), - [DYNAMIC_GREEN] = ColorPair(Green, Black), - [DYNAMIC_BLUE] = ColorPair(Blue, Black), - [DYNAMIC_CYAN] = ColorPair(Cyan, Black), - [DYNAMIC_MAGENTA] = ColorPair(Magenta, Black), - [DYNAMIC_YELLOW] = ColorPair(Yellow, Black), - [DYNAMIC_WHITE] = ColorPair(White, Black), - }, - [COLORSCHEME_BROKENGRAY] = { 0 } // dynamically generated. -}; - -int CRT_scrollHAmount = 5; - -int CRT_scrollWheelVAmount = 10; - -ColorScheme CRT_colorScheme = COLORSCHEME_DEFAULT; - -ATTR_NORETURN -static void CRT_handleSIGTERM(ATTR_UNUSED int sgn) { - CRT_done(); - _exit(0); -} - -#ifndef NDEBUG - -static int stderrRedirectNewFd = -1; -static int stderrRedirectBackupFd = -1; - -static int createStderrCacheFile(void) { -#if defined(HAVE_MEMFD_CREATE) - return memfd_create("htop.stderr-redirect", 0); -#elif defined(O_TMPFILE) - return open("/tmp", O_TMPFILE | O_CREAT | O_EXCL | O_RDWR, S_IRUSR | S_IWUSR); -#else - char tmpName[] = "htop.stderr-redirectXXXXXX"; - mode_t curUmask = umask(S_IXUSR | S_IRWXG | S_IRWXO); - int r = mkstemp(tmpName); - umask(curUmask); - if (r < 0) - return r; - - (void) unlink(tmpName); - - return r; -#endif /* HAVE_MEMFD_CREATE */ -} - -static void redirectStderr(void) { - stderrRedirectNewFd = createStderrCacheFile(); - if (stderrRedirectNewFd < 0) { - /* ignore failure */ - return; - } - - stderrRedirectBackupFd = dup(STDERR_FILENO); - dup2(stderrRedirectNewFd, STDERR_FILENO); -} - -static void dumpStderr(void) { - if (stderrRedirectNewFd < 0) - return; - - fsync(STDERR_FILENO); - dup2(stderrRedirectBackupFd, STDERR_FILENO); - close(stderrRedirectBackupFd); - stderrRedirectBackupFd = -1; - lseek(stderrRedirectNewFd, 0, SEEK_SET); - - bool header = false; - char buffer[8192]; - for (;;) { - errno = 0; - ssize_t res = read(stderrRedirectNewFd, buffer, sizeof(buffer)); - if (res < 0) { - if (errno == EINTR) - continue; - - break; - } - - if (res == 0) { - break; - } - - if (res > 0) { - if (!header) { - fprintf(stderr, ">>>>>>>>>> stderr output >>>>>>>>>>\n"); - header = true; - } - full_write(STDERR_FILENO, buffer, res); - } - } - - if (header) - fprintf(stderr, "\n<<<<<<<<<< stderr output <<<<<<<<<<\n"); - - close(stderrRedirectNewFd); - stderrRedirectNewFd = -1; -} - -void CRT_debug_impl(const char* file, size_t lineno, const char* func, const char* fmt, ...) { - va_list args; - - fprintf(stderr, "[%s:%zu (%s)]: ", file, lineno, func); - va_start(args, fmt); - vfprintf(stderr, fmt, args); - va_end(args); - fprintf(stderr, "\n"); -} - -#else /* !NDEBUG */ - -static void redirectStderr(void) { -} - -static void dumpStderr(void) { -} - -#endif /* !NDEBUG */ - -static struct sigaction old_sig_handler[32]; - -static void CRT_installSignalHandlers(void) { - struct sigaction act; - sigemptyset (&act.sa_mask); - act.sa_flags = (int)SA_RESETHAND | SA_NODEFER; - act.sa_handler = CRT_handleSIGSEGV; - sigaction (SIGSEGV, &act, &old_sig_handler[SIGSEGV]); - sigaction (SIGFPE, &act, &old_sig_handler[SIGFPE]); - sigaction (SIGILL, &act, &old_sig_handler[SIGILL]); - sigaction (SIGBUS, &act, &old_sig_handler[SIGBUS]); - sigaction (SIGPIPE, &act, &old_sig_handler[SIGPIPE]); - sigaction (SIGSYS, &act, &old_sig_handler[SIGSYS]); - sigaction (SIGABRT, &act, &old_sig_handler[SIGABRT]); - - signal(SIGCHLD, SIG_DFL); - signal(SIGINT, CRT_handleSIGTERM); - signal(SIGTERM, CRT_handleSIGTERM); - signal(SIGQUIT, CRT_handleSIGTERM); -} - -void CRT_resetSignalHandlers(void) { - sigaction (SIGSEGV, &old_sig_handler[SIGSEGV], NULL); - sigaction (SIGFPE, &old_sig_handler[SIGFPE], NULL); - sigaction (SIGILL, &old_sig_handler[SIGILL], NULL); - sigaction (SIGBUS, &old_sig_handler[SIGBUS], NULL); - sigaction (SIGPIPE, &old_sig_handler[SIGPIPE], NULL); - sigaction (SIGSYS, &old_sig_handler[SIGSYS], NULL); - sigaction (SIGABRT, &old_sig_handler[SIGABRT], NULL); - - signal(SIGINT, SIG_DFL); - signal(SIGTERM, SIG_DFL); - signal(SIGQUIT, SIG_DFL); -} - -#ifdef HAVE_GETMOUSE -void CRT_setMouse(bool enabled) { - if (enabled) { -#if NCURSES_MOUSE_VERSION > 1 - mousemask(BUTTON1_RELEASED | BUTTON4_PRESSED | BUTTON5_PRESSED, NULL); -#else - mousemask(BUTTON1_RELEASED, NULL); -#endif - } else { - mousemask(0, NULL); - } -} -#endif - -void CRT_init(const Settings* settings, bool allowUnicode) { - initscr(); - redirectStderr(); - noecho(); - CRT_crashSettings = settings; - CRT_delay = &(settings->delay); - CRT_colors = CRT_colorSchemes[settings->colorScheme]; - CRT_colorScheme = settings->colorScheme; - - for (int i = 0; i < LAST_COLORELEMENT; i++) { - unsigned int color = CRT_colorSchemes[COLORSCHEME_DEFAULT][i]; - CRT_colorSchemes[COLORSCHEME_BROKENGRAY][i] = color == (A_BOLD | ColorPairGrayBlack) ? ColorPair(White, Black) : color; - } - - halfdelay(*CRT_delay); - nonl(); - intrflush(stdscr, false); - keypad(stdscr, true); -#ifdef HAVE_GETMOUSE - mouseinterval(0); -#endif - curs_set(0); - - if (has_colors()) { - start_color(); - } - - const char* termType = getenv("TERM"); - if (termType && String_eq(termType, "linux")) { - CRT_scrollHAmount = 20; - } else { - CRT_scrollHAmount = 5; - } - - if (termType && (String_startsWith(termType, "xterm") || String_eq(termType, "vt220"))) { -#ifdef HTOP_NETBSD -#define define_key(s_, k_) define_key((char*)s_, k_) -IGNORE_WCASTQUAL_BEGIN -#endif - define_key("\033[H", KEY_HOME); - define_key("\033[F", KEY_END); - define_key("\033[7~", KEY_HOME); - define_key("\033[8~", KEY_END); - define_key("\033OP", KEY_F(1)); - define_key("\033OQ", KEY_F(2)); - define_key("\033OR", KEY_F(3)); - define_key("\033OS", KEY_F(4)); - define_key("\033O2R", KEY_F(15)); - define_key("\033[11~", KEY_F(1)); - define_key("\033[12~", KEY_F(2)); - define_key("\033[13~", KEY_F(3)); - define_key("\033[14~", KEY_F(4)); - define_key("\033[14;2~", KEY_F(15)); - define_key("\033[17;2~", KEY_F(18)); - define_key("\033[Z", KEY_SHIFT_TAB); - char sequence[3] = "\033a"; - for (char c = 'a'; c <= 'z'; c++) { - sequence[1] = c; - define_key(sequence, KEY_ALT('A' + (c - 'a'))); - } -#ifdef HTOP_NETBSD -IGNORE_WCASTQUAL_END -#undef define_key -#endif - } - if (termType && (String_startsWith(termType, "rxvt"))) { - define_key("\033[Z", KEY_SHIFT_TAB); - } - - CRT_installSignalHandlers(); - - use_default_colors(); - if (!has_colors()) - CRT_colorScheme = COLORSCHEME_MONOCHROME; - CRT_setColors(CRT_colorScheme); - -#ifdef HAVE_LIBNCURSESW - if (allowUnicode && String_eq(nl_langinfo(CODESET), "UTF-8")) { - CRT_utf8 = true; - } else { - CRT_utf8 = false; - } -#else - (void) allowUnicode; -#endif - - CRT_treeStr = -#ifdef HAVE_LIBNCURSESW - CRT_utf8 ? CRT_treeStrUtf8 : -#endif - CRT_treeStrAscii; - - CRT_setMouse(settings->enableMouse); - - CRT_degreeSign = initDegreeSign(); -} - -void CRT_done(void) { - int resetColor = CRT_colors ? CRT_colors[RESET_COLOR] : CRT_colorSchemes[COLORSCHEME_DEFAULT][RESET_COLOR]; - - attron(resetColor); - mvhline(LINES - 1, 0, ' ', COLS); - attroff(resetColor); - refresh(); - - curs_set(1); - endwin(); - - dumpStderr(); -} - -void CRT_fatalError(const char* note) { - const char* sysMsg = strerror(errno); - CRT_done(); - fprintf(stderr, "%s: %s\n", note, sysMsg); - exit(2); -} - -int CRT_readKey(void) { - nocbreak(); - cbreak(); - nodelay(stdscr, FALSE); - int ret = getch(); - halfdelay(*CRT_delay); - return ret; -} - -void CRT_disableDelay(void) { - nocbreak(); - cbreak(); - nodelay(stdscr, TRUE); -} - -void CRT_enableDelay(void) { - halfdelay(*CRT_delay); -} - -void CRT_setColors(int colorScheme) { - CRT_colorScheme = colorScheme; - - for (short int i = 0; i < 8; i++) { - for (short int j = 0; j < 8; j++) { - if (ColorIndex(i, j) != ColorIndexGrayBlack && ColorIndex(i, j) != ColorIndexWhiteDefault) { - short int bg = (colorScheme != COLORSCHEME_BLACKNIGHT) - ? (j == 0 ? -1 : j) - : j; - init_pair(ColorIndex(i, j), i, bg); - } - } - } - - short int grayBlackFg = COLORS > 8 ? 8 : 0; - short int grayBlackBg = (colorScheme != COLORSCHEME_BLACKNIGHT) ? -1 : 0; - init_pair(ColorIndexGrayBlack, grayBlackFg, grayBlackBg); - - init_pair(ColorIndexWhiteDefault, White, -1); - - CRT_colors = CRT_colorSchemes[colorScheme]; -} - -#ifdef PRINT_BACKTRACE -static void print_backtrace(void) { -#if defined(HAVE_LIBUNWIND_H) && defined(HAVE_LIBUNWIND) - unw_context_t context; - unw_getcontext(&context); - - unw_cursor_t cursor; - unw_init_local(&cursor, &context); - - unsigned int item = 0; - - while (unw_step(&cursor) > 0) { - unw_word_t pc; - unw_get_reg(&cursor, UNW_REG_IP, &pc); - if (pc == 0) - break; - - char symbolName[256] = "?"; - unw_word_t offset = 0; - unw_get_proc_name(&cursor, symbolName, sizeof(symbolName), &offset); - - unw_proc_info_t pip; - pip.unwind_info = 0; - - const char* fname = "?"; - const void* ptr = 0; - if (unw_get_proc_info(&cursor, &pip) == 0) { - ptr = (const void*)(pip.start_ip + offset); - - #ifdef HAVE_DLADDR - Dl_info dlinfo; - if (dladdr(ptr, &dlinfo) && dlinfo.dli_fname && *dlinfo.dli_fname) - fname = dlinfo.dli_fname; - #endif - } - - const char* frame = ""; - if (unw_is_signal_frame(&cursor) > 0) - frame = "{signal frame}"; - - fprintf(stderr, "%2u: %#14lx %s (%s+%#lx) [%p]%s%s\n", item++, pc, fname, symbolName, offset, ptr, frame ? " " : "", frame); - } -#elif defined(HAVE_EXECINFO_H) - void* backtraceArray[256]; - - size_t size = backtrace(backtraceArray, ARRAYSIZE(backtraceArray)); - backtrace_symbols_fd(backtraceArray, size, STDERR_FILENO); -#else -#error No implementation for print_backtrace()! -#endif -} -#endif - -void CRT_handleSIGSEGV(int signal) { - CRT_done(); - - fprintf(stderr, "\n\n" - "FATAL PROGRAM ERROR DETECTED\n" - "============================\n" - "Please check at https://htop.dev/issues whether this issue has already been reported.\n" - "If no similar issue has been reported before, please create a new issue with the following information:\n" - " - Your "PACKAGE" version: '"VERSION"'\n" - " - Your OS and kernel version (uname -a)\n" - " - Your distribution and release (lsb_release -a)\n" - " - Likely steps to reproduce (How did it happen?)\n" - ); - -#ifdef PRINT_BACKTRACE - fprintf(stderr, " - Backtrace of the issue (see below)\n"); -#endif - - fprintf(stderr, - "\n" - ); - - const char* signal_str = strsignal(signal); - if (!signal_str) { - signal_str = "unknown reason"; - } - fprintf(stderr, - "Error information:\n" - "------------------\n" - "A signal %d (%s) was received.\n" - "\n", - signal, signal_str - ); - - fprintf(stderr, - "Setting information:\n" - "--------------------\n"); - Settings_write(CRT_crashSettings, true); - fprintf(stderr, "\n\n"); - -#ifdef PRINT_BACKTRACE - fprintf(stderr, - "Backtrace information:\n" - "----------------------\n" - ); - - print_backtrace(); - - fprintf(stderr, - "\n" - "To make the above information more practical to work with, " - "please also provide a disassembly of your "PACKAGE" binary. " - "This can usually be done by running the following command:\n" - "\n" - ); - -#ifdef HTOP_DARWIN - fprintf(stderr, " otool -tvV `which "PACKAGE"` > ~/htop.otool\n"); -#else - fprintf(stderr, " objdump -d -S -w `which "PACKAGE"` > ~/htop.objdump\n"); -#endif - - fprintf(stderr, - "\n" - "Please include the generated file in your report.\n" - ); -#endif - - fprintf(stderr, - "Running this program with debug symbols or inside a debugger may provide further insights.\n" - "\n" - "Thank you for helping to improve "PACKAGE"!\n" - "\n" - ); - - /* Call old sigsegv handler; may be default exit or third party one (e.g. ASAN) */ - if (sigaction (signal, &old_sig_handler[signal], NULL) < 0) { - /* This avoids an infinite loop in case the handler could not be reset. */ - fprintf(stderr, - "!!! Chained handler could not be restored. Forcing exit.\n" - ); - _exit(1); - } - - /* Trigger the previous signal handler. */ - raise(signal); - - // Always terminate, even if installed handler returns - fprintf(stderr, - "!!! Chained handler did not exit. Forcing exit.\n" - ); - _exit(1); -} diff --git a/fedora/.local/bin/htop-vim/CRT.h b/fedora/.local/bin/htop-vim/CRT.h deleted file mode 100644 index bf5e460..0000000 --- a/fedora/.local/bin/htop-vim/CRT.h +++ /dev/null @@ -1,209 +0,0 @@ -#ifndef HEADER_CRT -#define HEADER_CRT -/* -htop - CRT.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" - -#include - -#include "Macros.h" -#include "ProvideCurses.h" -#include "Settings.h" - - -typedef enum TreeStr_ { - TREE_STR_VERT, - TREE_STR_RTEE, - TREE_STR_BEND, - TREE_STR_TEND, - TREE_STR_OPEN, - TREE_STR_SHUT, - TREE_STR_ASC, - TREE_STR_DESC, - LAST_TREE_STR -} TreeStr; - -typedef enum ColorScheme_ { - COLORSCHEME_DEFAULT, - COLORSCHEME_MONOCHROME, - COLORSCHEME_BLACKONWHITE, - COLORSCHEME_LIGHTTERMINAL, - COLORSCHEME_MIDNIGHT, - COLORSCHEME_BLACKNIGHT, - COLORSCHEME_BROKENGRAY, - LAST_COLORSCHEME -} ColorScheme; - -typedef enum ColorElements_ { - RESET_COLOR, - DEFAULT_COLOR, - FUNCTION_BAR, - FUNCTION_KEY, - FAILED_SEARCH, - FAILED_READ, - PAUSED, - PANEL_HEADER_FOCUS, - PANEL_HEADER_UNFOCUS, - PANEL_SELECTION_FOCUS, - PANEL_SELECTION_FOLLOW, - PANEL_SELECTION_UNFOCUS, - LARGE_NUMBER, - METER_SHADOW, - METER_TEXT, - METER_VALUE, - METER_VALUE_ERROR, - METER_VALUE_IOREAD, - METER_VALUE_IOWRITE, - METER_VALUE_NOTICE, - METER_VALUE_OK, - METER_VALUE_WARN, - LED_COLOR, - UPTIME, - BATTERY, - TASKS_RUNNING, - SWAP, - SWAP_CACHE, - PROCESS, - PROCESS_SHADOW, - PROCESS_TAG, - PROCESS_MEGABYTES, - PROCESS_GIGABYTES, - PROCESS_TREE, - PROCESS_RUN_STATE, - PROCESS_D_STATE, - PROCESS_BASENAME, - PROCESS_HIGH_PRIORITY, - PROCESS_LOW_PRIORITY, - PROCESS_NEW, - PROCESS_TOMB, - PROCESS_THREAD, - PROCESS_THREAD_BASENAME, - PROCESS_COMM, - PROCESS_THREAD_COMM, - PROCESS_PRIV, - BAR_BORDER, - BAR_SHADOW, - GRAPH_1, - GRAPH_2, - MEMORY_USED, - MEMORY_BUFFERS, - MEMORY_BUFFERS_TEXT, - MEMORY_CACHE, - MEMORY_SHARED, - HUGEPAGE_1, - HUGEPAGE_2, - HUGEPAGE_3, - HUGEPAGE_4, - LOAD, - LOAD_AVERAGE_FIFTEEN, - LOAD_AVERAGE_FIVE, - LOAD_AVERAGE_ONE, - CHECK_BOX, - CHECK_MARK, - CHECK_TEXT, - CLOCK, - DATE, - DATETIME, - HELP_BOLD, - HELP_SHADOW, - HOSTNAME, - CPU_NICE, - CPU_NICE_TEXT, - CPU_NORMAL, - CPU_SYSTEM, - CPU_IOWAIT, - CPU_IRQ, - CPU_SOFTIRQ, - CPU_STEAL, - CPU_GUEST, - PANEL_EDIT, - SCREENS_OTH_BORDER, - SCREENS_OTH_TEXT, - SCREENS_CUR_BORDER, - SCREENS_CUR_TEXT, - PRESSURE_STALL_TEN, - PRESSURE_STALL_SIXTY, - PRESSURE_STALL_THREEHUNDRED, - ZFS_MFU, - ZFS_MRU, - ZFS_ANON, - ZFS_HEADER, - ZFS_OTHER, - ZFS_COMPRESSED, - ZFS_RATIO, - ZRAM, - DYNAMIC_GRAY, - DYNAMIC_DARKGRAY, - DYNAMIC_RED, - DYNAMIC_GREEN, - DYNAMIC_BLUE, - DYNAMIC_CYAN, - DYNAMIC_MAGENTA, - DYNAMIC_YELLOW, - DYNAMIC_WHITE, - LAST_COLORELEMENT -} ColorElements; - -void CRT_fatalError(const char* note) ATTR_NORETURN; - -#ifdef NDEBUG -# define CRT_debug(...) -#else -void CRT_debug_impl(const char* file, size_t lineno, const char* func, const char* fmt, ...) ATTR_FORMAT(printf, 4, 5); -# define CRT_debug(...) CRT_debug_impl(__FILE__, __LINE__, __func__, __VA_ARGS__) -#endif - -void CRT_handleSIGSEGV(int signal) ATTR_NORETURN; - -#define KEY_WHEELUP KEY_F(30) -#define KEY_WHEELDOWN KEY_F(31) -#define KEY_RECLICK KEY_F(32) -#define KEY_SHIFT_TAB KEY_F(33) -#define KEY_ALT(x) (KEY_F(64 - 26) + ((x) - 'A')) - -extern const char* CRT_degreeSign; - -#ifdef HAVE_LIBNCURSESW - -extern bool CRT_utf8; - -#endif - -extern const char* const* CRT_treeStr; - -extern const int* CRT_colors; - -extern int CRT_cursorX; - -extern int CRT_scrollHAmount; - -extern int CRT_scrollWheelVAmount; - -extern ColorScheme CRT_colorScheme; - -#ifdef HAVE_GETMOUSE -void CRT_setMouse(bool enabled); -#else -#define CRT_setMouse(enabled) -#endif - -void CRT_init(const Settings* settings, bool allowUnicode); - -void CRT_done(void); - -void CRT_resetSignalHandlers(void); - -int CRT_readKey(void); - -void CRT_disableDelay(void); - -void CRT_enableDelay(void); - -void CRT_setColors(int colorScheme); - -#endif diff --git a/fedora/.local/bin/htop-vim/CategoriesPanel.c b/fedora/.local/bin/htop-vim/CategoriesPanel.c deleted file mode 100644 index 3cac073..0000000 --- a/fedora/.local/bin/htop-vim/CategoriesPanel.c +++ /dev/null @@ -1,177 +0,0 @@ -/* -htop - CategoriesPanel.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "CategoriesPanel.h" - -#include -#include -#include - -#include "AvailableColumnsPanel.h" -#include "AvailableMetersPanel.h" -#include "ColorsPanel.h" -#include "DisplayOptionsPanel.h" -#include "FunctionBar.h" -#include "Header.h" -#include "HeaderLayout.h" -#include "HeaderOptionsPanel.h" -#include "ListItem.h" -#include "Macros.h" -#include "MetersPanel.h" -#include "Object.h" -#include "ProvideCurses.h" -#include "ScreensPanel.h" -#include "Vector.h" -#include "XUtils.h" - - -static const char* const CategoriesFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL}; - -static void CategoriesPanel_delete(Object* object) { - Panel* super = (Panel*) object; - CategoriesPanel* this = (CategoriesPanel*) object; - Panel_done(super); - free(this); -} - -static void CategoriesPanel_makeMetersPage(CategoriesPanel* this) { - size_t columns = HeaderLayout_getColumns(this->scr->header->headerLayout); - MetersPanel** meterPanels = xMallocArray(columns, sizeof(MetersPanel*)); - - for (size_t i = 0; i < columns; i++) { - char titleBuffer[32]; - xSnprintf(titleBuffer, sizeof(titleBuffer), "Column %zu", i + 1); - meterPanels[i] = MetersPanel_new(this->settings, titleBuffer, this->header->columns[i], this->scr); - - if (i != 0) { - meterPanels[i]->leftNeighbor = meterPanels[i - 1]; - meterPanels[i - 1]->rightNeighbor = meterPanels[i]; - } - - ScreenManager_add(this->scr, (Panel*) meterPanels[i], 20); - } - - Panel* availableMeters = (Panel*) AvailableMetersPanel_new(this->settings, this->header, columns, meterPanels, this->scr, this->pl); - ScreenManager_add(this->scr, availableMeters, -1); -} - -static void CategoriesPanel_makeDisplayOptionsPage(CategoriesPanel* this) { - Panel* displayOptions = (Panel*) DisplayOptionsPanel_new(this->settings, this->scr); - ScreenManager_add(this->scr, displayOptions, -1); -} - -static void CategoriesPanel_makeColorsPage(CategoriesPanel* this) { - Panel* colors = (Panel*) ColorsPanel_new(this->settings); - ScreenManager_add(this->scr, colors, -1); -} - -static void CategoriesPanel_makeScreensPage(CategoriesPanel* this) { - Panel* screens = (Panel*) ScreensPanel_new(this->settings); - Panel* columns = (Panel*) ((ScreensPanel*)screens)->columns; - Panel* availableColumns = (Panel*) AvailableColumnsPanel_new(columns, this->settings->dynamicColumns); - ScreenManager_add(this->scr, screens, 20); - ScreenManager_add(this->scr, columns, 20); - ScreenManager_add(this->scr, availableColumns, -1); -} - -static void CategoriesPanel_makeHeaderOptionsPage(CategoriesPanel* this) { - Panel* colors = (Panel*) HeaderOptionsPanel_new(this->settings, this->scr); - ScreenManager_add(this->scr, colors, -1); -} - -typedef void (* CategoriesPanel_makePageFunc)(CategoriesPanel* ref); -typedef struct CategoriesPanelPage_ { - const char* name; - CategoriesPanel_makePageFunc ctor; -} CategoriesPanelPage; - -static const CategoriesPanelPage categoriesPanelPages[] = { - { .name = "Display options", .ctor = CategoriesPanel_makeDisplayOptionsPage }, - { .name = "Header layout", .ctor = CategoriesPanel_makeHeaderOptionsPage }, - { .name = "Meters", .ctor = CategoriesPanel_makeMetersPage }, - { .name = "Screens", .ctor = CategoriesPanel_makeScreensPage }, - { .name = "Colors", .ctor = CategoriesPanel_makeColorsPage }, -}; - -static HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) { - CategoriesPanel* this = (CategoriesPanel*) super; - - HandlerResult result = IGNORED; - - int selected = Panel_getSelectedIndex(super); - - switch (ch) { - case 'k': ch = KEY_UP; break; - case 'j': ch = KEY_DOWN; break; - case 'h': ch = KEY_LEFT; break; - case 'l': ch = KEY_RIGHT; break; - } - - switch (ch) { - case EVENT_SET_SELECTED: - result = HANDLED; - break; - case KEY_UP: - case KEY_CTRL('P'): - case KEY_DOWN: - case KEY_CTRL('N'): - case KEY_NPAGE: - case KEY_PPAGE: - case KEY_HOME: - case KEY_END: { - int previous = selected; - Panel_onKey(super, ch); - selected = Panel_getSelectedIndex(super); - if (previous != selected) - result = HANDLED; - break; - } - default: - if (0 < ch && ch < 255 && isgraph((unsigned char)ch)) - result = Panel_selectByTyping(super, ch); - if (result == BREAK_LOOP) - result = IGNORED; - break; - } - if (result == HANDLED) { - int size = ScreenManager_size(this->scr); - for (int i = 1; i < size; i++) - ScreenManager_remove(this->scr, 1); - - if (selected >= 0 && (size_t)selected < ARRAYSIZE(categoriesPanelPages)) { - categoriesPanelPages[selected].ctor(this); - } - } - return result; -} - -const PanelClass CategoriesPanel_class = { - .super = { - .extends = Class(Panel), - .delete = CategoriesPanel_delete - }, - .eventHandler = CategoriesPanel_eventHandler -}; - -CategoriesPanel* CategoriesPanel_new(ScreenManager* scr, Settings* settings, Header* header, ProcessList* pl) { - CategoriesPanel* this = AllocThis(CategoriesPanel); - Panel* super = (Panel*) this; - FunctionBar* fuBar = FunctionBar_new(CategoriesFunctions, NULL, NULL); - Panel_init(super, 1, 1, 1, 1, Class(ListItem), true, fuBar); - - this->scr = scr; - this->settings = settings; - this->header = header; - this->pl = pl; - Panel_setHeader(super, "Categories"); - for (size_t i = 0; i < ARRAYSIZE(categoriesPanelPages); i++) - Panel_add(super, (Object*) ListItem_new(categoriesPanelPages[i].name, 0)); - - ScreenManager_add(scr, super, 16); - categoriesPanelPages[0].ctor(this); - return this; -} diff --git a/fedora/.local/bin/htop-vim/CategoriesPanel.h b/fedora/.local/bin/htop-vim/CategoriesPanel.h deleted file mode 100644 index 825cd06..0000000 --- a/fedora/.local/bin/htop-vim/CategoriesPanel.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef HEADER_CategoriesPanel -#define HEADER_CategoriesPanel -/* -htop - CategoriesPanel.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Header.h" -#include "Panel.h" -#include "ProcessList.h" -#include "ScreenManager.h" -#include "Settings.h" - - -typedef struct CategoriesPanel_ { - Panel super; - ScreenManager* scr; - - Settings* settings; - Header* header; - ProcessList* pl; -} CategoriesPanel; - -extern const PanelClass CategoriesPanel_class; - -CategoriesPanel* CategoriesPanel_new(ScreenManager* scr, Settings* settings, Header* header, ProcessList* pl); - -#endif diff --git a/fedora/.local/bin/htop-vim/ChangeLog b/fedora/.local/bin/htop-vim/ChangeLog deleted file mode 100644 index 5717a52..0000000 --- a/fedora/.local/bin/htop-vim/ChangeLog +++ /dev/null @@ -1,1095 +0,0 @@ -What's new in version 3.2.2 - -* CPUMeter now can show frequency in text mode -* Add option to render distribution path prefixes shadowed -* DiskIOMeter converts to bytes per second (not per interval) -* DiskIOMeter uses complete units, including missing "iB/s" -* DiskIOMeter indicates read and write in meter mode -* NetworkIOMeter converts to packets per second, shows packet rate -* Allow continued process following when changing display settings -* Update the panel header when changing to another tab -* Drop margin around the header if there are no meters -* Use Unicode replacement character for non-printable characters -* Default color preset uses bold blue for better visibility -* Update the Panel header on sort order inversions ('I') -* Toggle the header meters with pound key -* Fix ScreenPanel to handle quitting the panel while renaming -* Add fallback for HOME environment variable using passwd database -* Replace meaningless ID column with FD column in lock screen -* Use device format in the lock screen matching the files screen -* On Linux, improvements to file-descriptor lock detection -* On Linux, further distinguish systemd states in the SystemdMeter -* On Linux, improvements to cgroup and container identification -* On Linux, support openat(2) without readlinkat(2) platforms -* On Darwin, fix current process buffer handling for busy systems -* On DragonFly BSD, fix incorrect processor time of processes -* On FreeBSD, fix an issue with the memory graph not showing correctly -* On FreeBSD, add support for displaying shared memory usage -* On PCP, use pmLookupDescs(3) if available for efficiency -* On PCP, normalize generic columns values for consistent display -* On PCP, changes preparing for configurable, dynamic screens -* Handle invalid process columns from the configuration file -* Avoid undefined behaviour with deeply nested processes -* Fix crash when removing the currently active screen -* Prevent possible crash on a very early error path -* Include automake for Debian/Ubuntu -* Restore non-mouse support -* Reject unsupported command line arguments -* Document idle process state -* Clarify M_TRS/M_DRS columns - -What's new in version 3.2.1 - -* Fix setting to show all branches collapsed by default -* Restore functionality of stripExeFromCmdline setting -* Fix some command line display settings not being honored without restart -* Display single digit precision for CPU% greater than 99.9% -* On Linux, FreeBSD and PCP consider only shrinkable ZFS ARC as cache -* On Linux, increase field width of CPUD% and SWAPD% columns -* Colorize process state characters in help screen -* Use mousemask(3X) to enable and disable mouse control -* Fix heap buffer overflow in Vector_compact -* On Solaris, fix a process time scaling error -* On Solaris, fix the build -* On NetBSD, OpenBSD and Solaris ensure env buffer size is sufficient -* On Linux, resolve processes exiting interfering with sampling -* Fix ProcessList quadratic removal when scanning processes -* Under LXC, limit CPU count to that given by /proc/cpuinfo -* Improve container detection for LXC -* Some minor documentation fixes - -What's new in version 3.2.0 - -* Support for displaying multiple tabs in the user interface -* Allow multiple filter and search terms (logical OR, separate by "|") -* Set correct default sorting direction (defaultSortDesc) -* Improve performance for process lookup and update -* Rework the IOMeters initial display -* Removed duplicate sections on COMM and EXE -* Highlight process UNINTERRUPTIBLE_WAIT state (D) -* Show only integer value when CPU% more than 99.9% -* Handle rounding ambiguity between 99.9 and 100.0% -* No longer leaves empty the last column in header -* Fix header layout and meters reset if a header column is empty -* Fix PID and UID column widths off-by-one error -* On Linux, read generic sysfs batteries -* On Linux, do not collect LRS per thread (it is process-wide) -* On Linux, dynamically adjust the SECATTR and CGROUP column widths -* On Linux, fix a crash in LXD -* On FreeBSD, add support for showing process emulation -* On Darwin, lazily set process TTY name -* Always set SIGCHLD to default handling -* Avoid zombie processes on signal races -* Ensure last line is cleared when SIGINT is received -* Instead of SIGTERM, pre-select the last sent signal -* Internal Hashtable performance and sizing improvements -* Add heuristics for guessing LXC or Docker from /proc/1/mounts -* Force elapsed time display to zero if process started in the future -* Avoid extremely large year values when printing time -* Fix division by zero when calculating IO rates -* Fix out of boundary writes in XUtils -* Fix custom thread name display issue -* Use AC_CANONICAL_HOST, not AC_CANONICAL_TARGET in configure.ac -* Support libunwind of LLVM - -What's new in version 3.1.2 - -* Bugfix for crash when storing modified settings at exit -* Generate xz-compressed source tarball (with configure) using github actions -* Allow -u UID with numerical value as argument -* Added documentation for obsolete/state libraries/program files highlighting -* Some obsolete/stale library highlighting refinements -* Column width issues resolved -* Dynamic UID column sizing improved -* Discard stale information from Disk and Network I/O meters -* Refined Linux kernel thread detection -* Reworked process state handling -* New CCGROUP column showing abbreviated cgroup name -* New OFFSET column in the list of open files screen - -What's new in version 3.1.1 - -* Update license headers to explicitly say GPLv2+ -* Document minimum version for libcap (thanks to James Brown) -* Fix mouse wheel collision with autogroups nice adjustment -* Adjust Makefile.am macro definitions for older automake versions -* Ensure consistent reporting of MemoryMeter 'used' memory -* Report hugepage memory as real and used memory (as before) -* Handle procExeDeleted, usesDeletedLib without mergedCommandline mode -* Validate meter configuration before proceeding beyond htoprc parsing -* Properly release memory on partially read configuration -* Handle interrupted sampling from within libpcp PDU transfers -* On Linux, provide O_PATH value if not defined -* On Linux, always compute procExeDeleted if already set -* Workaround for Rosetta 2 on Darwin (thanks to Alexander Momchilov) -* Fix FreeBSD cmdline memory leak in Process_updateCmdline, and -* Plug a Disk I/O meter memory leak on FreeBSD (thanks to Ximalas) - -What's new in version 3.1.0 - -* Updated COPYING file to remove the PLPA exemption (appendix 2) - With this change the license is now GPLv2 without any additional wording. -* Improved default sort ordering - Note for users: This may lead to an inverted sort order on startup of - htop 3.1.0 compared to previous versions. - This is due to what is stored in your htoprc file. Solution: Press I - (to invert sort order). - This changed setting will be saved by htop on exit as long as it can - write to your htoprc file. -* The compile-time option to cater specifically for running htop as - setuid has been removed -* Add read-only option - This allows htop to be run in an non-intrusive fashion where it acts only - as a process viewer disabling all functions to manipulate system state. - Note: This is not a security feature! -* Move the code for handling the command line formatting related tasks - to be shared across all platforms - This means important features like stale binary/library highlighting - can now be available on all supported platforms. -* Make the EXE and COMM columns available on all platforms - All supported platforms have the name of the executable (EXE) and a - self-chosen thread/command name (COMM) available one way or the other. - Moving this column to be handled as a platform-independently available - information simplifies the markup of the command line. -* Introduce configuration file versioning and config_reader_min_version - Starting with this version the configuration file contains a version - identifying the minimum version of the configuration parser needed to - fully understand the configuration file format. - Old configuration file formats are automatically upgraded when - saving the config file (htoprc). -* Make the configuration parser friendlier to users (thanks to Bart Bakker) - With this change only settings that cannot be parsed properly are - reset to their defaults. -* Improve default display for systems with many CPUs -* Add the process ELAPSED time column -* Improve the process STATE column sorting -* Reworked handling resize and redrawing of the UI -* Fixed an issue where the LED meter mode could overflow allotted space -* Allow text mode Meters to span empty neighbors to the right -* Rescale graph meters when value of total changes - (thanks to Michael Schรถnitzer) -* Update generic process field display - Usually "uninteresting" values in columns like 1 thread, nice value - of 0, CPU and memory of 0%, idle/sleeping state, etc. are shown with - reduced intensity (dark grey) -* Option and key ("*") to collapse / expand all branches under PID 1 - (and PID 2 if kernel threads are shown) (thanks to Krishna Chaitanya) -* Keep following a process when inverting the sort order, displaying - the help screen or hiding/unhiding userland threads. - If a thread is currently selected the selection is updated to point - to the thread's parent process. (thanks to Gonzalo, et.al.) -* Reorder process scanning to be performed before updating the display - of the meters in the header -* Always check the user for a process for any changes. - This affects multiple platforms that previously didn't correctly handle - the user field for a process to change at runtime (e.g. due to seteuid - or similar syscalls). -* Disable mouse option when support is unavailable -* Support curses libraries without ncurses mouse support - (thanks to Santhosh Raju) -* Support offline and hot-swapping of CPUs on all platforms -* Fix the CPU Meter for machines with more than 256 CPUs -* Supplemented the "show updated/deleted executables" feature (red basename) - to indicate when linked libraries were updated (yellow basename) -* Apply the stale binary highlighting for the EXE column in addition to - the command line field -* Add new combined Memory and Swap meter -* Implement bar and graph mode for NetworkIO Meter - (thanks to Michael F. Schรถnitzer) -* Rework TTY column to be more consistent across platforms -* Make the CWD column generally available on all platforms - (thanks to Santhosh Raju et. al.) -* Add Performance Co-Pilot (PCP) platform support - This is added via a separate pcp-htop(1) binary which provides remote host - analysis, new Meters for any PCP metric and new Columns for any PCP process - metric - see the pcp-htop(5) man page for further details. - (thanks to Sohaib Mohamed) -* Add Linux columns and key bindings for process autogroup identifier - and nice value -* Change available and used memory reporting on Linux to be based on - MemAvailable (Kernel 3.14+) (thanks to Chris Cheney and Tomas Wido) -* Add a new SysArchMeter showing kernel and platform information - (thanks to ahgamut) -* Linux memory usage explicitly treats tmpfs memory usage as shared memory - This is to make memory used by tmpfs visible as this cannot be freed - unlike normal filesystem cache data. -* Exclude zram devices when calculating DiskIO on Linux -* Use PATH lookup for systemctl in systemd meter (thanks to Scott Olson) -* Add native platform support for NetBSD - This allows htop to run on NetBSD without the need for active Linux - emulation of the procfs filesystem. - (thanks to Santhosh Raju and Nia Alarie) -* Add NetworkIO, DiskIO, CPU frequency, and battery meter support on NetBSD - (thanks to Nia Alarie) -* Fix NetBSD display of in-use and cached memory (thanks to Nia Alarie) -* Rework NetBSD CPU and memory accounting (thanks to Santhosh Raju) -* Fix NetBSD accounting of user and kernel threads (thanks to Santhosh Raju) -* Initial work to allow building with default libcurses on NetBSD - (thanks to Santhosh Raju) -* FreeBSD updates - implement process majflt and processor column values -* Add FreeBSD support for CPU frequency and temperature -* Fixes and cleanups for ZFS Meters and metrics -* Correctly color the ZFS ARC ratio (thanks to Ross Williams) -* Bugfixes related to CPU time display/calculations for darwin on M1 systems - (thanks to Alexander Momchilov) -* Harmonize the handling of multiple batteries across different platforms. - The system is now considered to run on AC if at least one power supply - marked as AC is found in the system. - Battery capacity is summed up over all batteries found. - This also changes the old behavior that batteries reported by the - system after the first AC adapter where sometimes ignored. -* Correctly handle multiple batteries on Darwin. - Resolves a possible memory leak on systems with multiple batteries. -* Handle Linux Shmem being part of Cached in the MemoryMeter -* Add SwapCached to the Linux swap meter (thanks to David Zarzycki) -* Convert process time to days if applicable (thanks to David Zarzycki) -* Always show the number of threads in the TaskMeter, even when threads - are not shown in the process list -* Fix Linux --drop-capabilities option handling -* Correctly detect failure to initialize Linux boottime -* Overhaul the Linux memory fields to partition them like free(1) now does -* Improve the Linux process I/O column values -* Rework the libsensors parsing on Linux -* Update the MemoryMeter to display shared memory -* Update OpenBSD platform - implement additional columns, scan LWP, - proper markup for STATE, show CPU frequency -* Fix the tree view on OpenBSD when hiding kernel threads -* Remove old InfoScreen lines before re-scanning (thanks to ร˜ystein Hiรฅsen) -* Document historic naming of Light-Weight Processes column aka threads -* Improve user interaction when the last process entry is selected -* Draw the panel header on the TraceScreen (thanks to Youngjae Lee) -* Add mouse wheel scroll and fix mouse selection on the InfoScreen - (thanks to Youngjae Lee) -* Add a HugepageMeter and subtract hugepages from normal memory -* Display wide characters in LED meters and restore non-wide ncurses support -* Add command line option to drop Linux capabilities -* Support scheduler affinity on platforms beyond Linux -* Report on any failure to write the configuration file -* Cache stderr to be able to print assert messages. - These messages are shown in case htop terminates unexpectedly. -* Print current settings on crash -* Reset signal handlers on program exit -* Add configure script option to create a static htop binary -* Resolved longer-standing compilation issues on Solaris/Illumos -* Check for availability of set_escdelay in configure - (thanks to Stefan Polluks) -* Build system updates for autotools 2.70 - -What's new in version 3.0.5 - -* BUGFIX / SECURITY: InfoScreen: fix uncontrolled format string -* BUGFIX: Improve white text in the Light Terminal colour scheme - (both of the above thanks to V) -* Enable the function bar on the main screen to be hidden (see Setup -> Display options) -* BUGFIX: Reduce layout issues esp. around printing wide characters (not complete yet) -* BUGFIX: Make the follow function exit cleanly after followed process died -* Solaris: make Process callbacks static -* Update help and man page for improved -t / -s options -* Drop usage of formatted error messages from -* Show arrow indicating order of sorted process column -* Lots of plumbing around the internal Hashtable, hardening and code cleanups -* LibSensors: add support for Ryzen CPUs - (thanks to Matej Dian) -* BUGFIX: Fix CPU percentage on M1 silicon Macs - (thanks to Luke Groeninger) -* LoadMeter: dynamically adjust color and total of bar -* Find libsensors.so.4 for Fedora and friends -* Add support to display CPU frequencies on Solarish platforms - (thanks to Dominik Hassler) -* Enable going back to previous search matches (Shift-F3) -* Added keybind 'N' for sorting by PID (drops 'n'/'N' as not used before much) - (thanks to Jake Mannens) - -What's new in version 3.0.4 - -* Separate tree and list sort orders -* Invert Process_compare so that superclass matches run first - (thanks to Hisham Muhammad) -* Unhardcode Mac OS tick-to-milliseconds conversion - (thanks to Alexander Momchilov) -* Check if clock_gettime needs linking of librt -* Define O_PATH if not already defined - (thanks to Chris Burr) -* Add column on Mac for processes running under translation - (thanks to Dรกniel Bakai) -* Configure check for additional linker flags for keypad(3) -* PSI Meter: constant width and only print ten-duration as bar -* Sort in paused mode after inverting sort order -* Handle absence of package CPU temperature -* Meter: restore non-wide-character build -* LibSensors: restore temperature for Raspberry Pi -* MainPanel: do not reset hideProcessSelection on KEY_SHUFFLE -* BarMeter: rework text padding -* Panel: rework drawing of FunctionBar -* Meter: fix artifacts with very tiny width -* DragonFlyBSD updates -* BUGFIX: Fix dlopen issue for libsensors5 for some platforms -* BUGFIX: Fix broken tree display on inverted sort order -* BUGFIX: Fix pause mode ("Z") in tree view -* BUGFIX: Correct timebase for non-x86 CPUs on Darwin -* BUGFIX: Avoid NULL dereference on zombie processes -* Document dynamic bindings and assumed external configuration -* Update key mapping documentation for sorting - -What's new in version 3.0.3 - -* Process sorting in 'tree' mode - (thanks to Maxim Zhiburt) -* Improved command display/sort functionality - (thanks to Narendran Gopalakrishnan) -* Add screen for active file locks - (thanks to Fynn J. Wulf) -* Calculate library size (M_LRS column) from maps file - (thanks to Fynn J. Wulf) -* Add a Zram meter - (thanks to Murloc Knight) -* Add Linux cwd process column -* Dynamically load libsensors at runtime -* Improve PressureStall Meter display strings -* Hide process selection on ESC -* Fully support non-ascii characters in Meter-Bar -* Add support to change numeric options in settings screen -* Rename virtual memory column from M_SIZE to M_VIRT -* Add process column for normalized CPU usage -* Show CPU temperature in CPU meter -* Drop hideThreads Setting -* Add a systemd meter -* Add a network IO meter -* Add a SELinux meter -* Compress size of default FunctionBar -* Updates to the OpenFiles screen -* Continue updating header data in paused mode -* BUGFIX: Handle data wraparounds in IO meters -* BUGFIX: Update InfoScreen content on resize -* Add security attribute process column -* Add DiskIOMeter for IO read/write usage -* Read CPU frequency from sysfs by default -* Add Linux process column for context switches -* Several FreeBSD and Mac OS X platform updates - (thanks to Christian Gรถttsche) -* Add process environment for FreeBSD - (thanks to Ross Williams) -* Parse POWER_SUPPLY_CAPACITY for Linux Battery meter - (thanks to Jan Palus) -* Add octuple-column CPU meters. -* BUGFIX: On Linux consider ZFS ARC to be cache - (thanks to @multi) -* BUGFIX: Limit screen title length to window width -* Show selected command wrapped in a separate window - (thanks to @ryenus) -* Allow to pass '/' for item search -* Document implicit incremental search -* Handle 'q' as quit if first character -* Avoid expensive build of process tree when not using it -* Include documentation for COMM and EXE -* Distinguish display of no permissions for reading M_LRS -* Only calculate M_LRS size every 2 seconds -* Improvements to comm / cmdline display functionality -* Merged view for COMM, EXE and cmdline - (thanks to Narendran Gopalakrishnan and Benny Baumann) -* Consistent kernel thread display for COMM/EXE columns -* Central fault handling for all platforms -* Handle parsing envID & VPid from process status file -* Use threshold for display of guest/steal/irq meters -* Enhance highlighting of semi-large and large numbers -* Documentation on the repository style guide - (thanks to Benny Baumann) -* Align processor identifier to the right - (thanks to Christian Hesse) -* Document M_PSS, M_PSSWP, M_SWAP in man page -* Add Date and DateTime meters - (thanks to Michael F. Schรถnitzer) -* BUGFIX: Fix Solaris 11.4 due to missing ZFS ARC kstats - (thanks to @senjan) -* Code hardening, speedups, fd and memory leak fixes - (thanks to Christian Gรถttsche and Benny Baumann) -* Number CPUs from zero by default - (thanks to Zev Weiss) -* Remove residual python checks during the build process - (thanks to Stephen Gregoratto) - -What's new in version 3.0.2 - -* BUGFIX: Drop 'vim_mode' - several issues, needs rethink -* BUGFIX: fix regression in -u optional-argument handling -* Build system rework to remove python, header generation - (thanks to Zev Weiss and Hugo Musso Gualandi) -* BUGFIX: report nice level correctly on Solaris - (thanks to Dominik Hassler) -* CI, code quality improvements - (thanks to Tobias Kortkamp, Christian Hesse, Benny Baumann) - -What's new in version 3.0.1 - -* Coverity fixes, CI improvements, documentation updates -* BUGFIX: Fix early exit with longer sysfs battery paths -* BUGFIX: Improve OOM output, fix sorting - (thanks to Christian Gรถttsche) -* Rework check buttons and tree open/closed - (thanks to Bert Wesarg) -* Add -U/--no-unicode option to disable unicode - (thanks to Christian Hesse) -* Improvements to the affinity panel - (thanks to Bert Wesarg) - -What's new in version 3.0.0 - -* New maintainers - after a prolonged period of inactivity - from Hisham, the creator and original maintainer, a team - of community maintainers have volunteered to take over a - fork at https://htop.dev and https://github.com/htop-dev - to keep the project going. -* Support ZFS ARC statistics - (thanks to Ross Williams) -* Support more than 2 smaller CPU meter columns - (thanks to Christoph Budziszewski) -* Support Linux proportional set size metrics - (thanks to @linvinus, @ntninja and @himikof) -* Support Linux pressure stall information metrics - (thanks to Ran Benita) -* New display option to show CPU frequency in CPU meters - (thanks to Arnav Singh) -* Update Linux sysfs battery discovery for recent kernels - (thanks to @smattie) -* Add hardware topology information in the affinity panel - (thanks to Bert Wesarg) -* Add timestamp reporting to the strace screen - (thanks to Mario Harjac) -* Add simple, optional vim key mapping mode - (thanks to Daniel Flanagan) -* Added an option to disable the mouse - (thanks to MartinJM) -* Add Solaris11 compatibility - (thanks to Jan Senolt) -* Without an argument -u uses $USER value automatically - (thanks to @solanav) -* Support less(1) search navigation shortcuts - (thanks to @syrrim) -* Update the FreeBSD maximum PID to match FreeBSD change - (thanks to @multiplexd) -* Report values larger than 100 terabytes - (thanks to @adrien1018) -* Widen ST_UID (UID) column to allow for UIDs > 9999 - (thanks to DLange) -* BUGFIX: fix makefiles for building with clang - (thanks to Jorge Pereira) -* BUGFIX: fix major() usage - (thanks to @wataash and Kang-Che Sung) -* BUGFIX: fix the STARTTIME column on FreeBSD - (thanks to Rob Crowston) -* BUGFIX: truncate overwide jail names on FreeBSD - (thanks to Rob Crowston) -* BUGFIX: fix reported memory values on FreeBSD - (thanks to Tobias Kortkamp) -* BUGFIX: fix reported CPU meter values on OpenBSD - (thanks to @motet-a) -* BUGFIX: correctly identify other types of zombie process - (thanks to @joder) -* BUGFIX: improve follow-process handling in some situations - (thanks to @wangqr) -* BUGFIX: fix custom meters reverting to unexpected setting - (thanks to @wangqr) -* BUGFIX: close pipe after running lsof(1) - (thanks to Jesin) -* BUGFIX: meters honour setting of counting CPUs from 0/1 - (thanks to @rnsanchez) - -What's new in version 2.2.0 - -* Solaris/Illumos/OpenIndiana support - (thanks to Guy M. Broome) -* -t/--tree flag for starting in tree-view mode - (thanks to Daniel Flanagan) -* macOS: detects High Sierra version to avoid OS bug - (thanks to Pierre Malhaire) -* OpenBSD: read battery data - (thanks to @nerd972) -* Various automake and build improvements - (thanks to Kang-Che Sung) -* Check for pkg-config when building with --enable-delayacct - (thanks to @florian2833z for the report) -* Avoid some bashisms in configure script - (thanks to Jesin) -* Use CFLAGS from ncurses*-config if present - (thanks to Michael Klein) -* Header generator supports non-UTF-8 environments - (thanks to @volkov-am) -* Linux: changed detection of kernel threads -* Collapse current subtree pressing Backspace -* BUGFIX: fix behavior of SYSCR column - (thanks to Marc Kleine-Budde) -* BUGFIX: obtain exit code of lsof correctly - (thanks to @wangqr) -* BUGFIX: fix crash with particular keycodes - (thanks to Wellington Torrejais da Silva for the report) -* BUGFIX: fix issue with small terminals - (thanks to Daniel Elf for the report) -* BUGFIX: fix terminal color issues - (thanks to Kang-Che Sung for the report) -* BUGFIX: preserve LDFLAGS when building - (thanks to Lance Frederickson for the report) -* BUGFIX: fixed overflow for systems with >= 100 signals - -What's new in version 2.1.0 - -* Linux: Delay accounting metrics - (thanks to Andrรฉ Carvalho) -* DragonFlyBSD support - (thanks to Diederik de Groot) -* Support for real-time signals - (thanks to Kang-Che Sung) -* 'c' key now works with threads as well -* Session column renamed from SESN to SID - (thanks to Kamyar Rasta) -* Improved UI for meter style selection - (thanks to Kang-Che Sung) -* Improved code for constructing process tree - (thanks to wangqr) -* Compile-time option to disable setuid -* Error checking of various standard library operations -* Replacement of sprintf with snprintf - (thanks to Tomasz Kramkowski) -* Linux: performance improvements in battery meter -* Linux: update process TTY device -* Linux: add support for sorting TASK_IDLE - (thanks to Vladimir Panteleev) -* Linux: add upper-bound to running process counter - (thanks to Lucas Correia Villa Real) -* BUGFIX: avoid crash when battery is removed - (thanks to Jan Chren) -* BUGFIX: macOS: fix infinite loop in tree view - (thanks to Wataru Ashihara) - -What's new in version 2.0.2 - -* Mac OS X: stop trying when task_for_pid fails for a process, - stops spamming logs with errors. -* Add Ctrl+A and Ctrl+E to go to beginning and end of line -* FreeBSD: fixes for CPU calculation - (thanks to Tim Creech, Andy Pilate) -* Usability: auto-follow process after a search. -* Use Linux backend on GNU Hurd -* Improvement for reproducible builds. -* BUGFIX: Fix behavior of Alt-key combinations - (thanks to Kang-Che Sung) -* Various code tweaks and cleanups - (thanks to Kang-Che Sung) - -What's new in version 2.0.1 - -* OpenBSD: Various fixes and improvements - (thanks to Michael McConville and Juan Francisco Cantero Hurtado) -* FreeBSD: fix CPU and memory readings - (thanks to Tim Creech, Hung-Yi Chen, Bernard Spil, Greg V) -* FreeBSD: add battery support - (thanks to Greg V) -* Linux: Retain last-obtained name of a zombie process -* Mac OS X: Improve portability for OS X versions - (thanks to Michael Klein) -* Mac OS X: Fix reading command-line arguments and basename -* Mac OS X: Fix process state information -* Mac OS X: Fix tree view collapsing/expanding -* Mac OS X: Fix tree organization -* Mac OS X: Fix memory accounting -* Fix crash when emptying a column of meters -* Make Esc key more responsive - -What's new in version 2.0.0 - -* Platform abstraction layer -* Initial FreeBSD support -* Initial Mac OS X support - (thanks to David Hunt) -* Swap meter for Mac OSX - (thanks to ศ˜tefan Rusu) -* OpenBSD port - (thanks to Michael McConville) -* FreeBSD support improvements - (thanks to Martin Misuth) -* Support for NCurses 6 ABI, including mouse wheel support -* Much improved mouse responsiveness -* Process environment variables screen - (thanks to Michael Klein) -* Higher-resolution UTF-8 based Graph mode - (Thanks to James Hall from vtop for the idea!) -* Show program path settings - (thanks to Tobias Geerinckx-Rice) -* BUGFIX: Fix crash when scrolling an empty filtered list. -* Use dynamic units for text display, and several fixes - (thanks to Christian Hesse) -* BUGFIX: fix error caused by overflow in usertime calculation. - (thanks to Patrick Marlier) -* Catch all memory allocation errors - (thanks to Michael McConville for the push) -* Several tweaks and bugfixes - (See the Git log for details and contributors!) - -What's new in version 1.0.3 - -* Tag all children ('c' key) -* Fixes in accounting of guest time when using virtualization - (thanks to Patrick Marlier) -* Performance improvements - (thanks to Jann Horn) -* Further performance improvements due to conditional parsing - of IO data depending on selected fields. -* Better consistency in coloring. -* Increase limit of buffer when tracing a deep nested process tree. -* Display pagefault stats. -* BUGFIX: Fix crash when adding meters and toggling detailed CPU time. - (thanks to Dawid Gajownik) -* Add column to track the OOM-killer score of processes - (thanks to Leigh Simpson) - -What's new in version 1.0.2 - -* Add IO priority support ('i' key) -* Avoid deleting .htoprc if it is a symlink -* Fail gracefully when /proc is not mounted - (thanks to Philipp Hagemeister) -* Option to update process names on every refresh - (thanks to Rob Hoelz) -* BUGFIX: Fix crashes when process list is empty - -What's new in version 1.0.1 - -* Move .htoprc to XDG-compliant path ~/.config/htop/htoprc, - respecting $XDG_CONFIG_HOME - (thanks to Hadzhimurad Ustarkhan for the suggestion.) -* Safer behavior on the kill screen, to make it harder to kill the wrong process. -* Fix for building in FreeBSD 8.2 - (thanks to Trond Endrestol) -* BUGFIX: behavior of 'F' (follow) key was broken, also affecting the - persistence of mouse selections. -* BUGFIX: keep main panel up-to-date when running the screen manager, - to fix crash when processes die while on the F9/Kill screen. - -What's new in version 1.0 - -* Performance improvements -* Support for splitting CPU meters into two or four columns - (thanks to Wim Heirman) -* Switch from PLPA, which is now deprecated, to HWLOC. -* Bring back support for native Linux sched_setaffinity, - so we don't have to use HWLOC where we don't need to. -* Support for typing in user names and column fields in selection panels. -* Support for UTF-8 tree drawing - (thanks to Bin Guo) -* Option for counting CPUs from zero - (thanks to Sean Noonan) -* Meters update in every screen (no longer halting while on Setup, etc.) -* Stricter checks for command-line options - (thanks to Sebastian Pipping) -* Incremental filtering - (thanks to Seth Heeren for the idea and initial implementation) -* Try harder to find the ncurses header - (thanks to Moritz Barsnick) -* Man page updates - (thanks to Vincent Launchbury) -* BUGFIX: Support larger numbers for process times. - (thanks to Tristan Nakagawa for the report.) -* BUGFIX: Segfault in BarMeterMode_draw() for small terminal widths - (patch by Sebastian Pipping) - -What's new in version 0.9 - -* Add support for "steal"/guest CPU time measurement - in virtualization environments -* Expand and collapse subtrees using '+' and '-' when in tree-view -* Support for cgroups - (thanks to Guillaume Zitta and Daniel Lezcano) -* Show custom thread names - (thanks to Anders Torger) -* Add support for STARTTIME field -* Upgrade PLPA to version 1.3.2 -* Fix license terms with regard to PLPA - (thanks to Tom Callaway) -* getopt-based long options and --no-color - (thanks to Vincent Launchbury) -* BUGFIX: Fix display of nan% in CPU meters - (thanks to Steven Hampson) -* BUGFIX: Fix memory leak - (thanks to Pavol Rusnak) -* Add Bash/emacs style navigation keys - (thanks to Daniel Schuler) -* Improve battery meter support - (thanks to Richard W.) -* BUGFIX: Fix IO-wait color in "Black on White" scheme -* BUGFIX: Fix search by process name when list is filtered by user. - (thanks to Sergej Pupykin for the report.) -* BUGFIX: Fix alignment for display of memory values above 100G (sign of the times!) - (thanks to Jan van Haarst for the report.) - -What's new in version 0.8.3 - -* BUGFIX: Fix crash on F6 key - (thanks to Rainer Suhm) -* BUGFIX: Fix a minor bug which affected the build process. - -What's new in version 0.8.2 - -* Integrated lsof (press 'l') -* Fix display of gigabyte-sized values - (thanks to Andika Triwidada) -* Option to display hostname in the meters area -* Rename VEID to CTID in OpenVZ systems - (thanks to Thorsten Schifferdecker) -* Corrections to the desktop entry file - (thanks by Samuli Suominen) -* BUGFIX: Correct page size calculation for FreeBSD systems - (thanks to Andrew Paulsen) -* Allow compilation without PLPA on systems that don't support it - (thanks to Timothy Redaelli) -* BUGFIX: Fix missing tree view when userland threads are hidden - (thanks to Josh Stone) -* BUGFIX: Fix for VPID on OpenVZ systems - (thanks to Wolfgang Frisch) - -What's new in version 0.8.1 - -* Linux-VServer support - (thanks to Jonathan Sambrook and Benedikt Bohm) -* Battery meter - (thanks to Ian Page Hands) -* BUGFIX: Fix collection of IO stats in multithreaded processes - (thanks to Gerhard Heift) -* Remove assertion that fails on hardened kernels - (thanks to Wolfram Schlich for the report) - -What's new in version 0.8 - -* Ability to change sort column with the mouse by - clicking column titles (click again to invert order) -* Add support for Linux per-process IO statistics, - enabled with the --enable-taskstats flag, which - requires a kernel compiled with taskstats support. - (thanks to Tobias Oetiker) -* Add Unicode support, enabled with the --enable-unicode - flag, which requires libncursesw. - (thanks to Sergej Pupykin) -* BUGFIX: Fix display of CPU count for threaded processes. - When user threads are hidden, process now shows the - sum of processor usage for all processors. When user - threads are displayed, each thread shows its own - processor usage, including the root thread. - (thanks to Bert Wesarg for the report) -* BUGFIX: avoid crashing when using many meters - (thanks to David Cho for the report) - -What's new in version 0.7 - -* CPU affinity configuration ('a' key) -* Improve display of tree view, properly nesting - threads of the same app based on TGID. -* IO-wait time now counts as idle time, which is a more - accurate description. It is still available in - split time, now called detailed CPU time. - (thanks to Samuel Thibault for the report) -* BUGFIX: Correct display of TPGID field -* Add TGID field -* BUGFIX: Don't crash with invalid command-line flags - (thanks to Nico Golde for the report) -* Fix GCC 4.3 compilation issues - (thanks to Martin Michlmayr for the report) -* OpenVZ support, enabled at compile-time with - the --enable-openvz flag. - (thanks to Sergey Lychko) - -What's new in version 0.6.6 - -* Add support of NLWP field - (thanks to Bert Wesarg) -* BUGFIX: Fix use of configurable /proc location - (thanks to Florent Thoumie) -* Fix memory percentage calculation and make it saner - (thanks to Olev Kartau for the report) -* Added display of DRS, DT, LRS and TRS - (thanks to Matthias Lederhofer) -* BUGFIX: LRS and DRS memory values were flipped - (thanks to Matthias Lederhofer) -* BUGFIX: Don't crash on very high UIDs - (thanks to Egmont Koblinger) - -What's new in version 0.6.5 - -* Add hardened-debug flags for debugging with Hardened GCC -* BUGFIX: Handle error condition when a directory vanishes - from /proc -* BUGFIX: Fix leak of process command line -* BUGFIX: Collect orphaned items when arranging the tree view. - (thanks to Wolfram Schlich for assistance with debugging) -* Separate proc and memory debugging into separate #defines. -* BUGFIX: Fix message when configure fails due to - missing libraries - (thanks to Jon) -* BUGFIX: Don't truncate value when displaying a very large - process - (thanks to Bo Liu) - -What's new in version 0.6.4 - -* Add an option to split the display of kernel time - in the CPU meter into system, IO-wait, IRQ and soft-IRQ. - (thanks to Philipp Richter) -* --sort-key flag in the command-line, overriding the - saved setting in .htoprc for the session. - (thanks to Rodolfo Borges) -* BUGFIX: Fixed string overflow on uptime display. - (thanks to Marc Cahalan) - -What's new in version 0.6.3 - -* Performance improvements: uses much less CPU than the - previous release with the default setup. -* Use 64-bit values when storing processor times to - avoid overflow. -* Memory consumption improvements, compensating storage - of 64-bit values. -* Internal change: rename TypedVector to Vector and - ListBox (and related classes) to Panel. -* Have configure actually fail when needed libraries or - headers are not found. -* Horizontally scroll in larger increments when on the - Linux console because of slow update of unaccelerated fb -* No longer untag processes after sending a signal - (useful for when SIGTERM fails and one wants to try again - with SIGKILL). All processes can be untagged at once with 'U'. - (thanks to A. Costa for the suggestion) - -What's new in version 0.6.2 - -* BUGFIX: Fixed crash when using some .htoprc files from 0.6 - (thanks to Wolfram Schlich and John Thomas for the reports) -* BUGFIX: Ensure changes to color scheme are saved -* BUGFIX: Make configure behave correctly with --with-proc -* Minor addition to .desktop file. - -What's new in version 0.6.1 - -* New meter type: "All CPUs", which dynamically adjusts - to the number of CPUs present in the machine. Note that - because of this, older versions of htop may crash when - using an .htoprc file modified my the newer version. -* Accept --with-proc= in configure, to specify - alternative procfs locations (making htop friendlier - to the Linux compatibility layer in FreeBSD) -* Included icon .desktop and desktop entry - (thanks to Peter Hyman) -* Added a check to make sure that a root-user htop closes - when its parent non-root terminal is closed. - (thanks to Ilya Evseev for the report) -* BUGFIX: does not crash anymore when $HOME is not set - (thanks to Henning Schild for the report) -* Wait for strace child process to die properly. - (thanks to Marcus Fritzsch) -* Support $HTOPRC - (thanks to Luis Limon) - -What's new in version 0.6 - -* Configuration of columns merged into the Setup screen -* Integrated strace (press 's') - (thanks to Marinho Barcellos for the help) -* BUGFIX: some fixes, aided by Valgrind - (thanks to Wolfram Schlich for the report) -* BUGFIX: fixed bug when switching meter modes - (thanks to Eduardo Righes for the report) -* Show processes of a single user -* "SortBy" function now menu-based -* Improved mouse handling -* ...and on top of that reduced memory consumption! - -What's new in version 0.5.4 - -* Color schemes -* -d flag, to configure delay between updates. - Note that the delay value is saved in ~/.htoprc. -* BUGFIX: Update of meters was halting after help screen. - (thanks to Matt Moore) -* BUGFIX: No longer display incorrect information - in first frame. -* BUGFIX: Fix auto-detection of /proc/stat, - correcting CPU usage information on multiprocessor - systems. - -What's new in version 0.5.3 - -* Read new field "steal" on newer /proc/stat files -* Auto-detects format of /proc/stat, to cope - with patched 2.4 kernels which display 2.6-style - information (most notably those on RHEL 3) - (thanks to Fernando Dotta for the report) -* Support $HOME_ETC initiative - (see http://www.pld-linux.org/Docs/home-etc) - (thanks to Roman Barczynski for the tip) -* The configure script now tests for /proc, so - that it fails early on unsupported platforms - instead of during compilation/execution. -* Made presentation of the function keys in the - status bar consistent across views - (thanks to David Mathog for the report) -* Minor changes to make the codebase more friendly - to possible future ports - (thanks to Jari Aalto and David Mathog for the reports) - -What's new in version 0.5.2 - -* BUGFIX: Correct display of user field - (thanks to Marcin Miroslaw for the report) -* Keyboard support improvements - (thanks to Aury Fink Filho for the report) - -What's new in version 0.5.1 - -* BUGFIX: Correctly displays NPTL threads from - /proc//task subdirectories - (thanks to Mike Pot for the report) -* BUGFIX: Fixes key handling on Signals listbox - (thanks to Ondrej Vlach) -* Renicing no longer displays temporary illegal values - (thanks to Ondrej Vlach) -* 'Hide userland threads' feature for NPTL threads - -What's new in version 0.5 - -* Tree view -* New column, TIME (user + system time, - like in top, 'T' switches to "sort by time") -* Major reorganization of the underlying code of the - setup screen, to manage setup pages -* New setup page: Display options -* Hide kernel threads ('K' key) -* Colorized memory numbers -* Vastly improved support for monochromatic terminals -* Shadow processes that do not belong to user ('U' key) -* Header margin configuration accessible via setup screen -* Visual feedback on failing incremental search -* BUGFIX: fixed keyboard input issues on 64-bit machines -* BUGFIX: hopefully fixed the incorrect values - that show on status bars in some systems -* BUGFIX: doesn't mess with fields list anymore when - canceling after changing the number of items -* Uptime meter no longer says "1 days" ;) - -What's new in version 0.4.1 - -* BUGFIX: compiles on 64-bit architectures again - (thanks to Bartosz Fenski for the report) -* BUGFIX: multi-processor support fixed on kernels 2.6 - (thanks to Wolfram Schlich for the report) - -What's new in version 0.4 - -* Support for multiple processors! -* Basic mouse support -* Modular header based on configurable meters; - supports 4 view modes: bar, text, LED, graph -* Uptime, load average meters - (thanks to Marc Calahan) -* Meters setup screen; should eventually evolve into a - general setup screen, with column setup, keybindings, etc. -* Thread hiding toggleable - (press 'T' to hide the nonstandard dotfiles in /proc) -* BUGFIX: Do not flicker screen on column configuration screen -* Clock and load average meters - (thanks to Marc Calahan) -* BUGFIX: numeric swap indicator was printing bogus value -* BUGFIX: internal fixes on Panel widget -* Clear the bottom line when exiting -* Press "F3" during search to walk through the results -* Improved navigation on column configuration screen -* BUGFIX: fix segfault on kernels with restricted /proc - enabled -* BUGFIX: a few last-minute bugfixes in the setup UI - (thanks to Gaspare Bruno for the reports) - - -What's new in version 0.3.3 - -* Saves column and sorting configuration in ~/.htoprc -* Displays "hidden" threads on RedHat 9 - (Thanks to Leonardo Godinho) -* BUGFIX: supports process names with spaces - (Thanks to Marc Calahan) -* BUGFIX: ...and parentheses :) -* BUGFIX: long process names overflowed RichString - (Thanks to Marc Calahan) - -What's new in version 0.3.2 - -* Performance and memory usage improvements, aided by gprof -* BUGFIX: quite a few fixes, aided by Valgrind -* Header preview on column configuration screen - (Thanks to Marc Calahan) - -What's new in version 0.3.1 - -* BUGFIX: crash fixes related to process list handling - (thanks to Marc Calahan) -* Man page - (thanks to Bartosz Fenski) -* Tag processes with the space bar -* Kill multiple process based on tag -* BUGFIX: corrected processing order of updates in list -* Screen refresh function on Ctrl-L -* Large numbers are shown in MB/GB notation in order to fit screen - (thanks to Marc Calahan) -* Realtime priority is correctly displayed - (thanks to Marc Calahan) -* Preliminary support for configurable columns, with 'C' - (thanks to Marc Calahan) - -- not all columns display properly yet - -What's new in version 0.3 - -* BUGFIX: no dirt left on screen on horizontal scrolling -* Signal selection on "kill" command -* Color-coding for users, nice and process status -* "Follow" function -* Fully selectable sort order -* Function bar on last line -* Build system now uses autotools - -What's new in version 0.2.1 - -* Sorting by process or memory usage ('P' and 'M', like top) -* Quicker default update (1.5 second, not yet configurable) -* Now the order of the elements in the process list stay - 'locked' for a while after you move the cursor to ease - selecting a process -* Corrected the installation instructions in README - (Thanks to Jeremy Eglen) -* Should now compile cleanly on Conectiva 9 and similar systems - (Thanks to Adriano Frare for the report) -* Friendlier Makefile -* Help screen ('h') - -What's new in version 0.2 - -* Memory indicators in header now show used and total, in MB -* Preliminary support for sorting (CPU% only) -* Memory percentage field (resident memory / used memory) -* BUGFIX: identified source of spurious crashes -* Can search names containing numbers - (Thanks to Rafael Jeffman) -* Correctly calculates memory page size - (Thanks to Rafael Jeffman) - -What's new in version 0.13 - -* Handles terminal resize -* Display all user names (not only those in /etc/passwd) - (Thanks to Julio Biason) - -What's new in version 0.12 - -* Support for 2.6 kernels -* Uses terminal default colors as a background - -What's new in version 0.11 - -* BUGFIX: does not crash when UID is not in /etc/passwd - -What's new in version 0.1 - -* Everything! diff --git a/fedora/.local/bin/htop-vim/ClockMeter.c b/fedora/.local/bin/htop-vim/ClockMeter.c deleted file mode 100644 index 8e3b66e..0000000 --- a/fedora/.local/bin/htop-vim/ClockMeter.c +++ /dev/null @@ -1,46 +0,0 @@ -/* -htop - ClockMeter.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "ClockMeter.h" - -#include -#include - -#include "CRT.h" -#include "Object.h" -#include "ProcessList.h" - - -static const int ClockMeter_attributes[] = { - CLOCK -}; - -static void ClockMeter_updateValues(Meter* this) { - const ProcessList* pl = this->pl; - - struct tm result; - const struct tm* lt = localtime_r(&pl->realtime.tv_sec, &result); - this->values[0] = lt->tm_hour * 60 + lt->tm_min; - strftime(this->txtBuffer, sizeof(this->txtBuffer), "%H:%M:%S", lt); -} - -const MeterClass ClockMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete - }, - .updateValues = ClockMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 1, - .total = 1440, /* 24*60 */ - .attributes = ClockMeter_attributes, - .name = "Clock", - .uiName = "Clock", - .caption = "Time: ", -}; diff --git a/fedora/.local/bin/htop-vim/ClockMeter.h b/fedora/.local/bin/htop-vim/ClockMeter.h deleted file mode 100644 index def0460..0000000 --- a/fedora/.local/bin/htop-vim/ClockMeter.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef HEADER_ClockMeter -#define HEADER_ClockMeter -/* -htop - ClockMeter.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Meter.h" - - -extern const MeterClass ClockMeter_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/ColorsPanel.c b/fedora/.local/bin/htop-vim/ColorsPanel.c deleted file mode 100644 index 5900884..0000000 --- a/fedora/.local/bin/htop-vim/ColorsPanel.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -htop - ColorsPanel.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "ColorsPanel.h" - -#include -#include -#include - -#include "CRT.h" -#include "FunctionBar.h" -#include "Macros.h" -#include "Object.h" -#include "OptionItem.h" -#include "ProvideCurses.h" - - -// TO ADD A NEW SCHEME: -// * Increment the size of bool check in ColorsPanel.h -// * Add the entry in the ColorSchemeNames array below in the file -// * Add a define in CRT.h that matches the order of the array -// * Add the colors in CRT_setColors - - -static const char* const ColorsFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL}; - -static const char* const ColorSchemeNames[] = { - "Default", - "Monochromatic", - "Black on White", - "Light Terminal", - "MC", - "Black Night", - "Broken Gray", - NULL -}; - -static void ColorsPanel_delete(Object* object) { - Panel* super = (Panel*) object; - ColorsPanel* this = (ColorsPanel*) object; - Panel_done(super); - free(this); -} - -static HandlerResult ColorsPanel_eventHandler(Panel* super, int ch) { - ColorsPanel* this = (ColorsPanel*) super; - - HandlerResult result = IGNORED; - int mark; - - switch (ch) { - case 0x0a: - case 0x0d: - case KEY_ENTER: - case KEY_MOUSE: - case KEY_RECLICK: - case ' ': - mark = Panel_getSelectedIndex(super); - assert(mark >= 0); - assert(mark < LAST_COLORSCHEME); - for (int i = 0; ColorSchemeNames[i] != NULL; i++) - CheckItem_set((CheckItem*)Panel_get(super, i), false); - CheckItem_set((CheckItem*)Panel_get(super, mark), true); - - this->settings->colorScheme = mark; - this->settings->changed = true; - this->settings->lastUpdate++; - - CRT_setColors(mark); - clear(); - - result = HANDLED | REDRAW; - } - - return result; -} - -const PanelClass ColorsPanel_class = { - .super = { - .extends = Class(Panel), - .delete = ColorsPanel_delete - }, - .eventHandler = ColorsPanel_eventHandler -}; - -ColorsPanel* ColorsPanel_new(Settings* settings) { - ColorsPanel* this = AllocThis(ColorsPanel); - Panel* super = (Panel*) this; - FunctionBar* fuBar = FunctionBar_new(ColorsFunctions, NULL, NULL); - Panel_init(super, 1, 1, 1, 1, Class(CheckItem), true, fuBar); - - this->settings = settings; - - assert(ARRAYSIZE(ColorSchemeNames) == LAST_COLORSCHEME + 1); - - Panel_setHeader(super, "Colors"); - for (int i = 0; ColorSchemeNames[i] != NULL; i++) { - Panel_add(super, (Object*) CheckItem_newByVal(ColorSchemeNames[i], false)); - } - CheckItem_set((CheckItem*)Panel_get(super, settings->colorScheme), true); - return this; -} diff --git a/fedora/.local/bin/htop-vim/ColorsPanel.h b/fedora/.local/bin/htop-vim/ColorsPanel.h deleted file mode 100644 index 373ec65..0000000 --- a/fedora/.local/bin/htop-vim/ColorsPanel.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef HEADER_ColorsPanel -#define HEADER_ColorsPanel -/* -htop - ColorsPanel.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Panel.h" -#include "Settings.h" - - -typedef struct ColorsPanel_ { - Panel super; - - Settings* settings; -} ColorsPanel; - -extern const PanelClass ColorsPanel_class; - -ColorsPanel* ColorsPanel_new(Settings* settings); - -#endif diff --git a/fedora/.local/bin/htop-vim/ColumnsPanel.c b/fedora/.local/bin/htop-vim/ColumnsPanel.c deleted file mode 100644 index d53fff2..0000000 --- a/fedora/.local/bin/htop-vim/ColumnsPanel.c +++ /dev/null @@ -1,178 +0,0 @@ -/* -htop - ColumnsPanel.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "ColumnsPanel.h" - -#include -#include -#include - -#include "CRT.h" -#include "DynamicColumn.h" -#include "FunctionBar.h" -#include "Hashtable.h" -#include "ListItem.h" -#include "Object.h" -#include "Process.h" -#include "ProvideCurses.h" -#include "XUtils.h" - - -static const char* const ColumnsFunctions[] = {" ", " ", " ", " ", " ", " ", "MoveUp", "MoveDn", "Remove", "Done ", NULL}; - -static void ColumnsPanel_delete(Object* object) { - Panel* super = (Panel*) object; - ColumnsPanel* this = (ColumnsPanel*) object; - Panel_done(super); - free(this); -} - -static HandlerResult ColumnsPanel_eventHandler(Panel* super, int ch) { - ColumnsPanel* const this = (ColumnsPanel*) super; - - int selected = Panel_getSelectedIndex(super); - HandlerResult result = IGNORED; - int size = Panel_size(super); - - switch (ch) { - case 0x0a: - case 0x0d: - case KEY_ENTER: - case KEY_MOUSE: - case KEY_RECLICK: - { - if (selected < size - 1) { - this->moving = !(this->moving); - Panel_setSelectionColor(super, this->moving ? PANEL_SELECTION_FOLLOW : PANEL_SELECTION_FOCUS); - ListItem* selectedItem = (ListItem*) Panel_getSelected(super); - if (selectedItem) - selectedItem->moving = this->moving; - result = HANDLED; - } - break; - } - case KEY_UP: - { - if (!this->moving) { - break; - } - } - /* else fallthrough */ - case KEY_F(7): - case '[': - case '-': - { - if (selected < size - 1) - Panel_moveSelectedUp(super); - result = HANDLED; - break; - } - case KEY_DOWN: - { - if (!this->moving) { - break; - } - } - /* else fallthrough */ - case KEY_F(8): - case ']': - case '+': - { - if (selected < size - 2) - Panel_moveSelectedDown(super); - result = HANDLED; - break; - } - case KEY_F(9): - case KEY_DC: - { - if (selected < size - 1) { - Panel_remove(super, selected); - } - result = HANDLED; - break; - } - default: - { - if (0 < ch && ch < 255 && isgraph((unsigned char)ch)) - result = Panel_selectByTyping(super, ch); - if (result == BREAK_LOOP) - result = IGNORED; - break; - } - } - if (result == HANDLED) - ColumnsPanel_update(super); - return result; -} - -const PanelClass ColumnsPanel_class = { - .super = { - .extends = Class(Panel), - .delete = ColumnsPanel_delete - }, - .eventHandler = ColumnsPanel_eventHandler -}; - -static void ColumnsPanel_add(Panel* super, unsigned int key, Hashtable* columns) { - const char* name; - if (key < LAST_PROCESSFIELD) { - name = Process_fields[key].name; - } else { - const DynamicColumn* column = Hashtable_get(columns, key); - assert(column); - if (!column) { - name = NULL; - } else { - name = column->caption ? column->caption : column->heading; - if (!name) - name = column->name; /* name is a mandatory field */ - } - } - if (name == NULL) - name = "- "; - Panel_add(super, (Object*) ListItem_new(name, key)); -} - -void ColumnsPanel_fill(ColumnsPanel* this, ScreenSettings* ss, Hashtable* columns) { - Panel* super = (Panel*) this; - Panel_prune(super); - for (const ProcessField* fields = ss->fields; *fields; fields++) - ColumnsPanel_add(super, *fields, columns); - this->ss = ss; -} - -ColumnsPanel* ColumnsPanel_new(ScreenSettings* ss, Hashtable* columns, bool* changed) { - ColumnsPanel* this = AllocThis(ColumnsPanel); - Panel* super = (Panel*) this; - FunctionBar* fuBar = FunctionBar_new(ColumnsFunctions, NULL, NULL); - Panel_init(super, 1, 1, 1, 1, Class(ListItem), true, fuBar); - - this->ss = ss; - this->changed = changed; - this->moving = false; - Panel_setHeader(super, "Active Columns"); - - ColumnsPanel_fill(this, ss, columns); - - return this; -} - -void ColumnsPanel_update(Panel* super) { - ColumnsPanel* this = (ColumnsPanel*) super; - int size = Panel_size(super); - *(this->changed) = true; - this->ss->fields = xRealloc(this->ss->fields, sizeof(ProcessField) * (size + 1)); - this->ss->flags = 0; - for (int i = 0; i < size; i++) { - int key = ((ListItem*) Panel_get(super, i))->key; - this->ss->fields[i] = key; - if (key < LAST_PROCESSFIELD) - this->ss->flags |= Process_fields[key].flags; - } - this->ss->fields[size] = 0; -} diff --git a/fedora/.local/bin/htop-vim/ColumnsPanel.h b/fedora/.local/bin/htop-vim/ColumnsPanel.h deleted file mode 100644 index 63f6f92..0000000 --- a/fedora/.local/bin/htop-vim/ColumnsPanel.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef HEADER_ColumnsPanel -#define HEADER_ColumnsPanel -/* -htop - ColumnsPanel.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include - -#include "Panel.h" -#include "Settings.h" - - -typedef struct ColumnsPanel_ { - Panel super; - ScreenSettings* ss; - bool* changed; - - bool moving; -} ColumnsPanel; - -extern const PanelClass ColumnsPanel_class; - -ColumnsPanel* ColumnsPanel_new(ScreenSettings* ss, Hashtable* columns, bool* changed); - -void ColumnsPanel_fill(ColumnsPanel* this, ScreenSettings* ss, Hashtable* columns); - -void ColumnsPanel_update(Panel* super); - -#endif diff --git a/fedora/.local/bin/htop-vim/CommandLine.c b/fedora/.local/bin/htop-vim/CommandLine.c deleted file mode 100644 index 682e054..0000000 --- a/fedora/.local/bin/htop-vim/CommandLine.c +++ /dev/null @@ -1,425 +0,0 @@ -/* -htop - CommandLine.c -(C) 2004-2011 Hisham H. Muhammad -(C) 2020-2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "CommandLine.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Action.h" -#include "CRT.h" -#include "DynamicColumn.h" -#include "DynamicMeter.h" -#include "Hashtable.h" -#include "Header.h" -#include "IncSet.h" -#include "MainPanel.h" -#include "MetersPanel.h" -#include "Panel.h" -#include "Platform.h" -#include "Process.h" -#include "ProcessList.h" -#include "ProvideCurses.h" -#include "ScreenManager.h" -#include "Settings.h" -#include "UsersTable.h" -#include "XUtils.h" - - -static void printVersionFlag(const char* name) { - printf("%s " VERSION "\n", name); -} - -static void printHelpFlag(const char* name) { - printf("%s " VERSION "\n" - COPYRIGHT "\n" - "Released under the GNU GPLv2+.\n\n" - "-C --no-color Use a monochrome color scheme\n" - "-d --delay=DELAY Set the delay between updates, in tenths of seconds\n" - "-F --filter=FILTER Show only the commands matching the given filter\n" - "-h --help Print this help screen\n" - "-H --highlight-changes[=DELAY] Highlight new and old processes\n", name); -#ifdef HAVE_GETMOUSE - printf("-M --no-mouse Disable the mouse\n"); -#endif - printf("-p --pid=PID[,PID,PID...] Show only the given PIDs\n" - " --readonly Disable all system and process changing features\n" - "-s --sort-key=COLUMN Sort by COLUMN in list view (try --sort-key=help for a list)\n" - "-t --tree Show the tree view (can be combined with -s)\n" - "-u --user[=USERNAME] Show only processes for a given user (or $USER)\n" - "-U --no-unicode Do not use unicode but plain ASCII\n" - "-V --version Print version info\n"); - Platform_longOptionsUsage(name); - printf("\n" - "Press F1 inside %s for online help.\n" - "See 'man %s' for more information.\n", name, name); -} - -// ---------------------------------------- - -typedef struct CommandLineSettings_ { - Hashtable* pidMatchList; - char* commFilter; - uid_t userId; - int sortKey; - int delay; - bool useColors; -#ifdef HAVE_GETMOUSE - bool enableMouse; -#endif - bool treeView; - bool allowUnicode; - bool highlightChanges; - int highlightDelaySecs; - bool readonly; -} CommandLineSettings; - -static CommandLineStatus parseArguments(const char* program, int argc, char** argv, CommandLineSettings* flags) { - - *flags = (CommandLineSettings) { - .pidMatchList = NULL, - .commFilter = NULL, - .userId = (uid_t)-1, // -1 is guaranteed to be an invalid uid_t (see setreuid(2)) - .sortKey = 0, - .delay = -1, - .useColors = true, -#ifdef HAVE_GETMOUSE - .enableMouse = true, -#endif - .treeView = false, - .allowUnicode = true, - .highlightChanges = false, - .highlightDelaySecs = -1, - .readonly = false, - }; - - const struct option long_opts[] = - { - {"help", no_argument, 0, 'h'}, - {"version", no_argument, 0, 'V'}, - {"delay", required_argument, 0, 'd'}, - {"sort-key", required_argument, 0, 's'}, - {"user", optional_argument, 0, 'u'}, - {"no-color", no_argument, 0, 'C'}, - {"no-colour", no_argument, 0, 'C'}, - {"no-mouse", no_argument, 0, 'M'}, - {"no-unicode", no_argument, 0, 'U'}, - {"tree", no_argument, 0, 't'}, - {"pid", required_argument, 0, 'p'}, - {"filter", required_argument, 0, 'F'}, - {"highlight-changes", optional_argument, 0, 'H'}, - {"readonly", no_argument, 0, 128}, - PLATFORM_LONG_OPTIONS - {0, 0, 0, 0} - }; - - int opt, opti = 0; - /* Parse arguments */ - while ((opt = getopt_long(argc, argv, "hVMCs:td:u::Up:F:H::", long_opts, &opti))) { - if (opt == EOF) - break; - switch (opt) { - case 'h': - printHelpFlag(program); - return STATUS_OK_EXIT; - case 'V': - printVersionFlag(program); - return STATUS_OK_EXIT; - case 's': - assert(optarg); /* please clang analyzer, cause optarg can be NULL in the 'u' case */ - if (String_eq(optarg, "help")) { - for (int j = 1; j < LAST_PROCESSFIELD; j++) { - const char* name = Process_fields[j].name; - const char* description = Process_fields[j].description; - if (name) - printf("%19s %s\n", name, description); - } - return STATUS_OK_EXIT; - } - flags->sortKey = 0; - for (int j = 1; j < LAST_PROCESSFIELD; j++) { - if (Process_fields[j].name == NULL) - continue; - if (String_eq(optarg, Process_fields[j].name)) { - flags->sortKey = j; - break; - } - } - if (flags->sortKey == 0) { - fprintf(stderr, "Error: invalid column \"%s\".\n", optarg); - return STATUS_ERROR_EXIT; - } - break; - case 'd': - if (sscanf(optarg, "%16d", &(flags->delay)) == 1) { - if (flags->delay < 1) - flags->delay = 1; - if (flags->delay > 100) - flags->delay = 100; - } else { - fprintf(stderr, "Error: invalid delay value \"%s\".\n", optarg); - return STATUS_ERROR_EXIT; - } - break; - case 'u': - { - const char* username = optarg; - if (!username && optind < argc && argv[optind] != NULL && - (argv[optind][0] != '\0' && argv[optind][0] != '-')) { - username = argv[optind++]; - } - - if (!username) { - flags->userId = geteuid(); - } else if (!Action_setUserOnly(username, &(flags->userId))) { - for (const char* itr = username; *itr; ++itr) - if (!isdigit((unsigned char)*itr)) { - fprintf(stderr, "Error: invalid user \"%s\".\n", username); - return STATUS_ERROR_EXIT; - } - flags->userId = atol(username); - } - break; - } - case 'C': - flags->useColors = false; - break; - case 'M': -#ifdef HAVE_GETMOUSE - flags->enableMouse = false; -#endif - break; - case 'U': - flags->allowUnicode = false; - break; - case 't': - flags->treeView = true; - break; - case 'p': { - assert(optarg); /* please clang analyzer, cause optarg can be NULL in the 'u' case */ - char* argCopy = xStrdup(optarg); - char* saveptr; - const char* pid = strtok_r(argCopy, ",", &saveptr); - - if (!flags->pidMatchList) { - flags->pidMatchList = Hashtable_new(8, false); - } - - while (pid) { - unsigned int num_pid = atoi(pid); - // deepcode ignore CastIntegerToAddress: we just want a non-NULL pointer here - Hashtable_put(flags->pidMatchList, num_pid, (void*) 1); - pid = strtok_r(NULL, ",", &saveptr); - } - free(argCopy); - - break; - } - case 'F': { - assert(optarg); - free_and_xStrdup(&flags->commFilter, optarg); - break; - } - case 'H': { - const char* delay = optarg; - if (!delay && optind < argc && argv[optind] != NULL && - (argv[optind][0] != '\0' && argv[optind][0] != '-')) { - delay = argv[optind++]; - } - if (delay) { - if (sscanf(delay, "%16d", &(flags->highlightDelaySecs)) == 1) { - if (flags->highlightDelaySecs < 1) - flags->highlightDelaySecs = 1; - } else { - fprintf(stderr, "Error: invalid highlight delay value \"%s\".\n", delay); - return STATUS_ERROR_EXIT; - } - } - flags->highlightChanges = true; - break; - } - case 128: - flags->readonly = true; - break; - - default: { - CommandLineStatus status; - if ((status = Platform_getLongOption(opt, argc, argv)) != STATUS_OK) - return status; - break; - } - } - } - - if (optind < argc) { - fprintf(stderr, "Error: unsupported non-option ARGV-elements:"); - while (optind < argc) - fprintf(stderr, " %s", argv[optind++]); - fprintf(stderr, "\n"); - return STATUS_ERROR_EXIT; - } - - return STATUS_OK; -} - -static void CommandLine_delay(ProcessList* pl, unsigned long millisec) { - struct timespec req = { - .tv_sec = 0, - .tv_nsec = millisec * 1000000L - }; - while (nanosleep(&req, &req) == -1) - continue; - Platform_gettime_realtime(&pl->realtime, &pl->realtimeMs); -} - -static void setCommFilter(State* state, char** commFilter) { - ProcessList* pl = state->pl; - IncSet* inc = state->mainPanel->inc; - - IncSet_setFilter(inc, *commFilter); - pl->incFilter = IncSet_filter(inc); - - free(*commFilter); - *commFilter = NULL; -} - -int CommandLine_run(const char* name, int argc, char** argv) { - - /* initialize locale */ - const char* lc_ctype; - if ((lc_ctype = getenv("LC_CTYPE")) || (lc_ctype = getenv("LC_ALL"))) - setlocale(LC_CTYPE, lc_ctype); - else - setlocale(LC_CTYPE, ""); - - CommandLineStatus status = STATUS_OK; - CommandLineSettings flags = { 0 }; - - if ((status = parseArguments(name, argc, argv, &flags)) != STATUS_OK) - return status != STATUS_OK_EXIT ? 1 : 0; - - if (flags.readonly) - Settings_enableReadonly(); - - if (!Platform_init()) - return 1; - - Process_setupColumnWidths(); - - UsersTable* ut = UsersTable_new(); - Hashtable* dc = DynamicColumns_new(); - Hashtable* dm = DynamicMeters_new(); - if (!dc) - dc = Hashtable_new(0, true); - - ProcessList* pl = ProcessList_new(ut, dm, dc, flags.pidMatchList, flags.userId); - - Settings* settings = Settings_new(pl->activeCPUs, dc); - pl->settings = settings; - - Header* header = Header_new(pl, settings, 2); - - Header_populateFromSettings(header); - - if (flags.delay != -1) - settings->delay = flags.delay; - if (!flags.useColors) - settings->colorScheme = COLORSCHEME_MONOCHROME; -#ifdef HAVE_GETMOUSE - if (!flags.enableMouse) - settings->enableMouse = false; -#endif - if (flags.treeView) - settings->ss->treeView = true; - if (flags.highlightChanges) - settings->highlightChanges = true; - if (flags.highlightDelaySecs != -1) - settings->highlightDelaySecs = flags.highlightDelaySecs; - if (flags.sortKey > 0) { - // -t -s means "tree sorted by key" - // -s means "list sorted by key" (previous existing behavior) - if (!flags.treeView) { - settings->ss->treeView = false; - } - ScreenSettings_setSortKey(settings->ss, flags.sortKey); - } - - CRT_init(settings, flags.allowUnicode); - - MainPanel* panel = MainPanel_new(); - ProcessList_setPanel(pl, (Panel*) panel); - - MainPanel_updateLabels(panel, settings->ss->treeView, flags.commFilter); - - State state = { - .settings = settings, - .ut = ut, - .pl = pl, - .mainPanel = panel, - .header = header, - .pauseProcessUpdate = false, - .hideProcessSelection = false, - .hideMeters = false, - }; - - MainPanel_setState(panel, &state); - if (flags.commFilter) - setCommFilter(&state, &(flags.commFilter)); - - ScreenManager* scr = ScreenManager_new(header, settings, &state, true); - ScreenManager_add(scr, (Panel*) panel, -1); - - ProcessList_scan(pl, false); - CommandLine_delay(pl, 75); - ProcessList_scan(pl, false); - - if (settings->ss->allBranchesCollapsed) - ProcessList_collapseAllBranches(pl); - - ScreenManager_run(scr, NULL, NULL, NULL); - - Platform_done(); - - CRT_done(); - - if (settings->changed) { - int r = Settings_write(settings, false); - if (r < 0) - fprintf(stderr, "Can not save configuration to %s: %s\n", settings->filename, strerror(-r)); - } - - Header_delete(header); - ProcessList_delete(pl); - - ScreenManager_delete(scr); - MetersPanel_cleanup(); - - UsersTable_delete(ut); - - if (flags.pidMatchList) - Hashtable_delete(flags.pidMatchList); - - CRT_resetSignalHandlers(); - - /* Delete these last, since they can get accessed in the crash handler */ - Settings_delete(settings); - DynamicColumns_delete(dc); - DynamicMeters_delete(dm); - - return 0; -} diff --git a/fedora/.local/bin/htop-vim/CommandLine.h b/fedora/.local/bin/htop-vim/CommandLine.h deleted file mode 100644 index fbdede8..0000000 --- a/fedora/.local/bin/htop-vim/CommandLine.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef HEADER_CommandLine -#define HEADER_CommandLine -/* -htop - CommandLine.h -(C) 2004-2011 Hisham H. Muhammad -(C) 2020-2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -typedef enum { - STATUS_OK, - STATUS_ERROR_EXIT, - STATUS_OK_EXIT -} CommandLineStatus; - -int CommandLine_run(const char* name, int argc, char** argv); - -#endif diff --git a/fedora/.local/bin/htop-vim/CommandScreen.c b/fedora/.local/bin/htop-vim/CommandScreen.c deleted file mode 100644 index 6a87d13..0000000 --- a/fedora/.local/bin/htop-vim/CommandScreen.c +++ /dev/null @@ -1,68 +0,0 @@ -#include "config.h" // IWYU pragma: keep - -#include "CommandScreen.h" - -#include -#include -#include - -#include "Macros.h" -#include "Panel.h" -#include "ProvideCurses.h" - - -static void CommandScreen_scan(InfoScreen* this) { - Panel* panel = this->display; - int idx = MAXIMUM(Panel_getSelectedIndex(panel), 0); - Panel_prune(panel); - - const char* p = Process_getCommand(this->process); - char line[COLS + 1]; - int line_offset = 0, last_spc = -1, len; - for (; *p != '\0'; p++, line_offset++) { - assert(line_offset >= 0 && (size_t)line_offset < sizeof(line)); - line[line_offset] = *p; - if (*p == ' ') { - last_spc = line_offset; - } - - if (line_offset == COLS) { - len = (last_spc == -1) ? line_offset : last_spc; - line[len] = '\0'; - InfoScreen_addLine(this, line); - - line_offset -= len; - last_spc = -1; - memcpy(line, p - line_offset, line_offset + 1); - } - } - - if (line_offset > 0) { - line[line_offset] = '\0'; - InfoScreen_addLine(this, line); - } - - Panel_setSelected(panel, idx); -} - -static void CommandScreen_draw(InfoScreen* this) { - InfoScreen_drawTitled(this, "Command of process %d - %s", this->process->pid, Process_getCommand(this->process)); -} - -const InfoScreenClass CommandScreen_class = { - .super = { - .extends = Class(Object), - .delete = CommandScreen_delete - }, - .scan = CommandScreen_scan, - .draw = CommandScreen_draw -}; - -CommandScreen* CommandScreen_new(Process* process) { - CommandScreen* this = AllocThis(CommandScreen); - return (CommandScreen*) InfoScreen_init(&this->super, process, NULL, LINES - 2, " "); -} - -void CommandScreen_delete(Object* this) { - free(InfoScreen_done((InfoScreen*)this)); -} diff --git a/fedora/.local/bin/htop-vim/CommandScreen.h b/fedora/.local/bin/htop-vim/CommandScreen.h deleted file mode 100644 index e56982b..0000000 --- a/fedora/.local/bin/htop-vim/CommandScreen.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef HEADER_CommandScreen -#define HEADER_CommandScreen - -#include "InfoScreen.h" -#include "Object.h" -#include "Process.h" - - -typedef struct CommandScreen_ { - InfoScreen super; -} CommandScreen; - -extern const InfoScreenClass CommandScreen_class; - -CommandScreen* CommandScreen_new(Process* process); - -void CommandScreen_delete(Object* this); - -#endif diff --git a/fedora/.local/bin/htop-vim/Compat.c b/fedora/.local/bin/htop-vim/Compat.c deleted file mode 100644 index d0ad2cc..0000000 --- a/fedora/.local/bin/htop-vim/Compat.c +++ /dev/null @@ -1,156 +0,0 @@ -/* -htop - Compat.c -(C) 2020 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "Compat.h" - -#include -#include // IWYU pragma: keep -#include -#include -#include -#include // IWYU pragma: keep - -#include "XUtils.h" // IWYU pragma: keep - - -/* GNU/Hurd does not have PATH_MAX in limits.h */ -#ifndef PATH_MAX -# define PATH_MAX 4096 -#endif - - -int Compat_faccessat(int dirfd, - const char* pathname, - int mode, - int flags) { - int ret; - -#ifdef HAVE_FACCESSAT - - // Implementation note: AT_SYMLINK_NOFOLLOW unsupported on FreeBSD, fallback to lstat in that case - - errno = 0; - - ret = faccessat(dirfd, pathname, mode, flags); - if (!ret || errno != EINVAL) - return ret; - -#endif - - // Error out on unsupported configurations - if (dirfd != (int)AT_FDCWD || mode != F_OK) { - errno = EINVAL; - return -1; - } - - // Fallback to stat(2)/lstat(2) depending on flags - struct stat statinfo; - if (flags) { - ret = lstat(pathname, &statinfo); - } else { - ret = stat(pathname, &statinfo); - } - - return ret; -} - -int Compat_fstatat(int dirfd, - const char* dirpath, - const char* pathname, - struct stat* statbuf, - int flags) { - -#ifdef HAVE_FSTATAT - - (void)dirpath; - - return fstatat(dirfd, pathname, statbuf, flags); - -#else - - (void)dirfd; - - char path[4096]; - xSnprintf(path, sizeof(path), "%s/%s", dirpath, pathname); - - if (flags & AT_SYMLINK_NOFOLLOW) - return lstat(path, statbuf); - - return stat(path, statbuf); - -#endif -} - -#ifndef HAVE_OPENAT - -int Compat_openat(const char* dirpath, - const char* pathname, - int flags) { - - char path[4096]; - xSnprintf(path, sizeof(path), "%s/%s", dirpath, pathname); - - return open(path, flags); -} - -#endif /* !HAVE_OPENAT */ - -ssize_t Compat_readlinkat(int dirfd, - const char* dirpath, - const char* pathname, - char* buf, - size_t bufsize) { - -#ifdef HAVE_READLINKAT - - (void)dirpath; - - return readlinkat(dirfd, pathname, buf, bufsize); - -#else - - (void)dirfd; - - char path[4096]; - xSnprintf(path, sizeof(path), "%s/%s", dirpath, pathname); - - return readlink(path, buf, bufsize); - -#endif -} - -ssize_t Compat_readlink(openat_arg_t dirfd, - const char* pathname, - char* buf, - size_t bufsize) { - -#ifdef HAVE_OPENAT - - char fdPath[32]; - xSnprintf(fdPath, sizeof(fdPath), "/proc/self/fd/%d", dirfd); - - char dirPath[PATH_MAX + 1]; - ssize_t r = readlink(fdPath, dirPath, sizeof(dirPath) - 1); - if (r < 0) - return r; - - dirPath[r] = '\0'; - - char linkPath[PATH_MAX + 1]; - xSnprintf(linkPath, sizeof(linkPath), "%s/%s", dirPath, pathname); - -#else - - char linkPath[PATH_MAX + 1]; - xSnprintf(linkPath, sizeof(linkPath), "%s/%s", dirfd, pathname); - -#endif /* HAVE_OPENAT */ - - return readlink(linkPath, buf, bufsize); -} diff --git a/fedora/.local/bin/htop-vim/Compat.h b/fedora/.local/bin/htop-vim/Compat.h deleted file mode 100644 index 1c4794e..0000000 --- a/fedora/.local/bin/htop-vim/Compat.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef HEADER_Compat -#define HEADER_Compat -/* -htop - Compat.h -(C) 2020 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include -#include -#include -#include // IWYU pragma: keep - - -int Compat_faccessat(int dirfd, - const char* pathname, - int mode, - int flags); - -int Compat_fstatat(int dirfd, - const char* dirpath, - const char* pathname, - struct stat* statbuf, - int flags); - -#ifdef HAVE_OPENAT - -typedef int openat_arg_t; - -static inline void Compat_openatArgClose(openat_arg_t dirfd) { - close(dirfd); -} - -static inline int Compat_openat(openat_arg_t dirfd, const char* pathname, int flags) { - return openat(dirfd, pathname, flags); -} - -#else /* HAVE_OPENAT */ - -typedef const char* openat_arg_t; - -static inline void Compat_openatArgClose(openat_arg_t dirpath) { - (void)dirpath; -} - -int Compat_openat(openat_arg_t dirpath, const char* pathname, int flags); - -#endif /* HAVE_OPENAT */ - -ssize_t Compat_readlinkat(int dirfd, - const char* dirpath, - const char* pathname, - char* buf, - size_t bufsize); - -ssize_t Compat_readlink(openat_arg_t dirfd, - const char* pathname, - char* buf, - size_t bufsize); - -#endif /* HEADER_Compat */ diff --git a/fedora/.local/bin/htop-vim/DateMeter.c b/fedora/.local/bin/htop-vim/DateMeter.c deleted file mode 100644 index 9628596..0000000 --- a/fedora/.local/bin/htop-vim/DateMeter.c +++ /dev/null @@ -1,52 +0,0 @@ -/* -htop - DateMeter.c -(C) 2004-2020 Hisham H. Muhammad, Michael Schรถnitzer -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "DateMeter.h" - -#include -#include - -#include "CRT.h" -#include "Object.h" -#include "ProcessList.h" - - -static const int DateMeter_attributes[] = { - DATE -}; - -static void DateMeter_updateValues(Meter* this) { - const ProcessList* pl = this->pl; - - struct tm result; - const struct tm* lt = localtime_r(&pl->realtime.tv_sec, &result); - this->values[0] = lt->tm_yday; - int year = lt->tm_year + 1900; - if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) { - this->total = 366; - } else { - this->total = 365; - } - strftime(this->txtBuffer, sizeof(this->txtBuffer), "%F", lt); -} - -const MeterClass DateMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete - }, - .updateValues = DateMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 1, - .total = 365, - .attributes = DateMeter_attributes, - .name = "Date", - .uiName = "Date", - .caption = "Date: ", -}; diff --git a/fedora/.local/bin/htop-vim/DateMeter.h b/fedora/.local/bin/htop-vim/DateMeter.h deleted file mode 100644 index ecbfa99..0000000 --- a/fedora/.local/bin/htop-vim/DateMeter.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef HEADER_DateMeter -#define HEADER_DateMeter -/* -htop - DateMeter.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Meter.h" - - -extern const MeterClass DateMeter_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/DateTimeMeter.c b/fedora/.local/bin/htop-vim/DateTimeMeter.c deleted file mode 100644 index 1044ff3..0000000 --- a/fedora/.local/bin/htop-vim/DateTimeMeter.c +++ /dev/null @@ -1,52 +0,0 @@ -/* -htop - DateTimeMeter.c -(C) 2004-2020 Hisham H. Muhammad, Michael Schรถnitzer -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "DateTimeMeter.h" - -#include -#include - -#include "CRT.h" -#include "Object.h" -#include "ProcessList.h" - - -static const int DateTimeMeter_attributes[] = { - DATETIME -}; - -static void DateTimeMeter_updateValues(Meter* this) { - const ProcessList* pl = this->pl; - - struct tm result; - const struct tm* lt = localtime_r(&pl->realtime.tv_sec, &result); - int year = lt->tm_year + 1900; - if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) { - this->total = 366; - } else { - this->total = 365; - } - this->values[0] = lt->tm_yday; - strftime(this->txtBuffer, sizeof(this->txtBuffer), "%F %H:%M:%S", lt); -} - -const MeterClass DateTimeMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete - }, - .updateValues = DateTimeMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 1, - .total = 365, - .attributes = DateTimeMeter_attributes, - .name = "DateTime", - .uiName = "Date and Time", - .caption = "Date & Time: ", -}; diff --git a/fedora/.local/bin/htop-vim/DateTimeMeter.h b/fedora/.local/bin/htop-vim/DateTimeMeter.h deleted file mode 100644 index 5196dd3..0000000 --- a/fedora/.local/bin/htop-vim/DateTimeMeter.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef HEADER_DateTimeMeter -#define HEADER_DateTimeMeter -/* -htop - DateTimeMeter.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Meter.h" - - -extern const MeterClass DateTimeMeter_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/DiskIOMeter.c b/fedora/.local/bin/htop-vim/DiskIOMeter.c deleted file mode 100644 index adab8f7..0000000 --- a/fedora/.local/bin/htop-vim/DiskIOMeter.c +++ /dev/null @@ -1,159 +0,0 @@ -/* -htop - DiskIOMeter.c -(C) 2020 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "DiskIOMeter.h" - -#include -#include - -#include "CRT.h" -#include "Macros.h" -#include "Meter.h" -#include "Object.h" -#include "Platform.h" -#include "ProcessList.h" -#include "RichString.h" -#include "XUtils.h" - - -static const int DiskIOMeter_attributes[] = { - METER_VALUE_NOTICE, - METER_VALUE_IOREAD, - METER_VALUE_IOWRITE, -}; - -static MeterRateStatus status = RATESTATUS_INIT; -static uint32_t cached_read_diff; -static uint32_t cached_write_diff; -static double cached_utilisation_diff; - -static void DiskIOMeter_updateValues(Meter* this) { - const ProcessList* pl = this->pl; - - static uint64_t cached_last_update; - uint64_t passedTimeInMs = pl->realtimeMs - cached_last_update; - - /* update only every 500ms to have a sane span for rate calculation */ - if (passedTimeInMs > 500) { - static uint64_t cached_read_total; - static uint64_t cached_write_total; - static uint64_t cached_msTimeSpend_total; - uint64_t diff; - - DiskIOData data; - if (!Platform_getDiskIO(&data)) { - status = RATESTATUS_NODATA; - } else if (cached_last_update == 0) { - status = RATESTATUS_INIT; - } else if (passedTimeInMs > 30000) { - status = RATESTATUS_STALE; - } else { - status = RATESTATUS_DATA; - } - - cached_last_update = pl->realtimeMs; - - if (status == RATESTATUS_NODATA) { - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "no data"); - return; - } - - if (data.totalBytesRead > cached_read_total) { - diff = data.totalBytesRead - cached_read_total; - diff = (1000 * diff) / passedTimeInMs; /* convert to B/s */ - diff /= ONE_K; /* convert to KiB/s */ - cached_read_diff = (uint32_t)diff; - } else { - cached_read_diff = 0; - } - cached_read_total = data.totalBytesRead; - - if (data.totalBytesWritten > cached_write_total) { - diff = data.totalBytesWritten - cached_write_total; - diff = (1000 * diff) / passedTimeInMs; /* convert to B/s */ - diff /= ONE_K; /* convert to KiB/s */ - cached_write_diff = (uint32_t)diff; - } else { - cached_write_diff = 0; - } - cached_write_total = data.totalBytesWritten; - - if (data.totalMsTimeSpend > cached_msTimeSpend_total) { - diff = data.totalMsTimeSpend - cached_msTimeSpend_total; - cached_utilisation_diff = 100.0 * (double)diff / passedTimeInMs; - } else { - cached_utilisation_diff = 0.0; - } - cached_msTimeSpend_total = data.totalMsTimeSpend; - } - - if (status == RATESTATUS_INIT) { - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "init"); - return; - } - if (status == RATESTATUS_STALE) { - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "stale"); - return; - } - - this->values[0] = cached_utilisation_diff; - this->total = MAXIMUM(this->values[0], 100.0); /* fix total after (initial) spike */ - - char bufferRead[12], bufferWrite[12]; - Meter_humanUnit(bufferRead, cached_read_diff, sizeof(bufferRead)); - Meter_humanUnit(bufferWrite, cached_write_diff, sizeof(bufferWrite)); - snprintf(this->txtBuffer, sizeof(this->txtBuffer), "r:%siB/s w:%siB/s %.1f%%", bufferRead, bufferWrite, cached_utilisation_diff); -} - -static void DiskIOMeter_display(ATTR_UNUSED const Object* cast, RichString* out) { - switch (status) { - case RATESTATUS_NODATA: - RichString_writeAscii(out, CRT_colors[METER_VALUE_ERROR], "no data"); - return; - case RATESTATUS_INIT: - RichString_writeAscii(out, CRT_colors[METER_VALUE], "initializing..."); - return; - case RATESTATUS_STALE: - RichString_writeAscii(out, CRT_colors[METER_VALUE_WARN], "stale data"); - return; - case RATESTATUS_DATA: - break; - } - - char buffer[16]; - int len; - - int color = cached_utilisation_diff > 40.0 ? METER_VALUE_NOTICE : METER_VALUE; - len = xSnprintf(buffer, sizeof(buffer), "%.1f%%", cached_utilisation_diff); - RichString_appendnAscii(out, CRT_colors[color], buffer, len); - - RichString_appendAscii(out, CRT_colors[METER_TEXT], " read: "); - Meter_humanUnit(buffer, cached_read_diff, sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_VALUE_IOREAD], buffer); - RichString_appendAscii(out, CRT_colors[METER_VALUE_IOREAD], "iB/s"); - - RichString_appendAscii(out, CRT_colors[METER_TEXT], " write: "); - Meter_humanUnit(buffer, cached_write_diff, sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_VALUE_IOWRITE], buffer); - RichString_appendAscii(out, CRT_colors[METER_VALUE_IOWRITE], "iB/s"); -} - -const MeterClass DiskIOMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = DiskIOMeter_display - }, - .updateValues = DiskIOMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 1, - .total = 100.0, - .attributes = DiskIOMeter_attributes, - .name = "DiskIO", - .uiName = "Disk IO", - .caption = "Disk IO: " -}; diff --git a/fedora/.local/bin/htop-vim/DiskIOMeter.h b/fedora/.local/bin/htop-vim/DiskIOMeter.h deleted file mode 100644 index 3b03e32..0000000 --- a/fedora/.local/bin/htop-vim/DiskIOMeter.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef HEADER_DiskIOMeter -#define HEADER_DiskIOMeter -/* -htop - DiskIOMeter.h -(C) 2020 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Meter.h" - - -typedef struct DiskIOData_ { - uint64_t totalBytesRead; - uint64_t totalBytesWritten; - uint64_t totalMsTimeSpend; -} DiskIOData; - -extern const MeterClass DiskIOMeter_class; - -#endif /* HEADER_DiskIOMeter */ diff --git a/fedora/.local/bin/htop-vim/DisplayOptionsPanel.c b/fedora/.local/bin/htop-vim/DisplayOptionsPanel.c deleted file mode 100644 index f9fa9b1..0000000 --- a/fedora/.local/bin/htop-vim/DisplayOptionsPanel.c +++ /dev/null @@ -1,160 +0,0 @@ -/* -htop - DisplayOptionsPanel.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "DisplayOptionsPanel.h" - -#include -#include - -#include "CRT.h" -#include "FunctionBar.h" -#include "Header.h" -#include "Object.h" -#include "OptionItem.h" -#include "ProvideCurses.h" -#include "ScreensPanel.h" - - -static const char* const DisplayOptionsFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL}; - -static void DisplayOptionsPanel_delete(Object* object) { - Panel* super = (Panel*) object; - DisplayOptionsPanel* this = (DisplayOptionsPanel*) object; - Panel_done(super); - free(this); -} - -static HandlerResult DisplayOptionsPanel_eventHandler(Panel* super, int ch) { - DisplayOptionsPanel* this = (DisplayOptionsPanel*) super; - - HandlerResult result = IGNORED; - OptionItem* selected = (OptionItem*) Panel_getSelected(super); - - switch (ch) { - case '\n': - case '\r': - case KEY_ENTER: - case KEY_MOUSE: - case KEY_RECLICK: - case ' ': - switch (OptionItem_kind(selected)) { - case OPTION_ITEM_TEXT: - break; - case OPTION_ITEM_CHECK: - CheckItem_toggle((CheckItem*)selected); - result = HANDLED; - break; - case OPTION_ITEM_NUMBER: - NumberItem_toggle((NumberItem*)selected); - result = HANDLED; - break; - } - break; - case '-': - if (OptionItem_kind(selected) == OPTION_ITEM_NUMBER) { - NumberItem_decrease((NumberItem*)selected); - result = HANDLED; - } - break; - case '+': - if (OptionItem_kind(selected) == OPTION_ITEM_NUMBER) { - NumberItem_increase((NumberItem*)selected); - result = HANDLED; - } - break; - } - - if (result == HANDLED) { - this->settings->changed = true; - this->settings->lastUpdate++; - Header* header = this->scr->header; - Header_calculateHeight(header); - Header_reinit(header); - Header_updateData(header); - Header_draw(header); - ScreenManager_resize(this->scr); - } - return result; -} - -const PanelClass DisplayOptionsPanel_class = { - .super = { - .extends = Class(Panel), - .delete = DisplayOptionsPanel_delete - }, - .eventHandler = DisplayOptionsPanel_eventHandler -}; - -DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager* scr) { - DisplayOptionsPanel* this = AllocThis(DisplayOptionsPanel); - Panel* super = (Panel*) this; - FunctionBar* fuBar = FunctionBar_new(DisplayOptionsFunctions, NULL, NULL); - Panel_init(super, 1, 1, 1, 1, Class(OptionItem), true, fuBar); - - this->settings = settings; - this->scr = scr; - - Panel_setHeader(super, "Display options"); - - #define TABMSG "For current screen tab: \0" - char tabheader[sizeof(TABMSG) + SCREEN_NAME_LEN + 1] = TABMSG; - strncat(tabheader, settings->ss->name, SCREEN_NAME_LEN); - Panel_add(super, (Object*) TextItem_new(tabheader)); - #undef TABMSG - - Panel_add(super, (Object*) CheckItem_newByRef("Tree view", &(settings->ss->treeView))); - Panel_add(super, (Object*) CheckItem_newByRef("- Tree view is always sorted by PID (htop 2 behavior)", &(settings->ss->treeViewAlwaysByPID))); - Panel_add(super, (Object*) CheckItem_newByRef("- Tree view is collapsed by default", &(settings->ss->allBranchesCollapsed))); - Panel_add(super, (Object*) TextItem_new("Global options:")); - Panel_add(super, (Object*) CheckItem_newByRef("Show tabs for screens", &(settings->screenTabs))); - Panel_add(super, (Object*) CheckItem_newByRef("Shadow other users' processes", &(settings->shadowOtherUsers))); - Panel_add(super, (Object*) CheckItem_newByRef("Hide kernel threads", &(settings->hideKernelThreads))); - Panel_add(super, (Object*) CheckItem_newByRef("Hide userland process threads", &(settings->hideUserlandThreads))); - Panel_add(super, (Object*) CheckItem_newByRef("Hide processes running in containers", &(settings->hideRunningInContainer))); - Panel_add(super, (Object*) CheckItem_newByRef("Display threads in a different color", &(settings->highlightThreads))); - Panel_add(super, (Object*) CheckItem_newByRef("Show custom thread names", &(settings->showThreadNames))); - Panel_add(super, (Object*) CheckItem_newByRef("Show program path", &(settings->showProgramPath))); - Panel_add(super, (Object*) CheckItem_newByRef("Highlight program \"basename\"", &(settings->highlightBaseName))); - Panel_add(super, (Object*) CheckItem_newByRef("Highlight out-dated/removed programs (red) / libraries (yellow)", &(settings->highlightDeletedExe))); - Panel_add(super, (Object*) CheckItem_newByRef("Shadow distribution path prefixes", &(settings->shadowDistPathPrefix))); - Panel_add(super, (Object*) CheckItem_newByRef("Merge exe, comm and cmdline in Command", &(settings->showMergedCommand))); - Panel_add(super, (Object*) CheckItem_newByRef("- Try to find comm in cmdline (when Command is merged)", &(settings->findCommInCmdline))); - Panel_add(super, (Object*) CheckItem_newByRef("- Try to strip exe from cmdline (when Command is merged)", &(settings->stripExeFromCmdline))); - Panel_add(super, (Object*) CheckItem_newByRef("Highlight large numbers in memory counters", &(settings->highlightMegabytes))); - Panel_add(super, (Object*) CheckItem_newByRef("Leave a margin around header", &(settings->headerMargin))); - Panel_add(super, (Object*) CheckItem_newByRef("Detailed CPU time (System/IO-Wait/Hard-IRQ/Soft-IRQ/Steal/Guest)", &(settings->detailedCPUTime))); - Panel_add(super, (Object*) CheckItem_newByRef("Count CPUs from 1 instead of 0", &(settings->countCPUsFromOne))); - Panel_add(super, (Object*) CheckItem_newByRef("Update process names on every refresh", &(settings->updateProcessNames))); - Panel_add(super, (Object*) CheckItem_newByRef("Add guest time in CPU meter percentage", &(settings->accountGuestInCPUMeter))); - Panel_add(super, (Object*) CheckItem_newByRef("Also show CPU percentage numerically", &(settings->showCPUUsage))); - Panel_add(super, (Object*) CheckItem_newByRef("Also show CPU frequency", &(settings->showCPUFrequency))); - #ifdef BUILD_WITH_CPU_TEMP - Panel_add(super, (Object*) CheckItem_newByRef( - #if defined(HTOP_LINUX) - "Also show CPU temperature (requires libsensors)", - #elif defined(HTOP_FREEBSD) - "Also show CPU temperature", - #else - #error Unknown temperature implementation! - #endif - &(settings->showCPUTemperature))); - Panel_add(super, (Object*) CheckItem_newByRef("- Show temperature in degree Fahrenheit instead of Celsius", &(settings->degreeFahrenheit))); - #endif - #ifdef HAVE_GETMOUSE - Panel_add(super, (Object*) CheckItem_newByRef("Enable the mouse", &(settings->enableMouse))); - #endif - Panel_add(super, (Object*) NumberItem_newByRef("Update interval (in seconds)", &(settings->delay), -1, 1, 255)); - Panel_add(super, (Object*) CheckItem_newByRef("Highlight new and old processes", &(settings->highlightChanges))); - Panel_add(super, (Object*) NumberItem_newByRef("- Highlight time (in seconds)", &(settings->highlightDelaySecs), 0, 1, 24 * 60 * 60)); - Panel_add(super, (Object*) NumberItem_newByRef("Hide main function bar (0 - off, 1 - on ESC until next input, 2 - permanently)", &(settings->hideFunctionBar), 0, 0, 2)); - #ifdef HAVE_LIBHWLOC - Panel_add(super, (Object*) CheckItem_newByRef("Show topology when selecting affinity by default", &(settings->topologyAffinity))); - #endif - return this; -} diff --git a/fedora/.local/bin/htop-vim/DisplayOptionsPanel.h b/fedora/.local/bin/htop-vim/DisplayOptionsPanel.h deleted file mode 100644 index 5e87a63..0000000 --- a/fedora/.local/bin/htop-vim/DisplayOptionsPanel.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef HEADER_DisplayOptionsPanel -#define HEADER_DisplayOptionsPanel -/* -htop - DisplayOptionsPanel.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Panel.h" -#include "ScreenManager.h" -#include "Settings.h" - - -typedef struct DisplayOptionsPanel_ { - Panel super; - - Settings* settings; - ScreenManager* scr; -} DisplayOptionsPanel; - -extern const PanelClass DisplayOptionsPanel_class; - -DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager* scr); - -#endif diff --git a/fedora/.local/bin/htop-vim/DynamicColumn.c b/fedora/.local/bin/htop-vim/DynamicColumn.c deleted file mode 100644 index bd038df..0000000 --- a/fedora/.local/bin/htop-vim/DynamicColumn.c +++ /dev/null @@ -1,66 +0,0 @@ -/* -htop - DynamicColumn.c -(C) 2021 Sohaib Mohammed -(C) 2021 htop dev team -(C) 2021 Red Hat, Inc. All Rights Reserved. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "DynamicColumn.h" - -#include - -#include "Platform.h" -#include "RichString.h" -#include "XUtils.h" - - -Hashtable* DynamicColumns_new(void) { - return Platform_dynamicColumns(); -} - -void DynamicColumns_delete(Hashtable* dynamics) { - if (dynamics) { - Platform_dynamicColumnsDone(dynamics); - Hashtable_delete(dynamics); - } -} - -const char* DynamicColumn_init(unsigned int key) { - return Platform_dynamicColumnInit(key); -} - -typedef struct { - const char* name; - const DynamicColumn* data; - unsigned int key; -} DynamicIterator; - -static void DynamicColumn_compare(ht_key_t key, void* value, void* data) { - const DynamicColumn* column = (const DynamicColumn*)value; - DynamicIterator* iter = (DynamicIterator*)data; - if (String_eq(iter->name, column->name)) { - iter->data = column; - iter->key = key; - } -} - -const DynamicColumn* DynamicColumn_search(Hashtable* dynamics, const char* name, unsigned int* key) { - DynamicIterator iter = { .key = 0, .data = NULL, .name = name }; - if (dynamics) - Hashtable_foreach(dynamics, DynamicColumn_compare, &iter); - if (key) - *key = iter.key; - return iter.data; -} - -const DynamicColumn* DynamicColumn_lookup(Hashtable* dynamics, unsigned int key) { - return (const DynamicColumn*) Hashtable_get(dynamics, key); -} - -bool DynamicColumn_writeField(const Process* proc, RichString* str, unsigned int key) { - return Platform_dynamicColumnWriteField(proc, str, key); -} diff --git a/fedora/.local/bin/htop-vim/DynamicColumn.h b/fedora/.local/bin/htop-vim/DynamicColumn.h deleted file mode 100644 index 4760e6e..0000000 --- a/fedora/.local/bin/htop-vim/DynamicColumn.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef HEADER_DynamicColumn -#define HEADER_DynamicColumn - -#include - -#include "Hashtable.h" -#include "Process.h" -#include "RichString.h" - - -#define DYNAMIC_MAX_COLUMN_WIDTH 28 -#define DYNAMIC_DEFAULT_COLUMN_WIDTH -5 - -typedef struct DynamicColumn_ { - char name[32]; /* unique, internal-only name */ - char* heading; /* displayed in main screen */ - char* caption; /* displayed in setup menu (short name) */ - char* description; /* displayed in setup menu (detail) */ - int width; /* display width +/- for value alignment */ -} DynamicColumn; - -Hashtable* DynamicColumns_new(void); - -void DynamicColumns_delete(Hashtable* dynamics); - -const char* DynamicColumn_init(unsigned int key); - -const DynamicColumn* DynamicColumn_lookup(Hashtable* dynamics, unsigned int key); - -const DynamicColumn* DynamicColumn_search(Hashtable* dynamics, const char* name, unsigned int* key); - -bool DynamicColumn_writeField(const Process* proc, RichString* str, unsigned int key); - -#endif diff --git a/fedora/.local/bin/htop-vim/DynamicMeter.c b/fedora/.local/bin/htop-vim/DynamicMeter.c deleted file mode 100644 index a8cd76c..0000000 --- a/fedora/.local/bin/htop-vim/DynamicMeter.c +++ /dev/null @@ -1,131 +0,0 @@ -/* -htop - DynamicMeter.c -(C) 2021 htop dev team -(C) 2021 Red Hat, Inc. All Rights Reserved. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "DynamicMeter.h" - -#include -#include -#include - -#include "CRT.h" -#include "Object.h" -#include "Platform.h" -#include "ProcessList.h" -#include "RichString.h" -#include "XUtils.h" - - -static const int DynamicMeter_attributes[] = { - DYNAMIC_GRAY, - DYNAMIC_DARKGRAY, - DYNAMIC_RED, - DYNAMIC_GREEN, - DYNAMIC_BLUE, - DYNAMIC_CYAN, - DYNAMIC_MAGENTA, - DYNAMIC_YELLOW, - DYNAMIC_WHITE -}; - -Hashtable* DynamicMeters_new(void) { - return Platform_dynamicMeters(); -} - -void DynamicMeters_delete(Hashtable* dynamics) { - if (dynamics) { - Platform_dynamicMetersDone(dynamics); - Hashtable_delete(dynamics); - } -} - -typedef struct { - unsigned int key; - const char* name; - bool found; -} DynamicIterator; - -static void DynamicMeter_compare(ht_key_t key, void* value, void* data) { - const DynamicMeter* meter = (const DynamicMeter*)value; - DynamicIterator* iter = (DynamicIterator*)data; - if (String_eq(iter->name, meter->name)) { - iter->found = true; - iter->key = key; - } -} - -bool DynamicMeter_search(Hashtable* dynamics, const char* name, unsigned int* key) { - DynamicIterator iter = { .key = 0, .name = name, .found = false }; - if (dynamics) - Hashtable_foreach(dynamics, DynamicMeter_compare, &iter); - if (key) - *key = iter.key; - return iter.found; -} - -const char* DynamicMeter_lookup(Hashtable* dynamics, unsigned int key) { - const DynamicMeter* meter = Hashtable_get(dynamics, key); - return meter ? meter->name : NULL; -} - -static void DynamicMeter_init(Meter* meter) { - Platform_dynamicMeterInit(meter); -} - -static void DynamicMeter_updateValues(Meter* meter) { - Platform_dynamicMeterUpdateValues(meter); -} - -static void DynamicMeter_display(const Object* cast, RichString* out) { - const Meter* meter = (const Meter*)cast; - Platform_dynamicMeterDisplay(meter, out); -} - -static const char* DynamicMeter_getCaption(const Meter* this) { - const ProcessList* pl = this->pl; - const DynamicMeter* meter = Hashtable_get(pl->dynamicMeters, this->param); - if (meter) - return meter->caption ? meter->caption : meter->name; - return this->caption; -} - -static void DynamicMeter_getUiName(const Meter* this, char* name, size_t length) { - const ProcessList* pl = this->pl; - const DynamicMeter* meter = Hashtable_get(pl->dynamicMeters, this->param); - if (meter) { - const char* uiName = meter->caption; - if (uiName) { - int len = strlen(uiName); - if (len > 2 && uiName[len - 2] == ':') - len -= 2; - xSnprintf(name, length, "%.*s", len, uiName); - } else { - xSnprintf(name, length, "%s", meter->name); - } - } -} - -const MeterClass DynamicMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = DynamicMeter_display - }, - .init = DynamicMeter_init, - .updateValues = DynamicMeter_updateValues, - .getCaption = DynamicMeter_getCaption, - .getUiName = DynamicMeter_getUiName, - .defaultMode = TEXT_METERMODE, - .maxItems = 0, - .total = 100.0, - .attributes = DynamicMeter_attributes, - .name = "Dynamic", - .uiName = "Dynamic", - .caption = "", -}; diff --git a/fedora/.local/bin/htop-vim/DynamicMeter.h b/fedora/.local/bin/htop-vim/DynamicMeter.h deleted file mode 100644 index 3ef0176..0000000 --- a/fedora/.local/bin/htop-vim/DynamicMeter.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef HEADER_DynamicMeter -#define HEADER_DynamicMeter - -#include - -#include "Hashtable.h" -#include "Meter.h" - - -typedef struct DynamicMeter_ { - char name[32]; /* unique name, cannot contain spaces */ - char* caption; - char* description; - unsigned int type; - double maximum; -} DynamicMeter; - -Hashtable* DynamicMeters_new(void); - -void DynamicMeters_delete(Hashtable* dynamics); - -const char* DynamicMeter_lookup(Hashtable* dynamics, unsigned int key); - -bool DynamicMeter_search(Hashtable* dynamics, const char* name, unsigned int* key); - -extern const MeterClass DynamicMeter_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/EnvScreen.c b/fedora/.local/bin/htop-vim/EnvScreen.c deleted file mode 100644 index 0fcee83..0000000 --- a/fedora/.local/bin/htop-vim/EnvScreen.c +++ /dev/null @@ -1,58 +0,0 @@ -#include "config.h" // IWYU pragma: keep - -#include "EnvScreen.h" - -#include -#include - -#include "Macros.h" -#include "Panel.h" -#include "Platform.h" -#include "ProvideCurses.h" -#include "Vector.h" -#include "XUtils.h" - - -EnvScreen* EnvScreen_new(Process* process) { - EnvScreen* this = xMalloc(sizeof(EnvScreen)); - Object_setClass(this, Class(EnvScreen)); - return (EnvScreen*) InfoScreen_init(&this->super, process, NULL, LINES - 2, " "); -} - -void EnvScreen_delete(Object* this) { - free(InfoScreen_done((InfoScreen*)this)); -} - -static void EnvScreen_draw(InfoScreen* this) { - InfoScreen_drawTitled(this, "Environment of process %d - %s", this->process->pid, Process_getCommand(this->process)); -} - -static void EnvScreen_scan(InfoScreen* this) { - Panel* panel = this->display; - int idx = MAXIMUM(Panel_getSelectedIndex(panel), 0); - - Panel_prune(panel); - - char* env = Platform_getProcessEnv(this->process->pid); - if (env) { - for (const char* p = env; *p; p = strrchr(p, 0) + 1) - InfoScreen_addLine(this, p); - free(env); - } - else { - InfoScreen_addLine(this, "Could not read process environment."); - } - - Vector_insertionSort(this->lines); - Vector_insertionSort(panel->items); - Panel_setSelected(panel, idx); -} - -const InfoScreenClass EnvScreen_class = { - .super = { - .extends = Class(Object), - .delete = EnvScreen_delete - }, - .scan = EnvScreen_scan, - .draw = EnvScreen_draw -}; diff --git a/fedora/.local/bin/htop-vim/EnvScreen.h b/fedora/.local/bin/htop-vim/EnvScreen.h deleted file mode 100644 index 4d44c81..0000000 --- a/fedora/.local/bin/htop-vim/EnvScreen.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef HEADER_EnvScreen -#define HEADER_EnvScreen - -#include "InfoScreen.h" -#include "Object.h" -#include "Process.h" - - -typedef struct EnvScreen_ { - InfoScreen super; -} EnvScreen; - -extern const InfoScreenClass EnvScreen_class; - -EnvScreen* EnvScreen_new(Process* process); - -void EnvScreen_delete(Object* this); - -#endif diff --git a/fedora/.local/bin/htop-vim/FunctionBar.c b/fedora/.local/bin/htop-vim/FunctionBar.c deleted file mode 100644 index 0850037..0000000 --- a/fedora/.local/bin/htop-vim/FunctionBar.c +++ /dev/null @@ -1,155 +0,0 @@ -/* -htop - FunctionBar.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "FunctionBar.h" - -#include -#include - -#include "CRT.h" -#include "Macros.h" -#include "ProvideCurses.h" -#include "XUtils.h" - - -static const char* const FunctionBar_FKeys[] = {"F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", NULL}; - -static const char* const FunctionBar_FLabels[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", NULL}; - -static int FunctionBar_FEvents[] = {KEY_F(1), KEY_F(2), KEY_F(3), KEY_F(4), KEY_F(5), KEY_F(6), KEY_F(7), KEY_F(8), KEY_F(9), KEY_F(10)}; - -static const char* const FunctionBar_EnterEscKeys[] = {"Enter", "Esc", NULL}; -static const int FunctionBar_EnterEscEvents[] = {13, 27}; - -static int currentLen = 0; - -FunctionBar* FunctionBar_newEnterEsc(const char* enter, const char* esc) { - const char* functions[] = {enter, esc, NULL}; - return FunctionBar_new(functions, FunctionBar_EnterEscKeys, FunctionBar_EnterEscEvents); -} - -FunctionBar* FunctionBar_new(const char* const* functions, const char* const* keys, const int* events) { - FunctionBar* this = xCalloc(1, sizeof(FunctionBar)); - this->functions = xCalloc(16, sizeof(char*)); - if (!functions) { - functions = FunctionBar_FLabels; - } - for (int i = 0; i < 15 && functions[i]; i++) { - this->functions[i] = xStrdup(functions[i]); - } - if (keys && events) { - this->staticData = false; - this->keys.keys = xCalloc(15, sizeof(char*)); - this->events = xCalloc(15, sizeof(int)); - int i = 0; - while (i < 15 && functions[i]) { - this->keys.keys[i] = xStrdup(keys[i]); - this->events[i] = events[i]; - i++; - } - this->size = i; - } else { - this->staticData = true; - this->keys.constKeys = FunctionBar_FKeys; - this->events = FunctionBar_FEvents; - this->size = ARRAYSIZE(FunctionBar_FEvents); - } - return this; -} - -void FunctionBar_delete(FunctionBar* this) { - for (int i = 0; i < 15 && this->functions[i]; i++) { - free(this->functions[i]); - } - free(this->functions); - if (!this->staticData) { - for (int i = 0; i < this->size; i++) { - free(this->keys.keys[i]); - } - free(this->keys.keys); - free(this->events); - } - free(this); -} - -void FunctionBar_setLabel(FunctionBar* this, int event, const char* text) { - for (int i = 0; i < this->size; i++) { - if (this->events[i] == event) { - free(this->functions[i]); - this->functions[i] = xStrdup(text); - break; - } - } -} - -int FunctionBar_draw(const FunctionBar* this) { - return FunctionBar_drawExtra(this, NULL, -1, false); -} - -int FunctionBar_drawExtra(const FunctionBar* this, const char* buffer, int attr, bool setCursor) { - int cursorX = 0; - attrset(CRT_colors[FUNCTION_BAR]); - mvhline(LINES - 1, 0, ' ', COLS); - int x = 0; - for (int i = 0; i < this->size; i++) { - attrset(CRT_colors[FUNCTION_KEY]); - mvaddstr(LINES - 1, x, this->keys.constKeys[i]); - x += strlen(this->keys.constKeys[i]); - attrset(CRT_colors[FUNCTION_BAR]); - mvaddstr(LINES - 1, x, this->functions[i]); - x += strlen(this->functions[i]); - } - - if (buffer) { - if (attr == -1) { - attrset(CRT_colors[FUNCTION_BAR]); - } else { - attrset(attr); - } - mvaddstr(LINES - 1, x, buffer); - x += strlen(buffer); - cursorX = x; - } - - attrset(CRT_colors[RESET_COLOR]); - - if (setCursor) { - curs_set(1); - } else { - curs_set(0); - } - - currentLen = x; - - return cursorX; -} - -void FunctionBar_append(const char* buffer, int attr) { - if (attr == -1) { - attrset(CRT_colors[FUNCTION_BAR]); - } else { - attrset(attr); - } - mvaddstr(LINES - 1, currentLen + 1, buffer); - attrset(CRT_colors[RESET_COLOR]); - - currentLen += strlen(buffer) + 1; -} - -int FunctionBar_synthesizeEvent(const FunctionBar* this, int pos) { - int x = 0; - for (int i = 0; i < this->size; i++) { - x += strlen(this->keys.constKeys[i]); - x += strlen(this->functions[i]); - if (pos < x) { - return this->events[i]; - } - } - return ERR; -} diff --git a/fedora/.local/bin/htop-vim/FunctionBar.h b/fedora/.local/bin/htop-vim/FunctionBar.h deleted file mode 100644 index f01a5ef..0000000 --- a/fedora/.local/bin/htop-vim/FunctionBar.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef HEADER_FunctionBar -#define HEADER_FunctionBar -/* -htop - FunctionBar.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include - - -typedef struct FunctionBar_ { - int size; - char** functions; - union { - char** keys; - const char* const* constKeys; - } keys; - int* events; - bool staticData; -} FunctionBar; - -FunctionBar* FunctionBar_newEnterEsc(const char* enter, const char* esc); - -FunctionBar* FunctionBar_new(const char* const* functions, const char* const* keys, const int* events); - -void FunctionBar_delete(FunctionBar* this); - -void FunctionBar_setLabel(FunctionBar* this, int event, const char* text); - -int FunctionBar_draw(const FunctionBar* this); - -int FunctionBar_drawExtra(const FunctionBar* this, const char* buffer, int attr, bool setCursor); - -void FunctionBar_append(const char* buffer, int attr); - -int FunctionBar_synthesizeEvent(const FunctionBar* this, int pos); - -#endif diff --git a/fedora/.local/bin/htop-vim/Hashtable.c b/fedora/.local/bin/htop-vim/Hashtable.c deleted file mode 100644 index 2756b23..0000000 --- a/fedora/.local/bin/htop-vim/Hashtable.c +++ /dev/null @@ -1,330 +0,0 @@ -/* -htop - Hashtable.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "Hashtable.h" - -#include -#include -#include -#include - -#include "CRT.h" -#include "Macros.h" -#include "XUtils.h" - -#ifndef NDEBUG -#include -#endif - - -typedef struct HashtableItem_ { - ht_key_t key; - size_t probe; - void* value; -} HashtableItem; - -struct Hashtable_ { - size_t size; - HashtableItem* buckets; - size_t items; - bool owner; -}; - - -#ifndef NDEBUG - -static void Hashtable_dump(const Hashtable* this) { - fprintf(stderr, "Hashtable %p: size=%zu items=%zu owner=%s\n", - (const void*)this, - this->size, - this->items, - this->owner ? "yes" : "no"); - - size_t items = 0; - for (size_t i = 0; i < this->size; i++) { - fprintf(stderr, " item %5zu: key = %5u probe = %2zu value = %p\n", - i, - this->buckets[i].key, - this->buckets[i].probe, - this->buckets[i].value); - - if (this->buckets[i].value) - items++; - } - - fprintf(stderr, "Hashtable %p: items=%zu counted=%zu\n", - (const void*)this, - this->items, - items); -} - -static bool Hashtable_isConsistent(const Hashtable* this) { - size_t items = 0; - for (size_t i = 0; i < this->size; i++) { - if (this->buckets[i].value) - items++; - } - bool res = items == this->items; - if (!res) - Hashtable_dump(this); - return res; -} - -size_t Hashtable_count(const Hashtable* this) { - size_t items = 0; - for (size_t i = 0; i < this->size; i++) { - if (this->buckets[i].value) - items++; - } - assert(items == this->items); - return items; -} - -#endif /* NDEBUG */ - -/* https://oeis.org/A014234 */ -static const uint64_t OEISprimes[] = { - 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, - 16381, 32749, 65521, 131071, 262139, 524287, 1048573, - 2097143, 4194301, 8388593, 16777213, 33554393, - 67108859, 134217689, 268435399, 536870909, 1073741789, - 2147483647, 4294967291, 8589934583, 17179869143, - 34359738337, 68719476731, 137438953447 -}; - -static size_t nextPrime(size_t n) { - /* on 32-bit make sure we do not return primes not fitting in size_t */ - for (size_t i = 0; i < ARRAYSIZE(OEISprimes) && OEISprimes[i] < SIZE_MAX; i++) { - if (n <= OEISprimes[i]) - return OEISprimes[i]; - } - - CRT_fatalError("Hashtable: no prime found"); -} - -Hashtable* Hashtable_new(size_t size, bool owner) { - Hashtable* this; - - this = xMalloc(sizeof(Hashtable)); - this->items = 0; - this->size = size ? nextPrime(size) : 13; - this->buckets = (HashtableItem*) xCalloc(this->size, sizeof(HashtableItem)); - this->owner = owner; - - assert(Hashtable_isConsistent(this)); - return this; -} - -void Hashtable_delete(Hashtable* this) { - Hashtable_clear(this); - - free(this->buckets); - free(this); -} - -void Hashtable_clear(Hashtable* this) { - assert(Hashtable_isConsistent(this)); - - if (this->owner) - for (size_t i = 0; i < this->size; i++) - free(this->buckets[i].value); - - memset(this->buckets, 0, this->size * sizeof(HashtableItem)); - this->items = 0; - - assert(Hashtable_isConsistent(this)); -} - -static void insert(Hashtable* this, ht_key_t key, void* value) { - size_t index = key % this->size; - size_t probe = 0; -#ifndef NDEBUG - size_t origIndex = index; -#endif - - for (;;) { - if (!this->buckets[index].value) { - this->items++; - this->buckets[index].key = key; - this->buckets[index].probe = probe; - this->buckets[index].value = value; - return; - } - - if (this->buckets[index].key == key) { - if (this->owner && this->buckets[index].value != value) - free(this->buckets[index].value); - this->buckets[index].value = value; - return; - } - - /* Robin Hood swap */ - if (probe > this->buckets[index].probe) { - HashtableItem tmp = this->buckets[index]; - - this->buckets[index].key = key; - this->buckets[index].probe = probe; - this->buckets[index].value = value; - - key = tmp.key; - probe = tmp.probe; - value = tmp.value; - } - - index = (index + 1) % this->size; - probe++; - - assert(index != origIndex); - } -} - -void Hashtable_setSize(Hashtable* this, size_t size) { - - assert(Hashtable_isConsistent(this)); - - if (size <= this->items) - return; - - size_t newSize = nextPrime(size); - if (newSize == this->size) - return; - - HashtableItem* oldBuckets = this->buckets; - size_t oldSize = this->size; - - this->size = newSize; - this->buckets = (HashtableItem*) xCalloc(this->size, sizeof(HashtableItem)); - this->items = 0; - - /* rehash */ - for (size_t i = 0; i < oldSize; i++) { - if (!oldBuckets[i].value) - continue; - - insert(this, oldBuckets[i].key, oldBuckets[i].value); - } - - free(oldBuckets); - - assert(Hashtable_isConsistent(this)); -} - -void Hashtable_put(Hashtable* this, ht_key_t key, void* value) { - - assert(Hashtable_isConsistent(this)); - assert(this->size > 0); - assert(value); - - /* grow on load-factor > 0.7 */ - if (10 * this->items > 7 * this->size) { - if (SIZE_MAX / 2 < this->size) - CRT_fatalError("Hashtable: size overflow"); - - Hashtable_setSize(this, 2 * this->size); - } - - insert(this, key, value); - - assert(Hashtable_isConsistent(this)); - assert(Hashtable_get(this, key) != NULL); - assert(this->size > this->items); -} - -void* Hashtable_remove(Hashtable* this, ht_key_t key) { - size_t index = key % this->size; - size_t probe = 0; -#ifndef NDEBUG - size_t origIndex = index; -#endif - - assert(Hashtable_isConsistent(this)); - - void* res = NULL; - - while (this->buckets[index].value) { - if (this->buckets[index].key == key) { - if (this->owner) { - free(this->buckets[index].value); - } else { - res = this->buckets[index].value; - } - - size_t next = (index + 1) % this->size; - - while (this->buckets[next].value && this->buckets[next].probe > 0) { - this->buckets[index] = this->buckets[next]; - this->buckets[index].probe -= 1; - - index = next; - next = (index + 1) % this->size; - } - - /* set empty after backward shifting */ - this->buckets[index].value = NULL; - this->items--; - - break; - } - - if (this->buckets[index].probe < probe) - break; - - index = (index + 1) % this->size; - probe++; - - assert(index != origIndex); - } - - assert(Hashtable_isConsistent(this)); - assert(Hashtable_get(this, key) == NULL); - - /* shrink on load-factor < 0.125 */ - if (8 * this->items < this->size) - Hashtable_setSize(this, this->size / 3); /* account for nextPrime rounding up */ - - return res; -} - -void* Hashtable_get(Hashtable* this, ht_key_t key) { - size_t index = key % this->size; - size_t probe = 0; - void* res = NULL; -#ifndef NDEBUG - size_t origIndex = index; -#endif - - assert(Hashtable_isConsistent(this)); - - while (this->buckets[index].value) { - if (this->buckets[index].key == key) { - res = this->buckets[index].value; - break; - } - - if (this->buckets[index].probe < probe) - break; - - index = (index + 1) != this->size ? (index + 1) : 0; - probe++; - - assert(index != origIndex); - } - - return res; -} - -void Hashtable_foreach(Hashtable* this, Hashtable_PairFunction f, void* userData) { - assert(Hashtable_isConsistent(this)); - for (size_t i = 0; i < this->size; i++) { - HashtableItem* walk = &this->buckets[i]; - if (walk->value) - f(walk->key, walk->value, userData); - } - assert(Hashtable_isConsistent(this)); -} diff --git a/fedora/.local/bin/htop-vim/Hashtable.h b/fedora/.local/bin/htop-vim/Hashtable.h deleted file mode 100644 index f51a294..0000000 --- a/fedora/.local/bin/htop-vim/Hashtable.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef HEADER_Hashtable -#define HEADER_Hashtable -/* -htop - Hashtable.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include - - -typedef unsigned int ht_key_t; - -typedef void(*Hashtable_PairFunction)(ht_key_t key, void* value, void* userdata); - -typedef struct Hashtable_ Hashtable; - -#ifndef NDEBUG - -size_t Hashtable_count(const Hashtable* this); - -#endif /* NDEBUG */ - -Hashtable* Hashtable_new(size_t size, bool owner); - -void Hashtable_delete(Hashtable* this); - -void Hashtable_clear(Hashtable* this); - -void Hashtable_setSize(Hashtable* this, size_t size); - -void Hashtable_put(Hashtable* this, ht_key_t key, void* value); - -void* Hashtable_remove(Hashtable* this, ht_key_t key); - -void* Hashtable_get(Hashtable* this, ht_key_t key); - -void Hashtable_foreach(Hashtable* this, Hashtable_PairFunction f, void* userData); - -#endif diff --git a/fedora/.local/bin/htop-vim/Header.c b/fedora/.local/bin/htop-vim/Header.c deleted file mode 100644 index 1953c02..0000000 --- a/fedora/.local/bin/htop-vim/Header.c +++ /dev/null @@ -1,304 +0,0 @@ -/* -htop - Header.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Header.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "CRT.h" -#include "CPUMeter.h" -#include "DynamicMeter.h" -#include "Macros.h" -#include "Object.h" -#include "Platform.h" -#include "ProvideCurses.h" -#include "XUtils.h" - - -Header* Header_new(ProcessList* pl, Settings* settings, HeaderLayout hLayout) { - Header* this = xCalloc(1, sizeof(Header)); - this->columns = xMallocArray(HeaderLayout_getColumns(hLayout), sizeof(Vector*)); - this->settings = settings; - this->pl = pl; - this->headerLayout = hLayout; - - Header_forEachColumn(this, i) { - this->columns[i] = Vector_new(Class(Meter), true, DEFAULT_SIZE); - } - - return this; -} - -void Header_delete(Header* this) { - Header_forEachColumn(this, i) { - Vector_delete(this->columns[i]); - } - - free(this->columns); - free(this); -} - -void Header_setLayout(Header* this, HeaderLayout hLayout) { - size_t oldColumns = HeaderLayout_getColumns(this->headerLayout); - size_t newColumns = HeaderLayout_getColumns(hLayout); - - this->headerLayout = hLayout; - - if (newColumns == oldColumns) - return; - - if (newColumns > oldColumns) { - this->columns = xReallocArray(this->columns, newColumns, sizeof(Vector*)); - for (size_t i = oldColumns; i < newColumns; i++) - this->columns[i] = Vector_new(Class(Meter), true, DEFAULT_SIZE); - } else { - // move meters from to-be-deleted columns into last one - for (size_t i = newColumns; i < oldColumns; i++) { - for (int j = this->columns[i]->items - 1; j >= 0; j--) { - Vector_add(this->columns[newColumns - 1], Vector_take(this->columns[i], j)); - } - Vector_delete(this->columns[i]); - } - this->columns = xReallocArray(this->columns, newColumns, sizeof(Vector*)); - } - - Header_calculateHeight(this); -} - -static void Header_addMeterByName(Header* this, const char* name, MeterModeId mode, unsigned int column) { - assert(column < HeaderLayout_getColumns(this->headerLayout)); - - Vector* meters = this->columns[column]; - - const char* paren = strchr(name, '('); - unsigned int param = 0; - size_t nameLen; - if (paren) { - int ok = sscanf(paren, "(%10u)", ¶m); // CPUMeter - if (!ok) { - char dynamic[32] = {0}; - if (sscanf(paren, "(%30s)", dynamic)) { // DynamicMeter - char* end; - if ((end = strrchr(dynamic, ')')) == NULL) - return; // htoprc parse failure - *end = '\0'; - if (!DynamicMeter_search(this->pl->dynamicMeters, dynamic, ¶m)) - return; // name lookup failure - } else { - param = 0; - } - } - nameLen = paren - name; - } else { - nameLen = strlen(name); - } - - for (const MeterClass* const* type = Platform_meterTypes; *type; type++) { - if (0 == strncmp(name, (*type)->name, nameLen) && (*type)->name[nameLen] == '\0') { - Meter* meter = Meter_new(this->pl, param, *type); - if (mode != 0) { - Meter_setMode(meter, mode); - } - Vector_add(meters, meter); - break; - } - } -} - -void Header_populateFromSettings(Header* this) { - Header_setLayout(this, this->settings->hLayout); - - Header_forEachColumn(this, col) { - const MeterColumnSetting* colSettings = &this->settings->hColumns[col]; - Vector_prune(this->columns[col]); - for (size_t i = 0; i < colSettings->len; i++) { - Header_addMeterByName(this, colSettings->names[i], colSettings->modes[i], col); - } - } - - Header_calculateHeight(this); -} - -void Header_writeBackToSettings(const Header* this) { - Settings_setHeaderLayout(this->settings, this->headerLayout); - - Header_forEachColumn(this, col) { - MeterColumnSetting* colSettings = &this->settings->hColumns[col]; - - if (colSettings->names) { - for (size_t j = 0; j < colSettings->len; j++) - free(colSettings->names[j]); - free(colSettings->names); - } - free(colSettings->modes); - - const Vector* vec = this->columns[col]; - int len = Vector_size(vec); - - colSettings->names = len ? xCalloc(len + 1, sizeof(char*)) : NULL; - colSettings->modes = len ? xCalloc(len, sizeof(int)) : NULL; - colSettings->len = len; - - for (int i = 0; i < len; i++) { - const Meter* meter = (Meter*) Vector_get(vec, i); - char* name; - if (meter->param && As_Meter(meter) == &DynamicMeter_class) { - const char* dynamic = DynamicMeter_lookup(this->pl->dynamicMeters, meter->param); - xAsprintf(&name, "%s(%s)", As_Meter(meter)->name, dynamic); - } else if (meter->param && As_Meter(meter) == &CPUMeter_class) { - xAsprintf(&name, "%s(%u)", As_Meter(meter)->name, meter->param); - } else { - xAsprintf(&name, "%s", As_Meter(meter)->name); - } - colSettings->names[i] = name; - colSettings->modes[i] = meter->mode; - } - } -} - -Meter* Header_addMeterByClass(Header* this, const MeterClass* type, unsigned int param, unsigned int column) { - assert(column < HeaderLayout_getColumns(this->headerLayout)); - - Vector* meters = this->columns[column]; - - Meter* meter = Meter_new(this->pl, param, type); - Vector_add(meters, meter); - return meter; -} - -void Header_reinit(Header* this) { - Header_forEachColumn(this, col) { - for (int i = 0; i < Vector_size(this->columns[col]); i++) { - Meter* meter = (Meter*) Vector_get(this->columns[col], i); - if (Meter_initFn(meter)) { - Meter_init(meter); - } - } - } -} - -void Header_draw(const Header* this) { - const int height = this->height; - const int pad = this->pad; - attrset(CRT_colors[RESET_COLOR]); - for (int y = 0; y < height; y++) { - mvhline(y, 0, ' ', COLS); - } - const int numCols = HeaderLayout_getColumns(this->headerLayout); - const int width = COLS - 2 * pad - (numCols - 1); - int x = pad; - float roundingLoss = 0.0F; - - Header_forEachColumn(this, col) { - Vector* meters = this->columns[col]; - float colWidth = (float)width * HeaderLayout_layouts[this->headerLayout].widths[col] / 100.0F; - - roundingLoss += colWidth - floorf(colWidth); - if (roundingLoss >= 1.0F) { - colWidth += 1.0F; - roundingLoss -= 1.0F; - } - - for (int y = (pad / 2), i = 0; i < Vector_size(meters); i++) { - Meter* meter = (Meter*) Vector_get(meters, i); - - float actualWidth = colWidth; - - /* Let meters in text mode expand to the right on empty neighbors; - except for multi column meters. */ - if (meter->mode == TEXT_METERMODE && !Meter_isMultiColumn(meter)) { - for (int j = 1; j < meter->columnWidthCount; j++) { - actualWidth++; /* separator column */ - actualWidth += (float)width * HeaderLayout_layouts[this->headerLayout].widths[col + j] / 100.0F; - } - } - - assert(meter->draw); - meter->draw(meter, x, y, floorf(actualWidth)); - y += meter->h; - } - - x += floorf(colWidth); - x++; /* separator column */ - } -} - -void Header_updateData(Header* this) { - Header_forEachColumn(this, col) { - Vector* meters = this->columns[col]; - int items = Vector_size(meters); - for (int i = 0; i < items; i++) { - Meter* meter = (Meter*) Vector_get(meters, i); - Meter_updateValues(meter); - } - } -} - -/* - * Calculate how many columns the current meter is allowed to span, - * by counting how many columns to the right are empty or contain a BlankMeter. - * Returns the number of columns to span, i.e. if the direct neighbor is occupied 1. - */ -static int calcColumnWidthCount(const Header* this, const Meter* curMeter, const int pad, const unsigned int curColumn, const int curHeight) { - for (size_t i = curColumn + 1; i < HeaderLayout_getColumns(this->headerLayout); i++) { - const Vector* meters = this->columns[i]; - - int height = pad; - for (int j = 0; j < Vector_size(meters); j++) { - const Meter* meter = (const Meter*) Vector_get(meters, j); - - if (height >= curHeight + curMeter->h) - break; - - height += meter->h; - if (height <= curHeight) - continue; - - if (!Object_isA((const Object*) meter, (const ObjectClass*) &BlankMeter_class)) - return i - curColumn; - } - } - - return HeaderLayout_getColumns(this->headerLayout) - curColumn; -} - -int Header_calculateHeight(Header* this) { - const int pad = this->settings->headerMargin ? 2 : 0; - int maxHeight = pad; - - Header_forEachColumn(this, col) { - const Vector* meters = this->columns[col]; - int height = pad; - for (int i = 0; i < Vector_size(meters); i++) { - Meter* meter = (Meter*) Vector_get(meters, i); - meter->columnWidthCount = calcColumnWidthCount(this, meter, pad, col, height); - height += meter->h; - } - maxHeight = MAXIMUM(maxHeight, height); - } - - if (maxHeight == pad) { - maxHeight = 0; - this->pad = 0; - } else { - this->pad = pad; - } - - if (this->settings->screenTabs) { - maxHeight++; - } - - this->height = maxHeight; - - return maxHeight; -} diff --git a/fedora/.local/bin/htop-vim/Header.h b/fedora/.local/bin/htop-vim/Header.h deleted file mode 100644 index 954d434..0000000 --- a/fedora/.local/bin/htop-vim/Header.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef HEADER_Header -#define HEADER_Header -/* -htop - Header.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "HeaderLayout.h" -#include "Meter.h" -#include "ProcessList.h" -#include "Settings.h" -#include "Vector.h" - - -typedef struct Header_ { - Vector** columns; - Settings* settings; - ProcessList* pl; - HeaderLayout headerLayout; - int pad; - int height; -} Header; - -#define Header_forEachColumn(this_, i_) for (size_t (i_)=0, H_fEC_numColumns_ = HeaderLayout_getColumns((this_)->headerLayout); (i_) < H_fEC_numColumns_; ++(i_)) - -Header* Header_new(ProcessList* pl, Settings* settings, HeaderLayout hLayout); - -void Header_delete(Header* this); - -void Header_setLayout(Header* this, HeaderLayout hLayout); - -void Header_populateFromSettings(Header* this); - -void Header_writeBackToSettings(const Header* this); - -Meter* Header_addMeterByClass(Header* this, const MeterClass* type, unsigned int param, unsigned int column); - -void Header_reinit(Header* this); - -void Header_draw(const Header* this); - -void Header_updateData(Header* this); - -int Header_calculateHeight(Header* this); - -#endif diff --git a/fedora/.local/bin/htop-vim/HeaderLayout.h b/fedora/.local/bin/htop-vim/HeaderLayout.h deleted file mode 100644 index 1cf7bf7..0000000 --- a/fedora/.local/bin/htop-vim/HeaderLayout.h +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef HEADER_HeaderLayout -#define HEADER_HeaderLayout -/* -htop - HeaderLayout.h -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include -#include -#include - -#include "Macros.h" -#include "XUtils.h" - - -typedef enum HeaderLayout_ { - HF_INVALID = -1, - HF_TWO_50_50, - HF_TWO_33_67, - HF_TWO_67_33, - HF_THREE_33_34_33, - HF_THREE_25_25_50, - HF_THREE_25_50_25, - HF_THREE_50_25_25, - HF_THREE_40_20_40, - HF_FOUR_25_25_25_25, - LAST_HEADER_LAYOUT -} HeaderLayout; - -static const struct { - uint8_t columns; - const uint8_t widths[4]; - const char* name; - const char* description; -} HeaderLayout_layouts[LAST_HEADER_LAYOUT] = { - [HF_TWO_50_50] = { 2, { 50, 50, 0, 0 }, "two_50_50", "2 columns - 50/50 (default)", }, - [HF_TWO_33_67] = { 2, { 33, 67, 0, 0 }, "two_33_67", "2 columns - 33/67", }, - [HF_TWO_67_33] = { 2, { 67, 33, 0, 0 }, "two_67_33", "2 columns - 67/33", }, - [HF_THREE_33_34_33] = { 3, { 33, 34, 33, 0 }, "three_33_34_33", "3 columns - 33/34/33", }, - [HF_THREE_25_25_50] = { 3, { 25, 25, 50, 0 }, "three_25_25_50", "3 columns - 25/25/50", }, - [HF_THREE_25_50_25] = { 3, { 25, 50, 25, 0 }, "three_25_50_25", "3 columns - 25/50/25", }, - [HF_THREE_50_25_25] = { 3, { 50, 25, 25, 0 }, "three_50_25_25", "3 columns - 50/25/25", }, - [HF_THREE_40_20_40] = { 3, { 40, 20, 40, 0 }, "three_40_20_40", "3 columns - 40/20/40", }, - [HF_FOUR_25_25_25_25] = { 4, { 25, 25, 25, 25 }, "four_25_25_25_25", "4 columns - 25/25/25/25", }, -}; - -static inline size_t HeaderLayout_getColumns(HeaderLayout hLayout) { - /* assert the layout is initialized */ - assert(0 <= hLayout); - assert(hLayout < LAST_HEADER_LAYOUT); - assert(HeaderLayout_layouts[hLayout].name[0]); - assert(HeaderLayout_layouts[hLayout].description[0]); - return HeaderLayout_layouts[hLayout].columns; -} - -static inline const char* HeaderLayout_getName(HeaderLayout hLayout) { - /* assert the layout is initialized */ - assert(0 <= hLayout); - assert(hLayout < LAST_HEADER_LAYOUT); - assert(HeaderLayout_layouts[hLayout].name[0]); - assert(HeaderLayout_layouts[hLayout].description[0]); - return HeaderLayout_layouts[hLayout].name; -} - -static inline HeaderLayout HeaderLayout_fromName(const char* name) { - for (size_t i = 0; i < LAST_HEADER_LAYOUT; i++) { - if (String_eq(HeaderLayout_layouts[i].name, name)) - return (HeaderLayout) i; - } - - return LAST_HEADER_LAYOUT; -} - -#endif /* HEADER_HeaderLayout */ diff --git a/fedora/.local/bin/htop-vim/HeaderOptionsPanel.c b/fedora/.local/bin/htop-vim/HeaderOptionsPanel.c deleted file mode 100644 index 25d1ddb..0000000 --- a/fedora/.local/bin/htop-vim/HeaderOptionsPanel.c +++ /dev/null @@ -1,88 +0,0 @@ -/* -htop - HeaderOptionsPanel.c -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "HeaderOptionsPanel.h" - -#include -#include -#include - -#include "CRT.h" -#include "FunctionBar.h" -#include "Header.h" -#include "HeaderLayout.h" -#include "Object.h" -#include "OptionItem.h" -#include "ProvideCurses.h" - - -static const char* const HeaderOptionsFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL}; - -static void HeaderOptionsPanel_delete(Object* object) { - Panel* super = (Panel*) object; - HeaderOptionsPanel* this = (HeaderOptionsPanel*) object; - Panel_done(super); - free(this); -} - -static HandlerResult HeaderOptionsPanel_eventHandler(Panel* super, int ch) { - HeaderOptionsPanel* this = (HeaderOptionsPanel*) super; - - HandlerResult result = IGNORED; - int mark; - - switch (ch) { - case 0x0a: - case 0x0d: - case KEY_ENTER: - case KEY_MOUSE: - case KEY_RECLICK: - case ' ': - mark = Panel_getSelectedIndex(super); - assert(mark >= 0); - assert(mark < LAST_HEADER_LAYOUT); - - for (int i = 0; i < LAST_HEADER_LAYOUT; i++) - CheckItem_set((CheckItem*)Panel_get(super, i), false); - CheckItem_set((CheckItem*)Panel_get(super, mark), true); - - Header_setLayout(this->scr->header, mark); - this->settings->changed = true; - this->settings->lastUpdate++; - - ScreenManager_resize(this->scr); - - result = HANDLED; - } - - return result; -} - -const PanelClass HeaderOptionsPanel_class = { - .super = { - .extends = Class(Panel), - .delete = HeaderOptionsPanel_delete - }, - .eventHandler = HeaderOptionsPanel_eventHandler -}; - -HeaderOptionsPanel* HeaderOptionsPanel_new(Settings* settings, ScreenManager* scr) { - HeaderOptionsPanel* this = AllocThis(HeaderOptionsPanel); - Panel* super = (Panel*) this; - FunctionBar* fuBar = FunctionBar_new(HeaderOptionsFunctions, NULL, NULL); - Panel_init(super, 1, 1, 1, 1, Class(CheckItem), true, fuBar); - - this->scr = scr; - this->settings = settings; - - Panel_setHeader(super, "Header Layout"); - for (int i = 0; i < LAST_HEADER_LAYOUT; i++) { - Panel_add(super, (Object*) CheckItem_newByVal(HeaderLayout_layouts[i].description, false)); - } - CheckItem_set((CheckItem*)Panel_get(super, scr->header->headerLayout), true); - return this; -} diff --git a/fedora/.local/bin/htop-vim/HeaderOptionsPanel.h b/fedora/.local/bin/htop-vim/HeaderOptionsPanel.h deleted file mode 100644 index aee9328..0000000 --- a/fedora/.local/bin/htop-vim/HeaderOptionsPanel.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef HEADER_HeaderOptionsPanel -#define HEADER_HeaderOptionsPanel -/* -htop - ColorsPanel.h -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Panel.h" -#include "ScreenManager.h" -#include "Settings.h" - - -typedef struct HeaderOptionsPanel_ { - Panel super; - - ScreenManager* scr; - Settings* settings; -} HeaderOptionsPanel; - -extern const PanelClass HeaderOptionsPanel_class; - -HeaderOptionsPanel* HeaderOptionsPanel_new(Settings* settings, ScreenManager* scr); - -#endif /* HEADER_HeaderOptionsPanel */ diff --git a/fedora/.local/bin/htop-vim/HostnameMeter.c b/fedora/.local/bin/htop-vim/HostnameMeter.c deleted file mode 100644 index 78444ea..0000000 --- a/fedora/.local/bin/htop-vim/HostnameMeter.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -htop - HostnameMeter.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "HostnameMeter.h" - -#include "CRT.h" -#include "Object.h" -#include "Platform.h" - - -static const int HostnameMeter_attributes[] = { - HOSTNAME -}; - -static void HostnameMeter_updateValues(Meter* this) { - Platform_getHostname(this->txtBuffer, sizeof(this->txtBuffer)); -} - -const MeterClass HostnameMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete - }, - .updateValues = HostnameMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 0, - .total = 100.0, - .attributes = HostnameMeter_attributes, - .name = "Hostname", - .uiName = "Hostname", - .caption = "Hostname: ", -}; diff --git a/fedora/.local/bin/htop-vim/HostnameMeter.h b/fedora/.local/bin/htop-vim/HostnameMeter.h deleted file mode 100644 index ec1b63a..0000000 --- a/fedora/.local/bin/htop-vim/HostnameMeter.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef HEADER_HostnameMeter -#define HEADER_HostnameMeter -/* -htop - HostnameMeter.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Meter.h" - - -extern const MeterClass HostnameMeter_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/IncSet.c b/fedora/.local/bin/htop-vim/IncSet.c deleted file mode 100644 index 71edf1c..0000000 --- a/fedora/.local/bin/htop-vim/IncSet.c +++ /dev/null @@ -1,247 +0,0 @@ -/* -htop - IncSet.c -(C) 2005-2012 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "IncSet.h" - -#include -#include -#include - -#include "CRT.h" -#include "ListItem.h" -#include "Object.h" -#include "ProvideCurses.h" -#include "XUtils.h" - - -static void IncMode_reset(IncMode* mode) { - mode->index = 0; - mode->buffer[0] = 0; -} - -void IncSet_reset(IncSet* this, IncType type) { - IncMode_reset(&this->modes[type]); -} - -void IncSet_setFilter(IncSet* this, const char* filter) { - IncMode* mode = &this->modes[INC_FILTER]; - size_t len = String_safeStrncpy(mode->buffer, filter, sizeof(mode->buffer)); - mode->index = len; - this->filtering = true; -} - -static const char* const searchFunctions[] = {"Next ", "Prev ", "Cancel ", " Search: ", NULL}; -static const char* const searchKeys[] = {"F3", "S-F3", "Esc", " "}; -static const int searchEvents[] = {KEY_F(3), KEY_F(15), 27, ERR}; - -static inline void IncMode_initSearch(IncMode* search) { - memset(search, 0, sizeof(IncMode)); - search->bar = FunctionBar_new(searchFunctions, searchKeys, searchEvents); - search->isFilter = false; -} - -static const char* const filterFunctions[] = {"Done ", "Clear ", " Filter: ", NULL}; -static const char* const filterKeys[] = {"Enter", "Esc", " "}; -static const int filterEvents[] = {13, 27, ERR}; - -static inline void IncMode_initFilter(IncMode* filter) { - memset(filter, 0, sizeof(IncMode)); - filter->bar = FunctionBar_new(filterFunctions, filterKeys, filterEvents); - filter->isFilter = true; -} - -static inline void IncMode_done(IncMode* mode) { - FunctionBar_delete(mode->bar); -} - -IncSet* IncSet_new(FunctionBar* bar) { - IncSet* this = xMalloc(sizeof(IncSet)); - IncMode_initSearch(&(this->modes[INC_SEARCH])); - IncMode_initFilter(&(this->modes[INC_FILTER])); - this->active = NULL; - this->defaultBar = bar; - this->filtering = false; - this->found = false; - return this; -} - -void IncSet_delete(IncSet* this) { - IncMode_done(&(this->modes[0])); - IncMode_done(&(this->modes[1])); - free(this); -} - -static void updateWeakPanel(const IncSet* this, Panel* panel, Vector* lines) { - const Object* selected = Panel_getSelected(panel); - Panel_prune(panel); - if (this->filtering) { - int n = 0; - const char* incFilter = this->modes[INC_FILTER].buffer; - for (int i = 0; i < Vector_size(lines); i++) { - ListItem* line = (ListItem*)Vector_get(lines, i); - if (String_contains_i(line->value, incFilter, true)) { - Panel_add(panel, (Object*)line); - if (selected == (Object*)line) { - Panel_setSelected(panel, n); - } - - n++; - } - } - } else { - for (int i = 0; i < Vector_size(lines); i++) { - Object* line = Vector_get(lines, i); - Panel_add(panel, line); - if (selected == line) { - Panel_setSelected(panel, i); - } - } - } -} - -static bool search(const IncSet* this, Panel* panel, IncMode_GetPanelValue getPanelValue) { - int size = Panel_size(panel); - for (int i = 0; i < size; i++) { - if (String_contains_i(getPanelValue(panel, i), this->active->buffer, true)) { - Panel_setSelected(panel, i); - return true; - } - } - - return false; -} - -void IncSet_activate(IncSet* this, IncType type, Panel* panel) { - this->active = &(this->modes[type]); - panel->currentBar = this->active->bar; - panel->cursorOn = true; - this->panel = panel; - IncSet_drawBar(this, CRT_colors[FUNCTION_BAR]); -} - -static void IncSet_deactivate(IncSet* this, Panel* panel) { - this->active = NULL; - Panel_setDefaultBar(panel); - panel->cursorOn = false; - FunctionBar_draw(this->defaultBar); -} - -static bool IncMode_find(const IncMode* mode, Panel* panel, IncMode_GetPanelValue getPanelValue, int step) { - int size = Panel_size(panel); - int here = Panel_getSelectedIndex(panel); - int i = here; - for (;;) { - i += step; - if (i == size) { - i = 0; - } - if (i == -1) { - i = size - 1; - } - if (i == here) { - return false; - } - - if (String_contains_i(getPanelValue(panel, i), mode->buffer, true)) { - Panel_setSelected(panel, i); - return true; - } - } -} - -bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue getPanelValue, Vector* lines) { - if (ch == ERR) - return true; - - IncMode* mode = this->active; - int size = Panel_size(panel); - bool filterChanged = false; - bool doSearch = true; - if (ch == KEY_F(3) || ch == KEY_F(15)) { - if (size == 0) - return true; - - IncMode_find(mode, panel, getPanelValue, ch == KEY_F(3) ? 1 : -1); - doSearch = false; - } else if (0 < ch && ch < 255 && isprint((unsigned char)ch)) { - if (mode->index < INCMODE_MAX) { - mode->buffer[mode->index] = (char) ch; - mode->index++; - mode->buffer[mode->index] = 0; - if (mode->isFilter) { - filterChanged = true; - if (mode->index == 1) { - this->filtering = true; - } - } - } - } else if (ch == KEY_BACKSPACE || ch == 127) { - if (mode->index > 0) { - mode->index--; - mode->buffer[mode->index] = 0; - if (mode->isFilter) { - filterChanged = true; - if (mode->index == 0) { - this->filtering = false; - IncMode_reset(mode); - } - } - } else { - doSearch = false; - } - } else if (ch == KEY_RESIZE) { - doSearch = (mode->index > 0); - } else { - if (mode->isFilter) { - filterChanged = true; - if (ch == 27) { - this->filtering = false; - IncMode_reset(mode); - } - } else { - if (ch == 27) { - IncMode_reset(mode); - } - } - IncSet_deactivate(this, panel); - doSearch = false; - } - if (doSearch) { - this->found = search(this, panel, getPanelValue); - } - if (filterChanged && lines) { - updateWeakPanel(this, panel, lines); - } - return filterChanged; -} - -const char* IncSet_getListItemValue(Panel* panel, int i) { - const ListItem* l = (const ListItem*) Panel_get(panel, i); - return l ? l->value : ""; -} - -void IncSet_drawBar(const IncSet* this, int attr) { - if (this->active) { - if (!this->active->isFilter && !this->found) - attr = CRT_colors[FAILED_SEARCH]; - int cursorX = FunctionBar_drawExtra(this->active->bar, this->active->buffer, attr, true); - this->panel->cursorY = LINES - 1; - this->panel->cursorX = cursorX; - } else { - FunctionBar_draw(this->defaultBar); - } -} - -int IncSet_synthesizeEvent(IncSet* this, int x) { - if (this->active) { - return FunctionBar_synthesizeEvent(this->active->bar, x); - } else { - return FunctionBar_synthesizeEvent(this->defaultBar, x); - } -} diff --git a/fedora/.local/bin/htop-vim/IncSet.h b/fedora/.local/bin/htop-vim/IncSet.h deleted file mode 100644 index 15b5d5d..0000000 --- a/fedora/.local/bin/htop-vim/IncSet.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef HEADER_IncSet -#define HEADER_IncSet -/* -htop - IncSet.h -(C) 2005-2012 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include - -#include "FunctionBar.h" -#include "Panel.h" -#include "Vector.h" - - -#define INCMODE_MAX 40 - -typedef enum { - INC_SEARCH = 0, - INC_FILTER = 1 -} IncType; - -typedef struct IncMode_ { - char buffer[INCMODE_MAX + 1]; - int index; - FunctionBar* bar; - bool isFilter; -} IncMode; - -typedef struct IncSet_ { - IncMode modes[2]; - IncMode* active; - Panel* panel; - FunctionBar* defaultBar; - bool filtering; - bool found; -} IncSet; - -static inline const char* IncSet_filter(const IncSet* this) { - return this->filtering ? this->modes[INC_FILTER].buffer : NULL; -} - -void IncSet_setFilter(IncSet* this, const char* filter); - -typedef const char* (*IncMode_GetPanelValue)(Panel*, int); - -void IncSet_reset(IncSet* this, IncType type); - -IncSet* IncSet_new(FunctionBar* bar); - -void IncSet_delete(IncSet* this); - -bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue getPanelValue, Vector* lines); - -const char* IncSet_getListItemValue(Panel* panel, int i); - -void IncSet_activate(IncSet* this, IncType type, Panel* panel); - -void IncSet_drawBar(const IncSet* this, int attr); - -int IncSet_synthesizeEvent(IncSet* this, int x); - -#endif diff --git a/fedora/.local/bin/htop-vim/InfoScreen.c b/fedora/.local/bin/htop-vim/InfoScreen.c deleted file mode 100644 index 105d9c3..0000000 --- a/fedora/.local/bin/htop-vim/InfoScreen.c +++ /dev/null @@ -1,177 +0,0 @@ -#include "config.h" // IWYU pragma: keep - -#include "InfoScreen.h" - -#include -#include -#include - -#include "CRT.h" -#include "IncSet.h" -#include "ListItem.h" -#include "Object.h" -#include "ProvideCurses.h" -#include "XUtils.h" - - -static const char* const InfoScreenFunctions[] = {"Search ", "Filter ", "Refresh", "Done ", NULL}; - -static const char* const InfoScreenKeys[] = {"F3", "F4", "F5", "Esc"}; - -static const int InfoScreenEvents[] = {KEY_F(3), KEY_F(4), KEY_F(5), 27}; - -InfoScreen* InfoScreen_init(InfoScreen* this, const Process* process, FunctionBar* bar, int height, const char* panelHeader) { - this->process = process; - if (!bar) { - bar = FunctionBar_new(InfoScreenFunctions, InfoScreenKeys, InfoScreenEvents); - } - this->display = Panel_new(0, 1, COLS, height, Class(ListItem), false, bar); - this->inc = IncSet_new(bar); - this->lines = Vector_new(Vector_type(this->display->items), true, DEFAULT_SIZE); - Panel_setHeader(this->display, panelHeader); - return this; -} - -InfoScreen* InfoScreen_done(InfoScreen* this) { - Panel_delete((Object*)this->display); - IncSet_delete(this->inc); - Vector_delete(this->lines); - return this; -} - -void InfoScreen_drawTitled(InfoScreen* this, const char* fmt, ...) { - va_list ap; - va_start(ap, fmt); - - char title[COLS + 1]; - int len = vsnprintf(title, sizeof(title), fmt, ap); - va_end(ap); - - if (len > COLS) { - memset(&title[COLS - 3], '.', 3); - } - - attrset(CRT_colors[METER_TEXT]); - mvhline(0, 0, ' ', COLS); - mvaddstr(0, 0, title); - attrset(CRT_colors[DEFAULT_COLOR]); - Panel_draw(this->display, true, true, true, false); - - IncSet_drawBar(this->inc, CRT_colors[FUNCTION_BAR]); -} - -void InfoScreen_addLine(InfoScreen* this, const char* line) { - Vector_add(this->lines, (Object*) ListItem_new(line, 0)); - const char* incFilter = IncSet_filter(this->inc); - if (!incFilter || String_contains_i(line, incFilter, true)) { - Panel_add(this->display, Vector_get(this->lines, Vector_size(this->lines) - 1)); - } -} - -void InfoScreen_appendLine(InfoScreen* this, const char* line) { - ListItem* last = (ListItem*)Vector_get(this->lines, Vector_size(this->lines) - 1); - ListItem_append(last, line); - const char* incFilter = IncSet_filter(this->inc); - if (incFilter && Panel_get(this->display, Panel_size(this->display) - 1) != (Object*)last && String_contains_i(line, incFilter, true)) { - Panel_add(this->display, (Object*)last); - } -} - -void InfoScreen_run(InfoScreen* this) { - Panel* panel = this->display; - - if (As_InfoScreen(this)->scan) - InfoScreen_scan(this); - - InfoScreen_draw(this); - - bool looping = true; - while (looping) { - - Panel_draw(panel, false, true, true, false); - IncSet_drawBar(this->inc, CRT_colors[FUNCTION_BAR]); - - int ch = Panel_getCh(panel); - - if (ch == ERR) { - if (As_InfoScreen(this)->onErr) { - InfoScreen_onErr(this); - continue; - } - } - -#ifdef HAVE_GETMOUSE - if (ch == KEY_MOUSE) { - MEVENT mevent; - int ok = getmouse(&mevent); - if (ok == OK) { - if (mevent.bstate & BUTTON1_RELEASED) { - if (mevent.y >= panel->y && mevent.y < LINES - 1) { - Panel_setSelected(panel, mevent.y - panel->y + panel->scrollV - 1); - ch = 0; - } else if (mevent.y == LINES - 1) { - ch = IncSet_synthesizeEvent(this->inc, mevent.x); - } - } - #if NCURSES_MOUSE_VERSION > 1 - else if (mevent.bstate & BUTTON4_PRESSED) { - ch = KEY_WHEELUP; - } else if (mevent.bstate & BUTTON5_PRESSED) { - ch = KEY_WHEELDOWN; - } - #endif - } - } -#endif - - if (this->inc->active) { - IncSet_handleKey(this->inc, ch, panel, IncSet_getListItemValue, this->lines); - continue; - } - - switch (ch) { - case ERR: - continue; - case KEY_F(3): - case '/': - IncSet_activate(this->inc, INC_SEARCH, panel); - break; - case KEY_F(4): - case '\\': - IncSet_activate(this->inc, INC_FILTER, panel); - break; - case KEY_F(5): - clear(); - if (As_InfoScreen(this)->scan) { - Vector_prune(this->lines); - InfoScreen_scan(this); - } - - InfoScreen_draw(this); - break; - case '\014': // Ctrl+L - clear(); - InfoScreen_draw(this); - break; - case 27: - case 'q': - case KEY_F(10): - looping = false; - break; - case KEY_RESIZE: - Panel_resize(panel, COLS, LINES - 2); - if (As_InfoScreen(this)->scan) { - Vector_prune(this->lines); - InfoScreen_scan(this); - } - - InfoScreen_draw(this); - break; - default: - if (As_InfoScreen(this)->onKey && InfoScreen_onKey(this, ch)) { - continue; - } - Panel_onKey(panel, ch); - } - } -} diff --git a/fedora/.local/bin/htop-vim/InfoScreen.h b/fedora/.local/bin/htop-vim/InfoScreen.h deleted file mode 100644 index d7497be..0000000 --- a/fedora/.local/bin/htop-vim/InfoScreen.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef HEADER_InfoScreen -#define HEADER_InfoScreen - -#include - -#include "FunctionBar.h" -#include "IncSet.h" -#include "Macros.h" -#include "Object.h" -#include "Panel.h" -#include "Process.h" -#include "Vector.h" - - -typedef struct InfoScreen_ { - Object super; - const Process* process; - Panel* display; - IncSet* inc; - Vector* lines; -} InfoScreen; - -typedef void(*InfoScreen_Scan)(InfoScreen*); -typedef void(*InfoScreen_Draw)(InfoScreen*); -typedef void(*InfoScreen_OnErr)(InfoScreen*); -typedef bool(*InfoScreen_OnKey)(InfoScreen*, int); - -typedef struct InfoScreenClass_ { - const ObjectClass super; - const InfoScreen_Scan scan; - const InfoScreen_Draw draw; - const InfoScreen_OnErr onErr; - const InfoScreen_OnKey onKey; -} InfoScreenClass; - -#define As_InfoScreen(this_) ((const InfoScreenClass*)(((InfoScreen*)(this_))->super.klass)) -#define InfoScreen_scan(this_) As_InfoScreen(this_)->scan((InfoScreen*)(this_)) -#define InfoScreen_draw(this_) As_InfoScreen(this_)->draw((InfoScreen*)(this_)) -#define InfoScreen_onErr(this_) As_InfoScreen(this_)->onErr((InfoScreen*)(this_)) -#define InfoScreen_onKey(this_, ch_) As_InfoScreen(this_)->onKey((InfoScreen*)(this_), ch_) - -InfoScreen* InfoScreen_init(InfoScreen* this, const Process* process, FunctionBar* bar, int height, const char* panelHeader); - -InfoScreen* InfoScreen_done(InfoScreen* this); - -ATTR_FORMAT(printf, 2, 3) -void InfoScreen_drawTitled(InfoScreen* this, const char* fmt, ...); - -void InfoScreen_addLine(InfoScreen* this, const char* line); - -void InfoScreen_appendLine(InfoScreen* this, const char* line); - -void InfoScreen_run(InfoScreen* this); - -#endif diff --git a/fedora/.local/bin/htop-vim/ListItem.c b/fedora/.local/bin/htop-vim/ListItem.c deleted file mode 100644 index 246bc5d..0000000 --- a/fedora/.local/bin/htop-vim/ListItem.c +++ /dev/null @@ -1,72 +0,0 @@ -/* -htop - ListItem.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "ListItem.h" - -#include -#include -#include - -#include "CRT.h" -#include "RichString.h" -#include "XUtils.h" - - -void ListItem_delete(Object* cast) { - ListItem* this = (ListItem*)cast; - free(this->value); - free(this); -} - -void ListItem_display(const Object* cast, RichString* out) { - const ListItem* const this = (const ListItem*)cast; - assert (this != NULL); - - if (this->moving) { - RichString_writeWide(out, CRT_colors[DEFAULT_COLOR], -#ifdef HAVE_LIBNCURSESW - CRT_utf8 ? "โ†• " : -#endif - "+ "); - } - RichString_appendWide(out, CRT_colors[DEFAULT_COLOR], this->value); -} - -void ListItem_init(ListItem* this, const char* value, int key) { - this->value = xStrdup(value); - this->key = key; - this->moving = false; -} - -ListItem* ListItem_new(const char* value, int key) { - ListItem* this = AllocThis(ListItem); - ListItem_init(this, value, key); - return this; -} - -void ListItem_append(ListItem* this, const char* text) { - size_t oldLen = strlen(this->value); - size_t textLen = strlen(text); - size_t newLen = oldLen + textLen; - this->value = xRealloc(this->value, newLen + 1); - memcpy(this->value + oldLen, text, textLen); - this->value[newLen] = '\0'; -} - -int ListItem_compare(const void* cast1, const void* cast2) { - const ListItem* obj1 = (const ListItem*) cast1; - const ListItem* obj2 = (const ListItem*) cast2; - return strcmp(obj1->value, obj2->value); -} - -const ObjectClass ListItem_class = { - .display = ListItem_display, - .delete = ListItem_delete, - .compare = ListItem_compare -}; diff --git a/fedora/.local/bin/htop-vim/ListItem.h b/fedora/.local/bin/htop-vim/ListItem.h deleted file mode 100644 index b2c3e06..0000000 --- a/fedora/.local/bin/htop-vim/ListItem.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef HEADER_ListItem -#define HEADER_ListItem -/* -htop - ListItem.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include - -#include "Object.h" - - -typedef struct ListItem_ { - Object super; - char* value; - int key; - bool moving; -} ListItem; - -extern const ObjectClass ListItem_class; - -void ListItem_delete(Object* cast); - -void ListItem_display(const Object* cast, RichString* out); - -void ListItem_init(ListItem* this, const char* value, int key); - -ListItem* ListItem_new(const char* value, int key); - -void ListItem_append(ListItem* this, const char* text); - -int ListItem_compare(const void* cast1, const void* cast2); - -static inline const char* ListItem_getRef(const ListItem* this) { - return this->value; -} - -#endif diff --git a/fedora/.local/bin/htop-vim/LoadAverageMeter.c b/fedora/.local/bin/htop-vim/LoadAverageMeter.c deleted file mode 100644 index 3fe3d90..0000000 --- a/fedora/.local/bin/htop-vim/LoadAverageMeter.c +++ /dev/null @@ -1,134 +0,0 @@ -/* -htop - LoadAverageMeter.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "LoadAverageMeter.h" - -#include "CRT.h" -#include "Object.h" -#include "Platform.h" -#include "ProcessList.h" -#include "RichString.h" -#include "XUtils.h" - - -static const int LoadAverageMeter_attributes[] = { - LOAD_AVERAGE_ONE, - LOAD_AVERAGE_FIVE, - LOAD_AVERAGE_FIFTEEN -}; - -static const int LoadMeter_attributes[] = { - LOAD -}; - -static const int OK_attributes[] = { - METER_VALUE_OK -}; - -static const int Medium_attributes[] = { - METER_VALUE_WARN -}; - -static const int High_attributes[] = { - METER_VALUE_ERROR -}; - -static void LoadAverageMeter_updateValues(Meter* this) { - Platform_getLoadAverage(&this->values[0], &this->values[1], &this->values[2]); - - // only show bar for 1min value - this->curItems = 1; - - // change bar color and total based on value - if (this->values[0] < 1.0) { - this->curAttributes = OK_attributes; - this->total = 1.0; - } else if (this->values[0] < this->pl->activeCPUs) { - this->curAttributes = Medium_attributes; - this->total = this->pl->activeCPUs; - } else { - this->curAttributes = High_attributes; - this->total = 2 * this->pl->activeCPUs; - } - - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%.2f/%.2f/%.2f", this->values[0], this->values[1], this->values[2]); -} - -static void LoadAverageMeter_display(const Object* cast, RichString* out) { - const Meter* this = (const Meter*)cast; - char buffer[20]; - int len; - - len = xSnprintf(buffer, sizeof(buffer), "%.2f ", this->values[0]); - RichString_appendnAscii(out, CRT_colors[LOAD_AVERAGE_ONE], buffer, len); - len = xSnprintf(buffer, sizeof(buffer), "%.2f ", this->values[1]); - RichString_appendnAscii(out, CRT_colors[LOAD_AVERAGE_FIVE], buffer, len); - len = xSnprintf(buffer, sizeof(buffer), "%.2f ", this->values[2]); - RichString_appendnAscii(out, CRT_colors[LOAD_AVERAGE_FIFTEEN], buffer, len); -} - -static void LoadMeter_updateValues(Meter* this) { - double five, fifteen; - Platform_getLoadAverage(&this->values[0], &five, &fifteen); - - // change bar color and total based on value - if (this->values[0] < 1.0) { - this->curAttributes = OK_attributes; - this->total = 1.0; - } else if (this->values[0] < this->pl->activeCPUs) { - this->curAttributes = Medium_attributes; - this->total = this->pl->activeCPUs; - } else { - this->curAttributes = High_attributes; - this->total = 2 * this->pl->activeCPUs; - } - - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%.2f", this->values[0]); -} - -static void LoadMeter_display(const Object* cast, RichString* out) { - const Meter* this = (const Meter*)cast; - char buffer[20]; - int len; - - len = xSnprintf(buffer, sizeof(buffer), "%.2f ", this->values[0]); - RichString_appendnAscii(out, CRT_colors[LOAD], buffer, len); -} - -const MeterClass LoadAverageMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = LoadAverageMeter_display, - }, - .updateValues = LoadAverageMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 3, - .total = 100.0, - .attributes = LoadAverageMeter_attributes, - .name = "LoadAverage", - .uiName = "Load average", - .description = "Load averages: 1 minute, 5 minutes, 15 minutes", - .caption = "Load average: " -}; - -const MeterClass LoadMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = LoadMeter_display, - }, - .updateValues = LoadMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 1, - .total = 100.0, - .attributes = LoadMeter_attributes, - .name = "Load", - .uiName = "Load", - .description = "Load: average of ready processes in the last minute", - .caption = "Load: " -}; diff --git a/fedora/.local/bin/htop-vim/LoadAverageMeter.h b/fedora/.local/bin/htop-vim/LoadAverageMeter.h deleted file mode 100644 index a34a4a3..0000000 --- a/fedora/.local/bin/htop-vim/LoadAverageMeter.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef HEADER_LoadAverageMeter -#define HEADER_LoadAverageMeter -/* -htop - LoadAverageMeter.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Meter.h" - - -extern const MeterClass LoadAverageMeter_class; - -extern const MeterClass LoadMeter_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/Macros.h b/fedora/.local/bin/htop-vim/Macros.h deleted file mode 100644 index 5e8891a..0000000 --- a/fedora/.local/bin/htop-vim/Macros.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef HEADER_Macros -#define HEADER_Macros - -#include // IWYU pragma: keep - -#ifndef MINIMUM -#define MINIMUM(a, b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef MAXIMUM -#define MAXIMUM(a, b) ((a) > (b) ? (a) : (b)) -#endif - -#ifndef CLAMP -#define CLAMP(x, low, high) (assert((low) <= (high)), ((x) > (high)) ? (high) : MAXIMUM(x, low)) -#endif - -#ifndef ARRAYSIZE -#define ARRAYSIZE(x) (sizeof(x) / sizeof((x)[0])) -#endif - -#ifndef SPACESHIP_NUMBER -#define SPACESHIP_NUMBER(a, b) (((a) > (b)) - ((a) < (b))) -#endif - -#ifndef SPACESHIP_NULLSTR -#define SPACESHIP_NULLSTR(a, b) strcmp((a) ? (a) : "", (b) ? (b) : "") -#endif - -#ifndef SPACESHIP_DEFAULTSTR -#define SPACESHIP_DEFAULTSTR(a, b, s) strcmp((a) ? (a) : (s), (b) ? (b) : (s)) -#endif - -#ifdef __GNUC__ // defined by GCC and Clang - -#define ATTR_FORMAT(type, index, check) __attribute__((format (type, index, check))) -#define ATTR_NONNULL __attribute__((nonnull)) -#define ATTR_NORETURN __attribute__((noreturn)) -#define ATTR_UNUSED __attribute__((unused)) -#define ATTR_MALLOC __attribute__((malloc)) - -#else /* __GNUC__ */ - -#define ATTR_FORMAT(type, index, check) -#define ATTR_NONNULL -#define ATTR_NORETURN -#define ATTR_UNUSED -#define ATTR_MALLOC - -#endif /* __GNUC__ */ - -#ifdef HAVE_ATTR_ALLOC_SIZE - -#define ATTR_ALLOC_SIZE1(a) __attribute__((alloc_size (a))) -#define ATTR_ALLOC_SIZE2(a, b) __attribute__((alloc_size (a, b))) - -#else - -#define ATTR_ALLOC_SIZE1(a) -#define ATTR_ALLOC_SIZE2(a, b) - -#endif /* HAVE_ATTR_ALLOC_SIZE */ - -// ignore casts discarding const specifier, e.g. -// const char [] -> char * / void * -// const char *[2]' -> char *const * -#if defined(__clang__) -#define IGNORE_WCASTQUAL_BEGIN _Pragma("clang diagnostic push") \ - _Pragma("clang diagnostic ignored \"-Wcast-qual\"") -#define IGNORE_WCASTQUAL_END _Pragma("clang diagnostic pop") -#elif defined(__GNUC__) -#define IGNORE_WCASTQUAL_BEGIN _Pragma("GCC diagnostic push") \ - _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") -#define IGNORE_WCASTQUAL_END _Pragma("GCC diagnostic pop") -#else -#define IGNORE_WCASTQUAL_BEGIN -#define IGNORE_WCASTQUAL_END -#endif - -/* This subtraction is used by Linux / NetBSD / OpenBSD for calculation of CPU usage items. */ -static inline unsigned long long saturatingSub(unsigned long long a, unsigned long long b) { - return a > b ? a - b : 0; -} - -#endif diff --git a/fedora/.local/bin/htop-vim/MainPanel.c b/fedora/.local/bin/htop-vim/MainPanel.c deleted file mode 100644 index fba01fe..0000000 --- a/fedora/.local/bin/htop-vim/MainPanel.c +++ /dev/null @@ -1,236 +0,0 @@ -/* -htop - ColumnsPanel.c -(C) 2004-2015 Hisham H. Muhammad -(C) 2020 Red Hat, Inc. All Rights Reserved. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "MainPanel.h" - -#include -#include - -#include "CRT.h" -#include "FunctionBar.h" -#include "Platform.h" -#include "Process.h" -#include "ProcessList.h" -#include "ProvideCurses.h" -#include "Settings.h" -#include "XUtils.h" - - -static const char* const MainFunctions[] = {"Help ", "Setup ", "Search", "Filter", "Tree ", "SortBy", "Nice -", "Nice +", "Kill ", "Quit ", NULL}; -static const char* const MainFunctions_ro[] = {"Help ", "Setup ", "Search", "Filter", "Tree ", "SortBy", " ", " ", " ", "Quit ", NULL}; - -void MainPanel_updateLabels(MainPanel* this, bool list, bool filter) { - FunctionBar* bar = MainPanel_getFunctionBar(this); - FunctionBar_setLabel(bar, KEY_F(5), list ? "List " : "Tree "); - FunctionBar_setLabel(bar, KEY_F(4), filter ? "FILTER" : "Filter"); -} - -static void MainPanel_pidSearch(MainPanel* this, int ch) { - Panel* super = (Panel*) this; - pid_t pid = ch - 48 + this->pidSearch; - for (int i = 0; i < Panel_size(super); i++) { - const Process* p = (const Process*) Panel_get(super, i); - if (p && p->pid == pid) { - Panel_setSelected(super, i); - break; - } - } - this->pidSearch = pid * 10; - if (this->pidSearch > 10000000) { - this->pidSearch = 0; - } -} - -static const char* MainPanel_getValue(Panel* this, int i) { - const Process* p = (const Process*) Panel_get(this, i); - return Process_getCommand(p); -} - -HandlerResult MainPanel_eventHandler(Panel* super, int ch) { - MainPanel* this = (MainPanel*) super; - - HandlerResult result = IGNORED; - - Htop_Reaction reaction = HTOP_OK; - - /* Let supervising ScreenManager handle resize */ - if (ch == KEY_RESIZE) - return IGNORED; - - /* reset on every normal key */ - bool needReset = ch != ERR; - #ifdef HAVE_GETMOUSE - /* except mouse events while mouse support is disabled */ - if (!(ch != KEY_MOUSE || this->state->settings->enableMouse)) - needReset = false; - #endif - if (needReset) - this->state->hideProcessSelection = false; - - Settings* settings = this->state->settings; - ScreenSettings* ss = settings->ss; - - if (EVENT_IS_HEADER_CLICK(ch)) { - int x = EVENT_HEADER_CLICK_GET_X(ch); - const ProcessList* pl = this->state->pl; - int hx = super->scrollH + x + 1; - ProcessField field = ProcessList_keyAt(pl, hx); - if (ss->treeView && ss->treeViewAlwaysByPID) { - ss->treeView = false; - ss->direction = 1; - reaction |= Action_setSortKey(settings, field); - } else if (field == ScreenSettings_getActiveSortKey(ss)) { - ScreenSettings_invertSortOrder(ss); - } else { - reaction |= Action_setSortKey(settings, field); - } - reaction |= HTOP_RECALCULATE | HTOP_REDRAW_BAR | HTOP_SAVE_SETTINGS; - result = HANDLED; - } else if (EVENT_IS_SCREEN_TAB_CLICK(ch)) { - int x = EVENT_SCREEN_TAB_GET_X(ch); - reaction |= Action_setScreenTab(settings, x); - result = HANDLED; - } else if (ch != ERR && this->inc->active) { - bool filterChanged = IncSet_handleKey(this->inc, ch, super, MainPanel_getValue, NULL); - if (filterChanged) { - this->state->pl->incFilter = IncSet_filter(this->inc); - reaction = HTOP_REFRESH | HTOP_REDRAW_BAR; - } - if (this->inc->found) { - reaction |= Action_follow(this->state); - reaction |= HTOP_KEEP_FOLLOWING; - } - result = HANDLED; - } else if (ch == 27) { - this->state->hideProcessSelection = true; - return HANDLED; - } else if (ch != ERR && ch > 0 && ch < KEY_MAX && this->keys[ch]) { - reaction |= (this->keys[ch])(this->state); - result = HANDLED; - } else if (0 < ch && ch < 255 && isdigit((unsigned char)ch)) { - MainPanel_pidSearch(this, ch); - } else { - if (ch != ERR) { - this->pidSearch = 0; - } else { - reaction |= HTOP_KEEP_FOLLOWING; - } - } - - if ((reaction & HTOP_REDRAW_BAR) == HTOP_REDRAW_BAR) { - MainPanel_updateLabels(this, settings->ss->treeView, this->state->pl->incFilter); - } - if ((reaction & HTOP_RESIZE) == HTOP_RESIZE) { - result |= RESIZE; - } - if ((reaction & HTOP_UPDATE_PANELHDR) == HTOP_UPDATE_PANELHDR) { - result |= REDRAW; - } - if ((reaction & HTOP_REFRESH) == HTOP_REFRESH) { - result |= REFRESH; - } - if ((reaction & HTOP_RECALCULATE) == HTOP_RECALCULATE) { - result |= RESCAN; - } - if ((reaction & HTOP_SAVE_SETTINGS) == HTOP_SAVE_SETTINGS) { - this->state->settings->changed = true; - } - if ((reaction & HTOP_QUIT) == HTOP_QUIT) { - return BREAK_LOOP; - } - if ((reaction & HTOP_KEEP_FOLLOWING) != HTOP_KEEP_FOLLOWING) { - this->state->pl->following = -1; - Panel_setSelectionColor(super, PANEL_SELECTION_FOCUS); - } - return result; -} - -int MainPanel_selectedPid(MainPanel* this) { - const Process* p = (const Process*) Panel_getSelected((Panel*)this); - if (p) { - return p->pid; - } - return -1; -} - -bool MainPanel_foreachProcess(MainPanel* this, MainPanel_ForeachProcessFn fn, Arg arg, bool* wasAnyTagged) { - Panel* super = (Panel*) this; - bool ok = true; - bool anyTagged = false; - for (int i = 0; i < Panel_size(super); i++) { - Process* p = (Process*) Panel_get(super, i); - if (p->tag) { - ok = fn(p, arg) && ok; - anyTagged = true; - } - } - if (!anyTagged) { - Process* p = (Process*) Panel_getSelected(super); - if (p) { - ok &= fn(p, arg); - } - } - - if (wasAnyTagged) - *wasAnyTagged = anyTagged; - - return ok; -} - -static void MainPanel_drawFunctionBar(Panel* super, bool hideFunctionBar) { - MainPanel* this = (MainPanel*) super; - - // Do not hide active search and filter bar. - if (hideFunctionBar && !this->inc->active) - return; - - IncSet_drawBar(this->inc, CRT_colors[FUNCTION_BAR]); - if (this->state->pauseProcessUpdate) { - FunctionBar_append("PAUSED", CRT_colors[PAUSED]); - } -} - -static void MainPanel_printHeader(Panel* super) { - MainPanel* this = (MainPanel*) super; - ProcessList_printHeader(this->state->pl, &super->header); -} - -const PanelClass MainPanel_class = { - .super = { - .extends = Class(Panel), - .delete = MainPanel_delete - }, - .eventHandler = MainPanel_eventHandler, - .drawFunctionBar = MainPanel_drawFunctionBar, - .printHeader = MainPanel_printHeader -}; - -MainPanel* MainPanel_new(void) { - MainPanel* this = AllocThis(MainPanel); - Panel_init((Panel*) this, 1, 1, 1, 1, Class(Process), false, FunctionBar_new(Settings_isReadonly() ? MainFunctions_ro : MainFunctions, NULL, NULL)); - this->keys = xCalloc(KEY_MAX, sizeof(Htop_Action)); - this->inc = IncSet_new(MainPanel_getFunctionBar(this)); - - Action_setBindings(this->keys); - Platform_setBindings(this->keys); - - return this; -} - -void MainPanel_setState(MainPanel* this, State* state) { - this->state = state; -} - -void MainPanel_delete(Object* object) { - Panel* super = (Panel*) object; - MainPanel* this = (MainPanel*) object; - Panel_done(super); - IncSet_delete(this->inc); - free(this->keys); - free(this); -} diff --git a/fedora/.local/bin/htop-vim/MainPanel.h b/fedora/.local/bin/htop-vim/MainPanel.h deleted file mode 100644 index 069d0b3..0000000 --- a/fedora/.local/bin/htop-vim/MainPanel.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef HEADER_MainPanel -#define HEADER_MainPanel -/* -htop - ColumnsPanel.h -(C) 2004-2015 Hisham H. Muhammad -(C) 2020 Red Hat, Inc. All Rights Reserved. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include -#include - -#include "Action.h" -#include "IncSet.h" -#include "Object.h" -#include "Panel.h" -#include "Process.h" - - -typedef struct MainPanel_ { - Panel super; - State* state; - IncSet* inc; - Htop_Action* keys; - pid_t pidSearch; -} MainPanel; - -typedef bool(*MainPanel_ForeachProcessFn)(Process*, Arg); - -#define MainPanel_getFunctionBar(this_) (((Panel*)(this_))->defaultBar) - -// update the Label Keys in the MainPanel bar, list: list / tree mode, filter: filter (inc) active / inactive -void MainPanel_updateLabels(MainPanel* this, bool list, bool filter); - -int MainPanel_selectedPid(MainPanel* this); - -bool MainPanel_foreachProcess(MainPanel* this, MainPanel_ForeachProcessFn fn, Arg arg, bool* wasAnyTagged); - -extern const PanelClass MainPanel_class; - -MainPanel* MainPanel_new(void); - -void MainPanel_setState(MainPanel* this, State* state); - -void MainPanel_delete(Object* object); - -HandlerResult MainPanel_eventHandler(Panel* super, int ch); - -#endif diff --git a/fedora/.local/bin/htop-vim/Makefile.am b/fedora/.local/bin/htop-vim/Makefile.am deleted file mode 100644 index 1c685e4..0000000 --- a/fedora/.local/bin/htop-vim/Makefile.am +++ /dev/null @@ -1,463 +0,0 @@ -if !HTOP_PCP -bin_PROGRAMS = htop -myhtopplatprogram = htop.c -else -bin_PROGRAMS = pcp-htop -myhtopplatprogram = pcp-htop.c -endif - -dist_man_MANS = htop.1 -EXTRA_DIST = \ - $(dist_man_MANS) \ - autogen.sh \ - htop.desktop \ - htop.png \ - htop.svg \ - build-aux/compile \ - build-aux/depcomp \ - build-aux/install-sh \ - build-aux/missing -applicationsdir = $(datadir)/applications -applications_DATA = htop.desktop -pixmapdir = $(datadir)/pixmaps -pixmap_DATA = htop.png -appicondir = $(datadir)/icons/hicolor/scalable/apps -appicon_DATA = htop.svg - -AM_CFLAGS += -pedantic -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR="\"$(sysconfdir)\"" -I"$(top_srcdir)/$(my_htop_platform)" -AM_LDFLAGS = - -myhtopsources = \ - Action.c \ - Affinity.c \ - AffinityPanel.c \ - AvailableColumnsPanel.c \ - AvailableMetersPanel.c \ - BatteryMeter.c \ - CategoriesPanel.c \ - ClockMeter.c \ - ColorsPanel.c \ - ColumnsPanel.c \ - CommandLine.c \ - CommandScreen.c \ - Compat.c \ - CPUMeter.c \ - CRT.c \ - DateMeter.c \ - DateTimeMeter.c \ - DiskIOMeter.c \ - DisplayOptionsPanel.c \ - DynamicColumn.c \ - DynamicMeter.c \ - EnvScreen.c \ - FunctionBar.c \ - Hashtable.c \ - Header.c \ - HeaderOptionsPanel.c \ - HostnameMeter.c \ - IncSet.c \ - InfoScreen.c \ - ListItem.c \ - LoadAverageMeter.c \ - MainPanel.c \ - MemoryMeter.c \ - MemorySwapMeter.c \ - Meter.c \ - MetersPanel.c \ - NetworkIOMeter.c \ - Object.c \ - OpenFilesScreen.c \ - OptionItem.c \ - Panel.c \ - Process.c \ - ProcessList.c \ - ProcessLocksScreen.c \ - RichString.c \ - Scheduling.c \ - ScreenManager.c \ - ScreensPanel.c \ - Settings.c \ - SignalsPanel.c \ - SwapMeter.c \ - SysArchMeter.c \ - TasksMeter.c \ - TraceScreen.c \ - UptimeMeter.c \ - UsersTable.c \ - Vector.c \ - XUtils.c - -myhtopheaders = \ - Action.h \ - Affinity.h \ - AffinityPanel.h \ - AvailableColumnsPanel.h \ - AvailableMetersPanel.h \ - BatteryMeter.h \ - CPUMeter.h \ - CRT.h \ - CategoriesPanel.h \ - ClockMeter.h \ - ColorsPanel.h \ - ColumnsPanel.h \ - CommandLine.h \ - CommandScreen.h \ - Compat.h \ - DateMeter.h \ - DateTimeMeter.h \ - DiskIOMeter.h \ - DisplayOptionsPanel.h \ - DynamicColumn.h \ - DynamicMeter.h \ - EnvScreen.h \ - FunctionBar.h \ - Hashtable.h \ - Header.h \ - HeaderLayout.h \ - HeaderOptionsPanel.h \ - HostnameMeter.h \ - IncSet.h \ - InfoScreen.h \ - ListItem.h \ - LoadAverageMeter.h \ - Macros.h \ - MainPanel.h \ - MemoryMeter.h \ - MemorySwapMeter.h \ - Meter.h \ - MetersPanel.h \ - NetworkIOMeter.h \ - Object.h \ - OpenFilesScreen.h \ - OptionItem.h \ - Panel.h \ - Process.h \ - ProcessList.h \ - ProcessLocksScreen.h \ - ProvideCurses.h \ - RichString.h \ - Scheduling.h \ - ScreenManager.h \ - ScreensPanel.h \ - Settings.h \ - SignalsPanel.h \ - SwapMeter.h \ - SysArchMeter.h \ - TasksMeter.h \ - TraceScreen.h \ - UptimeMeter.h \ - UsersTable.h \ - Vector.h \ - XUtils.h - -# Linux -# ----- - -linux_platform_headers = \ - generic/gettime.h \ - generic/hostname.h \ - generic/uname.h \ - linux/CGroupUtils.h \ - linux/HugePageMeter.h \ - linux/IOPriority.h \ - linux/IOPriorityPanel.h \ - linux/LibSensors.h \ - linux/LinuxProcess.h \ - linux/LinuxProcessList.h \ - linux/Platform.h \ - linux/PressureStallMeter.h \ - linux/ProcessField.h \ - linux/SELinuxMeter.h \ - linux/SystemdMeter.h \ - linux/ZramMeter.h \ - linux/ZramStats.h \ - zfs/ZfsArcMeter.h \ - zfs/ZfsArcStats.h \ - zfs/ZfsCompressedArcMeter.h - -linux_platform_sources = \ - generic/gettime.c \ - generic/hostname.c \ - generic/uname.c \ - linux/CGroupUtils.c \ - linux/HugePageMeter.c \ - linux/IOPriorityPanel.c \ - linux/LibSensors.c \ - linux/LinuxProcess.c \ - linux/LinuxProcessList.c \ - linux/Platform.c \ - linux/PressureStallMeter.c \ - linux/SELinuxMeter.c \ - linux/SystemdMeter.c \ - linux/ZramMeter.c \ - zfs/ZfsArcMeter.c \ - zfs/ZfsCompressedArcMeter.c - -if HTOP_LINUX -AM_LDFLAGS += -rdynamic -myhtopplatheaders = $(linux_platform_headers) -myhtopplatsources = $(linux_platform_sources) -endif - -# FreeBSD -# ------- - -freebsd_platform_headers = \ - freebsd/FreeBSDProcessList.h \ - freebsd/FreeBSDProcess.h \ - freebsd/Platform.h \ - freebsd/ProcessField.h \ - generic/gettime.h \ - generic/hostname.h \ - generic/openzfs_sysctl.h \ - generic/uname.h \ - zfs/ZfsArcMeter.h \ - zfs/ZfsArcStats.h \ - zfs/ZfsCompressedArcMeter.h - -freebsd_platform_sources = \ - freebsd/Platform.c \ - freebsd/FreeBSDProcessList.c \ - freebsd/FreeBSDProcess.c \ - generic/gettime.c \ - generic/hostname.c \ - generic/openzfs_sysctl.c \ - generic/uname.c \ - zfs/ZfsArcMeter.c \ - zfs/ZfsCompressedArcMeter.c - -if HTOP_FREEBSD -myhtopplatheaders = $(freebsd_platform_headers) -myhtopplatsources = $(freebsd_platform_sources) -endif - -# DragonFlyBSD -# ------------ - -dragonflybsd_platform_headers = \ - dragonflybsd/DragonFlyBSDProcessList.h \ - dragonflybsd/DragonFlyBSDProcess.h \ - dragonflybsd/Platform.h \ - dragonflybsd/ProcessField.h \ - generic/gettime.h \ - generic/hostname.h \ - generic/uname.h - -dragonflybsd_platform_sources = \ - dragonflybsd/DragonFlyBSDProcessList.c \ - dragonflybsd/DragonFlyBSDProcess.c \ - dragonflybsd/Platform.c \ - generic/gettime.c \ - generic/hostname.c \ - generic/uname.c - -if HTOP_DRAGONFLYBSD -myhtopplatheaders = $(dragonflybsd_platform_headers) -myhtopplatsources = $(dragonflybsd_platform_sources) -endif - -# NetBSD -# ------- - -netbsd_platform_headers = \ - generic/gettime.h \ - generic/hostname.h \ - generic/uname.h \ - netbsd/Platform.h \ - netbsd/ProcessField.h \ - netbsd/NetBSDProcess.h \ - netbsd/NetBSDProcessList.h - -netbsd_platform_sources = \ - generic/gettime.c \ - generic/hostname.c \ - generic/uname.c \ - netbsd/Platform.c \ - netbsd/NetBSDProcess.c \ - netbsd/NetBSDProcessList.c - -if HTOP_NETBSD -myhtopplatheaders = $(netbsd_platform_headers) -myhtopplatsources = $(netbsd_platform_sources) -endif - -# OpenBSD -# ------- - -openbsd_platform_headers = \ - generic/gettime.h \ - generic/hostname.h \ - generic/uname.h \ - openbsd/OpenBSDProcessList.h \ - openbsd/OpenBSDProcess.h \ - openbsd/Platform.h \ - openbsd/ProcessField.h - -openbsd_platform_sources = \ - generic/gettime.c \ - generic/hostname.c \ - generic/uname.c \ - openbsd/OpenBSDProcessList.c \ - openbsd/OpenBSDProcess.c \ - openbsd/Platform.c - -if HTOP_OPENBSD -myhtopplatheaders = $(openbsd_platform_headers) -myhtopplatsources = $(openbsd_platform_sources) -endif - -# Darwin -# ------ - -darwin_platform_headers = \ - darwin/DarwinProcess.h \ - darwin/DarwinProcessList.h \ - darwin/Platform.h \ - darwin/PlatformHelpers.h \ - darwin/ProcessField.h \ - generic/gettime.h \ - generic/hostname.h \ - generic/openzfs_sysctl.h \ - generic/uname.h \ - zfs/ZfsArcMeter.h \ - zfs/ZfsArcStats.h \ - zfs/ZfsCompressedArcMeter.h - -darwin_platform_sources = \ - darwin/Platform.c \ - darwin/PlatformHelpers.c \ - darwin/DarwinProcess.c \ - darwin/DarwinProcessList.c \ - generic/gettime.c \ - generic/hostname.c \ - generic/openzfs_sysctl.c \ - generic/uname.c \ - zfs/ZfsArcMeter.c \ - zfs/ZfsCompressedArcMeter.c - -if HTOP_DARWIN -AM_LDFLAGS += -framework IOKit -framework CoreFoundation -myhtopplatheaders = $(darwin_platform_headers) -myhtopplatsources = $(darwin_platform_sources) -endif - -# Solaris -# ------- - -solaris_platform_headers = \ - generic/gettime.h \ - generic/hostname.h \ - generic/uname.h \ - solaris/ProcessField.h \ - solaris/Platform.h \ - solaris/SolarisProcess.h \ - solaris/SolarisProcessList.h \ - zfs/ZfsArcMeter.h \ - zfs/ZfsArcStats.h \ - zfs/ZfsCompressedArcMeter.h - -solaris_platform_sources = \ - generic/gettime.c \ - generic/hostname.c \ - generic/uname.c \ - solaris/Platform.c \ - solaris/SolarisProcess.c \ - solaris/SolarisProcessList.c \ - zfs/ZfsArcMeter.c \ - zfs/ZfsCompressedArcMeter.c - -if HTOP_SOLARIS -myhtopplatheaders = $(solaris_platform_headers) -myhtopplatsources = $(solaris_platform_sources) -endif - -# Performance Co-Pilot (PCP) -# -------------------------- - -pcp_platform_headers = \ - linux/PressureStallMeter.h \ - linux/ZramMeter.h \ - linux/ZramStats.h \ - pcp/PCPDynamicColumn.h \ - pcp/PCPDynamicMeter.h \ - pcp/PCPMetric.h \ - pcp/PCPProcess.h \ - pcp/PCPProcessList.h \ - pcp/Platform.h \ - pcp/ProcessField.h \ - zfs/ZfsArcMeter.h \ - zfs/ZfsArcStats.h \ - zfs/ZfsCompressedArcMeter.h - -pcp_platform_sources = \ - linux/PressureStallMeter.c \ - linux/ZramMeter.c \ - pcp/PCPDynamicColumn.c \ - pcp/PCPDynamicMeter.c \ - pcp/PCPMetric.c \ - pcp/PCPProcess.c \ - pcp/PCPProcessList.c \ - pcp/Platform.c \ - zfs/ZfsArcMeter.c \ - zfs/ZfsCompressedArcMeter.c - -if HTOP_PCP -myhtopplatheaders = $(pcp_platform_headers) -myhtopplatsources = $(pcp_platform_sources) -pcp_htop_SOURCES = $(myhtopplatprogram) $(myhtopheaders) $(myhtopplatheaders) $(myhtopsources) $(myhtopplatsources) -endif - -# Unsupported -# ----------- - -unsupported_platform_headers = \ - generic/gettime.h \ - unsupported/Platform.h \ - unsupported/ProcessField.h \ - unsupported/UnsupportedProcess.h \ - unsupported/UnsupportedProcessList.h - -unsupported_platform_sources = \ - generic/gettime.c \ - unsupported/Platform.c \ - unsupported/UnsupportedProcess.c \ - unsupported/UnsupportedProcessList.c - -if HTOP_UNSUPPORTED -myhtopplatsources = $(unsupported_platform_sources) -myhtopplatheaders = $(unsupported_platform_headers) -endif - -# ---- - -htop_SOURCES = $(myhtopplatprogram) $(myhtopheaders) $(myhtopplatheaders) $(myhtopsources) $(myhtopplatsources) -nodist_htop_SOURCES = config.h - -target: - echo $(htop_SOURCES) - -profile: - $(MAKE) all AM_CPPFLAGS="-pg -O2 -DNDEBUG" - -debug: - $(MAKE) all AM_CPPFLAGS="-ggdb3 -Og" CFLAGS="`printf ' %s ' "$(CFLAGS)"|sed -E 's#[[:space:]]-O[^[:space:]]+[[:space:]]# #g'` -ggdb3 -Og" - -coverage: - $(MAKE) all AM_CPPFLAGS="-fprofile-arcs -ftest-coverage" AM_LDFLAGS="-lgcov" - -cppcheck: - cppcheck -q -v . --enable=all -DHAVE_OPENVZ - -dist-hook: $(top_distdir)/configure - @if grep 'pkg_m4_absent' '$(top_distdir)/configure'; then \ - echo 'configure is generated without pkg.m4. Please supply pkg.m4 and run ./autogen.sh to rebuild the configure script.'>&2; \ - (exit 1); \ - else :; \ - fi - -.PHONY: lcov - -lcov: - mkdir -p lcov - lcov --capture --directory . --output-file coverage.info - genhtml coverage.info --output-directory lcov diff --git a/fedora/.local/bin/htop-vim/MemoryMeter.c b/fedora/.local/bin/htop-vim/MemoryMeter.c deleted file mode 100644 index ac01dfe..0000000 --- a/fedora/.local/bin/htop-vim/MemoryMeter.c +++ /dev/null @@ -1,96 +0,0 @@ -/* -htop - MemoryMeter.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "MemoryMeter.h" - -#include -#include - -#include "CRT.h" -#include "Object.h" -#include "Platform.h" -#include "RichString.h" - - -static const int MemoryMeter_attributes[] = { - MEMORY_USED, - MEMORY_BUFFERS, - MEMORY_SHARED, - MEMORY_CACHE -}; - -static void MemoryMeter_updateValues(Meter* this) { - char* buffer = this->txtBuffer; - size_t size = sizeof(this->txtBuffer); - int written; - - /* shared and available memory are not supported on all platforms */ - this->values[MEMORY_METER_SHARED] = NAN; - this->values[MEMORY_METER_AVAILABLE] = NAN; - Platform_setMemoryValues(this); - - /* Do not print available memory in bar mode */ - this->curItems = 4; - - written = Meter_humanUnit(buffer, this->values[MEMORY_METER_USED], size); - METER_BUFFER_CHECK(buffer, size, written); - - METER_BUFFER_APPEND_CHR(buffer, size, '/'); - - Meter_humanUnit(buffer, this->total, size); -} - -static void MemoryMeter_display(const Object* cast, RichString* out) { - char buffer[50]; - const Meter* this = (const Meter*)cast; - - RichString_writeAscii(out, CRT_colors[METER_TEXT], ":"); - Meter_humanUnit(buffer, this->total, sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_VALUE], buffer); - - Meter_humanUnit(buffer, this->values[MEMORY_METER_USED], sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " used:"); - RichString_appendAscii(out, CRT_colors[MEMORY_USED], buffer); - - Meter_humanUnit(buffer, this->values[MEMORY_METER_BUFFERS], sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " buffers:"); - RichString_appendAscii(out, CRT_colors[MEMORY_BUFFERS_TEXT], buffer); - - /* shared memory is not supported on all platforms */ - if (!isnan(this->values[MEMORY_METER_SHARED])) { - Meter_humanUnit(buffer, this->values[MEMORY_METER_SHARED], sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " shared:"); - RichString_appendAscii(out, CRT_colors[MEMORY_SHARED], buffer); - } - - Meter_humanUnit(buffer, this->values[MEMORY_METER_CACHE], sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " cache:"); - RichString_appendAscii(out, CRT_colors[MEMORY_CACHE], buffer); - - /* available memory is not supported on all platforms */ - if (!isnan(this->values[MEMORY_METER_AVAILABLE])) { - Meter_humanUnit(buffer, this->values[MEMORY_METER_AVAILABLE], sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " available:"); - RichString_appendAscii(out, CRT_colors[METER_VALUE], buffer); - } -} - -const MeterClass MemoryMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = MemoryMeter_display, - }, - .updateValues = MemoryMeter_updateValues, - .defaultMode = BAR_METERMODE, - .maxItems = 5, - .total = 100.0, - .attributes = MemoryMeter_attributes, - .name = "Memory", - .uiName = "Memory", - .caption = "Mem" -}; diff --git a/fedora/.local/bin/htop-vim/MemoryMeter.h b/fedora/.local/bin/htop-vim/MemoryMeter.h deleted file mode 100644 index cc2a160..0000000 --- a/fedora/.local/bin/htop-vim/MemoryMeter.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef HEADER_MemoryMeter -#define HEADER_MemoryMeter -/* -htop - MemoryMeter.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Meter.h" - -typedef enum { - MEMORY_METER_USED = 0, - MEMORY_METER_BUFFERS = 1, - MEMORY_METER_SHARED = 2, - MEMORY_METER_CACHE = 3, - MEMORY_METER_AVAILABLE = 4, - MEMORY_METER_ITEMCOUNT = 5, // number of entries in this enum -} MemoryMeterValues; - -extern const MeterClass MemoryMeter_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/MemorySwapMeter.c b/fedora/.local/bin/htop-vim/MemorySwapMeter.c deleted file mode 100644 index 46b2a6b..0000000 --- a/fedora/.local/bin/htop-vim/MemorySwapMeter.c +++ /dev/null @@ -1,107 +0,0 @@ -/* -htop - MemorySwapMeter.c -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "MemorySwapMeter.h" - -#include -#include -#include - -#include "Macros.h" -#include "MemoryMeter.h" -#include "Object.h" -#include "SwapMeter.h" -#include "XUtils.h" - - -typedef struct MemorySwapMeterData_ { - Meter* memoryMeter; - Meter* swapMeter; -} MemorySwapMeterData; - -static void MemorySwapMeter_updateValues(Meter* this) { - MemorySwapMeterData* data = this->meterData; - - Meter_updateValues(data->memoryMeter); - Meter_updateValues(data->swapMeter); -} - -static void MemorySwapMeter_draw(Meter* this, int x, int y, int w) { - MemorySwapMeterData* data = this->meterData; - - /* Use the same width for each sub meter to align with CPU meter */ - const int colwidth = w / 2; - const int diff = w - colwidth * 2; - - assert(data->memoryMeter->draw); - data->memoryMeter->draw(data->memoryMeter, x, y, colwidth); - assert(data->swapMeter->draw); - data->swapMeter->draw(data->swapMeter, x + colwidth + diff, y, colwidth); -} - -static void MemorySwapMeter_init(Meter* this) { - MemorySwapMeterData* data = this->meterData; - - if (!data) { - data = this->meterData = xMalloc(sizeof(MemorySwapMeterData)); - data->memoryMeter = NULL; - data->swapMeter = NULL; - } - - if (!data->memoryMeter) - data->memoryMeter = Meter_new(this->pl, 0, (const MeterClass*) Class(MemoryMeter)); - if (!data->swapMeter) - data->swapMeter = Meter_new(this->pl, 0, (const MeterClass*) Class(SwapMeter)); - - if (Meter_initFn(data->memoryMeter)) - Meter_init(data->memoryMeter); - if (Meter_initFn(data->swapMeter)) - Meter_init(data->swapMeter); - - if (this->mode == 0) - this->mode = BAR_METERMODE; - - this->h = MAXIMUM(Meter_modes[data->memoryMeter->mode]->h, Meter_modes[data->swapMeter->mode]->h); -} - -static void MemorySwapMeter_updateMode(Meter* this, int mode) { - MemorySwapMeterData* data = this->meterData; - - this->mode = mode; - - Meter_setMode(data->memoryMeter, mode); - Meter_setMode(data->swapMeter, mode); - - this->h = MAXIMUM(Meter_modes[data->memoryMeter->mode]->h, Meter_modes[data->swapMeter->mode]->h); -} - -static void MemorySwapMeter_done(Meter* this) { - MemorySwapMeterData* data = this->meterData; - - Meter_delete((Object*)data->swapMeter); - Meter_delete((Object*)data->memoryMeter); - - free(data); -} - -const MeterClass MemorySwapMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - }, - .updateValues = MemorySwapMeter_updateValues, - .defaultMode = CUSTOM_METERMODE, - .isMultiColumn = true, - .name = "MemorySwap", - .uiName = "Memory & Swap", - .description = "Combined memory and swap usage", - .caption = "M&S", - .draw = MemorySwapMeter_draw, - .init = MemorySwapMeter_init, - .updateMode = MemorySwapMeter_updateMode, - .done = MemorySwapMeter_done -}; diff --git a/fedora/.local/bin/htop-vim/MemorySwapMeter.h b/fedora/.local/bin/htop-vim/MemorySwapMeter.h deleted file mode 100644 index a98d5e6..0000000 --- a/fedora/.local/bin/htop-vim/MemorySwapMeter.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef HEADER_MemorySwapMeter -#define HEADER_MemorySwapMeter -/* -htop - MemorySwapMeter.h -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Meter.h" - - -extern const MeterClass MemorySwapMeter_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/Meter.c b/fedora/.local/bin/htop-vim/Meter.c deleted file mode 100644 index 7f634f1..0000000 --- a/fedora/.local/bin/htop-vim/Meter.c +++ /dev/null @@ -1,487 +0,0 @@ -/* -htop - Meter.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "Meter.h" - -#include -#include -#include -#include -#include - -#include "CRT.h" -#include "Macros.h" -#include "Object.h" -#include "ProvideCurses.h" -#include "RichString.h" -#include "Settings.h" -#include "XUtils.h" - - -#define GRAPH_HEIGHT 4 /* Unit: rows (lines) */ - -const MeterClass Meter_class = { - .super = { - .extends = Class(Object) - } -}; - -Meter* Meter_new(const struct ProcessList_* pl, unsigned int param, const MeterClass* type) { - Meter* this = xCalloc(1, sizeof(Meter)); - Object_setClass(this, type); - this->h = 1; - this->param = param; - this->pl = pl; - this->curItems = type->maxItems; - this->curAttributes = NULL; - this->values = type->maxItems ? xCalloc(type->maxItems, sizeof(double)) : NULL; - this->total = type->total; - this->caption = xStrdup(type->caption); - if (Meter_initFn(this)) { - Meter_init(this); - } - Meter_setMode(this, type->defaultMode); - return this; -} - -int Meter_humanUnit(char* buffer, unsigned long int value, size_t size) { - const char* prefix = "KMGTPEZY"; - unsigned long int powi = 1; - unsigned int powj = 1, precision = 2; - - for (;;) { - if (value / 1024 < powi) - break; - - if (prefix[1] == '\0') - break; - - powi *= 1024; - ++prefix; - } - - if (*prefix == 'K') - precision = 0; - - for (; precision > 0; precision--) { - powj *= 10; - if (value / powi < powj) - break; - } - - return snprintf(buffer, size, "%.*f%c", precision, (double) value / powi, *prefix); -} - -void Meter_delete(Object* cast) { - if (!cast) - return; - - Meter* this = (Meter*) cast; - if (Meter_doneFn(this)) { - Meter_done(this); - } - free(this->drawData); - free(this->caption); - free(this->values); - free(this); -} - -void Meter_setCaption(Meter* this, const char* caption) { - free_and_xStrdup(&this->caption, caption); -} - -static inline void Meter_displayBuffer(const Meter* this, RichString* out) { - if (Object_displayFn(this)) { - Object_display(this, out); - } else { - RichString_writeWide(out, CRT_colors[Meter_attributes(this)[0]], this->txtBuffer); - } -} - -void Meter_setMode(Meter* this, int modeIndex) { - if (modeIndex > 0 && modeIndex == this->mode) { - return; - } - - if (!modeIndex) { - modeIndex = 1; - } - - assert(modeIndex < LAST_METERMODE); - if (Meter_defaultMode(this) == CUSTOM_METERMODE) { - this->draw = Meter_drawFn(this); - if (Meter_updateModeFn(this)) { - Meter_updateMode(this, modeIndex); - } - } else { - assert(modeIndex >= 1); - free(this->drawData); - this->drawData = NULL; - - const MeterMode* mode = Meter_modes[modeIndex]; - this->draw = mode->draw; - this->h = mode->h; - } - this->mode = modeIndex; -} - -ListItem* Meter_toListItem(const Meter* this, bool moving) { - char mode[20]; - if (this->mode) { - xSnprintf(mode, sizeof(mode), " [%s]", Meter_modes[this->mode]->uiName); - } else { - mode[0] = '\0'; - } - char name[32]; - if (Meter_getUiNameFn(this)) - Meter_getUiName(this, name, sizeof(name)); - else - xSnprintf(name, sizeof(name), "%s", Meter_uiName(this)); - char buffer[50]; - xSnprintf(buffer, sizeof(buffer), "%s%s", name, mode); - ListItem* li = ListItem_new(buffer, 0); - li->moving = moving; - return li; -} - -/* ---------- TextMeterMode ---------- */ - -static void TextMeterMode_draw(Meter* this, int x, int y, int w) { - const char* caption = Meter_getCaption(this); - attrset(CRT_colors[METER_TEXT]); - mvaddnstr(y, x, caption, w); - attrset(CRT_colors[RESET_COLOR]); - - int captionLen = strlen(caption); - x += captionLen; - w -= captionLen; - if (w <= 0) - return; - - RichString_begin(out); - Meter_displayBuffer(this, &out); - RichString_printoffnVal(out, y, x, 0, w); - RichString_delete(&out); -} - -/* ---------- BarMeterMode ---------- */ - -static const char BarMeterMode_characters[] = "|#*@$%&."; - -static void BarMeterMode_draw(Meter* this, int x, int y, int w) { - const char* caption = Meter_getCaption(this); - attrset(CRT_colors[METER_TEXT]); - int captionLen = 3; - mvaddnstr(y, x, caption, captionLen); - x += captionLen; - w -= captionLen; - attrset(CRT_colors[BAR_BORDER]); - mvaddch(y, x, '['); - w--; - mvaddch(y, x + MAXIMUM(w, 0), ']'); - w--; - attrset(CRT_colors[RESET_COLOR]); - - x++; - - if (w < 1) - return; - - // The text in the bar is right aligned; - // Pad with maximal spaces and then calculate needed starting position offset - RichString_begin(bar); - RichString_appendChr(&bar, 0, ' ', w); - RichString_appendWide(&bar, 0, this->txtBuffer); - int startPos = RichString_sizeVal(bar) - w; - if (startPos > w) { - // Text is too large for bar - // Truncate meter text at a space character - for (int pos = 2 * w; pos > w; pos--) { - if (RichString_getCharVal(bar, pos) == ' ') { - while (pos > w && RichString_getCharVal(bar, pos - 1) == ' ') - pos--; - startPos = pos - w; - break; - } - } - - // If still too large, print the start not the end - startPos = MINIMUM(startPos, w); - } - assert(startPos >= 0); - assert(startPos <= w); - assert(startPos + w <= RichString_sizeVal(bar)); - - int blockSizes[10]; - - // First draw in the bar[] buffer... - int offset = 0; - for (uint8_t i = 0; i < this->curItems; i++) { - double value = this->values[i]; - value = CLAMP(value, 0.0, this->total); - if (value > 0) { - blockSizes[i] = ceil((value / this->total) * w); - } else { - blockSizes[i] = 0; - } - int nextOffset = offset + blockSizes[i]; - // (Control against invalid values) - nextOffset = CLAMP(nextOffset, 0, w); - for (int j = offset; j < nextOffset; j++) - if (RichString_getCharVal(bar, startPos + j) == ' ') { - if (CRT_colorScheme == COLORSCHEME_MONOCHROME) { - RichString_setChar(&bar, startPos + j, BarMeterMode_characters[i]); - } else { - RichString_setChar(&bar, startPos + j, '|'); - } - } - offset = nextOffset; - } - - // ...then print the buffer. - offset = 0; - for (uint8_t i = 0; i < this->curItems; i++) { - int attr = this->curAttributes ? this->curAttributes[i] : Meter_attributes(this)[i]; - RichString_setAttrn(&bar, CRT_colors[attr], startPos + offset, blockSizes[i]); - RichString_printoffnVal(bar, y, x + offset, startPos + offset, MINIMUM(blockSizes[i], w - offset)); - offset += blockSizes[i]; - offset = CLAMP(offset, 0, w); - } - if (offset < w) { - RichString_setAttrn(&bar, CRT_colors[BAR_SHADOW], startPos + offset, w - offset); - RichString_printoffnVal(bar, y, x + offset, startPos + offset, w - offset); - } - - RichString_delete(&bar); - - move(y, x + w + 1); - attrset(CRT_colors[RESET_COLOR]); -} - -/* ---------- GraphMeterMode ---------- */ - -#ifdef HAVE_LIBNCURSESW - -#define PIXPERROW_UTF8 4 -static const char* const GraphMeterMode_dotsUtf8[] = { - /*00*/" ", /*01*/"โข€", /*02*/"โข ", /*03*/"โขฐ", /*04*/ "โขธ", - /*10*/"โก€", /*11*/"โฃ€", /*12*/"โฃ ", /*13*/"โฃฐ", /*14*/ "โฃธ", - /*20*/"โก„", /*21*/"โฃ„", /*22*/"โฃค", /*23*/"โฃด", /*24*/ "โฃผ", - /*30*/"โก†", /*31*/"โฃ†", /*32*/"โฃฆ", /*33*/"โฃถ", /*34*/ "โฃพ", - /*40*/"โก‡", /*41*/"โฃ‡", /*42*/"โฃง", /*43*/"โฃท", /*44*/ "โฃฟ" -}; - -#endif - -#define PIXPERROW_ASCII 2 -static const char* const GraphMeterMode_dotsAscii[] = { - /*00*/" ", /*01*/".", /*02*/":", - /*10*/".", /*11*/".", /*12*/":", - /*20*/":", /*21*/":", /*22*/":" -}; - -static void GraphMeterMode_draw(Meter* this, int x, int y, int w) { - const ProcessList* pl = this->pl; - - if (!this->drawData) { - this->drawData = xCalloc(1, sizeof(GraphData)); - } - GraphData* data = this->drawData; - const int nValues = METER_GRAPHDATA_SIZE; - - const char* const* GraphMeterMode_dots; - int GraphMeterMode_pixPerRow; -#ifdef HAVE_LIBNCURSESW - if (CRT_utf8) { - GraphMeterMode_dots = GraphMeterMode_dotsUtf8; - GraphMeterMode_pixPerRow = PIXPERROW_UTF8; - } else -#endif - { - GraphMeterMode_dots = GraphMeterMode_dotsAscii; - GraphMeterMode_pixPerRow = PIXPERROW_ASCII; - } - - const char* caption = Meter_getCaption(this); - attrset(CRT_colors[METER_TEXT]); - int captionLen = 3; - mvaddnstr(y, x, caption, captionLen); - x += captionLen; - w -= captionLen; - - if (!timercmp(&pl->realtime, &(data->time), <)) { - int globalDelay = this->pl->settings->delay; - struct timeval delay = { .tv_sec = globalDelay / 10, .tv_usec = (globalDelay % 10) * 100000L }; - timeradd(&pl->realtime, &delay, &(data->time)); - - for (int i = 0; i < nValues - 1; i++) - data->values[i] = data->values[i + 1]; - - double value = 0.0; - for (uint8_t i = 0; i < this->curItems; i++) - value += !isnan(this->values[i]) ? this->values[i] : 0; - data->values[nValues - 1] = value; - } - - int i = nValues - (w * 2), k = 0; - if (i < 0) { - k = -i / 2; - i = 0; - } - for (; i < nValues - 1; i += 2, k++) { - int pix = GraphMeterMode_pixPerRow * GRAPH_HEIGHT; - if (this->total < 1) - this->total = 1; - int v1 = CLAMP((int) lround(data->values[i] / this->total * pix), 1, pix); - int v2 = CLAMP((int) lround(data->values[i + 1] / this->total * pix), 1, pix); - - int colorIdx = GRAPH_1; - for (int line = 0; line < GRAPH_HEIGHT; line++) { - int line1 = CLAMP(v1 - (GraphMeterMode_pixPerRow * (GRAPH_HEIGHT - 1 - line)), 0, GraphMeterMode_pixPerRow); - int line2 = CLAMP(v2 - (GraphMeterMode_pixPerRow * (GRAPH_HEIGHT - 1 - line)), 0, GraphMeterMode_pixPerRow); - - attrset(CRT_colors[colorIdx]); - mvaddstr(y + line, x + k, GraphMeterMode_dots[line1 * (GraphMeterMode_pixPerRow + 1) + line2]); - colorIdx = GRAPH_2; - } - } - attrset(CRT_colors[RESET_COLOR]); -} - -/* ---------- LEDMeterMode ---------- */ - -static const char* const LEDMeterMode_digitsAscii[] = { - " __ ", " ", " __ ", " __ ", " ", " __ ", " __ ", " __ ", " __ ", " __ ", - "| |", " |", " __|", " __|", "|__|", "|__ ", "|__ ", " |", "|__|", "|__|", - "|__|", " |", "|__ ", " __|", " |", " __|", "|__|", " |", "|__|", " __|" -}; - -#ifdef HAVE_LIBNCURSESW - -static const char* const LEDMeterMode_digitsUtf8[] = { - "โ”Œโ”€โ”€โ”", " โ” ", "โ•ถโ”€โ”€โ”", "โ•ถโ”€โ”€โ”", "โ•ท โ•ท", "โ”Œโ”€โ”€โ•ด", "โ”Œโ”€โ”€โ•ด", "โ•ถโ”€โ”€โ”", "โ”Œโ”€โ”€โ”", "โ”Œโ”€โ”€โ”", - "โ”‚ โ”‚", " โ”‚ ", "โ”Œโ”€โ”€โ”˜", " โ”€โ”€โ”ค", "โ””โ”€โ”€โ”ค", "โ””โ”€โ”€โ”", "โ”œโ”€โ”€โ”", " โ”‚", "โ”œโ”€โ”€โ”ค", "โ””โ”€โ”€โ”ค", - "โ””โ”€โ”€โ”˜", " โ•ต ", "โ””โ”€โ”€โ•ด", "โ•ถโ”€โ”€โ”˜", " โ•ต", "โ•ถโ”€โ”€โ”˜", "โ””โ”€โ”€โ”˜", " โ•ต", "โ””โ”€โ”€โ”˜", " โ”€โ”€โ”˜" -}; - -#endif - -static const char* const* LEDMeterMode_digits; - -static void LEDMeterMode_drawDigit(int x, int y, int n) { - for (int i = 0; i < 3; i++) - mvaddstr(y + i, x, LEDMeterMode_digits[i * 10 + n]); -} - -static void LEDMeterMode_draw(Meter* this, int x, int y, int w) { -#ifdef HAVE_LIBNCURSESW - if (CRT_utf8) - LEDMeterMode_digits = LEDMeterMode_digitsUtf8; - else -#endif - LEDMeterMode_digits = LEDMeterMode_digitsAscii; - - RichString_begin(out); - Meter_displayBuffer(this, &out); - - int yText = -#ifdef HAVE_LIBNCURSESW - CRT_utf8 ? y + 1 : -#endif - y + 2; - attrset(CRT_colors[LED_COLOR]); - const char* caption = Meter_getCaption(this); - mvaddstr(yText, x, caption); - int xx = x + strlen(caption); - int len = RichString_sizeVal(out); - for (int i = 0; i < len; i++) { - int c = RichString_getCharVal(out, i); - if (c >= '0' && c <= '9') { - if (xx - x + 4 > w) - break; - - LEDMeterMode_drawDigit(xx, y, c - '0'); - xx += 4; - } else { - if (xx - x + 1 > w) - break; -#ifdef HAVE_LIBNCURSESW - const cchar_t wc = { .chars = { c, '\0' }, .attr = 0 }; /* use LED_COLOR from attrset() */ - mvadd_wch(yText, xx, &wc); -#else - mvaddch(yText, xx, c); -#endif - xx += 1; - } - } - attrset(CRT_colors[RESET_COLOR]); - RichString_delete(&out); -} - -static MeterMode BarMeterMode = { - .uiName = "Bar", - .h = 1, - .draw = BarMeterMode_draw, -}; - -static MeterMode TextMeterMode = { - .uiName = "Text", - .h = 1, - .draw = TextMeterMode_draw, -}; - -static MeterMode GraphMeterMode = { - .uiName = "Graph", - .h = GRAPH_HEIGHT, - .draw = GraphMeterMode_draw, -}; - -static MeterMode LEDMeterMode = { - .uiName = "LED", - .h = 3, - .draw = LEDMeterMode_draw, -}; - -const MeterMode* const Meter_modes[] = { - NULL, - &BarMeterMode, - &TextMeterMode, - &GraphMeterMode, - &LEDMeterMode, - NULL -}; - -/* Blank meter */ - -static void BlankMeter_updateValues(Meter* this) { - this->txtBuffer[0] = '\0'; -} - -static void BlankMeter_display(ATTR_UNUSED const Object* cast, ATTR_UNUSED RichString* out) { -} - -static const int BlankMeter_attributes[] = { - DEFAULT_COLOR -}; - -const MeterClass BlankMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = BlankMeter_display, - }, - .updateValues = BlankMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 0, - .total = 100.0, - .attributes = BlankMeter_attributes, - .name = "Blank", - .uiName = "Blank", - .caption = "" -}; diff --git a/fedora/.local/bin/htop-vim/Meter.h b/fedora/.local/bin/htop-vim/Meter.h deleted file mode 100644 index bd7604a..0000000 --- a/fedora/.local/bin/htop-vim/Meter.h +++ /dev/null @@ -1,162 +0,0 @@ -#ifndef HEADER_Meter -#define HEADER_Meter -/* -htop - Meter.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include -#include -#include -#include - -#include "ListItem.h" -#include "Object.h" -#include "ProcessList.h" - - -#define METER_TXTBUFFER_LEN 256 -#define METER_GRAPHDATA_SIZE 256 - -#define METER_BUFFER_CHECK(buffer, size, written) \ - do { \ - if ((written) < 0 || (size_t)(written) >= (size)) { \ - return; \ - } \ - (buffer) += (written); \ - (size) -= (size_t)(written); \ - } while (0) - -#define METER_BUFFER_APPEND_CHR(buffer, size, c) \ - do { \ - if ((size) < 2) { \ - return; \ - } \ - *(buffer)++ = c; \ - *(buffer) = '\0'; \ - (size)--; \ - if ((size) == 0) { \ - return; \ - } \ - } while (0) - - -struct Meter_; -typedef struct Meter_ Meter; - -typedef void(*Meter_Init)(Meter*); -typedef void(*Meter_Done)(Meter*); -typedef void(*Meter_UpdateMode)(Meter*, int); -typedef void(*Meter_UpdateValues)(Meter*); -typedef void(*Meter_Draw)(Meter*, int, int, int); -typedef const char* (*Meter_GetCaption)(const Meter*); -typedef void(*Meter_GetUiName)(const Meter*, char*, size_t); - -typedef struct MeterClass_ { - const ObjectClass super; - const Meter_Init init; - const Meter_Done done; - const Meter_UpdateMode updateMode; - const Meter_UpdateValues updateValues; - const Meter_Draw draw; - const Meter_GetCaption getCaption; - const Meter_GetUiName getUiName; - const int defaultMode; - const double total; - const int* const attributes; - const char* const name; /* internal name of the meter, must not contain any space */ - const char* const uiName; /* display name in header setup menu */ - const char* const caption; /* prefix in the actual header */ - const char* const description; /* optional meter description in header setup menu */ - const uint8_t maxItems; - const bool isMultiColumn; /* whether the meter draws multiple sub-columns (defaults to false) */ -} MeterClass; - -#define As_Meter(this_) ((const MeterClass*)((this_)->super.klass)) -#define Meter_initFn(this_) As_Meter(this_)->init -#define Meter_init(this_) As_Meter(this_)->init((Meter*)(this_)) -#define Meter_done(this_) As_Meter(this_)->done((Meter*)(this_)) -#define Meter_updateModeFn(this_) As_Meter(this_)->updateMode -#define Meter_updateMode(this_, m_) As_Meter(this_)->updateMode((Meter*)(this_), m_) -#define Meter_drawFn(this_) As_Meter(this_)->draw -#define Meter_doneFn(this_) As_Meter(this_)->done -#define Meter_updateValues(this_) As_Meter(this_)->updateValues((Meter*)(this_)) -#define Meter_getUiNameFn(this_) As_Meter(this_)->getUiName -#define Meter_getUiName(this_,n_,l_) As_Meter(this_)->getUiName((const Meter*)(this_),n_,l_) -#define Meter_getCaptionFn(this_) As_Meter(this_)->getCaption -#define Meter_getCaption(this_) (Meter_getCaptionFn(this_) ? As_Meter(this_)->getCaption((const Meter*)(this_)) : (this_)->caption) -#define Meter_defaultMode(this_) As_Meter(this_)->defaultMode -#define Meter_attributes(this_) As_Meter(this_)->attributes -#define Meter_name(this_) As_Meter(this_)->name -#define Meter_uiName(this_) As_Meter(this_)->uiName -#define Meter_isMultiColumn(this_) As_Meter(this_)->isMultiColumn - -typedef struct GraphData_ { - struct timeval time; - double values[METER_GRAPHDATA_SIZE]; -} GraphData; - -struct Meter_ { - Object super; - Meter_Draw draw; - - char* caption; - int mode; - unsigned int param; - GraphData* drawData; - int h; - int columnWidthCount; /**< only used internally by the Header */ - const ProcessList* pl; - uint8_t curItems; - const int* curAttributes; - char txtBuffer[METER_TXTBUFFER_LEN]; - double* values; - double total; - void* meterData; -}; - -typedef struct MeterMode_ { - Meter_Draw draw; - const char* uiName; - int h; -} MeterMode; - -typedef enum { - CUSTOM_METERMODE = 0, - BAR_METERMODE, - TEXT_METERMODE, - GRAPH_METERMODE, - LED_METERMODE, - LAST_METERMODE -} MeterModeId; - -typedef enum { - RATESTATUS_DATA, - RATESTATUS_INIT, - RATESTATUS_NODATA, - RATESTATUS_STALE -} MeterRateStatus; - -extern const MeterClass Meter_class; - -Meter* Meter_new(const ProcessList* pl, unsigned int param, const MeterClass* type); - -int Meter_humanUnit(char* buffer, unsigned long int value, size_t size); - -void Meter_delete(Object* cast); - -void Meter_setCaption(Meter* this, const char* caption); - -void Meter_setMode(Meter* this, int modeIndex); - -ListItem* Meter_toListItem(const Meter* this, bool moving); - -extern const MeterMode* const Meter_modes[]; - -extern const MeterClass BlankMeter_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/MetersPanel.c b/fedora/.local/bin/htop-vim/MetersPanel.c deleted file mode 100644 index 580e41b..0000000 --- a/fedora/.local/bin/htop-vim/MetersPanel.c +++ /dev/null @@ -1,224 +0,0 @@ -/* -htop - MetersPanel.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "MetersPanel.h" - -#include - -#include "CRT.h" -#include "FunctionBar.h" -#include "Header.h" -#include "ListItem.h" -#include "Meter.h" -#include "Object.h" -#include "ProvideCurses.h" - - -// Note: In code the meters are known to have bar/text/graph "Modes", but in UI -// we call them "Styles". -static const char* const MetersFunctions[] = {"Style ", "Move ", " ", "Delete", "Done ", NULL}; -static const char* const MetersKeys[] = {"Space", "Enter", "", "Del", "F10"}; -static const int MetersEvents[] = {' ', 13, ERR, KEY_DC, KEY_F(10)}; - -// We avoid UTF-8 arrows โ† โ†’ here as they might display full-width on Chinese -// terminals, breaking our aligning. -// In , arrows (U+2019..U+2199) are -// considered "Ambiguous characters". -static const char* const MetersMovingFunctions[] = {"Style ", "Lock ", "Up ", "Down ", "Left ", "Right ", " ", "Delete", "Done ", NULL}; -static const char* const MetersMovingKeys[] = {"Space", "Enter", "Up", "Dn", "<-", "->", " ", "Del", "F10"}; -static const int MetersMovingEvents[] = {' ', 13, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, ERR, KEY_DC, KEY_F(10)}; -static FunctionBar* Meters_movingBar = NULL; - -void MetersPanel_cleanup(void) { - if (Meters_movingBar) { - FunctionBar_delete(Meters_movingBar); - Meters_movingBar = NULL; - } -} - -static void MetersPanel_delete(Object* object) { - Panel* super = (Panel*) object; - MetersPanel* this = (MetersPanel*) object; - Panel_done(super); - free(this); -} - -void MetersPanel_setMoving(MetersPanel* this, bool moving) { - Panel* super = (Panel*) this; - this->moving = moving; - ListItem* selected = (ListItem*)Panel_getSelected(super); - if (selected) { - selected->moving = moving; - } - if (!moving) { - Panel_setSelectionColor(super, PANEL_SELECTION_FOCUS); - Panel_setDefaultBar(super); - } else { - Panel_setSelectionColor(super, PANEL_SELECTION_FOLLOW); - super->currentBar = Meters_movingBar; - } -} - -static inline bool moveToNeighbor(MetersPanel* this, MetersPanel* neighbor, int selected) { - Panel* super = (Panel*) this; - if (this->moving) { - if (neighbor) { - if (selected < Vector_size(this->meters)) { - MetersPanel_setMoving(this, false); - - Meter* meter = (Meter*) Vector_take(this->meters, selected); - Panel_remove(super, selected); - Vector_insert(neighbor->meters, selected, meter); - Panel_insert(&(neighbor->super), selected, (Object*) Meter_toListItem(meter, false)); - Panel_setSelected(&(neighbor->super), selected); - - MetersPanel_setMoving(neighbor, true); - return true; - } - } - } - return false; -} - -static HandlerResult MetersPanel_eventHandler(Panel* super, int ch) { - MetersPanel* this = (MetersPanel*) super; - - int selected = Panel_getSelectedIndex(super); - HandlerResult result = IGNORED; - bool sideMove = false; - - switch (ch) { - case 0x0a: - case 0x0d: - case KEY_ENTER: - { - if (!Vector_size(this->meters)) - break; - MetersPanel_setMoving(this, !(this->moving)); - result = HANDLED; - break; - } - case ' ': - case KEY_F(4): - case 't': - { - if (!Vector_size(this->meters)) - break; - Meter* meter = (Meter*) Vector_get(this->meters, selected); - int mode = meter->mode + 1; - if (mode == LAST_METERMODE) - mode = 1; - Meter_setMode(meter, mode); - Panel_set(super, selected, (Object*) Meter_toListItem(meter, this->moving)); - result = HANDLED; - break; - } - case KEY_UP: - { - if (!this->moving) { - break; - } - } - /* else fallthrough */ - case KEY_F(7): - case '[': - case '-': - { - Vector_moveUp(this->meters, selected); - Panel_moveSelectedUp(super); - result = HANDLED; - break; - } - case KEY_DOWN: - { - if (!this->moving) { - break; - } - } - /* else fallthrough */ - case KEY_F(8): - case ']': - case '+': - { - Vector_moveDown(this->meters, selected); - Panel_moveSelectedDown(super); - result = HANDLED; - break; - } - case KEY_RIGHT: - { - sideMove = moveToNeighbor(this, this->rightNeighbor, selected); - if (this->moving && !sideMove) { - // lock user here until it exits positioning-mode - result = HANDLED; - } - // if user is free, don't set HANDLED; - // let ScreenManager handle focus. - break; - } - case KEY_LEFT: - { - sideMove = moveToNeighbor(this, this->leftNeighbor, selected); - if (this->moving && !sideMove) { - result = HANDLED; - } - break; - } - case KEY_F(9): - case KEY_DC: - { - if (!Vector_size(this->meters)) - break; - if (selected < Vector_size(this->meters)) { - Vector_remove(this->meters, selected); - Panel_remove(super, selected); - } - MetersPanel_setMoving(this, false); - result = HANDLED; - break; - } - } - if (result == HANDLED || sideMove) { - Header* header = this->scr->header; - this->settings->changed = true; - this->settings->lastUpdate++; - Header_calculateHeight(header); - ScreenManager_resize(this->scr); - } - return result; -} - -const PanelClass MetersPanel_class = { - .super = { - .extends = Class(Panel), - .delete = MetersPanel_delete - }, - .eventHandler = MetersPanel_eventHandler -}; - -MetersPanel* MetersPanel_new(Settings* settings, const char* header, Vector* meters, ScreenManager* scr) { - MetersPanel* this = AllocThis(MetersPanel); - Panel* super = (Panel*) this; - FunctionBar* fuBar = FunctionBar_new(MetersFunctions, MetersKeys, MetersEvents); - if (!Meters_movingBar) { - Meters_movingBar = FunctionBar_new(MetersMovingFunctions, MetersMovingKeys, MetersMovingEvents); - } - Panel_init(super, 1, 1, 1, 1, Class(ListItem), true, fuBar); - - this->settings = settings; - this->meters = meters; - this->scr = scr; - this->moving = false; - this->rightNeighbor = NULL; - this->leftNeighbor = NULL; - Panel_setHeader(super, header); - for (int i = 0; i < Vector_size(meters); i++) { - const Meter* meter = (const Meter*) Vector_get(meters, i); - Panel_add(super, (Object*) Meter_toListItem(meter, false)); - } - return this; -} diff --git a/fedora/.local/bin/htop-vim/MetersPanel.h b/fedora/.local/bin/htop-vim/MetersPanel.h deleted file mode 100644 index 679c12d..0000000 --- a/fedora/.local/bin/htop-vim/MetersPanel.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef HEADER_MetersPanel -#define HEADER_MetersPanel -/* -htop - MetersPanel.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include - -#include "Panel.h" -#include "ScreenManager.h" -#include "Settings.h" -#include "Vector.h" - - -struct MetersPanel_; -typedef struct MetersPanel_ MetersPanel; - -struct MetersPanel_ { - Panel super; - - Settings* settings; - Vector* meters; - ScreenManager* scr; - MetersPanel* leftNeighbor; - MetersPanel* rightNeighbor; - bool moving; -}; - -void MetersPanel_cleanup(void); - -void MetersPanel_setMoving(MetersPanel* this, bool moving); - -extern const PanelClass MetersPanel_class; - -MetersPanel* MetersPanel_new(Settings* settings, const char* header, Vector* meters, ScreenManager* scr); - -#endif diff --git a/fedora/.local/bin/htop-vim/NEWS b/fedora/.local/bin/htop-vim/NEWS deleted file mode 100644 index 27fd578..0000000 --- a/fedora/.local/bin/htop-vim/NEWS +++ /dev/null @@ -1,4 +0,0 @@ - -See the commit history for news of the past. -See the bug tracker for news of the future. -Run the program for news of the present. diff --git a/fedora/.local/bin/htop-vim/NetworkIOMeter.c b/fedora/.local/bin/htop-vim/NetworkIOMeter.c deleted file mode 100644 index d41eafa..0000000 --- a/fedora/.local/bin/htop-vim/NetworkIOMeter.c +++ /dev/null @@ -1,167 +0,0 @@ -#include "NetworkIOMeter.h" - -#include -#include - -#include "CRT.h" -#include "Macros.h" -#include "Meter.h" -#include "Object.h" -#include "Platform.h" -#include "Process.h" -#include "ProcessList.h" -#include "RichString.h" -#include "XUtils.h" - - -static const int NetworkIOMeter_attributes[] = { - METER_VALUE_IOREAD, - METER_VALUE_IOWRITE, -}; - -static MeterRateStatus status = RATESTATUS_INIT; -static uint32_t cached_rxb_diff; -static uint32_t cached_rxp_diff; -static uint32_t cached_txb_diff; -static uint32_t cached_txp_diff; - -static void NetworkIOMeter_updateValues(Meter* this) { - const ProcessList* pl = this->pl; - static uint64_t cached_last_update = 0; - - uint64_t passedTimeInMs = pl->realtimeMs - cached_last_update; - - /* update only every 500ms to have a sane span for rate calculation */ - if (passedTimeInMs > 500) { - static uint64_t cached_rxb_total; - static uint64_t cached_rxp_total; - static uint64_t cached_txb_total; - static uint64_t cached_txp_total; - uint64_t diff; - - NetworkIOData data; - if (!Platform_getNetworkIO(&data)) { - status = RATESTATUS_NODATA; - } else if (cached_last_update == 0) { - status = RATESTATUS_INIT; - } else if (passedTimeInMs > 30000) { - status = RATESTATUS_STALE; - } else { - status = RATESTATUS_DATA; - } - - cached_last_update = pl->realtimeMs; - - if (status == RATESTATUS_NODATA) { - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "no data"); - return; - } - - if (data.bytesReceived > cached_rxb_total) { - diff = data.bytesReceived - cached_rxb_total; - diff = (1000 * diff) / passedTimeInMs; /* convert to B/s */ - diff /= ONE_K; /* convert to KiB/s */ - cached_rxb_diff = (uint32_t)diff; - } else { - cached_rxb_diff = 0; - } - cached_rxb_total = data.bytesReceived; - - if (data.packetsReceived > cached_rxp_total) { - diff = data.packetsReceived - cached_rxp_total; - diff = (1000 * diff) / passedTimeInMs; /* convert to B/s */ - cached_rxp_diff = (uint32_t)diff; - } else { - cached_rxp_diff = 0; - } - cached_rxp_total = data.packetsReceived; - - if (data.bytesTransmitted > cached_txb_total) { - diff = data.bytesTransmitted - cached_txb_total; - diff = (1000 * diff) / passedTimeInMs; /* convert to B/s */ - diff /= ONE_K; /* convert to KiB/s */ - cached_txb_diff = (uint32_t)diff; - } else { - cached_txb_diff = 0; - } - cached_txb_total = data.bytesTransmitted; - - if (data.packetsTransmitted > cached_txp_total) { - diff = data.packetsTransmitted - cached_txp_total; - diff = (1000 * diff) / passedTimeInMs; /* convert to B/s */ - cached_txp_diff = (uint32_t)diff; - } else { - cached_txp_diff = 0; - } - cached_txp_total = data.packetsTransmitted; - } - - if (status == RATESTATUS_INIT) { - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "init"); - return; - } - if (status == RATESTATUS_STALE) { - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "stale"); - return; - } - - this->values[0] = cached_rxb_diff; - this->values[1] = cached_txb_diff; - if (cached_rxb_diff + cached_txb_diff > this->total) { - this->total = cached_rxb_diff + cached_txb_diff; - } - - char bufferBytesReceived[12], bufferBytesTransmitted[12]; - Meter_humanUnit(bufferBytesReceived, cached_rxb_diff, sizeof(bufferBytesReceived)); - Meter_humanUnit(bufferBytesTransmitted, cached_txb_diff, sizeof(bufferBytesTransmitted)); - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "rx:%siB/s tx:%siB/s %d/%dpkts/s", - bufferBytesReceived, bufferBytesTransmitted, cached_rxp_diff, cached_txp_diff); -} - -static void NetworkIOMeter_display(ATTR_UNUSED const Object* cast, RichString* out) { - switch (status) { - case RATESTATUS_NODATA: - RichString_writeAscii(out, CRT_colors[METER_VALUE_ERROR], "no data"); - return; - case RATESTATUS_INIT: - RichString_writeAscii(out, CRT_colors[METER_VALUE], "initializing..."); - return; - case RATESTATUS_STALE: - RichString_writeAscii(out, CRT_colors[METER_VALUE_WARN], "stale data"); - return; - case RATESTATUS_DATA: - break; - } - - char buffer[64]; - int len; - - RichString_writeAscii(out, CRT_colors[METER_TEXT], "rx: "); - Meter_humanUnit(buffer, cached_rxb_diff, sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_VALUE_IOREAD], buffer); - RichString_appendAscii(out, CRT_colors[METER_VALUE_IOREAD], "iB/s"); - - RichString_appendAscii(out, CRT_colors[METER_TEXT], " tx: "); - Meter_humanUnit(buffer, cached_txb_diff, sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_VALUE_IOWRITE], buffer); - RichString_appendAscii(out, CRT_colors[METER_VALUE_IOWRITE], "iB/s"); - - len = xSnprintf(buffer, sizeof(buffer), " (%u/%u pkts/s) ", cached_rxp_diff, cached_txp_diff); - RichString_appendnAscii(out, CRT_colors[METER_TEXT], buffer, len); -} - -const MeterClass NetworkIOMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = NetworkIOMeter_display - }, - .updateValues = NetworkIOMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 2, - .total = 100.0, - .attributes = NetworkIOMeter_attributes, - .name = "NetworkIO", - .uiName = "Network IO", - .caption = "Network: " -}; diff --git a/fedora/.local/bin/htop-vim/NetworkIOMeter.h b/fedora/.local/bin/htop-vim/NetworkIOMeter.h deleted file mode 100644 index 18c23ce..0000000 --- a/fedora/.local/bin/htop-vim/NetworkIOMeter.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef HEADER_NetworkIOMeter -#define HEADER_NetworkIOMeter - -#include "Meter.h" - - -typedef struct NetworkIOData_ { - uint64_t bytesReceived; - uint64_t packetsReceived; - uint64_t bytesTransmitted; - uint64_t packetsTransmitted; -} NetworkIOData; - -extern const MeterClass NetworkIOMeter_class; - -#endif /* HEADER_NetworkIOMeter */ diff --git a/fedora/.local/bin/htop-vim/Object.c b/fedora/.local/bin/htop-vim/Object.c deleted file mode 100644 index f009148..0000000 --- a/fedora/.local/bin/htop-vim/Object.c +++ /dev/null @@ -1,29 +0,0 @@ -/* -htop - Object.c -(C) 2004-2012 Hisham H. Muhammad -(C) 2020 Red Hat, Inc. All Rights Reserved. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Object.h" - -#include - - -const ObjectClass Object_class = { - .extends = NULL -}; - -bool Object_isA(const Object* o, const ObjectClass* klass) { - if (!o) - return false; - - for (const ObjectClass* type = o->klass; type; type = type->extends) { - if (type == klass) { - return true; - } - } - - return false; -} diff --git a/fedora/.local/bin/htop-vim/Object.h b/fedora/.local/bin/htop-vim/Object.h deleted file mode 100644 index d5b3bb3..0000000 --- a/fedora/.local/bin/htop-vim/Object.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef HEADER_Object -#define HEADER_Object -/* -htop - Object.h -(C) 2004-2012 Hisham H. Muhammad -(C) 2020 Red Hat, Inc. All Rights Reserved. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include -#include - -#include "RichString.h" -#include "XUtils.h" // IWYU pragma: keep - - -struct Object_; -typedef struct Object_ Object; - -typedef void(*Object_Display)(const Object*, RichString*); -typedef int(*Object_Compare)(const void*, const void*); -typedef void(*Object_Delete)(Object*); - -#define Object_getClass(obj_) ((const Object*)(obj_))->klass -#define Object_setClass(obj_, class_) (((Object*)(obj_))->klass = (const ObjectClass*) (class_)) - -#define Object_delete(obj_) (assert(Object_getClass(obj_)->delete), Object_getClass(obj_)->delete((Object*)(obj_))) -#define Object_displayFn(obj_) Object_getClass(obj_)->display -#define Object_display(obj_, str_) (assert(Object_getClass(obj_)->display), Object_getClass(obj_)->display((const Object*)(obj_), str_)) -#define Object_compare(obj_, other_) (assert(Object_getClass(obj_)->compare), Object_getClass(obj_)->compare((const void*)(obj_), other_)) - -#define Class(class_) ((const ObjectClass*)(&(class_ ## _class))) - -#define AllocThis(class_) (class_*) xMalloc(sizeof(class_)); Object_setClass(this, Class(class_)) - -typedef struct ObjectClass_ { - const void* const extends; - const Object_Display display; - const Object_Delete delete; - const Object_Compare compare; -} ObjectClass; - -struct Object_ { - const ObjectClass* klass; -}; - -typedef union { - int i; - void* v; -} Arg; - -extern const ObjectClass Object_class; - -bool Object_isA(const Object* o, const ObjectClass* klass); - -#endif diff --git a/fedora/.local/bin/htop-vim/OpenFilesScreen.c b/fedora/.local/bin/htop-vim/OpenFilesScreen.c deleted file mode 100644 index 4256575..0000000 --- a/fedora/.local/bin/htop-vim/OpenFilesScreen.c +++ /dev/null @@ -1,288 +0,0 @@ -/* -htop - OpenFilesScreen.c -(C) 2005-2006 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "OpenFilesScreen.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Macros.h" -#include "Panel.h" -#include "ProvideCurses.h" -#include "Vector.h" -#include "XUtils.h" - - -typedef struct OpenFiles_Data_ { - char* data[8]; -} OpenFiles_Data; - -typedef struct OpenFiles_ProcessData_ { - OpenFiles_Data data; - int error; - struct OpenFiles_FileData_* files; -} OpenFiles_ProcessData; - -typedef struct OpenFiles_FileData_ { - OpenFiles_Data data; - struct OpenFiles_FileData_* next; -} OpenFiles_FileData; - -static size_t getIndexForType(char type) { - switch (type) { - case 'f': - return 0; - case 'a': - return 1; - case 'D': - return 2; - case 'i': - return 3; - case 'n': - return 4; - case 's': - return 5; - case 't': - return 6; - case 'o': - return 7; - } - - /* should never reach here */ - abort(); -} - -static const char* getDataForType(const OpenFiles_Data* data, char type) { - size_t index = getIndexForType(type); - return data->data[index] ? data->data[index] : ""; -} - -OpenFilesScreen* OpenFilesScreen_new(const Process* process) { - OpenFilesScreen* this = xMalloc(sizeof(OpenFilesScreen)); - Object_setClass(this, Class(OpenFilesScreen)); - if (Process_isThread(process)) { - this->pid = process->tgid; - } else { - this->pid = process->pid; - } - return (OpenFilesScreen*) InfoScreen_init(&this->super, process, NULL, LINES - 2, " FD TYPE MODE DEVICE SIZE OFFSET NODE NAME"); -} - -void OpenFilesScreen_delete(Object* this) { - free(InfoScreen_done((InfoScreen*)this)); -} - -static void OpenFilesScreen_draw(InfoScreen* this) { - InfoScreen_drawTitled(this, "Snapshot of files open in process %d - %s", ((OpenFilesScreen*)this)->pid, Process_getCommand(this->process)); -} - -static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) { - OpenFiles_ProcessData* pdata = xCalloc(1, sizeof(OpenFiles_ProcessData)); - - int fdpair[2] = {0, 0}; - if (pipe(fdpair) == -1) { - pdata->error = 1; - return pdata; - } - - pid_t child = fork(); - if (child == -1) { - close(fdpair[1]); - close(fdpair[0]); - pdata->error = 1; - return pdata; - } - - if (child == 0) { - close(fdpair[0]); - dup2(fdpair[1], STDOUT_FILENO); - close(fdpair[1]); - int fdnull = open("/dev/null", O_WRONLY); - if (fdnull < 0) { - exit(1); - } - - dup2(fdnull, STDERR_FILENO); - close(fdnull); - char buffer[32] = {0}; - xSnprintf(buffer, sizeof(buffer), "%d", pid); - // Use of NULL in variadic functions must have a pointer cast. - // The NULL constant is not required by standard to have a pointer type. - execlp("lsof", "lsof", "-P", "-o", "-p", buffer, "-F", (char *)NULL); - exit(127); - } - close(fdpair[1]); - - OpenFiles_Data* item = &(pdata->data); - OpenFiles_FileData* fdata = NULL; - bool lsofIncludesFileSize = false; - - FILE* fd = fdopen(fdpair[0], "r"); - if (!fd) { - pdata->error = 1; - return pdata; - } - for (;;) { - char* line = String_readLine(fd); - if (!line) { - break; - } - - unsigned char cmd = line[0]; - switch (cmd) { - case 'f': /* file descriptor */ - { - OpenFiles_FileData* nextFile = xCalloc(1, sizeof(OpenFiles_FileData)); - if (fdata == NULL) { - pdata->files = nextFile; - } else { - fdata->next = nextFile; - } - fdata = nextFile; - item = &(fdata->data); - } /* FALLTHRU */ - case 'a': /* file access mode */ - case 'D': /* file's major/minor device number */ - case 'i': /* file's inode number */ - case 'n': /* file name, comment, Internet address */ - case 's': /* file's size */ - case 't': /* file's type */ - { - size_t index = getIndexForType(cmd); - free_and_xStrdup(&item->data[index], line + 1); - break; - } - case 'o': /* file's offset */ - { - size_t index = getIndexForType(cmd); - if (String_startsWith(line + 1, "0t")) { - free_and_xStrdup(&item->data[index], line + 3); - } else { - free_and_xStrdup(&item->data[index], line + 1); - } - break; - } - case 'c': /* process command name */ - case 'd': /* file's device character code */ - case 'g': /* process group ID */ - case 'G': /* file flags */ - case 'k': /* link count */ - case 'l': /* file's lock status */ - case 'L': /* process login name */ - case 'p': /* process ID */ - case 'P': /* protocol name */ - case 'R': /* parent process ID */ - case 'T': /* TCP/TPI information, identified by prefixes */ - case 'u': /* process user ID */ - /* ignore */ - break; - } - - if (cmd == 's') - lsofIncludesFileSize = true; - - free(line); - } - fclose(fd); - - int wstatus; - while (waitpid(child, &wstatus, 0) == -1) - if (errno != EINTR) { - pdata->error = 1; - return pdata; - } - - if (!WIFEXITED(wstatus)) { - pdata->error = 1; - } else { - pdata->error = WEXITSTATUS(wstatus); - } - - /* We got all information we need; no post-processing needed */ - if (lsofIncludesFileSize) - return pdata; - - /* On linux, `lsof -o -F` omits SIZE, so add it back. */ - /* On macOS, `lsof -o -F` includes SIZE, so this block isn't needed. If no open files have a filesize, this will still run, unfortunately. */ - size_t fileSizeIndex = getIndexForType('s'); - for (fdata = pdata->files; fdata != NULL; fdata = fdata->next) { - item = &fdata->data; - const char* filename = getDataForType(item, 'n'); - - struct stat st; - if (stat(filename, &st) == 0) { - char fileSizeBuf[21]; /* 20 (long long) + 1 (NULL) */ - xSnprintf(fileSizeBuf, sizeof(fileSizeBuf), "%"PRIu64, (uint64_t)st.st_size); /* st.st_size is long long on macOS, long on linux */ - free_and_xStrdup(&item->data[fileSizeIndex], fileSizeBuf); - } - } - - return pdata; -} - -static void OpenFiles_Data_clear(OpenFiles_Data* data) { - for (size_t i = 0; i < ARRAYSIZE(data->data); i++) - free(data->data[i]); -} - -static void OpenFilesScreen_scan(InfoScreen* this) { - Panel* panel = this->display; - int idx = Panel_getSelectedIndex(panel); - Panel_prune(panel); - OpenFiles_ProcessData* pdata = OpenFilesScreen_getProcessData(((OpenFilesScreen*)this)->pid); - if (pdata->error == 127) { - InfoScreen_addLine(this, "Could not execute 'lsof'. Please make sure it is available in your $PATH."); - } else if (pdata->error == 1) { - InfoScreen_addLine(this, "Failed listing open files."); - } else { - OpenFiles_FileData* fdata = pdata->files; - while (fdata) { - OpenFiles_Data* data = &fdata->data; - size_t lenN = strlen(getDataForType(data, 'n')); - size_t sizeEntry = 5 + 7 + 4 + 10 + 10 + 10 + 10 + lenN + 8 /*spaces*/ + 1 /*null*/; - char entry[sizeEntry]; - xSnprintf(entry, sizeof(entry), "%5.5s %-7.7s %-4.4s %-10.10s %10.10s %10.10s %10.10s %s", - getDataForType(data, 'f'), - getDataForType(data, 't'), - getDataForType(data, 'a'), - getDataForType(data, 'D'), - getDataForType(data, 's'), - getDataForType(data, 'o'), - getDataForType(data, 'i'), - getDataForType(data, 'n')); - InfoScreen_addLine(this, entry); - OpenFiles_Data_clear(data); - OpenFiles_FileData* old = fdata; - fdata = fdata->next; - free(old); - } - OpenFiles_Data_clear(&pdata->data); - } - free(pdata); - Vector_insertionSort(this->lines); - Vector_insertionSort(panel->items); - Panel_setSelected(panel, idx); -} - -const InfoScreenClass OpenFilesScreen_class = { - .super = { - .extends = Class(Object), - .delete = OpenFilesScreen_delete - }, - .scan = OpenFilesScreen_scan, - .draw = OpenFilesScreen_draw -}; diff --git a/fedora/.local/bin/htop-vim/OpenFilesScreen.h b/fedora/.local/bin/htop-vim/OpenFilesScreen.h deleted file mode 100644 index 43f95ea..0000000 --- a/fedora/.local/bin/htop-vim/OpenFilesScreen.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef HEADER_OpenFilesScreen -#define HEADER_OpenFilesScreen -/* -htop - OpenFilesScreen.h -(C) 2005-2006 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include - -#include "InfoScreen.h" -#include "Object.h" -#include "Process.h" - - -typedef struct OpenFilesScreen_ { - InfoScreen super; - pid_t pid; -} OpenFilesScreen; - -extern const InfoScreenClass OpenFilesScreen_class; - -OpenFilesScreen* OpenFilesScreen_new(const Process* process); - -void OpenFilesScreen_delete(Object* this); - -#endif diff --git a/fedora/.local/bin/htop-vim/OptionItem.c b/fedora/.local/bin/htop-vim/OptionItem.c deleted file mode 100644 index 962c0a9..0000000 --- a/fedora/.local/bin/htop-vim/OptionItem.c +++ /dev/null @@ -1,215 +0,0 @@ -/* -htop - OptionItem.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "OptionItem.h" - -#include -#include -#include - -#include "CRT.h" -#include "Macros.h" -#include "RichString.h" -#include "XUtils.h" - - -static void OptionItem_delete(Object* cast) { - OptionItem* this = (OptionItem*)cast; - assert (this != NULL); - - free(this->text); - free(this); -} - -static void TextItem_display(const Object* cast, RichString* out) { - const TextItem* this = (const TextItem*)cast; - assert (this != NULL); - - RichString_appendWide(out, CRT_colors[HELP_BOLD], this->super.text); -} - -static void CheckItem_display(const Object* cast, RichString* out) { - const CheckItem* this = (const CheckItem*)cast; - assert (this != NULL); - - RichString_writeAscii(out, CRT_colors[CHECK_BOX], "["); - if (CheckItem_get(this)) { - RichString_appendAscii(out, CRT_colors[CHECK_MARK], "x"); - } else { - RichString_appendAscii(out, CRT_colors[CHECK_MARK], " "); - } - RichString_appendAscii(out, CRT_colors[CHECK_BOX], "] "); - RichString_appendWide(out, CRT_colors[CHECK_TEXT], this->super.text); -} - -static void NumberItem_display(const Object* cast, RichString* out) { - const NumberItem* this = (const NumberItem*)cast; - assert (this != NULL); - - char buffer[12]; - RichString_writeAscii(out, CRT_colors[CHECK_BOX], "["); - int written; - if (this->scale < 0) { - written = xSnprintf(buffer, sizeof(buffer), "%.*f", -this->scale, pow(10, this->scale) * NumberItem_get(this)); - } else if (this->scale > 0) { - written = xSnprintf(buffer, sizeof(buffer), "%d", (int) (pow(10, this->scale) * NumberItem_get(this))); - } else { - written = xSnprintf(buffer, sizeof(buffer), "%d", NumberItem_get(this)); - } - RichString_appendnAscii(out, CRT_colors[CHECK_MARK], buffer, written); - RichString_appendAscii(out, CRT_colors[CHECK_BOX], "]"); - for (int i = written; i < 5; i++) { - RichString_appendAscii(out, CRT_colors[CHECK_BOX], " "); - } - RichString_appendWide(out, CRT_colors[CHECK_TEXT], this->super.text); -} - -const OptionItemClass OptionItem_class = { - .super = { - .extends = Class(Object), - .delete = OptionItem_delete - } -}; - -const OptionItemClass TextItem_class = { - .super = { - .extends = Class(OptionItem), - .delete = OptionItem_delete, - .display = TextItem_display - }, - .kind = OPTION_ITEM_TEXT -}; - - -const OptionItemClass CheckItem_class = { - .super = { - .extends = Class(OptionItem), - .delete = OptionItem_delete, - .display = CheckItem_display - }, - .kind = OPTION_ITEM_CHECK -}; - - -const OptionItemClass NumberItem_class = { - .super = { - .extends = Class(OptionItem), - .delete = OptionItem_delete, - .display = NumberItem_display - }, - .kind = OPTION_ITEM_NUMBER -}; - -TextItem* TextItem_new(const char* text) { - TextItem* this = AllocThis(TextItem); - this->super.text = xStrdup(text); - return this; -} - -CheckItem* CheckItem_newByRef(const char* text, bool* ref) { - CheckItem* this = AllocThis(CheckItem); - this->super.text = xStrdup(text); - this->value = false; - this->ref = ref; - return this; -} - -CheckItem* CheckItem_newByVal(const char* text, bool value) { - CheckItem* this = AllocThis(CheckItem); - this->super.text = xStrdup(text); - this->value = value; - this->ref = NULL; - return this; -} - -bool CheckItem_get(const CheckItem* this) { - if (this->ref) { - return *(this->ref); - } else { - return this->value; - } -} - -void CheckItem_set(CheckItem* this, bool value) { - if (this->ref) { - *(this->ref) = value; - } else { - this->value = value; - } -} - -void CheckItem_toggle(CheckItem* this) { - if (this->ref) { - *(this->ref) = !*(this->ref); - } else { - this->value = !this->value; - } -} - -NumberItem* NumberItem_newByRef(const char* text, int* ref, int scale, int min, int max) { - assert(min <= max); - - NumberItem* this = AllocThis(NumberItem); - this->super.text = xStrdup(text); - this->value = 0; - this->ref = ref; - this->scale = scale; - this->min = min; - this->max = max; - return this; -} - -NumberItem* NumberItem_newByVal(const char* text, int value, int scale, int min, int max) { - assert(min <= max); - - NumberItem* this = AllocThis(NumberItem); - this->super.text = xStrdup(text); - this->value = CLAMP(value, min, max); - this->ref = NULL; - this->scale = scale; - this->min = min; - this->max = max; - return this; -} - -int NumberItem_get(const NumberItem* this) { - if (this->ref) { - return *(this->ref); - } else { - return this->value; - } -} - -void NumberItem_decrease(NumberItem* this) { - if (this->ref) { - *(this->ref) = CLAMP(*(this->ref) - 1, this->min, this->max); - } else { - this->value = CLAMP(this->value - 1, this->min, this->max); - } -} - -void NumberItem_increase(NumberItem* this) { - if (this->ref) { - *(this->ref) = CLAMP(*(this->ref) + 1, this->min, this->max); - } else { - this->value = CLAMP(this->value + 1, this->min, this->max); - } -} - -void NumberItem_toggle(NumberItem* this) { - if (this->ref) { - if (*(this->ref) >= this->max) - *(this->ref) = this->min; - else - *(this->ref) += 1; - } else { - if (this->value >= this->max) - this->value = this->min; - else - this->value += 1; - } -} diff --git a/fedora/.local/bin/htop-vim/OptionItem.h b/fedora/.local/bin/htop-vim/OptionItem.h deleted file mode 100644 index ba28775..0000000 --- a/fedora/.local/bin/htop-vim/OptionItem.h +++ /dev/null @@ -1,80 +0,0 @@ -#ifndef HEADER_OptionItem -#define HEADER_OptionItem -/* -htop - OptionItem.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include - -#include "Object.h" - - -enum OptionItemType { - OPTION_ITEM_TEXT, - OPTION_ITEM_CHECK, - OPTION_ITEM_NUMBER, -}; - -typedef struct OptionItemClass_ { - const ObjectClass super; - - enum OptionItemType kind; -} OptionItemClass; - -#define As_OptionItem(this_) ((const OptionItemClass*)((this_)->super.klass)) -#define OptionItem_kind(this_) As_OptionItem(this_)->kind - -typedef struct OptionItem_ { - Object super; - - char* text; -} OptionItem; - -typedef struct TextItem_ { - OptionItem super; - - char* text; -} TextItem; - -typedef struct CheckItem_ { - OptionItem super; - - bool* ref; - bool value; -} CheckItem; - -typedef struct NumberItem_ { - OptionItem super; - - char* text; - int* ref; - int value; - int scale; - int min; - int max; -} NumberItem; - -extern const OptionItemClass OptionItem_class; -extern const OptionItemClass TextItem_class; -extern const OptionItemClass CheckItem_class; -extern const OptionItemClass NumberItem_class; - -TextItem* TextItem_new(const char* text); - -CheckItem* CheckItem_newByRef(const char* text, bool* ref); -CheckItem* CheckItem_newByVal(const char* text, bool value); -bool CheckItem_get(const CheckItem* this); -void CheckItem_set(CheckItem* this, bool value); -void CheckItem_toggle(CheckItem* this); - -NumberItem* NumberItem_newByRef(const char* text, int* ref, int scale, int min, int max); -NumberItem* NumberItem_newByVal(const char* text, int value, int scale, int min, int max); -int NumberItem_get(const NumberItem* this); -void NumberItem_decrease(NumberItem* this); -void NumberItem_increase(NumberItem* this); -void NumberItem_toggle(NumberItem* this); - -#endif diff --git a/fedora/.local/bin/htop-vim/Panel.c b/fedora/.local/bin/htop-vim/Panel.c deleted file mode 100644 index de741f2..0000000 --- a/fedora/.local/bin/htop-vim/Panel.c +++ /dev/null @@ -1,526 +0,0 @@ -/* -htop - Panel.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Panel.h" - -#include -#include -#include -#include -#include -#include - -#include "CRT.h" -#include "ListItem.h" -#include "Macros.h" -#include "ProvideCurses.h" -#include "RichString.h" -#include "XUtils.h" - - -const PanelClass Panel_class = { - .super = { - .extends = Class(Object), - .delete = Panel_delete - }, - .eventHandler = Panel_selectByTyping, -}; - -Panel* Panel_new(int x, int y, int w, int h, const ObjectClass* type, bool owner, FunctionBar* fuBar) { - Panel* this; - this = xMalloc(sizeof(Panel)); - Object_setClass(this, Class(Panel)); - Panel_init(this, x, y, w, h, type, owner, fuBar); - return this; -} - -void Panel_delete(Object* cast) { - Panel* this = (Panel*)cast; - Panel_done(this); - free(this); -} - -void Panel_init(Panel* this, int x, int y, int w, int h, const ObjectClass* type, bool owner, FunctionBar* fuBar) { - this->x = x; - this->y = y; - this->w = w; - this->h = h; - this->cursorX = 0; - this->cursorY = 0; - this->eventHandlerState = NULL; - this->items = Vector_new(type, owner, DEFAULT_SIZE); - this->scrollV = 0; - this->scrollH = 0; - this->selected = 0; - this->oldSelected = 0; - this->selectedLen = 0; - this->needsRedraw = true; - this->cursorOn = false; - this->wasFocus = false; - RichString_beginAllocated(this->header); - this->defaultBar = fuBar; - this->currentBar = fuBar; - this->selectionColorId = PANEL_SELECTION_FOCUS; -} - -void Panel_done(Panel* this) { - assert (this != NULL); - free(this->eventHandlerState); - Vector_delete(this->items); - FunctionBar_delete(this->defaultBar); - RichString_delete(&this->header); -} - -void Panel_setCursorToSelection(Panel* this) { - this->cursorY = this->y + this->selected - this->scrollV + 1; - this->cursorX = this->x + this->selectedLen - this->scrollH; -} - -void Panel_setSelectionColor(Panel* this, ColorElements colorId) { - this->selectionColorId = colorId; -} - -inline void Panel_setHeader(Panel* this, const char* header) { - RichString_writeWide(&(this->header), CRT_colors[PANEL_HEADER_FOCUS], header); - this->needsRedraw = true; -} - -void Panel_move(Panel* this, int x, int y) { - assert (this != NULL); - - this->x = x; - this->y = y; - this->needsRedraw = true; -} - -void Panel_resize(Panel* this, int w, int h) { - assert (this != NULL); - - this->w = w; - this->h = h; - this->needsRedraw = true; -} - -void Panel_prune(Panel* this) { - assert (this != NULL); - - Vector_prune(this->items); - this->scrollV = 0; - this->selected = 0; - this->oldSelected = 0; - this->needsRedraw = true; -} - -void Panel_add(Panel* this, Object* o) { - assert (this != NULL); - - Vector_add(this->items, o); - this->needsRedraw = true; -} - -void Panel_insert(Panel* this, int i, Object* o) { - assert (this != NULL); - - Vector_insert(this->items, i, o); - this->needsRedraw = true; -} - -void Panel_set(Panel* this, int i, Object* o) { - assert (this != NULL); - - Vector_set(this->items, i, o); -} - -Object* Panel_get(Panel* this, int i) { - assert (this != NULL); - - return Vector_get(this->items, i); -} - -Object* Panel_remove(Panel* this, int i) { - assert (this != NULL); - - this->needsRedraw = true; - Object* removed = Vector_remove(this->items, i); - if (this->selected > 0 && this->selected >= Vector_size(this->items)) { - this->selected--; - } - - return removed; -} - -Object* Panel_getSelected(Panel* this) { - assert (this != NULL); - if (Vector_size(this->items) > 0) { - return Vector_get(this->items, this->selected); - } else { - return NULL; - } -} - -void Panel_moveSelectedUp(Panel* this) { - assert (this != NULL); - - Vector_moveUp(this->items, this->selected); - if (this->selected > 0) { - this->selected--; - } -} - -void Panel_moveSelectedDown(Panel* this) { - assert (this != NULL); - - Vector_moveDown(this->items, this->selected); - if (this->selected + 1 < Vector_size(this->items)) { - this->selected++; - } -} - -int Panel_getSelectedIndex(const Panel* this) { - assert (this != NULL); - - return this->selected; -} - -int Panel_size(const Panel* this) { - assert (this != NULL); - - return Vector_size(this->items); -} - -void Panel_setSelected(Panel* this, int selected) { - assert (this != NULL); - - int size = Vector_size(this->items); - if (selected >= size) { - selected = size - 1; - } - if (selected < 0) { - selected = 0; - } - this->selected = selected; - if (Panel_eventHandlerFn(this)) { - Panel_eventHandler(this, EVENT_SET_SELECTED); - } -} - -void Panel_splice(Panel* this, Vector* from) { - assert (this != NULL); - assert (from != NULL); - - Vector_splice(this->items, from); - this->needsRedraw = true; -} - -void Panel_draw(Panel* this, bool force_redraw, bool focus, bool highlightSelected, bool hideFunctionBar) { - assert (this != NULL); - - int size = Vector_size(this->items); - int scrollH = this->scrollH; - int y = this->y; - int x = this->x; - int h = this->h; - - if (hideFunctionBar) - h++; - - const int header_attr = focus - ? CRT_colors[PANEL_HEADER_FOCUS] - : CRT_colors[PANEL_HEADER_UNFOCUS]; - if (force_redraw) { - if (Panel_printHeaderFn(this)) - Panel_printHeader(this); - else - RichString_setAttr(&this->header, header_attr); - } - int headerLen = RichString_sizeVal(this->header); - if (headerLen > 0) { - attrset(header_attr); - mvhline(y, x, ' ', this->w); - if (scrollH < headerLen) { - RichString_printoffnVal(this->header, y, x, scrollH, - MINIMUM(headerLen - scrollH, this->w)); - } - attrset(CRT_colors[RESET_COLOR]); - y++; - h--; - } - - // ensure scroll area is on screen - if (this->scrollV < 0) { - this->scrollV = 0; - this->needsRedraw = true; - } else if (this->scrollV > size - h) { - this->scrollV = MAXIMUM(size - h, 0); - this->needsRedraw = true; - } - // ensure selection is on screen - if (this->selected < this->scrollV) { - this->scrollV = this->selected; - this->needsRedraw = true; - } else if (this->selected >= this->scrollV + h) { - this->scrollV = this->selected - h + 1; - this->needsRedraw = true; - } - - int first = this->scrollV; - int upTo = MINIMUM(first + h, size); - - int selectionColor = focus - ? CRT_colors[this->selectionColorId] - : CRT_colors[PANEL_SELECTION_UNFOCUS]; - - if (this->needsRedraw || force_redraw) { - int line = 0; - for (int i = first; line < h && i < upTo; i++) { - const Object* itemObj = Vector_get(this->items, i); - RichString_begin(item); - Object_display(itemObj, &item); - int itemLen = RichString_sizeVal(item); - int amt = MINIMUM(itemLen - scrollH, this->w); - if (highlightSelected && i == this->selected) { - item.highlightAttr = selectionColor; - } - if (item.highlightAttr) { - attrset(item.highlightAttr); - RichString_setAttr(&item, item.highlightAttr); - this->selectedLen = itemLen; - } - mvhline(y + line, x, ' ', this->w); - if (amt > 0) - RichString_printoffnVal(item, y + line, x, scrollH, amt); - if (item.highlightAttr) - attrset(CRT_colors[RESET_COLOR]); - RichString_delete(&item); - line++; - } - while (line < h) { - mvhline(y + line, x, ' ', this->w); - line++; - } - - } else { - const Object* oldObj = Vector_get(this->items, this->oldSelected); - RichString_begin(old); - Object_display(oldObj, &old); - int oldLen = RichString_sizeVal(old); - const Object* newObj = Vector_get(this->items, this->selected); - RichString_begin(new); - Object_display(newObj, &new); - int newLen = RichString_sizeVal(new); - this->selectedLen = newLen; - mvhline(y + this->oldSelected - first, x + 0, ' ', this->w); - if (scrollH < oldLen) - RichString_printoffnVal(old, y + this->oldSelected - first, x, - scrollH, MINIMUM(oldLen - scrollH, this->w)); - attrset(selectionColor); - mvhline(y + this->selected - first, x + 0, ' ', this->w); - RichString_setAttr(&new, selectionColor); - if (scrollH < newLen) - RichString_printoffnVal(new, y + this->selected - first, x, - scrollH, MINIMUM(newLen - scrollH, this->w)); - attrset(CRT_colors[RESET_COLOR]); - RichString_delete(&new); - RichString_delete(&old); - } - - if (focus && (this->needsRedraw || force_redraw || !this->wasFocus)) { - if (Panel_drawFunctionBarFn(this)) - Panel_drawFunctionBar(this, hideFunctionBar); - else if (!hideFunctionBar) - FunctionBar_draw(this->currentBar); - } - - this->oldSelected = this->selected; - this->wasFocus = focus; - this->needsRedraw = false; -} - -static int Panel_headerHeight(const Panel* this) { - return RichString_sizeVal(this->header) > 0 ? 1 : 0; -} - -bool Panel_onKey(Panel* this, int key) { - assert (this != NULL); - - const int size = Vector_size(this->items); - - #define PANEL_SCROLL(amount) \ - do { \ - this->selected += (amount); \ - this->scrollV = CLAMP(this->scrollV + (amount), 0, MAXIMUM(0, (size - this->h - Panel_headerHeight(this)))); \ - this->needsRedraw = true; \ - } while (0) - - switch (key) { - case KEY_DOWN: - case 'j': - case KEY_CTRL('N'): - #ifdef KEY_C_DOWN - case KEY_C_DOWN: - #endif - this->selected++; - break; - - case KEY_UP: - case 'k': - case KEY_CTRL('P'): - #ifdef KEY_C_UP - case KEY_C_UP: - #endif - this->selected--; - break; - - case KEY_LEFT: - case 'h': - if (this->scrollH > 0) { - this->scrollH -= MAXIMUM(CRT_scrollHAmount, 0); - this->needsRedraw = true; - } - break; - - case KEY_RIGHT: - case 'l': - this->scrollH += CRT_scrollHAmount; - this->needsRedraw = true; - break; - - case KEY_CTRL('U'): - this->selected -= (this->h - 1) / 2; - this->needsRedraw = true; - break; - case KEY_CTRL('D'): - this->selected += (this->h - 1) / 2; - this->needsRedraw = true; - break; - - case KEY_PPAGE: - case KEY_CTRL('B'): - PANEL_SCROLL(-(this->h - Panel_headerHeight(this))); - break; - - case KEY_NPAGE: - case KEY_CTRL('F'): - PANEL_SCROLL(+(this->h - Panel_headerHeight(this))); - break; - - case KEY_WHEELUP: - PANEL_SCROLL(-CRT_scrollWheelVAmount); - break; - - case KEY_WHEELDOWN: - PANEL_SCROLL(+CRT_scrollWheelVAmount); - break; - - case KEY_HOME: - case 'g': - this->selected = 0; - break; - - case KEY_END: - case 'G': - this->selected = size - 1; - break; - - case KEY_CTRL('A'): - case '^': - this->scrollH = 0; - this->needsRedraw = true; - break; - case KEY_CTRL('E'): - case '$': - this->scrollH = MAXIMUM(this->selectedLen - this->w, 0); - this->needsRedraw = true; - break; - default: - return false; - } - - #undef PANEL_SCROLL - - // ensure selection within bounds - if (this->selected < 0 || size == 0) { - this->selected = 0; - this->needsRedraw = true; - } else if (this->selected >= size) { - this->selected = size - 1; - this->needsRedraw = true; - } - - return true; -} - - -HandlerResult Panel_selectByTyping(Panel* this, int ch) { - int size = Panel_size(this); - - if (ch == '#') - return IGNORED; - - if (!this->eventHandlerState) - this->eventHandlerState = xCalloc(100, sizeof(char)); - char* buffer = this->eventHandlerState; - - if (0 < ch && ch < 255 && isgraph((unsigned char)ch)) { - int len = strlen(buffer); - if (!len) { - if ('/' == ch) { - ch = '\001'; - } else if ('q' == ch) { - return BREAK_LOOP; - } - } else if (1 == len && '\001' == buffer[0]) { - len--; - } - - if (len < 99) { - buffer[len] = (char) ch; - buffer[len + 1] = '\0'; - } - - for (int try = 0; try < 2; try++) { - len = strlen(buffer); - for (int i = 0; i < size; i++) { - const char* cur = ((ListItem*) Panel_get(this, i))->value; - while (*cur == ' ') - cur++; - if (strncasecmp(cur, buffer, len) == 0) { - Panel_setSelected(this, i); - return HANDLED; - } - } - - // if current word did not match, - // retry considering the character the start of a new word. - buffer[0] = (char) ch; - buffer[1] = '\0'; - } - - return HANDLED; - } else if (ch != ERR) { - buffer[0] = '\0'; - } - - if (ch == 13) { - return BREAK_LOOP; - } - - return IGNORED; -} - -int Panel_getCh(Panel* this) { - if (this->cursorOn) { - move(this->cursorY, this->cursorX); - curs_set(1); - } else { - curs_set(0); - } -#ifdef HAVE_SET_ESCDELAY - set_escdelay(25); -#endif - return getch(); -} diff --git a/fedora/.local/bin/htop-vim/Panel.h b/fedora/.local/bin/htop-vim/Panel.h deleted file mode 100644 index 33d532e..0000000 --- a/fedora/.local/bin/htop-vim/Panel.h +++ /dev/null @@ -1,143 +0,0 @@ -#ifndef HEADER_Panel -#define HEADER_Panel -/* -htop - Panel.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include -#include - -#include "CRT.h" -#include "FunctionBar.h" -#include "Object.h" -#include "RichString.h" -#include "Vector.h" - - -struct Panel_; -typedef struct Panel_ Panel; - -typedef enum HandlerResult_ { - HANDLED = 0x01, - IGNORED = 0x02, - BREAK_LOOP = 0x04, - REFRESH = 0x08, - REDRAW = 0x10, - RESCAN = 0x20, - RESIZE = 0x40, - SYNTH_KEY = 0x80, -} HandlerResult; - -#define EVENT_SET_SELECTED (-1) - -#define EVENT_HEADER_CLICK(x_) (-10000 + (x_)) -#define EVENT_IS_HEADER_CLICK(ev_) ((ev_) >= -10000 && (ev_) <= -9000) -#define EVENT_HEADER_CLICK_GET_X(ev_) ((ev_) + 10000) - -#define EVENT_SCREEN_TAB_CLICK(x_) (-20000 + (x_)) -#define EVENT_IS_SCREEN_TAB_CLICK(ev_) ((ev_) >= -20000 && (ev_) < -10000) -#define EVENT_SCREEN_TAB_GET_X(ev_) ((ev_) + 20000) - -typedef HandlerResult (*Panel_EventHandler)(Panel*, int); -typedef void (*Panel_DrawFunctionBar)(Panel*, bool); -typedef void (*Panel_PrintHeader)(Panel*); - -typedef struct PanelClass_ { - const ObjectClass super; - const Panel_EventHandler eventHandler; - const Panel_DrawFunctionBar drawFunctionBar; - const Panel_PrintHeader printHeader; -} PanelClass; - -#define As_Panel(this_) ((const PanelClass*)((this_)->super.klass)) -#define Panel_eventHandlerFn(this_) As_Panel(this_)->eventHandler -#define Panel_eventHandler(this_, ev_) (assert(As_Panel(this_)->eventHandler), As_Panel(this_)->eventHandler((Panel*)(this_), ev_)) -#define Panel_drawFunctionBarFn(this_) As_Panel(this_)->drawFunctionBar -#define Panel_drawFunctionBar(this_, hideFB_) (assert(As_Panel(this_)->drawFunctionBar), As_Panel(this_)->drawFunctionBar((Panel*)(this_), hideFB_)) -#define Panel_printHeaderFn(this_) As_Panel(this_)->printHeader -#define Panel_printHeader(this_) (assert(As_Panel(this_)->printHeader), As_Panel(this_)->printHeader((Panel*)(this_))) - -struct Panel_ { - Object super; - int x, y, w, h; - int cursorX, cursorY; - Vector* items; - int selected; - int oldSelected; - int selectedLen; - void* eventHandlerState; - int scrollV; - int scrollH; - bool needsRedraw; - bool cursorOn; - bool wasFocus; - FunctionBar* currentBar; - FunctionBar* defaultBar; - RichString header; - ColorElements selectionColorId; -}; - -#define Panel_setDefaultBar(this_) do { (this_)->currentBar = (this_)->defaultBar; } while (0) - -#define KEY_CTRL(l) ((l)-'A'+1) - -extern const PanelClass Panel_class; - -Panel* Panel_new(int x, int y, int w, int h, const ObjectClass* type, bool owner, FunctionBar* fuBar); - -void Panel_delete(Object* cast); - -void Panel_init(Panel* this, int x, int y, int w, int h, const ObjectClass* type, bool owner, FunctionBar* fuBar); - -void Panel_done(Panel* this); - -void Panel_setCursorToSelection(Panel* this); - -void Panel_setSelectionColor(Panel* this, ColorElements colorId); - -void Panel_setHeader(Panel* this, const char* header); - -void Panel_move(Panel* this, int x, int y); - -void Panel_resize(Panel* this, int w, int h); - -void Panel_prune(Panel* this); - -void Panel_add(Panel* this, Object* o); - -void Panel_insert(Panel* this, int i, Object* o); - -void Panel_set(Panel* this, int i, Object* o); - -Object* Panel_get(Panel* this, int i); - -Object* Panel_remove(Panel* this, int i); - -Object* Panel_getSelected(Panel* this); - -void Panel_moveSelectedUp(Panel* this); - -void Panel_moveSelectedDown(Panel* this); - -int Panel_getSelectedIndex(const Panel* this); - -int Panel_size(const Panel* this); - -void Panel_setSelected(Panel* this, int selected); - -void Panel_draw(Panel* this, bool force_redraw, bool focus, bool highlightSelected, bool hideFunctionBar); - -void Panel_splice(Panel* this, Vector* from); - -bool Panel_onKey(Panel* this, int key); - -HandlerResult Panel_selectByTyping(Panel* this, int ch); - -int Panel_getCh(Panel* this); - -#endif diff --git a/fedora/.local/bin/htop-vim/Process.c b/fedora/.local/bin/htop-vim/Process.c deleted file mode 100644 index 5a179b4..0000000 --- a/fedora/.local/bin/htop-vim/Process.c +++ /dev/null @@ -1,1353 +0,0 @@ -/* -htop - Process.c -(C) 2004-2015 Hisham H. Muhammad -(C) 2020 Red Hat, Inc. All Rights Reserved. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "Process.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "CRT.h" -#include "Macros.h" -#include "Platform.h" -#include "ProcessList.h" -#include "DynamicColumn.h" -#include "RichString.h" -#include "Scheduling.h" -#include "Settings.h" -#include "XUtils.h" - -#if defined(MAJOR_IN_MKDEV) -#include -#endif - - -/* Used to identify kernel threads in Comm and Exe columns */ -static const char* const kthreadID = "KTHREAD"; - -static uid_t Process_getuid = (uid_t)-1; - -int Process_pidDigits = PROCESS_MIN_PID_DIGITS; -int Process_uidDigits = PROCESS_MIN_UID_DIGITS; - -void Process_setupColumnWidths(void) { - int maxPid = Platform_getMaxPid(); - if (maxPid == -1) - return; - - if (maxPid < (int)pow(10, PROCESS_MIN_PID_DIGITS)) { - Process_pidDigits = PROCESS_MIN_PID_DIGITS; - return; - } - - Process_pidDigits = (int)log10(maxPid) + 1; - assert(Process_pidDigits <= PROCESS_MAX_PID_DIGITS); -} - -void Process_setUidColumnWidth(uid_t maxUid) { - if (maxUid < (uid_t)pow(10, PROCESS_MIN_UID_DIGITS)) { - Process_uidDigits = PROCESS_MIN_UID_DIGITS; - return; - } - - Process_uidDigits = (int)log10(maxUid) + 1; - assert(Process_uidDigits <= PROCESS_MAX_UID_DIGITS); -} - -void Process_printBytes(RichString* str, unsigned long long number, bool coloring) { - char buffer[16]; - int len; - - int largeNumberColor = coloring ? CRT_colors[LARGE_NUMBER] : CRT_colors[PROCESS]; - int processMegabytesColor = coloring ? CRT_colors[PROCESS_MEGABYTES] : CRT_colors[PROCESS]; - int processGigabytesColor = coloring ? CRT_colors[PROCESS_GIGABYTES] : CRT_colors[PROCESS]; - int shadowColor = coloring ? CRT_colors[PROCESS_SHADOW] : CRT_colors[PROCESS]; - int processColor = CRT_colors[PROCESS]; - - if (number == ULLONG_MAX) { - //Invalid number - RichString_appendAscii(str, shadowColor, " N/A "); - return; - } - - number /= ONE_K; - - if (number < 1000) { - //Plain number, no markings - len = xSnprintf(buffer, sizeof(buffer), "%5llu ", number); - RichString_appendnAscii(str, processColor, buffer, len); - } else if (number < 100000) { - //2 digit MB, 3 digit KB - len = xSnprintf(buffer, sizeof(buffer), "%2llu", number / 1000); - RichString_appendnAscii(str, processMegabytesColor, buffer, len); - number %= 1000; - len = xSnprintf(buffer, sizeof(buffer), "%03llu ", number); - RichString_appendnAscii(str, processColor, buffer, len); - } else if (number < 1000 * ONE_K) { - //3 digit MB - number /= ONE_K; - len = xSnprintf(buffer, sizeof(buffer), "%4lluM ", number); - RichString_appendnAscii(str, processMegabytesColor, buffer, len); - } else if (number < 10000 * ONE_K) { - //1 digit GB, 3 digit MB - number /= ONE_K; - len = xSnprintf(buffer, sizeof(buffer), "%1llu", number / 1000); - RichString_appendnAscii(str, processGigabytesColor, buffer, len); - number %= 1000; - len = xSnprintf(buffer, sizeof(buffer), "%03lluM ", number); - RichString_appendnAscii(str, processMegabytesColor, buffer, len); - } else if (number < 100000 * ONE_K) { - //2 digit GB, 1 digit MB - number /= 100 * ONE_K; - len = xSnprintf(buffer, sizeof(buffer), "%2llu", number / 10); - RichString_appendnAscii(str, processGigabytesColor, buffer, len); - number %= 10; - len = xSnprintf(buffer, sizeof(buffer), ".%1llu", number); - RichString_appendnAscii(str, processMegabytesColor, buffer, len); - RichString_appendAscii(str, processGigabytesColor, "G "); - } else if (number < 1000 * ONE_M) { - //3 digit GB - number /= ONE_M; - len = xSnprintf(buffer, sizeof(buffer), "%4lluG ", number); - RichString_appendnAscii(str, processGigabytesColor, buffer, len); - } else if (number < 10000ULL * ONE_M) { - //1 digit TB, 3 digit GB - number /= ONE_M; - len = xSnprintf(buffer, sizeof(buffer), "%1llu", number / 1000); - RichString_appendnAscii(str, largeNumberColor, buffer, len); - number %= 1000; - len = xSnprintf(buffer, sizeof(buffer), "%03lluG ", number); - RichString_appendnAscii(str, processGigabytesColor, buffer, len); - } else if (number < 100000 * ONE_M) { - //2 digit TB, 1 digit GB - number /= 100 * ONE_M; - len = xSnprintf(buffer, sizeof(buffer), "%2llu", number / 10); - RichString_appendnAscii(str, largeNumberColor, buffer, len); - number %= 10; - len = xSnprintf(buffer, sizeof(buffer), ".%1llu", number); - RichString_appendnAscii(str, processGigabytesColor, buffer, len); - RichString_appendAscii(str, largeNumberColor, "T "); - } else if (number < 10000ULL * ONE_G) { - //3 digit TB or 1 digit PB, 3 digit TB - number /= ONE_G; - len = xSnprintf(buffer, sizeof(buffer), "%4lluT ", number); - RichString_appendnAscii(str, largeNumberColor, buffer, len); - } else { - //2 digit PB and above - len = xSnprintf(buffer, sizeof(buffer), "%4.1lfP ", (double)number / ONE_T); - RichString_appendnAscii(str, largeNumberColor, buffer, len); - } -} - -void Process_printKBytes(RichString* str, unsigned long long number, bool coloring) { - if (number == ULLONG_MAX) - Process_printBytes(str, ULLONG_MAX, coloring); - else - Process_printBytes(str, number * ONE_K, coloring); -} - -void Process_printCount(RichString* str, unsigned long long number, bool coloring) { - char buffer[13]; - - int largeNumberColor = coloring ? CRT_colors[LARGE_NUMBER] : CRT_colors[PROCESS]; - int processMegabytesColor = coloring ? CRT_colors[PROCESS_MEGABYTES] : CRT_colors[PROCESS]; - int processColor = CRT_colors[PROCESS]; - int processShadowColor = coloring ? CRT_colors[PROCESS_SHADOW] : CRT_colors[PROCESS]; - - if (number == ULLONG_MAX) { - RichString_appendAscii(str, CRT_colors[PROCESS_SHADOW], " N/A "); - } else if (number >= 100000LL * ONE_DECIMAL_T) { - xSnprintf(buffer, sizeof(buffer), "%11llu ", number / ONE_DECIMAL_G); - RichString_appendnAscii(str, largeNumberColor, buffer, 12); - } else if (number >= 100LL * ONE_DECIMAL_T) { - xSnprintf(buffer, sizeof(buffer), "%11llu ", number / ONE_DECIMAL_M); - RichString_appendnAscii(str, largeNumberColor, buffer, 8); - RichString_appendnAscii(str, processMegabytesColor, buffer + 8, 4); - } else if (number >= 10LL * ONE_DECIMAL_G) { - xSnprintf(buffer, sizeof(buffer), "%11llu ", number / ONE_DECIMAL_K); - RichString_appendnAscii(str, largeNumberColor, buffer, 5); - RichString_appendnAscii(str, processMegabytesColor, buffer + 5, 3); - RichString_appendnAscii(str, processColor, buffer + 8, 4); - } else { - xSnprintf(buffer, sizeof(buffer), "%11llu ", number); - RichString_appendnAscii(str, largeNumberColor, buffer, 2); - RichString_appendnAscii(str, processMegabytesColor, buffer + 2, 3); - RichString_appendnAscii(str, processColor, buffer + 5, 3); - RichString_appendnAscii(str, processShadowColor, buffer + 8, 4); - } -} - -void Process_printTime(RichString* str, unsigned long long totalHundredths, bool coloring) { - char buffer[10]; - int len; - - unsigned long long totalSeconds = totalHundredths / 100; - unsigned long long hours = totalSeconds / 3600; - unsigned long long days = totalSeconds / 86400; - int minutes = (totalSeconds / 60) % 60; - int seconds = totalSeconds % 60; - int hundredths = totalHundredths - (totalSeconds * 100); - - int yearColor = coloring ? CRT_colors[LARGE_NUMBER] : CRT_colors[PROCESS]; - int dayColor = coloring ? CRT_colors[PROCESS_GIGABYTES] : CRT_colors[PROCESS]; - int hourColor = coloring ? CRT_colors[PROCESS_MEGABYTES] : CRT_colors[PROCESS]; - int defColor = CRT_colors[PROCESS]; - - if (days >= /* Ignore leapyears */365) { - int years = days / 365; - int daysLeft = days - 365 * years; - - if (years >= 10000000) { - RichString_appendnAscii(str, yearColor, "eternity ", 9); - } else if (years >= 1000) { - len = xSnprintf(buffer, sizeof(buffer), "%7dy ", years); - RichString_appendnAscii(str, yearColor, buffer, len); - } else if (daysLeft >= 100) { - len = xSnprintf(buffer, sizeof(buffer), "%3dy", years); - RichString_appendnAscii(str, yearColor, buffer, len); - len = xSnprintf(buffer, sizeof(buffer), "%3dd ", daysLeft); - RichString_appendnAscii(str, dayColor, buffer, len); - } else if (daysLeft >= 10) { - len = xSnprintf(buffer, sizeof(buffer), "%4dy", years); - RichString_appendnAscii(str, yearColor, buffer, len); - len = xSnprintf(buffer, sizeof(buffer), "%2dd ", daysLeft); - RichString_appendnAscii(str, dayColor, buffer, len); - } else { - len = xSnprintf(buffer, sizeof(buffer), "%5dy", years); - RichString_appendnAscii(str, yearColor, buffer, len); - len = xSnprintf(buffer, sizeof(buffer), "%1dd ", daysLeft); - RichString_appendnAscii(str, dayColor, buffer, len); - } - } else if (days >= 100) { - int hoursLeft = hours - days * 24; - - if (hoursLeft >= 10) { - len = xSnprintf(buffer, sizeof(buffer), "%4llud", days); - RichString_appendnAscii(str, dayColor, buffer, len); - len = xSnprintf(buffer, sizeof(buffer), "%2dh ", hoursLeft); - RichString_appendnAscii(str, hourColor, buffer, len); - } else { - len = xSnprintf(buffer, sizeof(buffer), "%5llud", days); - RichString_appendnAscii(str, dayColor, buffer, len); - len = xSnprintf(buffer, sizeof(buffer), "%1dh ", hoursLeft); - RichString_appendnAscii(str, hourColor, buffer, len); - } - } else if (hours >= 100) { - int minutesLeft = totalSeconds / 60 - hours * 60; - - if (minutesLeft >= 10) { - len = xSnprintf(buffer, sizeof(buffer), "%4lluh", hours); - RichString_appendnAscii(str, hourColor, buffer, len); - len = xSnprintf(buffer, sizeof(buffer), "%2dm ", minutesLeft); - RichString_appendnAscii(str, defColor, buffer, len); - } else { - len = xSnprintf(buffer, sizeof(buffer), "%5lluh", hours); - RichString_appendnAscii(str, hourColor, buffer, len); - len = xSnprintf(buffer, sizeof(buffer), "%1dm ", minutesLeft); - RichString_appendnAscii(str, defColor, buffer, len); - } - } else if (hours > 0) { - len = xSnprintf(buffer, sizeof(buffer), "%2lluh", hours); - RichString_appendnAscii(str, hourColor, buffer, len); - len = xSnprintf(buffer, sizeof(buffer), "%02d:%02d ", minutes, seconds); - RichString_appendnAscii(str, defColor, buffer, len); - } else { - len = xSnprintf(buffer, sizeof(buffer), "%2d:%02d.%02d ", minutes, seconds, hundredths); - RichString_appendnAscii(str, defColor, buffer, len); - } -} - -void Process_fillStarttimeBuffer(Process* this) { - struct tm date; - (void) localtime_r(&this->starttime_ctime, &date); - strftime(this->starttime_show, sizeof(this->starttime_show) - 1, (this->starttime_ctime > (time(NULL) - 86400)) ? "%R " : "%b%d ", &date); -} - -/* - * TASK_COMM_LEN is defined to be 16 for /proc/[pid]/comm in man proc(5), but it is - * not available in an userspace header - so define it. - * - * Note: This is taken from LINUX headers, but implicitly taken for other platforms - * for sake of brevity. - * - * Note: when colorizing a basename with the comm prefix, the entire basename - * (not just the comm prefix) is colorized for better readability, and it is - * implicit that only upto (TASK_COMM_LEN - 1) could be comm. - */ -#define TASK_COMM_LEN 16 - -static bool findCommInCmdline(const char* comm, const char* cmdline, int cmdlineBasenameStart, int* pCommStart, int* pCommEnd) { - /* Try to find procComm in tokenized cmdline - this might in rare cases - * mis-identify a string or fail, if comm or cmdline had been unsuitably - * modified by the process */ - const char* tokenBase; - size_t tokenLen; - const size_t commLen = strlen(comm); - - if (cmdlineBasenameStart < 0) - return false; - - for (const char* token = cmdline + cmdlineBasenameStart; *token;) { - for (tokenBase = token; *token && *token != '\n'; ++token) { - if (*token == '/') { - tokenBase = token + 1; - } - } - tokenLen = token - tokenBase; - - if ((tokenLen == commLen || (tokenLen > commLen && commLen == (TASK_COMM_LEN - 1))) && - strncmp(tokenBase, comm, commLen) == 0) { - *pCommStart = tokenBase - cmdline; - *pCommEnd = token - cmdline; - return true; - } - - if (*token) { - do { - ++token; - } while (*token && '\n' == *token); - } - } - return false; -} - -static int matchCmdlinePrefixWithExeSuffix(const char* cmdline, int cmdlineBaseOffset, const char* exe, int exeBaseOffset, int exeBaseLen) { - int matchLen; /* matching length to be returned */ - char delim; /* delimiter following basename */ - - /* cmdline prefix is an absolute path: it must match whole exe. */ - if (cmdline[0] == '/') { - matchLen = exeBaseLen + exeBaseOffset; - if (strncmp(cmdline, exe, matchLen) == 0) { - delim = cmdline[matchLen]; - if (delim == 0 || delim == '\n' || delim == ' ') { - return matchLen; - } - } - return 0; - } - - /* cmdline prefix is a relative path: We need to first match the basename at - * cmdlineBaseOffset and then reverse match the cmdline prefix with the exe - * suffix. But there is a catch: Some processes modify their cmdline in ways - * that make htop's identification of the basename in cmdline unreliable. - * For e.g. /usr/libexec/gdm-session-worker modifies its cmdline to - * "gdm-session-worker [pam/gdm-autologin]" and htop ends up with - * proccmdlineBasenameEnd at "gdm-autologin]". This issue could arise with - * chrome as well as it stores in cmdline its concatenated argument vector, - * without NUL delimiter between the arguments (which may contain a '/') - * - * So if needed, we adjust cmdlineBaseOffset to the previous (if any) - * component of the cmdline relative path, and retry the procedure. */ - bool delimFound; /* if valid basename delimiter found */ - do { - /* match basename */ - matchLen = exeBaseLen + cmdlineBaseOffset; - if (cmdlineBaseOffset < exeBaseOffset && - strncmp(cmdline + cmdlineBaseOffset, exe + exeBaseOffset, exeBaseLen) == 0) { - delim = cmdline[matchLen]; - if (delim == 0 || delim == '\n' || delim == ' ') { - int i, j; - /* reverse match the cmdline prefix and exe suffix */ - for (i = cmdlineBaseOffset - 1, j = exeBaseOffset - 1; - i >= 0 && j >= 0 && cmdline[i] == exe[j]; --i, --j) - ; - - /* full match, with exe suffix being a valid relative path */ - if (i < 0 && j >= 0 && exe[j] == '/') - return matchLen; - } - } - - /* Try to find the previous potential cmdlineBaseOffset - it would be - * preceded by '/' or nothing, and delimited by ' ' or '\n' */ - for (delimFound = false, cmdlineBaseOffset -= 2; cmdlineBaseOffset > 0; --cmdlineBaseOffset) { - if (delimFound) { - if (cmdline[cmdlineBaseOffset - 1] == '/') { - break; - } - } else if (cmdline[cmdlineBaseOffset] == ' ' || cmdline[cmdlineBaseOffset] == '\n') { - delimFound = true; - } - } - } while (delimFound); - - return 0; -} - -/* stpcpy, but also converts newlines to spaces */ -static inline char* stpcpyWithNewlineConversion(char* dstStr, const char* srcStr) { - for (; *srcStr; ++srcStr) { - *dstStr++ = (*srcStr == '\n') ? ' ' : *srcStr; - } - *dstStr = 0; - return dstStr; -} - -/* - * This function makes the merged Command string. It also stores the offsets of the - * basename, comm w.r.t the merged Command string - these offsets will be used by - * Process_writeCommand() for coloring. The merged Command string is also - * returned by Process_getCommand() for searching, sorting and filtering. - */ -void Process_makeCommandStr(Process* this) { - ProcessMergedCommand* mc = &this->mergedCommand; - const Settings* settings = this->settings; - - bool showMergedCommand = settings->showMergedCommand; - bool showProgramPath = settings->showProgramPath; - bool searchCommInCmdline = settings->findCommInCmdline; - bool stripExeFromCmdline = settings->stripExeFromCmdline; - bool showThreadNames = settings->showThreadNames; - bool shadowDistPathPrefix = settings->shadowDistPathPrefix; - - uint64_t settingsStamp = settings->lastUpdate; - - /* Nothing to do to (Re)Generate the Command string, if the process is: - * - a kernel thread, or - * - a zombie from before being under htop's watch, or - * - a user thread and showThreadNames is not set */ - if (Process_isKernelThread(this)) - return; - if (this->state == ZOMBIE && !this->mergedCommand.str) - return; - - /* this->mergedCommand.str needs updating only if its state or contents changed. - * Its content is based on the fields cmdline, comm, and exe. */ - if (mc->lastUpdate >= settingsStamp) - return; - - mc->lastUpdate = settingsStamp; - - /* The field separtor "โ”‚" has been chosen such that it will not match any - * valid string used for searching or filtering */ - const char* SEPARATOR = CRT_treeStr[TREE_STR_VERT]; - const int SEPARATOR_LEN = strlen(SEPARATOR); - - /* Accommodate the column text, two field separators and terminating NUL */ - size_t maxLen = 2 * SEPARATOR_LEN + 1; - maxLen += this->cmdline ? strlen(this->cmdline) : strlen("(zombie)"); - maxLen += this->procComm ? strlen(this->procComm) : 0; - maxLen += this->procExe ? strlen(this->procExe) : 0; - - free(mc->str); - mc->str = xCalloc(1, maxLen); - - /* Reset all locations that need extra handling when actually displaying */ - mc->highlightCount = 0; - memset(mc->highlights, 0, sizeof(mc->highlights)); - - size_t mbMismatch = 0; - #define WRITE_HIGHLIGHT(_offset, _length, _attr, _flags) \ - do { \ - /* Check if we still have capacity */ \ - assert(mc->highlightCount < ARRAYSIZE(mc->highlights)); \ - if (mc->highlightCount >= ARRAYSIZE(mc->highlights)) \ - break; \ - \ - mc->highlights[mc->highlightCount].offset = str - strStart + (_offset) - mbMismatch; \ - mc->highlights[mc->highlightCount].length = _length; \ - mc->highlights[mc->highlightCount].attr = _attr; \ - mc->highlights[mc->highlightCount].flags = _flags; \ - mc->highlightCount++; \ - } while (0) - - #define WRITE_SEPARATOR \ - do { \ - WRITE_HIGHLIGHT(0, 1, CRT_colors[FAILED_READ], CMDLINE_HIGHLIGHT_FLAG_SEPARATOR); \ - mbMismatch += SEPARATOR_LEN - 1; \ - str = stpcpy(str, SEPARATOR); \ - } while (0) - - #define CHECK_AND_MARK(str_, prefix_) \ - if (String_startsWith(str_, prefix_)) { \ - WRITE_HIGHLIGHT(0, strlen(prefix_), CRT_colors[PROCESS_SHADOW], CMDLINE_HIGHLIGHT_FLAG_PREFIXDIR); \ - break; \ - } else (void)0 - - #define CHECK_AND_MARK_DIST_PATH_PREFIXES(str_) \ - do { \ - if ((str_)[0] != '/') { \ - break; \ - } \ - switch ((str_)[1]) { \ - case 'b': \ - CHECK_AND_MARK(str_, "/bin/"); \ - break; \ - case 'l': \ - CHECK_AND_MARK(str_, "/lib/"); \ - CHECK_AND_MARK(str_, "/lib32/"); \ - CHECK_AND_MARK(str_, "/lib64/"); \ - CHECK_AND_MARK(str_, "/libx32/"); \ - break; \ - case 's': \ - CHECK_AND_MARK(str_, "/sbin/"); \ - break; \ - case 'u': \ - if (String_startsWith(str_, "/usr/")) { \ - switch ((str_)[5]) { \ - case 'b': \ - CHECK_AND_MARK(str_, "/usr/bin/"); \ - break; \ - case 'l': \ - CHECK_AND_MARK(str_, "/usr/libexec/"); \ - CHECK_AND_MARK(str_, "/usr/lib/"); \ - CHECK_AND_MARK(str_, "/usr/lib32/"); \ - CHECK_AND_MARK(str_, "/usr/lib64/"); \ - CHECK_AND_MARK(str_, "/usr/libx32/"); \ - \ - CHECK_AND_MARK(str_, "/usr/local/bin/"); \ - CHECK_AND_MARK(str_, "/usr/local/lib/"); \ - CHECK_AND_MARK(str_, "/usr/local/sbin/"); \ - break; \ - case 's': \ - CHECK_AND_MARK(str_, "/usr/sbin/"); \ - break; \ - } \ - } \ - break; \ - } \ - } while (0) - - const int baseAttr = Process_isThread(this) ? CRT_colors[PROCESS_THREAD_BASENAME] : CRT_colors[PROCESS_BASENAME]; - const int commAttr = Process_isThread(this) ? CRT_colors[PROCESS_THREAD_COMM] : CRT_colors[PROCESS_COMM]; - const int delExeAttr = CRT_colors[FAILED_READ]; - const int delLibAttr = CRT_colors[PROCESS_TAG]; - - /* Establish some shortcuts to data we need */ - const char* cmdline = this->cmdline; - const char* procComm = this->procComm; - const char* procExe = this->procExe; - - char* strStart = mc->str; - char* str = strStart; - - int cmdlineBasenameStart = this->cmdlineBasenameStart; - int cmdlineBasenameEnd = this->cmdlineBasenameEnd; - - if (!cmdline) { - cmdlineBasenameStart = 0; - cmdlineBasenameEnd = 0; - cmdline = "(zombie)"; - } - - assert(cmdlineBasenameStart >= 0); - assert(cmdlineBasenameStart <= (int)strlen(cmdline)); - - if (!showMergedCommand || !procExe || !procComm) { /* fall back to cmdline */ - if ((showMergedCommand || (Process_isUserlandThread(this) && showThreadNames)) && procComm && strlen(procComm)) { /* set column to or prefix it with comm */ - if (strncmp(cmdline + cmdlineBasenameStart, procComm, MINIMUM(TASK_COMM_LEN - 1, strlen(procComm))) != 0) { - WRITE_HIGHLIGHT(0, strlen(procComm), commAttr, CMDLINE_HIGHLIGHT_FLAG_COMM); - str = stpcpy(str, procComm); - - if (!showMergedCommand) - return; - - WRITE_SEPARATOR; - } - } - - if (shadowDistPathPrefix && showProgramPath) - CHECK_AND_MARK_DIST_PATH_PREFIXES(cmdline); - - if (cmdlineBasenameEnd > cmdlineBasenameStart) - WRITE_HIGHLIGHT(showProgramPath ? cmdlineBasenameStart : 0, cmdlineBasenameEnd - cmdlineBasenameStart, baseAttr, CMDLINE_HIGHLIGHT_FLAG_BASENAME); - - if (this->procExeDeleted) - WRITE_HIGHLIGHT(showProgramPath ? cmdlineBasenameStart : 0, cmdlineBasenameEnd - cmdlineBasenameStart, delExeAttr, CMDLINE_HIGHLIGHT_FLAG_DELETED); - else if (this->usesDeletedLib) - WRITE_HIGHLIGHT(showProgramPath ? cmdlineBasenameStart : 0, cmdlineBasenameEnd - cmdlineBasenameStart, delLibAttr, CMDLINE_HIGHLIGHT_FLAG_DELETED); - - (void)stpcpyWithNewlineConversion(str, cmdline + (showProgramPath ? 0 : cmdlineBasenameStart)); - - return; - } - - int exeLen = strlen(this->procExe); - int exeBasenameOffset = this->procExeBasenameOffset; - int exeBasenameLen = exeLen - exeBasenameOffset; - - assert(exeBasenameOffset >= 0); - assert(exeBasenameOffset <= (int)strlen(procExe)); - - bool haveCommInExe = false; - if (procExe && procComm && (!Process_isUserlandThread(this) || showThreadNames)) { - haveCommInExe = strncmp(procExe + exeBasenameOffset, procComm, TASK_COMM_LEN - 1) == 0; - } - - /* Start with copying exe */ - if (showProgramPath) { - if (shadowDistPathPrefix) - CHECK_AND_MARK_DIST_PATH_PREFIXES(procExe); - if (haveCommInExe) - WRITE_HIGHLIGHT(exeBasenameOffset, exeBasenameLen, commAttr, CMDLINE_HIGHLIGHT_FLAG_COMM); - WRITE_HIGHLIGHT(exeBasenameOffset, exeBasenameLen, baseAttr, CMDLINE_HIGHLIGHT_FLAG_BASENAME); - if (this->procExeDeleted) - WRITE_HIGHLIGHT(exeBasenameOffset, exeBasenameLen, delExeAttr, CMDLINE_HIGHLIGHT_FLAG_DELETED); - else if (this->usesDeletedLib) - WRITE_HIGHLIGHT(exeBasenameOffset, exeBasenameLen, delLibAttr, CMDLINE_HIGHLIGHT_FLAG_DELETED); - str = stpcpy(str, procExe); - } else { - if (haveCommInExe) - WRITE_HIGHLIGHT(0, exeBasenameLen, commAttr, CMDLINE_HIGHLIGHT_FLAG_COMM); - WRITE_HIGHLIGHT(0, exeBasenameLen, baseAttr, CMDLINE_HIGHLIGHT_FLAG_BASENAME); - if (this->procExeDeleted) - WRITE_HIGHLIGHT(0, exeBasenameLen, delExeAttr, CMDLINE_HIGHLIGHT_FLAG_DELETED); - else if (this->usesDeletedLib) - WRITE_HIGHLIGHT(0, exeBasenameLen, delLibAttr, CMDLINE_HIGHLIGHT_FLAG_DELETED); - str = stpcpy(str, procExe + exeBasenameOffset); - } - - bool haveCommInCmdline = false; - int commStart = 0; - int commEnd = 0; - - /* Try to match procComm with procExe's basename: This is reliable (predictable) */ - if (searchCommInCmdline) { - /* commStart/commEnd will be adjusted later along with cmdline */ - haveCommInCmdline = (!Process_isUserlandThread(this) || showThreadNames) && findCommInCmdline(procComm, cmdline, cmdlineBasenameStart, &commStart, &commEnd); - } - - int matchLen = matchCmdlinePrefixWithExeSuffix(cmdline, cmdlineBasenameStart, procExe, exeBasenameOffset, exeBasenameLen); - - bool haveCommField = false; - - if (!haveCommInExe && !haveCommInCmdline && procComm && (!Process_isUserlandThread(this) || showThreadNames)) { - WRITE_SEPARATOR; - WRITE_HIGHLIGHT(0, strlen(procComm), commAttr, CMDLINE_HIGHLIGHT_FLAG_COMM); - str = stpcpy(str, procComm); - haveCommField = true; - } - - if (matchLen) { - if (stripExeFromCmdline) { - /* strip the matched exe prefix */ - cmdline += matchLen; - - commStart -= matchLen; - commEnd -= matchLen; - } else { - matchLen = 0; - } - } - - if (!matchLen || (haveCommField && *cmdline)) { - /* cmdline will be a separate field */ - WRITE_SEPARATOR; - } - - if (shadowDistPathPrefix) - CHECK_AND_MARK_DIST_PATH_PREFIXES(cmdline); - - if (!haveCommInExe && haveCommInCmdline && !haveCommField && (!Process_isUserlandThread(this) || showThreadNames)) - WRITE_HIGHLIGHT(commStart, commEnd - commStart, commAttr, CMDLINE_HIGHLIGHT_FLAG_COMM); - - /* Display cmdline if it hasn't been consumed by procExe */ - if (*cmdline) - (void)stpcpyWithNewlineConversion(str, cmdline); - - #undef CHECK_AND_MARK_DIST_PATH_PREFIXES - #undef CHECK_AND_MARK - #undef WRITE_SEPARATOR - #undef WRITE_HIGHLIGHT -} - -void Process_writeCommand(const Process* this, int attr, int baseAttr, RichString* str) { - (void)baseAttr; - - const ProcessMergedCommand* mc = &this->mergedCommand; - const char* mergedCommand = mc->str; - - int strStart = RichString_size(str); - - const bool highlightBaseName = this->settings->highlightBaseName; - const bool highlightSeparator = true; - const bool highlightDeleted = this->settings->highlightDeletedExe; - - if (!mergedCommand) { - int len = 0; - const char* cmdline = this->cmdline; - - if (highlightBaseName || !this->settings->showProgramPath) { - int basename = 0; - for (int i = 0; i < this->cmdlineBasenameEnd; i++) { - if (cmdline[i] == '/') { - basename = i + 1; - } else if (cmdline[i] == ':') { - len = i + 1; - break; - } - } - if (len == 0) { - if (this->settings->showProgramPath) { - strStart += basename; - } else { - cmdline += basename; - } - len = this->cmdlineBasenameEnd - basename; - } - } - - RichString_appendWide(str, attr, cmdline); - - if (this->settings->highlightBaseName) { - RichString_setAttrn(str, baseAttr, strStart, len); - } - - return; - } - - RichString_appendWide(str, attr, mergedCommand); - - for (size_t i = 0, hlCount = CLAMP(mc->highlightCount, 0, ARRAYSIZE(mc->highlights)); i < hlCount; i++) { - const ProcessCmdlineHighlight* hl = &mc->highlights[i]; - - if (!hl->length) - continue; - - if (hl->flags & CMDLINE_HIGHLIGHT_FLAG_SEPARATOR) - if (!highlightSeparator) - continue; - - if (hl->flags & CMDLINE_HIGHLIGHT_FLAG_BASENAME) - if (!highlightBaseName) - continue; - - if (hl->flags & CMDLINE_HIGHLIGHT_FLAG_DELETED) - if (!highlightDeleted) - continue; - - if (hl->flags & CMDLINE_HIGHLIGHT_FLAG_PREFIXDIR) - if (!highlightDeleted) - continue; - - RichString_setAttrn(str, hl->attr, strStart + hl->offset, hl->length); - } -} - -void Process_printRate(RichString* str, double rate, bool coloring) { - char buffer[16]; - - int largeNumberColor = CRT_colors[LARGE_NUMBER]; - int processMegabytesColor = CRT_colors[PROCESS_MEGABYTES]; - int processColor = CRT_colors[PROCESS]; - int shadowColor = CRT_colors[PROCESS_SHADOW]; - - if (!coloring) { - largeNumberColor = CRT_colors[PROCESS]; - processMegabytesColor = CRT_colors[PROCESS]; - } - - if (isnan(rate)) { - RichString_appendAscii(str, shadowColor, " N/A "); - } else if (rate < 0.005) { - int len = snprintf(buffer, sizeof(buffer), "%7.2f B/s ", rate); - RichString_appendnAscii(str, shadowColor, buffer, len); - } else if (rate < ONE_K) { - int len = snprintf(buffer, sizeof(buffer), "%7.2f B/s ", rate); - RichString_appendnAscii(str, processColor, buffer, len); - } else if (rate < ONE_M) { - int len = snprintf(buffer, sizeof(buffer), "%7.2f K/s ", rate / ONE_K); - RichString_appendnAscii(str, processColor, buffer, len); - } else if (rate < ONE_G) { - int len = snprintf(buffer, sizeof(buffer), "%7.2f M/s ", rate / ONE_M); - RichString_appendnAscii(str, processMegabytesColor, buffer, len); - } else if (rate < ONE_T) { - int len = snprintf(buffer, sizeof(buffer), "%7.2f G/s ", rate / ONE_G); - RichString_appendnAscii(str, largeNumberColor, buffer, len); - } else if (rate < ONE_P) { - int len = snprintf(buffer, sizeof(buffer), "%7.2f T/s ", rate / ONE_T); - RichString_appendnAscii(str, largeNumberColor, buffer, len); - } else { - int len = snprintf(buffer, sizeof(buffer), "%7.2f P/s ", rate / ONE_P); - RichString_appendnAscii(str, largeNumberColor, buffer, len); - } -} - -void Process_printLeftAlignedField(RichString* str, int attr, const char* content, unsigned int width) { - int columns = width; - RichString_appendnWideColumns(str, attr, content, strlen(content), &columns); - RichString_appendChr(str, attr, ' ', width + 1 - columns); -} - -void Process_printPercentage(float val, char* buffer, int n, uint8_t width, int* attr) { - if (val >= 0) { - if (val < 0.05F) - *attr = CRT_colors[PROCESS_SHADOW]; - else if (val >= 99.9F) - *attr = CRT_colors[PROCESS_MEGABYTES]; - - int precision = 1; - - // Display "val" as "100" for columns like "MEM%". - if (width == 4 && val > 99.9F) { - precision = 0; - val = 100.0F; - } - - xSnprintf(buffer, n, "%*.*f ", width, precision, val); - } else { - *attr = CRT_colors[PROCESS_SHADOW]; - xSnprintf(buffer, n, "%*.*s ", width, width, "N/A"); - } -} - -static inline char processStateChar(ProcessState state) { - switch (state) { - case UNKNOWN: return '?'; - case RUNNABLE: return 'U'; - case RUNNING: return 'R'; - case QUEUED: return 'Q'; - case WAITING: return 'W'; - case UNINTERRUPTIBLE_WAIT: return 'D'; - case BLOCKED: return 'B'; - case PAGING: return 'P'; - case STOPPED: return 'T'; - case TRACED: return 't'; - case ZOMBIE: return 'Z'; - case DEFUNCT: return 'X'; - case IDLE: return 'I'; - case SLEEPING: return 'S'; - default: - assert(0); - return '!'; - } -} - -void Process_writeField(const Process* this, RichString* str, ProcessField field) { - char buffer[256]; - size_t n = sizeof(buffer); - int attr = CRT_colors[DEFAULT_COLOR]; - bool coloring = this->settings->highlightMegabytes; - - switch (field) { - case COMM: { - int baseattr = CRT_colors[PROCESS_BASENAME]; - if (this->settings->highlightThreads && Process_isThread(this)) { - attr = CRT_colors[PROCESS_THREAD]; - baseattr = CRT_colors[PROCESS_THREAD_BASENAME]; - } - const ScreenSettings* ss = this->settings->ss; - if (!ss->treeView || this->indent == 0) { - Process_writeCommand(this, attr, baseattr, str); - return; - } - - char* buf = buffer; - const bool lastItem = (this->indent < 0); - - for (uint32_t indent = (this->indent < 0 ? -this->indent : this->indent); indent > 1; indent >>= 1) { - int written, ret; - if (indent & 1U) { - ret = xSnprintf(buf, n, "%s ", CRT_treeStr[TREE_STR_VERT]); - } else { - ret = xSnprintf(buf, n, " "); - } - if (ret < 0 || (size_t)ret >= n) { - written = n; - } else { - written = ret; - } - buf += written; - n -= written; - } - - const char* draw = CRT_treeStr[lastItem ? TREE_STR_BEND : TREE_STR_RTEE]; - xSnprintf(buf, n, "%s%s ", draw, this->showChildren ? CRT_treeStr[TREE_STR_SHUT] : CRT_treeStr[TREE_STR_OPEN] ); - RichString_appendWide(str, CRT_colors[PROCESS_TREE], buffer); - Process_writeCommand(this, attr, baseattr, str); - return; - } - case PROC_COMM: { - const char* procComm; - if (this->procComm) { - attr = CRT_colors[Process_isUserlandThread(this) ? PROCESS_THREAD_COMM : PROCESS_COMM]; - procComm = this->procComm; - } else { - attr = CRT_colors[PROCESS_SHADOW]; - procComm = Process_isKernelThread(this) ? kthreadID : "N/A"; - } - - Process_printLeftAlignedField(str, attr, procComm, TASK_COMM_LEN - 1); - return; - } - case PROC_EXE: { - const char* procExe; - if (this->procExe) { - attr = CRT_colors[Process_isUserlandThread(this) ? PROCESS_THREAD_BASENAME : PROCESS_BASENAME]; - if (this->settings->highlightDeletedExe) { - if (this->procExeDeleted) - attr = CRT_colors[FAILED_READ]; - else if (this->usesDeletedLib) - attr = CRT_colors[PROCESS_TAG]; - } - procExe = this->procExe + this->procExeBasenameOffset; - } else { - attr = CRT_colors[PROCESS_SHADOW]; - procExe = Process_isKernelThread(this) ? kthreadID : "N/A"; - } - - Process_printLeftAlignedField(str, attr, procExe, TASK_COMM_LEN - 1); - return; - } - case CWD: { - const char* cwd; - if (!this->procCwd) { - attr = CRT_colors[PROCESS_SHADOW]; - cwd = "N/A"; - } else if (String_startsWith(this->procCwd, "/proc/") && strstr(this->procCwd, " (deleted)") != NULL) { - attr = CRT_colors[PROCESS_SHADOW]; - cwd = "main thread terminated"; - } else { - cwd = this->procCwd; - } - Process_printLeftAlignedField(str, attr, cwd, 25); - return; - } - case ELAPSED: { - const uint64_t rt = this->processList->realtimeMs; - const uint64_t st = this->starttime_ctime * 1000; - const uint64_t dt = - rt < st ? 0 : - rt - st; - Process_printTime(str, /* convert to hundreds of a second */ dt / 10, coloring); - return; - } - case MAJFLT: Process_printCount(str, this->majflt, coloring); return; - case MINFLT: Process_printCount(str, this->minflt, coloring); return; - case M_RESIDENT: Process_printKBytes(str, this->m_resident, coloring); return; - case M_VIRT: Process_printKBytes(str, this->m_virt, coloring); return; - case NICE: - xSnprintf(buffer, n, "%3ld ", this->nice); - attr = this->nice < 0 ? CRT_colors[PROCESS_HIGH_PRIORITY] - : this->nice > 0 ? CRT_colors[PROCESS_LOW_PRIORITY] - : CRT_colors[PROCESS_SHADOW]; - break; - case NLWP: - if (this->nlwp == 1) - attr = CRT_colors[PROCESS_SHADOW]; - - xSnprintf(buffer, n, "%4ld ", this->nlwp); - break; - case PERCENT_CPU: Process_printPercentage(this->percent_cpu, buffer, n, Process_fieldWidths[PERCENT_CPU], &attr); break; - case PERCENT_NORM_CPU: { - float cpuPercentage = this->percent_cpu / this->processList->activeCPUs; - Process_printPercentage(cpuPercentage, buffer, n, Process_fieldWidths[PERCENT_CPU], &attr); - break; - } - case PERCENT_MEM: Process_printPercentage(this->percent_mem, buffer, n, 4, &attr); break; - case PGRP: xSnprintf(buffer, n, "%*d ", Process_pidDigits, this->pgrp); break; - case PID: xSnprintf(buffer, n, "%*d ", Process_pidDigits, this->pid); break; - case PPID: xSnprintf(buffer, n, "%*d ", Process_pidDigits, this->ppid); break; - case PRIORITY: - if (this->priority <= -100) - xSnprintf(buffer, n, " RT "); - else - xSnprintf(buffer, n, "%3ld ", this->priority); - break; - case PROCESSOR: xSnprintf(buffer, n, "%3d ", Settings_cpuId(this->settings, this->processor)); break; - case SCHEDULERPOLICY: { - const char* schedPolStr = "N/A"; -#ifdef SCHEDULER_SUPPORT - if (this->scheduling_policy >= 0) - schedPolStr = Scheduling_formatPolicy(this->scheduling_policy); -#endif - xSnprintf(buffer, n, "%-5s ", schedPolStr); - break; - } - case SESSION: xSnprintf(buffer, n, "%*d ", Process_pidDigits, this->session); break; - case STARTTIME: xSnprintf(buffer, n, "%s", this->starttime_show); break; - case STATE: - xSnprintf(buffer, n, "%c ", processStateChar(this->state)); - switch (this->state) { - case RUNNABLE: - case RUNNING: - case TRACED: - attr = CRT_colors[PROCESS_RUN_STATE]; - break; - - case BLOCKED: - case DEFUNCT: - case STOPPED: - case UNINTERRUPTIBLE_WAIT: - case ZOMBIE: - attr = CRT_colors[PROCESS_D_STATE]; - break; - - case QUEUED: - case WAITING: - case IDLE: - case SLEEPING: - attr = CRT_colors[PROCESS_SHADOW]; - break; - - case UNKNOWN: - case PAGING: - break; - } - break; - case ST_UID: xSnprintf(buffer, n, "%*d ", Process_uidDigits, this->st_uid); break; - case TIME: Process_printTime(str, this->time, coloring); return; - case TGID: - if (this->tgid == this->pid) - attr = CRT_colors[PROCESS_SHADOW]; - - xSnprintf(buffer, n, "%*d ", Process_pidDigits, this->tgid); - break; - case TPGID: xSnprintf(buffer, n, "%*d ", Process_pidDigits, this->tpgid); break; - case TTY: - if (!this->tty_name) { - attr = CRT_colors[PROCESS_SHADOW]; - xSnprintf(buffer, n, "(no tty) "); - } else { - const char* name = String_startsWith(this->tty_name, "/dev/") ? (this->tty_name + strlen("/dev/")) : this->tty_name; - xSnprintf(buffer, n, "%-8s ", name); - } - break; - case USER: - if (this->elevated_priv) - attr = CRT_colors[PROCESS_PRIV]; - else if (Process_getuid != this->st_uid) - attr = CRT_colors[PROCESS_SHADOW]; - - if (this->user) { - Process_printLeftAlignedField(str, attr, this->user, 10); - return; - } - - xSnprintf(buffer, n, "%-10d ", this->st_uid); - break; - default: - if (DynamicColumn_writeField(this, str, field)) - return; - assert(0 && "Process_writeField: default key reached"); /* should never be reached */ - xSnprintf(buffer, n, "- "); - break; - } - RichString_appendAscii(str, attr, buffer); -} - -void Process_display(const Object* cast, RichString* out) { - const Process* this = (const Process*) cast; - const ProcessField* fields = this->settings->ss->fields; - for (int i = 0; fields[i]; i++) - As_Process(this)->writeField(this, out, fields[i]); - - if (this->settings->shadowOtherUsers && this->st_uid != Process_getuid) { - RichString_setAttr(out, CRT_colors[PROCESS_SHADOW]); - } - - if (this->tag == true) { - RichString_setAttr(out, CRT_colors[PROCESS_TAG]); - } - - if (this->settings->highlightChanges) { - if (Process_isTomb(this)) { - out->highlightAttr = CRT_colors[PROCESS_TOMB]; - } else if (Process_isNew(this)) { - out->highlightAttr = CRT_colors[PROCESS_NEW]; - } - } - - assert(RichString_size(out) > 0); -} - -void Process_done(Process* this) { - assert (this != NULL); - free(this->cmdline); - free(this->procComm); - free(this->procExe); - free(this->procCwd); - free(this->mergedCommand.str); - free(this->tty_name); -} - -/* This function returns the string displayed in Command column, so that sorting - * happens on what is displayed - whether comm, full path, basename, etc.. So - * this follows Process_writeField(COMM) and Process_writeCommand */ -const char* Process_getCommand(const Process* this) { - if ((Process_isUserlandThread(this) && this->settings->showThreadNames) || !this->mergedCommand.str) { - return this->cmdline; - } - - return this->mergedCommand.str; -} - -const ProcessClass Process_class = { - .super = { - .extends = Class(Object), - .display = Process_display, - .delete = Process_delete, - .compare = Process_compare - }, - .writeField = Process_writeField, -}; - -void Process_init(Process* this, const Settings* settings) { - this->settings = settings; - this->tag = false; - this->showChildren = true; - this->show = true; - this->updated = false; - this->cmdlineBasenameEnd = -1; - this->st_uid = (uid_t)-1; - - if (Process_getuid == (uid_t)-1) { - Process_getuid = getuid(); - } -} - -void Process_toggleTag(Process* this) { - this->tag = !this->tag; -} - -bool Process_isNew(const Process* this) { - assert(this->processList); - if (this->processList->monotonicMs >= this->seenStampMs) { - return this->processList->monotonicMs - this->seenStampMs <= 1000 * (uint64_t)this->processList->settings->highlightDelaySecs; - } - return false; -} - -bool Process_isTomb(const Process* this) { - return this->tombStampMs > 0; -} - -bool Process_setPriority(Process* this, int priority) { - if (Settings_isReadonly()) - return false; - - int old_prio = getpriority(PRIO_PROCESS, this->pid); - int err = setpriority(PRIO_PROCESS, this->pid, priority); - - if (err == 0 && old_prio != getpriority(PRIO_PROCESS, this->pid)) { - this->nice = priority; - } - return (err == 0); -} - -bool Process_changePriorityBy(Process* this, Arg delta) { - return Process_setPriority(this, this->nice + delta.i); -} - -bool Process_sendSignal(Process* this, Arg sgn) { - return kill(this->pid, sgn.i) == 0; -} - -int Process_compare(const void* v1, const void* v2) { - const Process* p1 = (const Process*)v1; - const Process* p2 = (const Process*)v2; - - const Settings* settings = p1->settings; - const ScreenSettings* ss = settings->ss; - - ProcessField key = ScreenSettings_getActiveSortKey(ss); - - int result = Process_compareByKey(p1, p2, key); - - // Implement tie-breaker (needed to make tree mode more stable) - if (!result) - return SPACESHIP_NUMBER(p1->pid, p2->pid); - - return (ScreenSettings_getActiveDirection(ss) == 1) ? result : -result; -} - -int Process_compareByKey_Base(const Process* p1, const Process* p2, ProcessField key) { - int r; - - switch (key) { - case PERCENT_CPU: - case PERCENT_NORM_CPU: - return SPACESHIP_NUMBER(p1->percent_cpu, p2->percent_cpu); - case PERCENT_MEM: - return SPACESHIP_NUMBER(p1->m_resident, p2->m_resident); - case COMM: - return SPACESHIP_NULLSTR(Process_getCommand(p1), Process_getCommand(p2)); - case PROC_COMM: { - const char* comm1 = p1->procComm ? p1->procComm : (Process_isKernelThread(p1) ? kthreadID : ""); - const char* comm2 = p2->procComm ? p2->procComm : (Process_isKernelThread(p2) ? kthreadID : ""); - return SPACESHIP_NULLSTR(comm1, comm2); - } - case PROC_EXE: { - const char* exe1 = p1->procExe ? (p1->procExe + p1->procExeBasenameOffset) : (Process_isKernelThread(p1) ? kthreadID : ""); - const char* exe2 = p2->procExe ? (p2->procExe + p2->procExeBasenameOffset) : (Process_isKernelThread(p2) ? kthreadID : ""); - return SPACESHIP_NULLSTR(exe1, exe2); - } - case CWD: - return SPACESHIP_NULLSTR(p1->procCwd, p2->procCwd); - case ELAPSED: - r = -SPACESHIP_NUMBER(p1->starttime_ctime, p2->starttime_ctime); - return r != 0 ? r : SPACESHIP_NUMBER(p1->pid, p2->pid); - case MAJFLT: - return SPACESHIP_NUMBER(p1->majflt, p2->majflt); - case MINFLT: - return SPACESHIP_NUMBER(p1->minflt, p2->minflt); - case M_RESIDENT: - return SPACESHIP_NUMBER(p1->m_resident, p2->m_resident); - case M_VIRT: - return SPACESHIP_NUMBER(p1->m_virt, p2->m_virt); - case NICE: - return SPACESHIP_NUMBER(p1->nice, p2->nice); - case NLWP: - return SPACESHIP_NUMBER(p1->nlwp, p2->nlwp); - case PGRP: - return SPACESHIP_NUMBER(p1->pgrp, p2->pgrp); - case PID: - return SPACESHIP_NUMBER(p1->pid, p2->pid); - case PPID: - return SPACESHIP_NUMBER(p1->ppid, p2->ppid); - case PRIORITY: - return SPACESHIP_NUMBER(p1->priority, p2->priority); - case PROCESSOR: - return SPACESHIP_NUMBER(p1->processor, p2->processor); - case SCHEDULERPOLICY: - return SPACESHIP_NUMBER(p1->scheduling_policy, p2->scheduling_policy); - case SESSION: - return SPACESHIP_NUMBER(p1->session, p2->session); - case STARTTIME: - r = SPACESHIP_NUMBER(p1->starttime_ctime, p2->starttime_ctime); - return r != 0 ? r : SPACESHIP_NUMBER(p1->pid, p2->pid); - case STATE: - return SPACESHIP_NUMBER(p1->state, p2->state); - case ST_UID: - return SPACESHIP_NUMBER(p1->st_uid, p2->st_uid); - case TIME: - return SPACESHIP_NUMBER(p1->time, p2->time); - case TGID: - return SPACESHIP_NUMBER(p1->tgid, p2->tgid); - case TPGID: - return SPACESHIP_NUMBER(p1->tpgid, p2->tpgid); - case TTY: - /* Order no tty last */ - return SPACESHIP_DEFAULTSTR(p1->tty_name, p2->tty_name, "\x7F"); - case USER: - return SPACESHIP_NULLSTR(p1->user, p2->user); - default: - CRT_debug("Process_compareByKey_Base() called with key %d", key); - assert(0 && "Process_compareByKey_Base: default key reached"); /* should never be reached */ - return SPACESHIP_NUMBER(p1->pid, p2->pid); - } -} - -void Process_updateComm(Process* this, const char* comm) { - if (!this->procComm && !comm) - return; - - if (this->procComm && comm && String_eq(this->procComm, comm)) - return; - - free(this->procComm); - this->procComm = comm ? xStrdup(comm) : NULL; - - this->mergedCommand.lastUpdate = 0; -} - -static int skipPotentialPath(const char* cmdline, int end) { - if (cmdline[0] != '/') - return 0; - - int slash = 0; - for (int i = 1; i < end; i++) { - if (cmdline[i] == '/' && cmdline[i + 1] != '\0') { - slash = i + 1; - continue; - } - - if (cmdline[i] == ' ' && cmdline[i - 1] != '\\') - return slash; - - if (cmdline[i] == ':' && cmdline[i + 1] == ' ') - return slash; - } - - return slash; -} - -void Process_updateCmdline(Process* this, const char* cmdline, int basenameStart, int basenameEnd) { - assert(basenameStart >= 0); - assert((cmdline && basenameStart < (int)strlen(cmdline)) || (!cmdline && basenameStart == 0)); - assert((basenameEnd > basenameStart) || (basenameEnd == 0 && basenameStart == 0)); - assert((cmdline && basenameEnd <= (int)strlen(cmdline)) || (!cmdline && basenameEnd == 0)); - - if (!this->cmdline && !cmdline) - return; - - if (this->cmdline && cmdline && String_eq(this->cmdline, cmdline)) - return; - - free(this->cmdline); - this->cmdline = cmdline ? xStrdup(cmdline) : NULL; - this->cmdlineBasenameStart = (basenameStart || !cmdline) ? basenameStart : skipPotentialPath(cmdline, basenameEnd); - this->cmdlineBasenameEnd = basenameEnd; - - this->mergedCommand.lastUpdate = 0; -} - -void Process_updateExe(Process* this, const char* exe) { - if (!this->procExe && !exe) - return; - - if (this->procExe && exe && String_eq(this->procExe, exe)) - return; - - free(this->procExe); - if (exe) { - this->procExe = xStrdup(exe); - const char* lastSlash = strrchr(exe, '/'); - this->procExeBasenameOffset = (lastSlash && *(lastSlash + 1) != '\0' && lastSlash != exe) ? (lastSlash - exe + 1) : 0; - } else { - this->procExe = NULL; - this->procExeBasenameOffset = 0; - } - - this->mergedCommand.lastUpdate = 0; -} - -uint8_t Process_fieldWidths[LAST_PROCESSFIELD] = { 0 }; - -void Process_resetFieldWidths(void) { - for (size_t i = 0; i < LAST_PROCESSFIELD; i++) { - if (!Process_fields[i].autoWidth) - continue; - - size_t len = strlen(Process_fields[i].title); - assert(len <= UINT8_MAX); - Process_fieldWidths[i] = (uint8_t)len; - } -} - -void Process_updateFieldWidth(ProcessField key, size_t width) { - if (width > UINT8_MAX) - Process_fieldWidths[key] = UINT8_MAX; - else if (width > Process_fieldWidths[key]) - Process_fieldWidths[key] = (uint8_t)width; -} - -void Process_updateCPUFieldWidths(float percentage) { - if (percentage < 99.9F) { - Process_updateFieldWidth(PERCENT_CPU, 4); - Process_updateFieldWidth(PERCENT_NORM_CPU, 4); - return; - } - - // Add additional two characters, one for "." and another for precision. - uint8_t width = ceil(log10(percentage + 0.1)) + 2; - - Process_updateFieldWidth(PERCENT_CPU, width); - Process_updateFieldWidth(PERCENT_NORM_CPU, width); -} diff --git a/fedora/.local/bin/htop-vim/Process.h b/fedora/.local/bin/htop-vim/Process.h deleted file mode 100644 index db32ecc..0000000 --- a/fedora/.local/bin/htop-vim/Process.h +++ /dev/null @@ -1,430 +0,0 @@ -#ifndef HEADER_Process -#define HEADER_Process -/* -htop - Process.h -(C) 2004-2015 Hisham H. Muhammad -(C) 2020 Red Hat, Inc. All Rights Reserved. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include -#include - -#include "Object.h" -#include "ProcessField.h" -#include "RichString.h" - - -#define PROCESS_FLAG_IO 0x00000001 -#define PROCESS_FLAG_CWD 0x00000002 -#define PROCESS_FLAG_SCHEDPOL 0x00000004 - -#define DEFAULT_HIGHLIGHT_SECS 5 - -typedef enum ProcessField_ { - NULL_PROCESSFIELD = 0, - PID = 1, - COMM = 2, - STATE = 3, - PPID = 4, - PGRP = 5, - SESSION = 6, - TTY = 7, - TPGID = 8, - MINFLT = 10, - MAJFLT = 12, - PRIORITY = 18, - NICE = 19, - STARTTIME = 21, - PROCESSOR = 38, - M_VIRT = 39, - M_RESIDENT = 40, - ST_UID = 46, - PERCENT_CPU = 47, - PERCENT_MEM = 48, - USER = 49, - TIME = 50, - NLWP = 51, - TGID = 52, - PERCENT_NORM_CPU = 53, - ELAPSED = 54, - SCHEDULERPOLICY = 55, - PROC_COMM = 124, - PROC_EXE = 125, - CWD = 126, - - /* Platform specific fields, defined in ${platform}/ProcessField.h */ - PLATFORM_PROCESS_FIELDS - - /* Do not add new fields after this entry (dynamic entries follow) */ - LAST_PROCESSFIELD -} ProcessField; - -/* Core process states (shared by platforms) - * NOTE: The enum has an ordering that is important! - * See processStateChar in process.c for ProcessSate -> letter mapping */ -typedef enum ProcessState_ { - UNKNOWN = 1, - RUNNABLE, - RUNNING, - QUEUED, - WAITING, - UNINTERRUPTIBLE_WAIT, - BLOCKED, - PAGING, - STOPPED, - TRACED, - ZOMBIE, - DEFUNCT, - IDLE, - SLEEPING -} ProcessState; - -struct Settings_; - -/* Holds information about regions of the cmdline that should be - * highlighted (e.g. program basename, delimiter, comm). */ -typedef struct ProcessCmdlineHighlight_ { - size_t offset; /* first character to highlight */ - size_t length; /* How many characters to highlight, zero if unused */ - int attr; /* The attributes used to highlight */ - int flags; /* Special flags used for selective highlighting, zero for always */ -} ProcessCmdlineHighlight; - -/* ProcessMergedCommand is populated by Process_makeCommandStr: It - * contains the merged Command string, and the information needed by - * Process_writeCommand to color the string. str will be NULL for kernel - * threads and zombies */ -typedef struct ProcessMergedCommand_ { - uint64_t lastUpdate; /* Marker based on settings->lastUpdate to track when the rendering needs refreshing */ - char* str; /* merged Command string */ - size_t highlightCount; /* how many portions of cmdline to highlight */ - ProcessCmdlineHighlight highlights[8]; /* which portions of cmdline to highlight */ -} ProcessMergedCommand; - -typedef struct Process_ { - /* Super object for emulated OOP */ - Object super; - - /* Pointer to quasi-global data structures */ - const struct ProcessList_* processList; - const struct Settings_* settings; - - /* Process identifier */ - pid_t pid; - - /* Parent process identifier */ - pid_t ppid; - - /* Thread group identifier */ - pid_t tgid; - - /* Process group identifier */ - int pgrp; - - /* Session identifier */ - int session; - - /* Foreground group identifier of the controlling terminal */ - int tpgid; - - /* This is a kernel (helper) task */ - bool isKernelThread; - - /* This is a userland thread / LWP */ - bool isUserlandThread; - - /* This process is running inside a container */ - bool isRunningInContainer; - - /* Controlling terminal identifier of the process */ - unsigned long int tty_nr; - - /* Controlling terminal name of the process */ - char* tty_name; - - /* User identifier */ - uid_t st_uid; - - /* User name */ - const char* user; - - /* Non root owned process with elevated privileges - * Linux: - * - from file capabilities - * - inherited from the ambient set - */ - bool elevated_priv; - - /* Process runtime (in hundredth of a second) */ - unsigned long long int time; - - /* - * Process name including arguments. - * Use Process_getCommand() for Command actually displayed. - */ - char* cmdline; - - /* End Offset in cmdline of the process basename */ - int cmdlineBasenameEnd; - - /* Start Offset in cmdline of the process basename */ - int cmdlineBasenameStart; - - /* The process' "command" name */ - char* procComm; - - /* The main process executable */ - char* procExe; - - /* The process/thread working directory */ - char* procCwd; - - /* Offset in procExe of the process basename */ - int procExeBasenameOffset; - - /* Tells if the executable has been replaced in the filesystem since start */ - bool procExeDeleted; - - /* Tells if the process uses replaced shared libraries since start */ - bool usesDeletedLib; - - /* CPU number last executed on */ - int processor; - - /* CPU usage during last cycle (in percent) */ - float percent_cpu; - - /* Memory usage during last cycle (in percent) */ - float percent_mem; - - /* Scheduling priority */ - long int priority; - - /* Nice value */ - long int nice; - - /* Number of threads in this process */ - long int nlwp; - - /* Process start time (in seconds elapsed since the Epoch) */ - time_t starttime_ctime; - - /* Process start time (cached formatted string) */ - char starttime_show[8]; - - /* Total program size (in kilobytes) */ - long m_virt; - - /* Resident set size (in kilobytes) */ - long m_resident; - - /* Number of minor faults the process has made which have not required loading a memory page from disk */ - unsigned long int minflt; - - /* Number of major faults the process has made which have required loading a memory page from disk */ - unsigned long int majflt; - - /* Process state enum field (platform dependent) */ - ProcessState state; - - /* Current scheduling policy */ - int scheduling_policy; - - /* Whether the process was updated during the current scan */ - bool updated; - - /* Whether the process was tagged by the user */ - bool tag; - - /* Whether to display this process */ - bool show; - - /* Whether this process was shown last cycle */ - bool wasShown; - - /* Whether to show children of this process in tree-mode */ - bool showChildren; - - /* - * Internal time counts for showing new and exited processes. - */ - uint64_t seenStampMs; - uint64_t tombStampMs; - - /* - * Internal state for tree-mode. - */ - int32_t indent; - unsigned int tree_depth; - - /* Has no known parent process */ - bool isRoot; - - /* - * Internal state for merged Command display - */ - ProcessMergedCommand mergedCommand; -} Process; - -typedef struct ProcessFieldData_ { - /* Name (displayed in setup menu) */ - const char* name; - - /* Title (display in main screen); must have same width as the printed values */ - const char* title; - - /* Description (displayed in setup menu) */ - const char* description; - - /* Scan flag to enable scan-method otherwise not run */ - uint32_t flags; - - /* Whether the values are process identifiers; adjusts the width of title and values if true */ - bool pidColumn; - - /* Whether the column should be sorted in descending order by default */ - bool defaultSortDesc; - - /* Whether the column width is dynamically adjusted (the minimum width is determined by the title length) */ - bool autoWidth; -} ProcessFieldData; - -// Implemented in platform-specific code: -void Process_writeField(const Process* this, RichString* str, ProcessField field); -int Process_compare(const void* v1, const void* v2); -void Process_delete(Object* cast); -extern const ProcessFieldData Process_fields[LAST_PROCESSFIELD]; -extern uint8_t Process_fieldWidths[LAST_PROCESSFIELD]; -#define PROCESS_MIN_PID_DIGITS 5 -#define PROCESS_MAX_PID_DIGITS 19 -#define PROCESS_MIN_UID_DIGITS 5 -#define PROCESS_MAX_UID_DIGITS 20 -extern int Process_pidDigits; -extern int Process_uidDigits; - -typedef Process* (*Process_New)(const struct Settings_*); -typedef void (*Process_WriteField)(const Process*, RichString*, ProcessField); -typedef int (*Process_CompareByKey)(const Process*, const Process*, ProcessField); - -typedef struct ProcessClass_ { - const ObjectClass super; - const Process_WriteField writeField; - const Process_CompareByKey compareByKey; -} ProcessClass; - -#define As_Process(this_) ((const ProcessClass*)((this_)->super.klass)) - -#define Process_compareByKey(p1_, p2_, key_) (As_Process(p1_)->compareByKey ? (As_Process(p1_)->compareByKey(p1_, p2_, key_)) : Process_compareByKey_Base(p1_, p2_, key_)) - -static inline pid_t Process_getParentPid(const Process* this) { - return this->tgid == this->pid ? this->ppid : this->tgid; -} - -static inline bool Process_isChildOf(const Process* this, pid_t pid) { - return pid == Process_getParentPid(this); -} - -static inline bool Process_isKernelThread(const Process* this) { - return this->isKernelThread; -} - -static inline bool Process_isUserlandThread(const Process* this) { - return this->isUserlandThread; -} - -static inline bool Process_isThread(const Process* this) { - return Process_isUserlandThread(this) || Process_isKernelThread(this); -} - -#define CMDLINE_HIGHLIGHT_FLAG_SEPARATOR 0x00000001 -#define CMDLINE_HIGHLIGHT_FLAG_BASENAME 0x00000002 -#define CMDLINE_HIGHLIGHT_FLAG_COMM 0x00000004 -#define CMDLINE_HIGHLIGHT_FLAG_DELETED 0x00000008 -#define CMDLINE_HIGHLIGHT_FLAG_PREFIXDIR 0x00000010 - -#define ONE_K 1024UL -#define ONE_M (ONE_K * ONE_K) -#define ONE_G (ONE_M * ONE_K) -#define ONE_T (1ULL * ONE_G * ONE_K) -#define ONE_P (1ULL * ONE_T * ONE_K) - -#define ONE_DECIMAL_K 1000UL -#define ONE_DECIMAL_M (ONE_DECIMAL_K * ONE_DECIMAL_K) -#define ONE_DECIMAL_G (ONE_DECIMAL_M * ONE_DECIMAL_K) -#define ONE_DECIMAL_T (1ULL * ONE_DECIMAL_G * ONE_DECIMAL_K) -#define ONE_DECIMAL_P (1ULL * ONE_DECIMAL_T * ONE_DECIMAL_K) - -void Process_setupColumnWidths(void); - -/* Sets the size of the UID column based on the passed UID */ -void Process_setUidColumnWidth(uid_t maxUid); - -/* Takes number in bytes (base 1024). Prints 6 columns. */ -void Process_printBytes(RichString* str, unsigned long long number, bool coloring); - -/* Takes number in kilo bytes (base 1024). Prints 6 columns. */ -void Process_printKBytes(RichString* str, unsigned long long number, bool coloring); - -/* Takes number as count (base 1000). Prints 12 columns. */ -void Process_printCount(RichString* str, unsigned long long number, bool coloring); - -/* Takes time in hundredths of a seconds. Prints 9 columns. */ -void Process_printTime(RichString* str, unsigned long long totalHundredths, bool coloring); - -/* Takes rate in bare unit (base 1024) per second. Prints 12 columns. */ -void Process_printRate(RichString* str, double rate, bool coloring); - -void Process_fillStarttimeBuffer(Process* this); - -void Process_printLeftAlignedField(RichString* str, int attr, const char* content, unsigned int width); - -void Process_printPercentage(float val, char* buffer, int n, uint8_t width, int* attr); - -void Process_display(const Object* cast, RichString* out); - -void Process_done(Process* this); - -extern const ProcessClass Process_class; - -void Process_init(Process* this, const struct Settings_* settings); - -void Process_toggleTag(Process* this); - -bool Process_isNew(const Process* this); - -bool Process_isTomb(const Process* this); - -bool Process_setPriority(Process* this, int priority); - -bool Process_changePriorityBy(Process* this, Arg delta); - -bool Process_sendSignal(Process* this, Arg sgn); - -static inline int Process_pidEqualCompare(const void* v1, const void* v2) { - const pid_t p1 = ((const Process*)v1)->pid; - const pid_t p2 = ((const Process*)v2)->pid; - return p1 != p2; /* return zero when equal */ -} - -int Process_compareByKey_Base(const Process* p1, const Process* p2, ProcessField key); - -const char* Process_getCommand(const Process* this); - -void Process_updateComm(Process* this, const char* comm); -void Process_updateCmdline(Process* this, const char* cmdline, int basenameStart, int basenameEnd); -void Process_updateExe(Process* this, const char* exe); - -/* This function constructs the string that is displayed by - * Process_writeCommand and also returned by Process_getCommand */ -void Process_makeCommandStr(Process* this); - -void Process_writeCommand(const Process* this, int attr, int baseAttr, RichString* str); - -void Process_resetFieldWidths(void); -void Process_updateFieldWidth(ProcessField key, size_t width); -void Process_updateCPUFieldWidths(float percentage); - -#endif diff --git a/fedora/.local/bin/htop-vim/ProcessList.c b/fedora/.local/bin/htop-vim/ProcessList.c deleted file mode 100644 index d115678..0000000 --- a/fedora/.local/bin/htop-vim/ProcessList.c +++ /dev/null @@ -1,511 +0,0 @@ -/* -htop - ProcessList.c -(C) 2004,2005 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "ProcessList.h" - -#include -#include -#include - -#include "CRT.h" -#include "DynamicColumn.h" -#include "Hashtable.h" -#include "Macros.h" -#include "Platform.h" -#include "Vector.h" -#include "XUtils.h" - - -ProcessList* ProcessList_init(ProcessList* this, const ObjectClass* klass, UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId) { - this->processes = Vector_new(klass, true, DEFAULT_SIZE); - this->displayList = Vector_new(klass, false, DEFAULT_SIZE); - - this->processTable = Hashtable_new(200, false); - this->needsSort = true; - - this->usersTable = usersTable; - this->pidMatchList = pidMatchList; - this->dynamicMeters = dynamicMeters; - this->dynamicColumns = dynamicColumns; - - this->userId = userId; - - // set later by platform-specific code - this->activeCPUs = 0; - this->existingCPUs = 0; - this->monotonicMs = 0; - - // always maintain valid realtime timestamps - Platform_gettime_realtime(&this->realtime, &this->realtimeMs); - -#ifdef HAVE_LIBHWLOC - this->topologyOk = false; - if (hwloc_topology_init(&this->topology) == 0) { - this->topologyOk = - #if HWLOC_API_VERSION < 0x00020000 - /* try to ignore the top-level machine object type */ - 0 == hwloc_topology_ignore_type_keep_structure(this->topology, HWLOC_OBJ_MACHINE) && - /* ignore caches, which don't add structure */ - 0 == hwloc_topology_ignore_type_keep_structure(this->topology, HWLOC_OBJ_CORE) && - 0 == hwloc_topology_ignore_type_keep_structure(this->topology, HWLOC_OBJ_CACHE) && - 0 == hwloc_topology_set_flags(this->topology, HWLOC_TOPOLOGY_FLAG_WHOLE_SYSTEM) && - #else - 0 == hwloc_topology_set_all_types_filter(this->topology, HWLOC_TYPE_FILTER_KEEP_STRUCTURE) && - #endif - 0 == hwloc_topology_load(this->topology); - } -#endif - - this->following = -1; - - return this; -} - -void ProcessList_done(ProcessList* this) { -#ifdef HAVE_LIBHWLOC - if (this->topologyOk) { - hwloc_topology_destroy(this->topology); - } -#endif - - Hashtable_delete(this->processTable); - - Vector_delete(this->displayList); - Vector_delete(this->processes); -} - -void ProcessList_setPanel(ProcessList* this, Panel* panel) { - this->panel = panel; -} - -static const char* alignedDynamicColumnTitle(const ProcessList* this, int key, char* titleBuffer, size_t titleBufferSize) { - const DynamicColumn* column = Hashtable_get(this->dynamicColumns, key); - if (column == NULL) - return "- "; - int width = column->width; - if (!width || abs(width) > DYNAMIC_MAX_COLUMN_WIDTH) - width = DYNAMIC_DEFAULT_COLUMN_WIDTH; - xSnprintf(titleBuffer, titleBufferSize, "%*s", width, column->heading); - return titleBuffer; -} - -static const char* alignedProcessFieldTitle(const ProcessList* this, ProcessField field) { - static char titleBuffer[UINT8_MAX + sizeof(" ")]; - assert(sizeof(titleBuffer) >= DYNAMIC_MAX_COLUMN_WIDTH + sizeof(" ")); - assert(sizeof(titleBuffer) >= PROCESS_MAX_PID_DIGITS + sizeof(" ")); - assert(sizeof(titleBuffer) >= PROCESS_MAX_UID_DIGITS + sizeof(" ")); - - if (field >= LAST_PROCESSFIELD) - return alignedDynamicColumnTitle(this, field, titleBuffer, sizeof(titleBuffer)); - - const char* title = Process_fields[field].title; - if (!title) - return "- "; - - if (Process_fields[field].pidColumn) { - xSnprintf(titleBuffer, sizeof(titleBuffer), "%*s ", Process_pidDigits, title); - return titleBuffer; - } - - if (field == ST_UID) { - xSnprintf(titleBuffer, sizeof(titleBuffer), "%*s ", Process_uidDigits, title); - return titleBuffer; - } - - if (Process_fields[field].autoWidth) { - if (field == PERCENT_CPU) - xSnprintf(titleBuffer, sizeof(titleBuffer), "%*s ", Process_fieldWidths[field], title); - else - xSnprintf(titleBuffer, sizeof(titleBuffer), "%-*.*s ", Process_fieldWidths[field], Process_fieldWidths[field], title); - return titleBuffer; - } - - return title; -} - -void ProcessList_printHeader(const ProcessList* this, RichString* header) { - RichString_rewind(header, RichString_size(header)); - - const Settings* settings = this->settings; - const ScreenSettings* ss = settings->ss; - const ProcessField* fields = ss->fields; - - ProcessField key = ScreenSettings_getActiveSortKey(ss); - - for (int i = 0; fields[i]; i++) { - int color; - if (ss->treeView && ss->treeViewAlwaysByPID) { - color = CRT_colors[PANEL_HEADER_FOCUS]; - } else if (key == fields[i]) { - color = CRT_colors[PANEL_SELECTION_FOCUS]; - } else { - color = CRT_colors[PANEL_HEADER_FOCUS]; - } - - RichString_appendWide(header, color, alignedProcessFieldTitle(this, fields[i])); - if (key == fields[i] && RichString_getCharVal(*header, RichString_size(header) - 1) == ' ') { - bool ascending = ScreenSettings_getActiveDirection(ss) == 1; - RichString_rewind(header, 1); // rewind to override space - RichString_appendnWide(header, - CRT_colors[PANEL_SELECTION_FOCUS], - CRT_treeStr[ascending ? TREE_STR_ASC : TREE_STR_DESC], - 1); - } - if (COMM == fields[i] && settings->showMergedCommand) { - RichString_appendAscii(header, color, "(merged)"); - } - } -} - -void ProcessList_add(ProcessList* this, Process* p) { - assert(Vector_indexOf(this->processes, p, Process_pidEqualCompare) == -1); - assert(Hashtable_get(this->processTable, p->pid) == NULL); - p->processList = this; - - // highlighting processes found in first scan by first scan marked "far in the past" - p->seenStampMs = this->monotonicMs; - - Vector_add(this->processes, p); - Hashtable_put(this->processTable, p->pid, p); - - assert(Vector_indexOf(this->processes, p, Process_pidEqualCompare) != -1); - assert(Hashtable_get(this->processTable, p->pid) != NULL); - assert(Vector_countEquals(this->processes, Hashtable_count(this->processTable))); -} - -// ProcessList_removeIndex removes Process p from the list's map and soft deletes -// it from its vector. Vector_compact *must* be called once the caller is done -// removing items. -// Should only be called from ProcessList_scan to avoid breaking dying process highlighting. -static void ProcessList_removeIndex(ProcessList* this, const Process* p, int idx) { - pid_t pid = p->pid; - - assert(p == (Process*)Vector_get(this->processes, idx)); - assert(Hashtable_get(this->processTable, pid) != NULL); - - Hashtable_remove(this->processTable, pid); - Vector_softRemove(this->processes, idx); - - if (this->following != -1 && this->following == pid) { - this->following = -1; - Panel_setSelectionColor(this->panel, PANEL_SELECTION_FOCUS); - } - - assert(Hashtable_get(this->processTable, pid) == NULL); - assert(Vector_countEquals(this->processes, Hashtable_count(this->processTable))); -} - -static void ProcessList_buildTreeBranch(ProcessList* this, pid_t pid, unsigned int level, int32_t indent, bool show) { - // On OpenBSD the kernel thread 'swapper' has pid 0. - // Do not treat it as root of any tree. - if (pid == 0) - return; - - // The vector is sorted by parent PID, find the start of the range by bisection - int vsize = Vector_size(this->processes); - int l = 0; - int r = vsize; - while (l < r) { - int c = (l + r) / 2; - Process* process = (Process*)Vector_get(this->processes, c); - pid_t ppid = process->isRoot ? 0 : Process_getParentPid(process); - if (ppid < pid) { - l = c + 1; - } else { - r = c; - } - } - // Find the end to know the last line for indent handling purposes - int lastShown = r; - while (r < vsize) { - Process* process = (Process*)Vector_get(this->processes, r); - if (!Process_isChildOf(process, pid)) - break; - if (process->show) - lastShown = r; - r++; - } - - for (int i = l; i < r; i++) { - Process* process = (Process*)Vector_get(this->processes, i); - - if (!show) { - process->show = false; - } - - Vector_add(this->displayList, process); - - int32_t nextIndent = indent | ((int32_t)1 << MINIMUM(level, sizeof(process->indent) * 8 - 2)); - ProcessList_buildTreeBranch(this, process->pid, level + 1, (i < lastShown) ? nextIndent : indent, process->show && process->showChildren); - if (i == lastShown) { - process->indent = -nextIndent; - } else { - process->indent = nextIndent; - } - - process->tree_depth = level + 1; - } -} - -static int compareProcessByKnownParentThenNatural(const void* v1, const void* v2) { - const Process* p1 = (const Process*)v1; - const Process* p2 = (const Process*)v2; - - int result = SPACESHIP_NUMBER( - p1->isRoot ? 0 : Process_getParentPid(p1), - p2->isRoot ? 0 : Process_getParentPid(p2) - ); - - if (result != 0) - return result; - - return Process_compare(v1, v2); -} - -// Builds a sorted tree from scratch, without relying on previously gathered information -static void ProcessList_buildTree(ProcessList* this) { - Vector_prune(this->displayList); - - // Mark root processes - int vsize = Vector_size(this->processes); - for (int i = 0; i < vsize; i++) { - Process* process = (Process*)Vector_get(this->processes, i); - pid_t ppid = Process_getParentPid(process); - process->isRoot = false; - - // If PID corresponds with PPID (e.g. "kernel_task" (PID:0, PPID:0) - // on Mac OS X 10.11.6) regard this process as root. - if (process->pid == ppid) { - process->isRoot = true; - continue; - } - - // On Linux both the init process (pid 1) and the root UMH kernel thread (pid 2) - // use a ppid of 0. As that PID can't exist, we can skip searching for it. - if (!ppid) { - process->isRoot = true; - continue; - } - - // We don't know about its parent for whatever reason - if (ProcessList_findProcess(this, ppid) == NULL) - process->isRoot = true; - } - - // Sort by known parent PID (roots first), then PID - Vector_quickSortCustomCompare(this->processes, compareProcessByKnownParentThenNatural); - - // Find all processes whose parent is not visible - for (int i = 0; i < vsize; i++) { - Process* process = (Process*)Vector_get(this->processes, i); - - // If parent not found, then construct the tree with this node as root - if (process->isRoot) { - process = (Process*)Vector_get(this->processes, i); - process->indent = 0; - process->tree_depth = 0; - Vector_add(this->displayList, process); - ProcessList_buildTreeBranch(this, process->pid, 0, 0, process->showChildren); - continue; - } - } - - this->needsSort = false; - - // Check consistency of the built structures - assert(Vector_size(this->displayList) == vsize); (void)vsize; -} - -void ProcessList_updateDisplayList(ProcessList* this) { - if (this->settings->ss->treeView) { - if (this->needsSort) - ProcessList_buildTree(this); - } else { - if (this->needsSort) - Vector_insertionSort(this->processes); - Vector_prune(this->displayList); - int size = Vector_size(this->processes); - for (int i = 0; i < size; i++) - Vector_add(this->displayList, Vector_get(this->processes, i)); - } - this->needsSort = false; -} - -ProcessField ProcessList_keyAt(const ProcessList* this, int at) { - int x = 0; - const ProcessField* fields = this->settings->ss->fields; - ProcessField field; - for (int i = 0; (field = fields[i]); i++) { - int len = strlen(alignedProcessFieldTitle(this, field)); - if (at >= x && at <= x + len) { - return field; - } - x += len; - } - return COMM; -} - -void ProcessList_expandTree(ProcessList* this) { - int size = Vector_size(this->processes); - for (int i = 0; i < size; i++) { - Process* process = (Process*) Vector_get(this->processes, i); - process->showChildren = true; - } -} - -// Called on collapse-all toggle and on startup, possibly in non-tree mode -void ProcessList_collapseAllBranches(ProcessList* this) { - ProcessList_buildTree(this); // Update `tree_depth` fields of the processes - this->needsSort = true; // ProcessList is sorted by parent now, force new sort - int size = Vector_size(this->processes); - for (int i = 0; i < size; i++) { - Process* process = (Process*) Vector_get(this->processes, i); - // FreeBSD has pid 0 = kernel and pid 1 = init, so init has tree_depth = 1 - if (process->tree_depth > 0 && process->pid > 1) - process->showChildren = false; - } -} - -void ProcessList_rebuildPanel(ProcessList* this) { - ProcessList_updateDisplayList(this); - - const char* incFilter = this->incFilter; - - const int currPos = Panel_getSelectedIndex(this->panel); - const int currScrollV = this->panel->scrollV; - const int currSize = Panel_size(this->panel); - - Panel_prune(this->panel); - - /* Follow main process if followed a userland thread and threads are now hidden */ - const Settings* settings = this->settings; - if (this->following != -1 && settings->hideUserlandThreads) { - const Process* followedProcess = (const Process*) Hashtable_get(this->processTable, this->following); - if (followedProcess && Process_isThread(followedProcess) && Hashtable_get(this->processTable, followedProcess->tgid) != NULL) { - this->following = followedProcess->tgid; - } - } - - const int processCount = Vector_size(this->displayList); - int idx = 0; - bool foundFollowed = false; - - for (int i = 0; i < processCount; i++) { - Process* p = (Process*) Vector_get(this->displayList, i); - - if ( (!p->show) - || (this->userId != (uid_t) -1 && (p->st_uid != this->userId)) - || (incFilter && !(String_contains_i(Process_getCommand(p), incFilter, true))) - || (this->pidMatchList && !Hashtable_get(this->pidMatchList, p->tgid)) ) - continue; - - Panel_set(this->panel, idx, (Object*)p); - - if (this->following != -1 && p->pid == this->following) { - foundFollowed = true; - Panel_setSelected(this->panel, idx); - this->panel->scrollV = currScrollV; - } - idx++; - } - - if (this->following != -1 && !foundFollowed) { - /* Reset if current followed pid not found */ - this->following = -1; - Panel_setSelectionColor(this->panel, PANEL_SELECTION_FOCUS); - } - - if (this->following == -1) { - /* If the last item was selected, keep the new last item selected */ - if (currPos > 0 && currPos == currSize - 1) - Panel_setSelected(this->panel, Panel_size(this->panel) - 1); - else - Panel_setSelected(this->panel, currPos); - - this->panel->scrollV = currScrollV; - } -} - -Process* ProcessList_getProcess(ProcessList* this, pid_t pid, bool* preExisting, Process_New constructor) { - Process* proc = (Process*) Hashtable_get(this->processTable, pid); - *preExisting = proc != NULL; - if (proc) { - assert(Vector_indexOf(this->processes, proc, Process_pidEqualCompare) != -1); - assert(proc->pid == pid); - } else { - proc = constructor(this->settings); - assert(proc->cmdline == NULL); - proc->pid = pid; - } - return proc; -} - -void ProcessList_scan(ProcessList* this, bool pauseProcessUpdate) { - // in pause mode only gather global data for meters (CPU/memory/...) - if (pauseProcessUpdate) { - ProcessList_goThroughEntries(this, true); - return; - } - - // mark all process as "dirty" - for (int i = 0; i < Vector_size(this->processes); i++) { - Process* p = (Process*) Vector_get(this->processes, i); - p->updated = false; - p->wasShown = p->show; - p->show = true; - } - - this->totalTasks = 0; - this->userlandThreads = 0; - this->kernelThreads = 0; - this->runningTasks = 0; - - Process_resetFieldWidths(); - - // set scan timestamp - static bool firstScanDone = false; - if (firstScanDone) { - Platform_gettime_monotonic(&this->monotonicMs); - } else { - this->monotonicMs = 0; - firstScanDone = true; - } - - ProcessList_goThroughEntries(this, false); - - uid_t maxUid = 0; - for (int i = Vector_size(this->processes) - 1; i >= 0; i--) { - Process* p = (Process*) Vector_get(this->processes, i); - Process_makeCommandStr(p); - - // keep track of the highest UID for column scaling - if (p->st_uid > maxUid) - maxUid = p->st_uid; - - if (p->tombStampMs > 0) { - // remove tombed process - if (this->monotonicMs >= p->tombStampMs) { - ProcessList_removeIndex(this, p, i); - } - } else if (p->updated == false) { - // process no longer exists - if (this->settings->highlightChanges && p->wasShown) { - // mark tombed - p->tombStampMs = this->monotonicMs + 1000 * this->settings->highlightDelaySecs; - } else { - // immediately remove - ProcessList_removeIndex(this, p, i); - } - } - } - - // Compact the processes vector in case of any deletions - Vector_compact(this->processes); - - // Set UID column width based on max UID. - Process_setUidColumnWidth(maxUid); -} diff --git a/fedora/.local/bin/htop-vim/ProcessList.h b/fedora/.local/bin/htop-vim/ProcessList.h deleted file mode 100644 index 419dea8..0000000 --- a/fedora/.local/bin/htop-vim/ProcessList.h +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef HEADER_ProcessList -#define HEADER_ProcessList -/* -htop - ProcessList.h -(C) 2004,2005 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include -#include -#include -#include -#include - -#include "Hashtable.h" -#include "Object.h" -#include "Panel.h" -#include "Process.h" -#include "RichString.h" -#include "Settings.h" -#include "UsersTable.h" -#include "Vector.h" - -#ifdef HAVE_LIBHWLOC -#include -#endif - - -#ifndef MAX_NAME -#define MAX_NAME 128 -#endif - -#ifndef MAX_READ -#define MAX_READ 2048 -#endif - -typedef unsigned long long int memory_t; -#define MEMORY_MAX ULLONG_MAX - -typedef struct ProcessList_ { - const Settings* settings; - - Vector* processes; /* all known processes; sort order can vary and differ from display order */ - Vector* displayList; /* process tree flattened in display order (borrowed); - updated in ProcessList_updateDisplayList when rebuilding panel */ - Hashtable* processTable; /* fast known process lookup by PID */ - UsersTable* usersTable; - - bool needsSort; - - Hashtable* dynamicMeters; /* runtime-discovered meters */ - Hashtable* dynamicColumns; /* runtime-discovered Columns */ - - struct timeval realtime; /* time of the current sample */ - uint64_t realtimeMs; /* current time in milliseconds */ - uint64_t monotonicMs; /* same, but from monotonic clock */ - - Panel* panel; - int following; - uid_t userId; - const char* incFilter; - Hashtable* pidMatchList; - - #ifdef HAVE_LIBHWLOC - hwloc_topology_t topology; - bool topologyOk; - #endif - - unsigned int totalTasks; - unsigned int runningTasks; - unsigned int userlandThreads; - unsigned int kernelThreads; - - memory_t totalMem; - memory_t usedMem; - memory_t buffersMem; - memory_t cachedMem; - memory_t sharedMem; - memory_t availableMem; - - memory_t totalSwap; - memory_t usedSwap; - memory_t cachedSwap; - - unsigned int activeCPUs; - unsigned int existingCPUs; -} ProcessList; - -/* Implemented by platforms */ -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId); -void ProcessList_delete(ProcessList* pl); -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate); -bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id); - - -ProcessList* ProcessList_init(ProcessList* this, const ObjectClass* klass, UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId); - -void ProcessList_done(ProcessList* this); - -void ProcessList_setPanel(ProcessList* this, Panel* panel); - -void ProcessList_printHeader(const ProcessList* this, RichString* header); - -void ProcessList_add(ProcessList* this, Process* p); - -void ProcessList_updateDisplayList(ProcessList* this); - -ProcessField ProcessList_keyAt(const ProcessList* this, int at); - -void ProcessList_expandTree(ProcessList* this); - -void ProcessList_collapseAllBranches(ProcessList* this); - -void ProcessList_rebuildPanel(ProcessList* this); - -Process* ProcessList_getProcess(ProcessList* this, pid_t pid, bool* preExisting, Process_New constructor); - -void ProcessList_scan(ProcessList* this, bool pauseProcessUpdate); - -static inline Process* ProcessList_findProcess(ProcessList* this, pid_t pid) { - return (Process*) Hashtable_get(this->processTable, pid); -} - -#endif diff --git a/fedora/.local/bin/htop-vim/ProcessLocksScreen.c b/fedora/.local/bin/htop-vim/ProcessLocksScreen.c deleted file mode 100644 index 57c9ce7..0000000 --- a/fedora/.local/bin/htop-vim/ProcessLocksScreen.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -htop - ProcessLocksScreen.c -(C) 2020 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "ProcessLocksScreen.h" - -#include -#include -#include - -#include "Panel.h" -#include "Platform.h" -#include "ProvideCurses.h" -#include "Vector.h" -#include "XUtils.h" - - -ProcessLocksScreen* ProcessLocksScreen_new(const Process* process) { - ProcessLocksScreen* this = xMalloc(sizeof(ProcessLocksScreen)); - Object_setClass(this, Class(ProcessLocksScreen)); - if (Process_isThread(process)) - this->pid = process->tgid; - else - this->pid = process->pid; - - return (ProcessLocksScreen*) InfoScreen_init(&this->super, process, NULL, LINES - 2, " FD TYPE EXCLUSION READ/WRITE DEVICE NODE START END FILENAME"); -} - -void ProcessLocksScreen_delete(Object* this) { - free(InfoScreen_done((InfoScreen*)this)); -} - -static void ProcessLocksScreen_draw(InfoScreen* this) { - InfoScreen_drawTitled(this, "Snapshot of file locks of process %d - %s", ((ProcessLocksScreen*)this)->pid, Process_getCommand(this->process)); -} - -static inline void FileLocks_Data_clear(FileLocks_Data* data) { - free(data->locktype); - free(data->exclusive); - free(data->readwrite); - free(data->filename); -} - -static void ProcessLocksScreen_scan(InfoScreen* this) { - Panel* panel = this->display; - int idx = Panel_getSelectedIndex(panel); - Panel_prune(panel); - FileLocks_ProcessData* pdata = Platform_getProcessLocks(((ProcessLocksScreen*)this)->pid); - if (!pdata) { - InfoScreen_addLine(this, "This feature is not supported on your platform."); - } else if (pdata->error) { - InfoScreen_addLine(this, "Could not determine file locks."); - } else { - FileLocks_LockData* ldata = pdata->locks; - if (!ldata) { - InfoScreen_addLine(this, "No locks have been found for the selected process."); - } - while (ldata) { - FileLocks_Data* data = &ldata->data; - - char entry[512]; - if (ULLONG_MAX == data->end) { - xSnprintf(entry, sizeof(entry), "%5d %-10s %-10s %-10s %#6"PRIx64" %10"PRIu64" %19"PRIu64" %19s %s", - data->fd, - data->locktype, data->exclusive, data->readwrite, - (uint64_t) data->dev, data->inode, - data->start, "", - data->filename ? data->filename : "" - ); - } else { - xSnprintf(entry, sizeof(entry), "%5d %-10s %-10s %-10s %#6"PRIx64" %10"PRIu64" %19"PRIu64" %19"PRIu64" %s", - data->fd, - data->locktype, data->exclusive, data->readwrite, - (uint64_t) data->dev, data->inode, - data->start, data->end, - data->filename ? data->filename : "" - ); - } - - InfoScreen_addLine(this, entry); - FileLocks_Data_clear(&ldata->data); - - FileLocks_LockData* old = ldata; - ldata = ldata->next; - free(old); - } - } - free(pdata); - Vector_insertionSort(this->lines); - Vector_insertionSort(panel->items); - Panel_setSelected(panel, idx); -} - -const InfoScreenClass ProcessLocksScreen_class = { - .super = { - .extends = Class(Object), - .delete = ProcessLocksScreen_delete - }, - .scan = ProcessLocksScreen_scan, - .draw = ProcessLocksScreen_draw -}; diff --git a/fedora/.local/bin/htop-vim/ProcessLocksScreen.h b/fedora/.local/bin/htop-vim/ProcessLocksScreen.h deleted file mode 100644 index 417df7b..0000000 --- a/fedora/.local/bin/htop-vim/ProcessLocksScreen.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef HEADER_ProcessLocksScreen -#define HEADER_ProcessLocksScreen -/* -htop - ProcessLocksScreen.h -(C) 2020 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include -#include - -#include "InfoScreen.h" -#include "Object.h" -#include "Process.h" - - -typedef struct ProcessLocksScreen_ { - InfoScreen super; - pid_t pid; -} ProcessLocksScreen; - -typedef struct FileLocks_Data_ { - char* locktype; - char* exclusive; - char* readwrite; - char* filename; - int fd; - dev_t dev; - uint64_t inode; - uint64_t start; - uint64_t end; -} FileLocks_Data; - -typedef struct FileLocks_LockData_ { - FileLocks_Data data; - struct FileLocks_LockData_* next; -} FileLocks_LockData; - -typedef struct FileLocks_ProcessData_ { - bool error; - struct FileLocks_LockData_* locks; -} FileLocks_ProcessData; - -extern const InfoScreenClass ProcessLocksScreen_class; - -ProcessLocksScreen* ProcessLocksScreen_new(const Process* process); - -void ProcessLocksScreen_delete(Object* this); - -#endif diff --git a/fedora/.local/bin/htop-vim/ProvideCurses.h b/fedora/.local/bin/htop-vim/ProvideCurses.h deleted file mode 100644 index 06602ff..0000000 --- a/fedora/.local/bin/htop-vim/ProvideCurses.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef HEADER_ProvideCurses -#define HEADER_ProvideCurses -/* -htop - RichString.h -(C) 2004,2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - - -#include "config.h" - -// IWYU pragma: begin_exports - -#if defined(HAVE_NCURSESW_CURSES_H) -#include -#elif defined(HAVE_NCURSES_NCURSES_H) -#include -#elif defined(HAVE_NCURSES_CURSES_H) -#include -#elif defined(HAVE_NCURSES_H) -#include -#elif defined(HAVE_CURSES_H) -#include -#endif - -#ifdef HAVE_LIBNCURSESW -#include -#include -#endif - -// IWYU pragma: end_exports - -#endif // HEADER_ProvideCurses diff --git a/fedora/.local/bin/htop-vim/README b/fedora/.local/bin/htop-vim/README deleted file mode 100644 index f90f463..0000000 --- a/fedora/.local/bin/htop-vim/README +++ /dev/null @@ -1,230 +0,0 @@ -# [![htop logo](htop.png)](https://htop.dev) - -[![CI](https://github.com/htop-dev/htop/workflows/CI/badge.svg)](https://github.com/htop-dev/htop/actions) -[![Coverity Scan Build Status](https://scan.coverity.com/projects/21665/badge.svg)](https://scan.coverity.com/projects/21665) -[![Mailing List](https://img.shields.io/badge/Mailing%20List-htop-blue.svg)](https://groups.io/g/htop) -[![IRC #htop](https://img.shields.io/badge/IRC-htop-blue.svg)](https://web.libera.chat/#htop) -[![GitHub Release](https://img.shields.io/github/release/htop-dev/htop.svg)](https://github.com/htop-dev/htop/releases/latest) -[![Packaging status](https://repology.org/badge/tiny-repos/htop.svg)](https://repology.org/project/htop/versions) -[![License: GPL v2+](https://img.shields.io/badge/License-GPL%20v2+-blue.svg)](COPYING?raw=true) - -![Screenshot of htop](docs/images/screenshot.png?raw=true) - -## Introduction - -`htop` is a cross-platform interactive process viewer. - -`htop` allows scrolling the list of processes vertically and horizontally to see their full command lines and related information like memory and CPU consumption. -Also system wide information, like load average or swap usage, is shown. - -The information displayed is configurable through a graphical setup and can be sorted and filtered interactively. - -Tasks related to processes (e.g. killing and renicing) can be done without entering their PIDs. - -Vim keybindings ----------------- - -These are the keybindings added in this fork of htop: - -``` - g to the top (gg in vim) - - up 1 page - - up 1/2 page - - k - -h l one character - - j - - down 1/2 page - - down 1 page - - G to the end - --------------------------------------------------- - - o Expand/collapse (like in NERDTree) -``` - -In order to accomodate these keybindings, the following changes -were made to the original keybindings: - -* Ctrl+F and Ctrt+B can no longer be used to navigate horizontally -* 'h' can no longer be used to access the help, leaving Ctrl+F1 & '?' -* 'k' can no longer be used to kill processes, being replaced with 'x' -* 'l' can no longer be used to list open files, being replaced with 'L' -* 'x' can no longer be used to list file locks, being replaced with 'X' - - -Comparison between `htop` and classic `top` -------------------------------------------- - -Running `htop` requires `ncurses` libraries, typically named libncurses(w). - -`htop` is written in C. - -For more information and details visit [htop.dev](https://htop.dev). - -## Build instructions - -### Prerequisite -List of build-time dependencies: - * standard GNU autotools-based C toolchain - - C99 compliant compiler - - `autoconf` - - `automake` - - `autotools` - * `ncurses` - -**Note about `ncurses`:** -> `htop` requires `ncurses` 6.0. Be aware the appropriate package is sometimes still called libncurses5 (on Debian/Ubuntu). Also `ncurses` usually comes in two flavours: ->* With Unicode support. ->* Without Unicode support. -> -> This is also something that is reflected in the package name on Debian/Ubuntu (via the additional 'w' - 'w'ide character support). - -List of additional build-time dependencies (based on feature flags): -* `sensors` -* `hwloc` -* `libcap` (v2.21 or later) -* `libnl-3` - -Install these and other required packages for C development from your package manager. - -**Debian/Ubuntu** -~~~ shell -sudo apt install libncursesw5-dev autotools-dev autoconf automake build-essential -~~~ - -**Fedora/RHEL** -~~~ shell -sudo dnf install ncurses-devel automake autoconf gcc -~~~ - -**Archlinux/Manjaro** -~~~ shell -sudo pacman -S ncurses automake autoconf gcc -~~~ - -**macOS** -~~~ shell -brew install ncurses automake autoconf gcc -~~~ - -### Compile from source: -To compile from source, download from the Git repository (`git clone` or downloads from [GitHub releases](https://github.com/htop-dev/htop/releases/)), then run: -~~~ shell -./autogen.sh && ./configure && make -~~~ - -### Install -To install on the local system run `make install`. By default `make install` installs into `/usr/local`. To change this path use `./configure --prefix=/some/path`. - -### Build Options - -`htop` has several build-time options to enable/disable additional features. - -#### Generic - - * `--enable-unicode`: - enable Unicode support - - dependency: *libncursesw* - - default: *yes* - * `--enable-affinity`: - enable `sched_setaffinity(2)` and `sched_getaffinity(2)` for affinity support; conflicts with hwloc - - default: *check* - * `--enable-hwloc`: - enable hwloc support for CPU affinity; disables affinity support - - dependency: *libhwloc* - - default: *no* - * `--enable-static`: - build a static htop binary; hwloc and delay accounting are not supported - - default: *no* - * `--enable-debug`: - Enable asserts and internal sanity checks; implies a performance penalty - - default: *no* - -#### Performance Co-Pilot - - * `--enable-pcp`: - enable Performance Co-Pilot support via a new pcp-htop utility - - dependency: *libpcp* - - default: *no* - -#### Linux - - * `--enable-sensors`: - enable libsensors(3) support for reading temperature data - - dependencies: *libsensors-dev*(build-time), at runtime *libsensors* is loaded via `dlopen(3)` if available - - default: *check* - * `--enable-capabilities`: - enable Linux capabilities support - - dependency: *libcap* - - default: *check* - * `--with-proc`: - location of a Linux-compatible proc filesystem - - default: */proc* - * `--enable-openvz`: - enable OpenVZ support - - default: *no* - * `--enable-vserver`: - enable VServer support - - default: *no* - * `--enable-ancient-vserver`: - enable ancient VServer support (implies `--enable-vserver`) - - default: *no* - * `--enable-delayacct`: - enable Linux delay accounting support - - dependencies: *pkg-config*(build-time), *libnl-3* and *libnl-genl-3* - - default: *check* - - -## Runtime dependencies: -`htop` has a set of fixed minimum runtime dependencies, which is kept as minimal as possible: -* `ncurses` libraries for terminal handling (wide character support). - -### Runtime optional dependencies: -`htop` has a set of fixed optional dependencies, depending on build/configure option used: - -#### Linux -* `libdl`, if not building a static binary, is always required when support for optional dependencies (i.e. `libsensors`, `libsystemd`) is present. -* `libcap`, user-space interfaces to POSIX 1003.1e capabilities, is always required when `--enable-capabilities` was used to configure `htop`. -* `libsensors`, readout of temperatures and CPU speeds, is optional even when `--enable-sensors` was used to configure `htop`. -* `libsystemd` is optional when `--enable-static` was not used to configure `htop`. If building statically and `libsystemd` is not found by `configure`, support for the systemd meter is disabled entirely. - -`htop` checks for the availability of the actual runtime libraries as `htop` runs. - -#### BSD -On most BSD systems `kvm` is a requirement to read kernel information. - -More information on required and optional dependencies can be found in [configure.ac](configure.ac). - -## Usage -See the manual page (`man htop`) or the help menu (**F1** or **h** inside `htop`) for a list of supported key commands. - -## Support - -If you have trouble running `htop` please consult your operating system / Linux distribution documentation for getting support and filing bugs. - -## Bugs, development feedback - -We have a [development mailing list](https://htop.dev/mailinglist.html). Feel free to subscribe for release announcements or asking questions on the development of `htop`. - -You can also join our IRC channel [#htop on Libera.Chat](https://web.libera.chat/#htop) and talk to the developers there. - -If you have found an issue within the source of `htop`, please check whether this has already been reported in our [GitHub issue tracker](https://github.com/htop-dev/htop/issues). -If not, please file a new issue describing the problem you have found, the potential location in the source code you are referring to and a possible fix if available. - -## History - -`htop` was invented, developed and maintained by [Hisham Muhammad](https://hisham.hm/) from 2004 to 2019. His [legacy repository](https://github.com/hishamhm/htop/) has been archived to preserve the history. - -In 2020 a [team](https://github.com/orgs/htop-dev/people) took over the development amicably and continues to maintain `htop` collaboratively. - -## License - -GNU General Public License, version 2 (GPL-2.0) or, at your option, any later version. diff --git a/fedora/.local/bin/htop-vim/README.md b/fedora/.local/bin/htop-vim/README.md deleted file mode 120000 index 100b938..0000000 --- a/fedora/.local/bin/htop-vim/README.md +++ /dev/null @@ -1 +0,0 @@ -README \ No newline at end of file diff --git a/fedora/.local/bin/htop-vim/RichString.c b/fedora/.local/bin/htop-vim/RichString.c deleted file mode 100644 index daa0c91..0000000 --- a/fedora/.local/bin/htop-vim/RichString.c +++ /dev/null @@ -1,221 +0,0 @@ -/* -htop - RichString.c -(C) 2004,2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "RichString.h" - -#include -#include -#include - -#include "Macros.h" -#include "XUtils.h" - - -#define charBytes(n) (sizeof(CharType) * (n)) - -static void RichString_extendLen(RichString* this, int len) { - if (this->chlen <= RICHSTRING_MAXLEN) { - if (len > RICHSTRING_MAXLEN) { - this->chptr = xMalloc(charBytes(len + 1)); - memcpy(this->chptr, this->chstr, charBytes(this->chlen)); - } - } else { - if (len <= RICHSTRING_MAXLEN) { - memcpy(this->chstr, this->chptr, charBytes(len)); - free(this->chptr); - this->chptr = this->chstr; - } else { - this->chptr = xRealloc(this->chptr, charBytes(len + 1)); - } - } - - RichString_setChar(this, len, 0); - this->chlen = len; -} - -static void RichString_setLen(RichString* this, int len) { - if (len < RICHSTRING_MAXLEN && this->chlen < RICHSTRING_MAXLEN) { - RichString_setChar(this, len, 0); - this->chlen = len; - } else { - RichString_extendLen(this, len); - } -} - -void RichString_rewind(RichString* this, int count) { - RichString_setLen(this, this->chlen - count); -} - -#ifdef HAVE_LIBNCURSESW - -static inline int RichString_writeFromWide(RichString* this, int attrs, const char* data_c, int from, int len) { - wchar_t data[len + 1]; - len = mbstowcs(data, data_c, len); - if (len <= 0) - return 0; - - int newLen = from + len; - RichString_setLen(this, newLen); - for (int i = from, j = 0; i < newLen; i++, j++) { - this->chptr[i] = (CharType) { .attr = attrs & 0xffffff, .chars = { (iswprint(data[j]) ? data[j] : L'\xFFFD') } }; - } - - return len; -} - -int RichString_appendnWideColumns(RichString* this, int attrs, const char* data_c, int len, int* columns) { - wchar_t data[len + 1]; - len = mbstowcs(data, data_c, len); - if (len <= 0) - return 0; - - int from = this->chlen; - int newLen = from + len; - RichString_setLen(this, newLen); - int columnsWritten = 0; - int pos = from; - for (int j = 0; j < len; j++) { - wchar_t c = iswprint(data[j]) ? data[j] : L'\xFFFD'; - int cwidth = wcwidth(c); - if (cwidth > *columns) - break; - - *columns -= cwidth; - columnsWritten += cwidth; - - this->chptr[pos] = (CharType) { .attr = attrs & 0xffffff, .chars = { c, '\0' } }; - pos++; - } - - RichString_setLen(this, pos); - *columns = columnsWritten; - - return pos - from; -} - -static inline int RichString_writeFromAscii(RichString* this, int attrs, const char* data, int from, int len) { - int newLen = from + len; - RichString_setLen(this, newLen); - for (int i = from, j = 0; i < newLen; i++, j++) { - this->chptr[i] = (CharType) { .attr = attrs & 0xffffff, .chars = { (isprint(data[j]) ? data[j] : L'\xFFFD') } }; - } - - return len; -} - -inline void RichString_setAttrn(RichString* this, int attrs, int start, int charcount) { - int end = CLAMP(start + charcount, 0, this->chlen); - for (int i = start; i < end; i++) { - this->chptr[i].attr = attrs; - } -} - -void RichString_appendChr(RichString* this, int attrs, char c, int count) { - int from = this->chlen; - int newLen = from + count; - RichString_setLen(this, newLen); - for (int i = from; i < newLen; i++) { - this->chptr[i] = (CharType) { .attr = attrs, .chars = { c, 0 } }; - } -} - -int RichString_findChar(const RichString* this, char c, int start) { - const wchar_t wc = btowc(c); - const cchar_t* ch = this->chptr + start; - for (int i = start; i < this->chlen; i++) { - if (ch->chars[0] == wc) - return i; - ch++; - } - return -1; -} - -#else /* HAVE_LIBNCURSESW */ - -static inline int RichString_writeFromWide(RichString* this, int attrs, const char* data_c, int from, int len) { - int newLen = from + len; - RichString_setLen(this, newLen); - for (int i = from, j = 0; i < newLen; i++, j++) { - this->chptr[i] = (((unsigned char)data_c[j]) >= 32 ? ((unsigned char)data_c[j]) : '?') | attrs; - } - this->chptr[newLen] = 0; - - return len; -} - -int RichString_appendnWideColumns(RichString* this, int attrs, const char* data_c, int len, int* columns) { - int written = RichString_writeFromWide(this, attrs, data_c, this->chlen, MINIMUM(len, *columns)); - *columns = written; - return written; -} - -static inline int RichString_writeFromAscii(RichString* this, int attrs, const char* data_c, int from, int len) { - return RichString_writeFromWide(this, attrs, data_c, from, len); -} - -void RichString_setAttrn(RichString* this, int attrs, int start, int charcount) { - int end = CLAMP(start + charcount, 0, this->chlen); - for (int i = start; i < end; i++) { - this->chptr[i] = (this->chptr[i] & 0xff) | attrs; - } -} - -void RichString_appendChr(RichString* this, int attrs, char c, int count) { - int from = this->chlen; - int newLen = from + count; - RichString_setLen(this, newLen); - for (int i = from; i < newLen; i++) { - this->chptr[i] = c | attrs; - } -} - -int RichString_findChar(const RichString* this, char c, int start) { - const chtype* ch = this->chptr + start; - for (int i = start; i < this->chlen; i++) { - if ((*ch & 0xff) == (chtype) c) - return i; - ch++; - } - return -1; -} - -#endif /* HAVE_LIBNCURSESW */ - -void RichString_delete(RichString* this) { - if (this->chlen > RICHSTRING_MAXLEN) { - free(this->chptr); - this->chptr = this->chstr; - } -} - -void RichString_setAttr(RichString* this, int attrs) { - RichString_setAttrn(this, attrs, 0, this->chlen); -} - -int RichString_appendWide(RichString* this, int attrs, const char* data) { - return RichString_writeFromWide(this, attrs, data, this->chlen, strlen(data)); -} - -int RichString_appendnWide(RichString* this, int attrs, const char* data, int len) { - return RichString_writeFromWide(this, attrs, data, this->chlen, len); -} - -int RichString_writeWide(RichString* this, int attrs, const char* data) { - return RichString_writeFromWide(this, attrs, data, 0, strlen(data)); -} - -int RichString_appendAscii(RichString* this, int attrs, const char* data) { - return RichString_writeFromAscii(this, attrs, data, this->chlen, strlen(data)); -} - -int RichString_appendnAscii(RichString* this, int attrs, const char* data, int len) { - return RichString_writeFromAscii(this, attrs, data, this->chlen, len); -} - -int RichString_writeAscii(RichString* this, int attrs, const char* data) { - return RichString_writeFromAscii(this, attrs, data, 0, strlen(data)); -} diff --git a/fedora/.local/bin/htop-vim/RichString.h b/fedora/.local/bin/htop-vim/RichString.h deleted file mode 100644 index cbcbe48..0000000 --- a/fedora/.local/bin/htop-vim/RichString.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef HEADER_RichString -#define HEADER_RichString -/* -htop - RichString.h -(C) 2004,2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" - -#include "ProvideCurses.h" - - -#define RichString_size(this) ((this)->chlen) -#define RichString_sizeVal(this) ((this).chlen) - -#define RichString_begin(this) RichString this; RichString_beginAllocated(this) -#define RichString_beginAllocated(this) \ - do { \ - (this).chlen = 0, \ - (this).chptr = (this).chstr; \ - RichString_setChar(&(this), 0, 0); \ - (this).highlightAttr = 0; \ - } while(0) - -#ifdef HAVE_LIBNCURSESW -#define RichString_printVal(this, y, x) mvadd_wchstr(y, x, (this).chptr) -#define RichString_printoffnVal(this, y, x, off, n) mvadd_wchnstr(y, x, (this).chptr + (off), n) -#define RichString_getCharVal(this, i) ((this).chptr[i].chars[0]) -#define RichString_setChar(this, at, ch) do { (this)->chptr[(at)] = (CharType) { .chars = { ch, 0 } }; } while (0) -#define CharType cchar_t -#else -#define RichString_printVal(this, y, x) mvaddchstr(y, x, (this).chptr) -#define RichString_printoffnVal(this, y, x, off, n) mvaddchnstr(y, x, (this).chptr + (off), n) -#define RichString_getCharVal(this, i) ((this).chptr[i] & 0xff) -#define RichString_setChar(this, at, ch) do { (this)->chptr[(at)] = ch; } while (0) -#define CharType chtype -#endif - -#define RICHSTRING_MAXLEN 350 - -typedef struct RichString_ { - int chlen; - CharType* chptr; - CharType chstr[RICHSTRING_MAXLEN + 1]; - int highlightAttr; -} RichString; - -void RichString_delete(RichString* this); - -void RichString_rewind(RichString* this, int count); - -void RichString_setAttrn(RichString* this, int attrs, int start, int charcount); - -int RichString_findChar(const RichString* this, char c, int start); - -void RichString_setAttr(RichString* this, int attrs); - -void RichString_appendChr(RichString* this, int attrs, char c, int count); - -/* All appending and writing functions return the number of written characters (not columns). */ - -int RichString_appendWide(RichString* this, int attrs, const char* data); - -int RichString_appendnWide(RichString* this, int attrs, const char* data, int len); - -/* columns takes the maximum number of columns to write and contains on return the number of columns written. */ -int RichString_appendnWideColumns(RichString* this, int attrs, const char* data, int len, int* columns); - -int RichString_writeWide(RichString* this, int attrs, const char* data); - -int RichString_appendAscii(RichString* this, int attrs, const char* data); - -int RichString_appendnAscii(RichString* this, int attrs, const char* data, int len); - -int RichString_writeAscii(RichString* this, int attrs, const char* data); - -#endif diff --git a/fedora/.local/bin/htop-vim/Scheduling.c b/fedora/.local/bin/htop-vim/Scheduling.c deleted file mode 100644 index 5ca49ae..0000000 --- a/fedora/.local/bin/htop-vim/Scheduling.c +++ /dev/null @@ -1,154 +0,0 @@ -/* -htop - Scheduling.c -(C) 2023 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Scheduling.h" -#include "EnvScreen.h" - -#ifdef SCHEDULER_SUPPORT - -#include - -#include "FunctionBar.h" -#include "ListItem.h" -#include "Macros.h" -#include "Object.h" -#include "Panel.h" -#include "XUtils.h" - - -static const SchedulingPolicy policies[] = { - [SCHED_OTHER] = { "Other", SCHED_OTHER, false }, -#ifdef SCHED_BATCH - [SCHED_BATCH] = { "Batch", SCHED_BATCH, false }, -#endif -#ifdef SCHED_IDLE - [SCHED_IDLE] = { "Idle", SCHED_IDLE, false }, -#endif - [SCHED_FIFO] = { "FiFo", SCHED_FIFO, true }, - [SCHED_RR] = { "RoundRobin", SCHED_RR, true }, -}; - -#ifdef SCHED_RESET_ON_FORK -static bool reset_on_fork = false; -#endif - - -Panel* Scheduling_newPolicyPanel(int preSelectedPolicy) { - Panel* this = Panel_new(0, 0, 0, 0, Class(ListItem), true, FunctionBar_newEnterEsc("Select ", "Cancel ")); - Panel_setHeader(this, "New policy:"); - -#ifdef SCHED_RESET_ON_FORK - Panel_add(this, (Object*) ListItem_new(reset_on_fork ? "Reset on fork: on" : "Reset on fork: off", -1)); -#endif - - for (unsigned i = 0; i < ARRAYSIZE(policies); i++) { - if (!policies[i].name) - continue; - - Panel_add(this, (Object*) ListItem_new(policies[i].name, policies[i].id)); - if (policies[i].id == preSelectedPolicy) - Panel_setSelected(this, i); - } - - return this; -} - -void Scheduling_togglePolicyPanelResetOnFork(Panel* schedPanel) { -#ifdef SCHED_RESET_ON_FORK - reset_on_fork = !reset_on_fork; - - ListItem* item = (ListItem*) Panel_get(schedPanel, 0); - - free_and_xStrdup(&item->value, reset_on_fork ? "Reset on fork: on" : "Reset on fork: off"); -#else - (void)schedPanel; -#endif -} - -Panel* Scheduling_newPriorityPanel(int policy, int preSelectedPriority) { - if (policy < 0 || (unsigned)policy >= ARRAYSIZE(policies) || policies[policy].name == NULL) - return NULL; - - if (!policies[policy].prioritySupport) - return NULL; - - int min = sched_get_priority_min(policy); - if (min < 0) - return NULL; - int max = sched_get_priority_max(policy); - if (max < 0 ) - return NULL; - - Panel* this = Panel_new(0, 0, 0, 0, Class(ListItem), true, FunctionBar_newEnterEsc("Select ", "Cancel ")); - Panel_setHeader(this, "Priority:"); - - for (int i = min; i <= max; i++) { - char buf[16]; - xSnprintf(buf, sizeof(buf), "%d", i); - Panel_add(this, (Object*) ListItem_new(buf, i)); - if (i == preSelectedPriority) - Panel_setSelected(this, i); - } - - return this; -} - -bool Scheduling_setPolicy(Process* proc, Arg arg) { - const SchedulingArg* sarg = arg.v; - int policy = sarg->policy; - - assert(policy >= 0); - assert((unsigned)policy < ARRAYSIZE(policies)); - assert(policies[policy].name); - - const struct sched_param param = { .sched_priority = policies[policy].prioritySupport ? sarg->priority : 0 }; - - #ifdef SCHED_RESET_ON_FORK - if (reset_on_fork) - policy &= SCHED_RESET_ON_FORK; - #endif - - int r = sched_setscheduler(proc->pid, policy, ¶m); - - /* POSIX says on success the previous scheduling policy should be returned, - * but Linux always returns 0. */ - return r != -1; -} - -const char* Scheduling_formatPolicy(int policy) { -#ifdef SCHED_RESET_ON_FORK - policy = policy & ~SCHED_RESET_ON_FORK; -#endif - - switch (policy) { - case SCHED_OTHER: - return "OTHER"; - case SCHED_FIFO: - return "FIFO"; - case SCHED_RR: - return "RR"; -#ifdef SCHED_BATCH - case SCHED_BATCH: - return "BATCH"; -#endif -#ifdef SCHED_IDLE - case SCHED_IDLE: - return "IDLE"; -#endif -#ifdef SCHED_DEADLINE - case SCHED_DEADLINE: - return "EDF"; -#endif - default: - return "???"; - } -} - -void Scheduling_readProcessPolicy(Process* proc) { - proc->scheduling_policy = sched_getscheduler(proc->pid); -} -#endif /* SCHEDULER_SUPPORT */ diff --git a/fedora/.local/bin/htop-vim/Scheduling.h b/fedora/.local/bin/htop-vim/Scheduling.h deleted file mode 100644 index d91855a..0000000 --- a/fedora/.local/bin/htop-vim/Scheduling.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef HEADER_Scheduling -#define HEADER_Scheduling -/* -htop - Scheduling.h -(C) 2023 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include -#include - -#include "Panel.h" - - -#if defined(HAVE_SCHED_SETSCHEDULER) && defined(HAVE_SCHED_GETSCHEDULER) -#define SCHEDULER_SUPPORT - -typedef struct { - const char* name; - int id; - bool prioritySupport; -} SchedulingPolicy; - -#define SCHEDULINGPANEL_INITSELECTEDPOLICY SCHED_OTHER -#define SCHEDULINGPANEL_INITSELECTEDPRIORITY 50 - -Panel* Scheduling_newPolicyPanel(int preSelectedPolicy); -void Scheduling_togglePolicyPanelResetOnFork(Panel* schedPanel); - -Panel* Scheduling_newPriorityPanel(int policy, int preSelectedPriority); - - -typedef struct { - int policy; - int priority; -} SchedulingArg; - -bool Scheduling_setPolicy(Process* proc, Arg arg); - -const char* Scheduling_formatPolicy(int policy); - -void Scheduling_readProcessPolicy(Process* proc); - -#endif - -#endif /* HEADER_Scheduling */ diff --git a/fedora/.local/bin/htop-vim/ScreenManager.c b/fedora/.local/bin/htop-vim/ScreenManager.c deleted file mode 100644 index 3f7dd12..0000000 --- a/fedora/.local/bin/htop-vim/ScreenManager.c +++ /dev/null @@ -1,418 +0,0 @@ -/* -htop - ScreenManager.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "ScreenManager.h" - -#include -#include -#include -#include - -#include "CRT.h" -#include "FunctionBar.h" -#include "Macros.h" -#include "MainPanel.h" -#include "Object.h" -#include "Platform.h" -#include "ProcessList.h" -#include "ProvideCurses.h" -#include "XUtils.h" - - -ScreenManager* ScreenManager_new(Header* header, const Settings* settings, State* state, bool owner) { - ScreenManager* this; - this = xMalloc(sizeof(ScreenManager)); - this->x1 = 0; - this->y1 = 0; - this->x2 = 0; - this->y2 = -1; - this->panels = Vector_new(Class(Panel), owner, DEFAULT_SIZE); - this->panelCount = 0; - this->header = header; - this->settings = settings; - this->state = state; - this->allowFocusChange = true; - return this; -} - -void ScreenManager_delete(ScreenManager* this) { - Vector_delete(this->panels); - free(this); -} - -inline int ScreenManager_size(const ScreenManager* this) { - return this->panelCount; -} - -void ScreenManager_add(ScreenManager* this, Panel* item, int size) { - ScreenManager_insert(this, item, size, Vector_size(this->panels)); -} - -static int header_height(const ScreenManager* this) { - if (this->state->hideMeters) - return 0; - - if (this->header) - return this->header->height; - - return 0; -} - -void ScreenManager_insert(ScreenManager* this, Panel* item, int size, int idx) { - int lastX = 0; - if (idx > 0) { - const Panel* last = (const Panel*) Vector_get(this->panels, idx - 1); - lastX = last->x + last->w + 1; - } - int height = LINES - this->y1 - header_height(this) + this->y2; - if (size <= 0) { - size = COLS - this->x1 + this->x2 - lastX; - } - Panel_resize(item, size, height); - Panel_move(item, lastX, this->y1 + header_height(this)); - if (idx < this->panelCount) { - for (int i = idx + 1; i <= this->panelCount; i++) { - Panel* p = (Panel*) Vector_get(this->panels, i); - Panel_move(p, p->x + size, p->y); - } - } - Vector_insert(this->panels, idx, item); - item->needsRedraw = true; - this->panelCount++; -} - -Panel* ScreenManager_remove(ScreenManager* this, int idx) { - assert(this->panelCount > idx); - int w = ((Panel*) Vector_get(this->panels, idx))->w; - Panel* panel = (Panel*) Vector_remove(this->panels, idx); - this->panelCount--; - if (idx < this->panelCount) { - for (int i = idx; i < this->panelCount; i++) { - Panel* p = (Panel*) Vector_get(this->panels, i); - Panel_move(p, p->x - w, p->y); - } - } - return panel; -} - -void ScreenManager_resize(ScreenManager* this) { - int y1_header = this->y1 + header_height(this); - int panels = this->panelCount; - int lastX = 0; - for (int i = 0; i < panels - 1; i++) { - Panel* panel = (Panel*) Vector_get(this->panels, i); - Panel_resize(panel, panel->w, LINES - y1_header + this->y2); - Panel_move(panel, lastX, y1_header); - lastX = panel->x + panel->w + 1; - } - Panel* panel = (Panel*) Vector_get(this->panels, panels - 1); - Panel_resize(panel, COLS - this->x1 + this->x2 - lastX, LINES - y1_header + this->y2); - Panel_move(panel, lastX, y1_header); -} - -static void checkRecalculation(ScreenManager* this, double* oldTime, int* sortTimeout, bool* redraw, bool* rescan, bool* timedOut, bool* force_redraw) { - ProcessList* pl = this->header->pl; - - Platform_gettime_realtime(&pl->realtime, &pl->realtimeMs); - double newTime = ((double)pl->realtime.tv_sec * 10) + ((double)pl->realtime.tv_usec / 100000); - - *timedOut = (newTime - *oldTime > this->settings->delay); - *rescan |= *timedOut; - - if (newTime < *oldTime) { - *rescan = true; // clock was adjusted? - } - - if (*rescan) { - *oldTime = newTime; - int oldUidDigits = Process_uidDigits; - if (!this->state->pauseProcessUpdate && (*sortTimeout == 0 || this->settings->ss->treeView)) { - pl->needsSort = true; - *sortTimeout = 1; - } - // scan processes first - some header values are calculated there - ProcessList_scan(pl, this->state->pauseProcessUpdate); - // always update header, especially to avoid gaps in graph meters - Header_updateData(this->header); - // force redraw if the number of UID digits was changed - if (Process_uidDigits != oldUidDigits) { - *force_redraw = true; - } - *redraw = true; - } - if (*redraw) { - ProcessList_rebuildPanel(pl); - if (!this->state->hideMeters) - Header_draw(this->header); - } - *rescan = false; -} - -static inline bool drawTab(int* y, int* x, int l, const char* name, bool cur) { - attrset(CRT_colors[cur ? SCREENS_CUR_BORDER : SCREENS_OTH_BORDER]); - mvaddch(*y, *x, '['); - (*x)++; - if (*x >= l) - return false; - int nameLen = strlen(name); - int n = MINIMUM(l - *x, nameLen); - attrset(CRT_colors[cur ? SCREENS_CUR_TEXT : SCREENS_OTH_TEXT]); - mvaddnstr(*y, *x, name, n); - *x += n; - if (*x >= l) - return false; - attrset(CRT_colors[cur ? SCREENS_CUR_BORDER : SCREENS_OTH_BORDER]); - mvaddch(*y, *x, ']'); - *x += 2; - if (*x >= l) - return false; - return true; -} - -static void ScreenManager_drawScreenTabs(ScreenManager* this) { - ScreenSettings** screens = this->settings->screens; - int cur = this->settings->ssIndex; - int l = COLS; - Panel* panel = (Panel*) Vector_get(this->panels, 0); - int y = panel->y - 1; - int x = 2; - - if (this->name) { - drawTab(&y, &x, l, this->name, true); - return; - } - - for (int s = 0; screens[s]; s++) { - bool ok = drawTab(&y, &x, l, screens[s]->name, s == cur); - if (!ok) { - break; - } - } - attrset(CRT_colors[RESET_COLOR]); -} - -static void ScreenManager_drawPanels(ScreenManager* this, int focus, bool force_redraw) { - if (this->settings->screenTabs) { - ScreenManager_drawScreenTabs(this); - } - const int nPanels = this->panelCount; - for (int i = 0; i < nPanels; i++) { - Panel* panel = (Panel*) Vector_get(this->panels, i); - Panel_draw(panel, - force_redraw, - i == focus, - panel != (Panel*)this->state->mainPanel || !this->state->hideProcessSelection, - State_hideFunctionBar(this->state)); - mvvline(panel->y, panel->x + panel->w, ' ', panel->h + (State_hideFunctionBar(this->state) ? 1 : 0)); - } -} - -void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey, const char* name) { - bool quit = false; - int focus = 0; - - Panel* panelFocus = (Panel*) Vector_get(this->panels, focus); - - double oldTime = 0.0; - - int ch = ERR; - int closeTimeout = 0; - - bool timedOut = true; - bool redraw = true; - bool force_redraw = true; - bool rescan = false; - int sortTimeout = 0; - int resetSortTimeout = 5; - - this->name = name; - - while (!quit) { - if (this->header) { - checkRecalculation(this, &oldTime, &sortTimeout, &redraw, &rescan, &timedOut, &force_redraw); - } - - if (redraw || force_redraw) { - ScreenManager_drawPanels(this, focus, force_redraw); - force_redraw = false; - } - - int prevCh = ch; - ch = Panel_getCh(panelFocus); - - HandlerResult result = IGNORED; -#ifdef HAVE_GETMOUSE - if (ch == KEY_MOUSE && this->settings->enableMouse) { - ch = ERR; - MEVENT mevent; - int ok = getmouse(&mevent); - if (ok == OK) { - if (mevent.bstate & BUTTON1_RELEASED) { - if (mevent.y == LINES - 1) { - ch = FunctionBar_synthesizeEvent(panelFocus->currentBar, mevent.x); - } else { - for (int i = 0; i < this->panelCount; i++) { - Panel* panel = (Panel*) Vector_get(this->panels, i); - if (mevent.x >= panel->x && mevent.x <= panel->x + panel->w) { - if (mevent.y == panel->y) { - ch = EVENT_HEADER_CLICK(mevent.x - panel->x); - break; - } else if (this->settings->screenTabs && mevent.y == panel->y - 1) { - ch = EVENT_SCREEN_TAB_CLICK(mevent.x); - break; - } else if (mevent.y > panel->y && mevent.y <= panel->y + panel->h) { - ch = KEY_MOUSE; - if (panel == panelFocus || this->allowFocusChange) { - focus = i; - panelFocus = panel; - const Object* oldSelection = Panel_getSelected(panel); - Panel_setSelected(panel, mevent.y - panel->y + panel->scrollV - 1); - if (Panel_getSelected(panel) == oldSelection) { - ch = KEY_RECLICK; - } - } - break; - } - } - } - } - #if NCURSES_MOUSE_VERSION > 1 - } else if (mevent.bstate & BUTTON4_PRESSED) { - ch = KEY_WHEELUP; - } else if (mevent.bstate & BUTTON5_PRESSED) { - ch = KEY_WHEELDOWN; - #endif - } - } - } -#endif - if (ch == ERR) { - if (sortTimeout > 0) - sortTimeout--; - if (prevCh == ch && !timedOut) { - closeTimeout++; - if (closeTimeout == 100) { - break; - } - } else { - closeTimeout = 0; - } - redraw = false; - continue; - } - redraw = true; - if (Panel_eventHandlerFn(panelFocus)) { - if (Panel_eventHandlerFn(panelFocus) != MainPanel_eventHandler) { - switch (ch) { - case 'h': case KEY_ALT('H'): ch = KEY_LEFT; break; - case 'j': case KEY_ALT('J'): ch = KEY_DOWN; break; - case 'k': case KEY_ALT('K'): ch = KEY_UP; break; - case 'l': case KEY_ALT('L'): ch = KEY_RIGHT; break; - } - } - result = Panel_eventHandler(panelFocus, ch); - } - if (result & SYNTH_KEY) { - ch = result >> 16; - } - if (result & REFRESH) { - sortTimeout = 0; - } - if (result & REDRAW) { - force_redraw = true; - } - if (result & RESIZE) { - ScreenManager_resize(this); - force_redraw = true; - } - if (result & RESCAN) { - rescan = true; - sortTimeout = 0; - } - if (result & HANDLED) { - continue; - } else if (result & BREAK_LOOP) { - quit = true; - continue; - } - - switch (ch) { - case KEY_RESIZE: - { - ScreenManager_resize(this); - continue; - } - case KEY_LEFT: - case 'h': - if (this->panelCount < 2) { - goto defaultHandler; - } - - if (!this->allowFocusChange) { - break; - } - -tryLeft: - if (focus > 0) { - focus--; - } - - panelFocus = (Panel*) Vector_get(this->panels, focus); - if (Panel_size(panelFocus) == 0 && focus > 0) { - goto tryLeft; - } - - break; - case KEY_RIGHT: - case 'l': - case 9: - if (this->panelCount < 2) { - goto defaultHandler; - } - if (!this->allowFocusChange) { - break; - } - -tryRight: - if (focus < this->panelCount - 1) { - focus++; - } - - panelFocus = (Panel*) Vector_get(this->panels, focus); - if (Panel_size(panelFocus) == 0 && focus < this->panelCount - 1) { - goto tryRight; - } - - break; - case '#': - this->state->hideMeters = !this->state->hideMeters; - ScreenManager_resize(this); - force_redraw = true; - break; - case 27: - case 'q': - case KEY_F(10): - quit = true; - continue; - default: -defaultHandler: - sortTimeout = resetSortTimeout; - Panel_onKey(panelFocus, ch); - break; - } - } - - if (lastFocus) { - *lastFocus = panelFocus; - } - - if (lastKey) { - *lastKey = ch; - } -} diff --git a/fedora/.local/bin/htop-vim/ScreenManager.h b/fedora/.local/bin/htop-vim/ScreenManager.h deleted file mode 100644 index d08a941..0000000 --- a/fedora/.local/bin/htop-vim/ScreenManager.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef HEADER_ScreenManager -#define HEADER_ScreenManager -/* -htop - ScreenManager.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include - -#include "Action.h" -#include "Header.h" -#include "Panel.h" -#include "Settings.h" -#include "Vector.h" - - -typedef struct ScreenManager_ { - int x1; - int y1; - int x2; - int y2; - Vector* panels; - const char* name; - int panelCount; - Header* header; - const Settings* settings; - State* state; - bool allowFocusChange; -} ScreenManager; - -ScreenManager* ScreenManager_new(Header* header, const Settings* settings, State* state, bool owner); - -void ScreenManager_delete(ScreenManager* this); - -int ScreenManager_size(const ScreenManager* this); - -void ScreenManager_add(ScreenManager* this, Panel* item, int size); - -void ScreenManager_insert(ScreenManager* this, Panel* item, int size, int idx); - -Panel* ScreenManager_remove(ScreenManager* this, int idx); - -void ScreenManager_resize(ScreenManager* this); - -void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey, const char* name); - -#endif diff --git a/fedora/.local/bin/htop-vim/ScreensPanel.c b/fedora/.local/bin/htop-vim/ScreensPanel.c deleted file mode 100644 index cb664ac..0000000 --- a/fedora/.local/bin/htop-vim/ScreensPanel.c +++ /dev/null @@ -1,340 +0,0 @@ -/* -htop - ScreensPanel.c -(C) 2004-2011 Hisham H. Muhammad -(C) 2020-2022 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "ScreensPanel.h" - -#include -#include -#include - -#include "CRT.h" -#include "FunctionBar.h" -#include "Hashtable.h" -#include "ProvideCurses.h" -#include "Settings.h" -#include "XUtils.h" - - -static void ScreenListItem_delete(Object* cast) { - ScreenListItem* this = (ScreenListItem*)cast; - if (this->ss) { - ScreenSettings_delete(this->ss); - } - ListItem_delete(cast); -} - -ObjectClass ScreenListItem_class = { - .extends = Class(ListItem), - .display = ListItem_display, - .delete = ScreenListItem_delete, - .compare = ListItem_compare -}; - -ScreenListItem* ScreenListItem_new(const char* value, ScreenSettings* ss) { - ScreenListItem* this = AllocThis(ScreenListItem); - ListItem_init((ListItem*)this, value, 0); - this->ss = ss; - return this; -} - -static const char* const ScreensFunctions[] = {" ", "Rename", " ", " ", "New ", " ", "MoveUp", "MoveDn", "Remove", "Done ", NULL}; - -static void ScreensPanel_delete(Object* object) { - Panel* super = (Panel*) object; - ScreensPanel* this = (ScreensPanel*) object; - - /* do not delete screen settings still in use */ - int n = Panel_size(super); - for (int i = 0; i < n; i++) { - ScreenListItem* item = (ScreenListItem*) Panel_get(super, i); - item->ss = NULL; - } - - /* during renaming the ListItem's value points to our static buffer */ - if (this->renamingItem) - this->renamingItem->value = this->saved; - - Panel_done(super); - free(this); -} - -static HandlerResult ScreensPanel_eventHandlerRenaming(Panel* super, int ch) { - ScreensPanel* const this = (ScreensPanel*) super; - - if (ch >= 32 && ch < 127 && ch != '=') { - if (this->cursor < SCREEN_NAME_LEN - 1) { - this->buffer[this->cursor] = (char)ch; - this->cursor++; - super->selectedLen = strlen(this->buffer); - Panel_setCursorToSelection(super); - } - } else { - switch (ch) { - case 127: - case KEY_BACKSPACE: - { - if (this->cursor > 0) { - this->cursor--; - this->buffer[this->cursor] = '\0'; - super->selectedLen = strlen(this->buffer); - Panel_setCursorToSelection(super); - } - break; - } - case '\n': - case '\r': - case KEY_ENTER: - { - ListItem* item = (ListItem*) Panel_getSelected(super); - if (!item) - break; - assert(item == this->renamingItem); - free(this->saved); - item->value = xStrdup(this->buffer); - this->renamingItem = NULL; - super->cursorOn = false; - Panel_setSelectionColor(super, PANEL_SELECTION_FOCUS); - ScreensPanel_update(super); - break; - } - case 27: // Esc - { - ListItem* item = (ListItem*) Panel_getSelected(super); - if (!item) - break; - assert(item == this->renamingItem); - item->value = this->saved; - this->renamingItem = NULL; - super->cursorOn = false; - Panel_setSelectionColor(super, PANEL_SELECTION_FOCUS); - break; - } - } - } - return HANDLED; -} - -static void startRenaming(Panel* super) { - ScreensPanel* const this = (ScreensPanel*) super; - - ListItem* item = (ListItem*) Panel_getSelected(super); - if (item == NULL) - return; - this->renamingItem = item; - super->cursorOn = true; - char* name = item->value; - this->saved = name; - strncpy(this->buffer, name, SCREEN_NAME_LEN); - this->buffer[SCREEN_NAME_LEN] = '\0'; - this->cursor = strlen(this->buffer); - item->value = this->buffer; - Panel_setSelectionColor(super, PANEL_EDIT); - super->selectedLen = strlen(this->buffer); - Panel_setCursorToSelection(super); -} - -static void rebuildSettingsArray(Panel* super, int selected) { - ScreensPanel* const this = (ScreensPanel*) super; - - int n = Panel_size(super); - free(this->settings->screens); - this->settings->screens = xMallocArray(n + 1, sizeof(ScreenSettings*)); - this->settings->screens[n] = NULL; - for (int i = 0; i < n; i++) { - ScreenListItem* item = (ScreenListItem*) Panel_get(super, i); - this->settings->screens[i] = item->ss; - } - this->settings->nScreens = n; - /* ensure selection is in valid range */ - if (selected > n - 1) - selected = n - 1; - else if (selected < 0) - selected = 0; - this->settings->ssIndex = selected; - this->settings->ss = this->settings->screens[selected]; -} - -static void addNewScreen(Panel* super) { - ScreensPanel* const this = (ScreensPanel*) super; - - const char* name = "New"; - ScreenSettings* ss = Settings_newScreen(this->settings, &(const ScreenDefaults) { .name = name, .columns = "PID Command", .sortKey = "PID" }); - ScreenListItem* item = ScreenListItem_new(name, ss); - int idx = Panel_getSelectedIndex(super); - Panel_insert(super, idx + 1, (Object*) item); - Panel_setSelected(super, idx + 1); -} - -static HandlerResult ScreensPanel_eventHandlerNormal(Panel* super, int ch) { - ScreensPanel* const this = (ScreensPanel*) super; - - int selected = Panel_getSelectedIndex(super); - ScreenListItem* oldFocus = (ScreenListItem*) Panel_getSelected(super); - bool shouldRebuildArray = false; - HandlerResult result = IGNORED; - switch (ch) { - case '\n': - case '\r': - case KEY_ENTER: - case KEY_MOUSE: - case KEY_RECLICK: - { - this->moving = !(this->moving); - Panel_setSelectionColor(super, this->moving ? PANEL_SELECTION_FOLLOW : PANEL_SELECTION_FOCUS); - ListItem* item = (ListItem*) Panel_getSelected(super); - if (item) - item->moving = this->moving; - result = HANDLED; - break; - } - case EVENT_SET_SELECTED: - result = HANDLED; - break; - case KEY_NPAGE: - case KEY_PPAGE: - case KEY_HOME: - case KEY_END: { - Panel_onKey(super, ch); - break; - } - case KEY_F(2): - case KEY_CTRL('R'): - { - startRenaming(super); - result = HANDLED; - break; - } - case KEY_F(5): - case KEY_CTRL('N'): - { - addNewScreen(super); - startRenaming(super); - shouldRebuildArray = true; - result = HANDLED; - break; - } - case KEY_UP: - { - if (!this->moving) { - Panel_onKey(super, ch); - break; - } - /* else fallthrough */ - } /* FALLTHRU */ - case KEY_F(7): - case '[': - case '-': - { - Panel_moveSelectedUp(super); - shouldRebuildArray = true; - result = HANDLED; - break; - } - case KEY_DOWN: - { - if (!this->moving) { - Panel_onKey(super, ch); - break; - } - /* else fallthrough */ - } /* FALLTHRU */ - case KEY_F(8): - case ']': - case '+': - { - Panel_moveSelectedDown(super); - shouldRebuildArray = true; - result = HANDLED; - break; - } - case KEY_F(9): - //case KEY_DC: - { - if (Panel_size(super) > 1) - Panel_remove(super, selected); - shouldRebuildArray = true; - result = HANDLED; - break; - } - default: - { - if (ch < 255 && isalpha(ch)) - result = Panel_selectByTyping(super, ch); - if (result == BREAK_LOOP) - result = IGNORED; - break; - } - } - ScreenListItem* newFocus = (ScreenListItem*) Panel_getSelected(super); - if (newFocus && oldFocus != newFocus) { - ColumnsPanel_fill(this->columns, newFocus->ss, this->settings->dynamicColumns); - result = HANDLED; - } - if (shouldRebuildArray) - rebuildSettingsArray(super, selected); - if (result == HANDLED) - ScreensPanel_update(super); - return result; -} - -static HandlerResult ScreensPanel_eventHandler(Panel* super, int ch) { - ScreensPanel* const this = (ScreensPanel*) super; - - if (this->renamingItem) { - return ScreensPanel_eventHandlerRenaming(super, ch); - } else { - return ScreensPanel_eventHandlerNormal(super, ch); - } -} - -PanelClass ScreensPanel_class = { - .super = { - .extends = Class(Panel), - .delete = ScreensPanel_delete - }, - .eventHandler = ScreensPanel_eventHandler -}; - -ScreensPanel* ScreensPanel_new(Settings* settings) { - ScreensPanel* this = AllocThis(ScreensPanel); - Panel* super = (Panel*) this; - Hashtable* columns = settings->dynamicColumns; - FunctionBar* fuBar = FunctionBar_new(ScreensFunctions, NULL, NULL); - Panel_init(super, 1, 1, 1, 1, Class(ListItem), true, fuBar); - - this->settings = settings; - this->columns = ColumnsPanel_new(settings->screens[0], columns, &(settings->changed)); - this->moving = false; - this->renamingItem = NULL; - super->cursorOn = false; - this->cursor = 0; - Panel_setHeader(super, "Screens"); - - for (unsigned int i = 0; i < settings->nScreens; i++) { - ScreenSettings* ss = settings->screens[i]; - char* name = ss->name; - Panel_add(super, (Object*) ScreenListItem_new(name, ss)); - } - return this; -} - -void ScreensPanel_update(Panel* super) { - ScreensPanel* this = (ScreensPanel*) super; - int size = Panel_size(super); - this->settings->changed = true; - this->settings->lastUpdate++; - this->settings->screens = xReallocArray(this->settings->screens, size + 1, sizeof(ScreenSettings*)); - for (int i = 0; i < size; i++) { - ScreenListItem* item = (ScreenListItem*) Panel_get(super, i); - ScreenSettings* ss = item->ss; - free(ss->name); - this->settings->screens[i] = ss; - ss->name = xStrdup(((ListItem*) item)->value); - } - this->settings->screens[size] = NULL; -} diff --git a/fedora/.local/bin/htop-vim/ScreensPanel.h b/fedora/.local/bin/htop-vim/ScreensPanel.h deleted file mode 100644 index 88d85b5..0000000 --- a/fedora/.local/bin/htop-vim/ScreensPanel.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef HEADER_ScreensPanel -#define HEADER_ScreensPanel -/* -htop - ScreensPanel.h -(C) 2004-2011 Hisham H. Muhammad -(C) 2020-2022 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include - -#include "ColumnsPanel.h" -#include "ListItem.h" -#include "Object.h" -#include "Panel.h" -#include "ScreenManager.h" -#include "Settings.h" - -#ifndef SCREEN_NAME_LEN -#define SCREEN_NAME_LEN 20 -#endif - -typedef struct ScreensPanel_ { - Panel super; - - ScreenManager* scr; - Settings* settings; - ColumnsPanel* columns; - char buffer[SCREEN_NAME_LEN + 1]; - char* saved; - int cursor; - bool moving; - ListItem *renamingItem; -} ScreensPanel; - -typedef struct ScreenListItem_ { - ListItem super; - ScreenSettings* ss; -} ScreenListItem; - - -extern ObjectClass ScreenListItem_class; - -ScreenListItem* ScreenListItem_new(const char* value, ScreenSettings* ss); - -extern PanelClass ScreensPanel_class; - -ScreensPanel* ScreensPanel_new(Settings* settings); - -void ScreensPanel_update(Panel* super); - -#endif diff --git a/fedora/.local/bin/htop-vim/Settings.c b/fedora/.local/bin/htop-vim/Settings.c deleted file mode 100644 index 8543b9e..0000000 --- a/fedora/.local/bin/htop-vim/Settings.c +++ /dev/null @@ -1,830 +0,0 @@ -/* -htop - Settings.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Settings.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "CRT.h" -#include "DynamicColumn.h" -#include "Macros.h" -#include "Meter.h" -#include "Platform.h" -#include "XUtils.h" - - -/* - -static char** readQuotedList(char* line) { - int n = 0; - char** list = xCalloc(sizeof(char*), 1); - int start = 0; - for (;;) { - while (line[start] && line[start] == ' ') { - start++; - } - if (line[start] != '"') { - break; - } - start++; - int close = start; - while (line[close] && line[close] != '"') { - close++; - } - int len = close - start; - char* item = xMalloc(len + 1); - strncpy(item, line + start, len); - item[len] = '\0'; - list[n] = item; - n++; - list = xRealloc(list, sizeof(char*) * (n + 1)); - start = close + 1; - } - list[n] = NULL; - return list; -} - -static void writeQuotedList(FILE* fd, char** list) { - const char* sep = ""; - for (int i = 0; list[i]; i++) { - fprintf(fd, "%s\"%s\"", sep, list[i]); - sep = " "; - } - fprintf(fd, "\n"); -} - -*/ - -void Settings_delete(Settings* this) { - free(this->filename); - for (unsigned int i = 0; i < HeaderLayout_getColumns(this->hLayout); i++) { - String_freeArray(this->hColumns[i].names); - free(this->hColumns[i].modes); - } - free(this->hColumns); - if (this->screens) { - for (unsigned int i = 0; this->screens[i]; i++) { - ScreenSettings_delete(this->screens[i]); - } - free(this->screens); - } - free(this); -} - -static void Settings_readMeters(Settings* this, const char* line, unsigned int column) { - char* trim = String_trim(line); - char** ids = String_split(trim, ' ', NULL); - free(trim); - column = MINIMUM(column, HeaderLayout_getColumns(this->hLayout) - 1); - this->hColumns[column].names = ids; -} - -static void Settings_readMeterModes(Settings* this, const char* line, unsigned int column) { - char* trim = String_trim(line); - char** ids = String_split(trim, ' ', NULL); - free(trim); - int len = 0; - for (int i = 0; ids[i]; i++) { - len++; - } - column = MINIMUM(column, HeaderLayout_getColumns(this->hLayout) - 1); - this->hColumns[column].len = len; - int* modes = len ? xCalloc(len, sizeof(int)) : NULL; - for (int i = 0; i < len; i++) { - modes[i] = atoi(ids[i]); - } - String_freeArray(ids); - this->hColumns[column].modes = modes; -} - -static bool Settings_validateMeters(Settings* this) { - const size_t colCount = HeaderLayout_getColumns(this->hLayout); - - bool anyMeter = false; - - for (size_t column = 0; column < colCount; column++) { - char** names = this->hColumns[column].names; - const int* modes = this->hColumns[column].modes; - const size_t len = this->hColumns[column].len; - - if (!len) - continue; - - if (!names || !modes) - return false; - - anyMeter |= !!len; - - // Check for each mode there is an entry with a non-NULL name - for (size_t meterIdx = 0; meterIdx < len; meterIdx++) - if (!names[meterIdx]) - return false; - - if (names[len]) - return false; - } - - return anyMeter; -} - -static void Settings_defaultMeters(Settings* this, unsigned int initialCpuCount) { - int sizes[] = { 3, 3 }; - - if (initialCpuCount > 4 && initialCpuCount <= 128) { - sizes[1]++; - } - - // Release any previously allocated memory - for (size_t i = 0; i < HeaderLayout_getColumns(this->hLayout); i++) { - String_freeArray(this->hColumns[i].names); - free(this->hColumns[i].modes); - } - free(this->hColumns); - - this->hLayout = HF_TWO_50_50; - this->hColumns = xCalloc(HeaderLayout_getColumns(this->hLayout), sizeof(MeterColumnSetting)); - for (size_t i = 0; i < 2; i++) { - this->hColumns[i].names = xCalloc(sizes[i] + 1, sizeof(char*)); - this->hColumns[i].modes = xCalloc(sizes[i], sizeof(int)); - this->hColumns[i].len = sizes[i]; - } - - int r = 0; - - if (initialCpuCount > 128) { - // Just show the average, ricers need to config for impressive screenshots - this->hColumns[0].names[0] = xStrdup("CPU"); - this->hColumns[0].modes[0] = BAR_METERMODE; - } else if (initialCpuCount > 32) { - this->hColumns[0].names[0] = xStrdup("LeftCPUs8"); - this->hColumns[0].modes[0] = BAR_METERMODE; - this->hColumns[1].names[r] = xStrdup("RightCPUs8"); - this->hColumns[1].modes[r++] = BAR_METERMODE; - } else if (initialCpuCount > 16) { - this->hColumns[0].names[0] = xStrdup("LeftCPUs4"); - this->hColumns[0].modes[0] = BAR_METERMODE; - this->hColumns[1].names[r] = xStrdup("RightCPUs4"); - this->hColumns[1].modes[r++] = BAR_METERMODE; - } else if (initialCpuCount > 8) { - this->hColumns[0].names[0] = xStrdup("LeftCPUs2"); - this->hColumns[0].modes[0] = BAR_METERMODE; - this->hColumns[1].names[r] = xStrdup("RightCPUs2"); - this->hColumns[1].modes[r++] = BAR_METERMODE; - } else if (initialCpuCount > 4) { - this->hColumns[0].names[0] = xStrdup("LeftCPUs"); - this->hColumns[0].modes[0] = BAR_METERMODE; - this->hColumns[1].names[r] = xStrdup("RightCPUs"); - this->hColumns[1].modes[r++] = BAR_METERMODE; - } else { - this->hColumns[0].names[0] = xStrdup("AllCPUs"); - this->hColumns[0].modes[0] = BAR_METERMODE; - } - this->hColumns[0].names[1] = xStrdup("Memory"); - this->hColumns[0].modes[1] = BAR_METERMODE; - this->hColumns[0].names[2] = xStrdup("Swap"); - this->hColumns[0].modes[2] = BAR_METERMODE; - this->hColumns[1].names[r] = xStrdup("Tasks"); - this->hColumns[1].modes[r++] = TEXT_METERMODE; - this->hColumns[1].names[r] = xStrdup("LoadAverage"); - this->hColumns[1].modes[r++] = TEXT_METERMODE; - this->hColumns[1].names[r] = xStrdup("Uptime"); - this->hColumns[1].modes[r++] = TEXT_METERMODE; -} - -static const char* toFieldName(Hashtable* columns, int id) { - if (id < 0) - return NULL; - if (id >= LAST_PROCESSFIELD) { - const DynamicColumn* column = DynamicColumn_lookup(columns, id); - return column->name; - } - return Process_fields[id].name; -} - -static int toFieldIndex(Hashtable* columns, const char* str) { - if (isdigit(str[0])) { - // This "+1" is for compatibility with the older enum format. - int id = atoi(str) + 1; - if (toFieldName(columns, id)) { - return id; - } - } else { - // Dynamically-defined columns are always stored by-name. - char dynamic[32] = {0}; - if (sscanf(str, "Dynamic(%30s)", dynamic)) { - char* end; - if ((end = strrchr(dynamic, ')')) != NULL) { - bool success; - unsigned int key; - *end = '\0'; - success = DynamicColumn_search(columns, dynamic, &key) != NULL; - *end = ')'; - if (success) - return key; - } - } - // Fallback to iterative scan of table of fields by-name. - for (int p = 1; p < LAST_PROCESSFIELD; p++) { - const char* pName = toFieldName(columns, p); - if (pName && strcmp(pName, str) == 0) - return p; - } - } - return -1; -} - -static void ScreenSettings_readFields(ScreenSettings* ss, Hashtable* columns, const char* line) { - char* trim = String_trim(line); - char** ids = String_split(trim, ' ', NULL); - free(trim); - - /* reset default fields */ - memset(ss->fields, '\0', LAST_PROCESSFIELD * sizeof(ProcessField)); - - for (size_t j = 0, i = 0; ids[i]; i++) { - if (j >= UINT_MAX / sizeof(ProcessField)) - continue; - if (j >= LAST_PROCESSFIELD) { - ss->fields = xRealloc(ss->fields, (j + 1) * sizeof(ProcessField)); - memset(&ss->fields[j], 0, sizeof(ProcessField)); - } - int id = toFieldIndex(columns, ids[i]); - if (id >= 0) - ss->fields[j++] = id; - if (id > 0 && id < LAST_PROCESSFIELD) - ss->flags |= Process_fields[id].flags; - } - String_freeArray(ids); -} - -ScreenSettings* Settings_newScreen(Settings* this, const ScreenDefaults* defaults) { - int sortKey = defaults->sortKey ? toFieldIndex(this->dynamicColumns, defaults->sortKey) : PID; - int sortDesc = (sortKey >= 0 && sortKey < LAST_PROCESSFIELD) ? Process_fields[sortKey].defaultSortDesc : 1; - - ScreenSettings* ss = xMalloc(sizeof(ScreenSettings)); - *ss = (ScreenSettings) { - .name = xStrdup(defaults->name), - .fields = xCalloc(LAST_PROCESSFIELD, sizeof(ProcessField)), - .flags = 0, - .direction = sortDesc ? -1 : 1, - .treeDirection = 1, - .sortKey = sortKey, - .treeSortKey = PID, - .treeView = false, - .treeViewAlwaysByPID = false, - .allBranchesCollapsed = false, - }; - - ScreenSettings_readFields(ss, this->dynamicColumns, defaults->columns); - this->screens[this->nScreens] = ss; - this->nScreens++; - this->screens = xRealloc(this->screens, sizeof(ScreenSettings*) * (this->nScreens + 1)); - this->screens[this->nScreens] = NULL; - return ss; -} - -void ScreenSettings_delete(ScreenSettings* this) { - free(this->name); - free(this->fields); - free(this); -} - -static ScreenSettings* Settings_defaultScreens(Settings* this) { - if (this->nScreens) - return this->screens[0]; - for (unsigned int i = 0; i < Platform_numberOfDefaultScreens; i++) { - const ScreenDefaults* defaults = &Platform_defaultScreens[i]; - Settings_newScreen(this, defaults); - } - return this->screens[0]; -} - -static bool Settings_read(Settings* this, const char* fileName, unsigned int initialCpuCount) { - FILE* fd = fopen(fileName, "r"); - if (!fd) - return false; - - ScreenSettings* screen = NULL; - bool didReadMeters = false; - bool didReadAny = false; - for (;;) { - char* line = String_readLine(fd); - if (!line) { - break; - } - didReadAny = true; - size_t nOptions; - char** option = String_split(line, '=', &nOptions); - free (line); - if (nOptions < 2) { - String_freeArray(option); - continue; - } - if (String_eq(option[0], "config_reader_min_version")) { - this->config_version = atoi(option[1]); - if (this->config_version > CONFIG_READER_MIN_VERSION) { - // the version of the config file on disk is newer than what we can read - fprintf(stderr, "WARNING: %s specifies configuration format\n", fileName); - fprintf(stderr, " version v%d, but this %s binary only supports up to version v%d.\n", this->config_version, PACKAGE, CONFIG_READER_MIN_VERSION); - fprintf(stderr, " The configuration file will be downgraded to v%d when %s exits.\n", CONFIG_READER_MIN_VERSION, PACKAGE); - String_freeArray(option); - fclose(fd); - return false; - } - } else if (String_eq(option[0], "fields") && this->config_version <= 2) { - // old (no screen) naming also supported for backwards compatibility - screen = Settings_defaultScreens(this); - ScreenSettings_readFields(screen, this->dynamicColumns, option[1]); - } else if (String_eq(option[0], "sort_key") && this->config_version <= 2) { - // old (no screen) naming also supported for backwards compatibility - // This "+1" is for compatibility with the older enum format. - screen = Settings_defaultScreens(this); - screen->sortKey = atoi(option[1]) + 1; - } else if (String_eq(option[0], "tree_sort_key") && this->config_version <= 2) { - // old (no screen) naming also supported for backwards compatibility - // This "+1" is for compatibility with the older enum format. - screen = Settings_defaultScreens(this); - screen->treeSortKey = atoi(option[1]) + 1; - } else if (String_eq(option[0], "sort_direction") && this->config_version <= 2) { - // old (no screen) naming also supported for backwards compatibility - screen = Settings_defaultScreens(this); - screen->direction = atoi(option[1]); - } else if (String_eq(option[0], "tree_sort_direction") && this->config_version <= 2) { - // old (no screen) naming also supported for backwards compatibility - screen = Settings_defaultScreens(this); - screen->treeDirection = atoi(option[1]); - } else if (String_eq(option[0], "tree_view") && this->config_version <= 2) { - // old (no screen) naming also supported for backwards compatibility - screen = Settings_defaultScreens(this); - screen->treeView = atoi(option[1]); - } else if (String_eq(option[0], "tree_view_always_by_pid") && this->config_version <= 2) { - // old (no screen) naming also supported for backwards compatibility - screen = Settings_defaultScreens(this); - screen->treeViewAlwaysByPID = atoi(option[1]); - } else if (String_eq(option[0], "all_branches_collapsed") && this->config_version <= 2) { - // old (no screen) naming also supported for backwards compatibility - screen = Settings_defaultScreens(this); - screen->allBranchesCollapsed = atoi(option[1]); - } else if (String_eq(option[0], "hide_kernel_threads")) { - this->hideKernelThreads = atoi(option[1]); - } else if (String_eq(option[0], "hide_userland_threads")) { - this->hideUserlandThreads = atoi(option[1]); - } else if (String_eq(option[0], "hide_running_in_container")) { - this->hideRunningInContainer = atoi(option[1]); - } else if (String_eq(option[0], "shadow_other_users")) { - this->shadowOtherUsers = atoi(option[1]); - } else if (String_eq(option[0], "show_thread_names")) { - this->showThreadNames = atoi(option[1]); - } else if (String_eq(option[0], "show_program_path")) { - this->showProgramPath = atoi(option[1]); - } else if (String_eq(option[0], "highlight_base_name")) { - this->highlightBaseName = atoi(option[1]); - } else if (String_eq(option[0], "highlight_deleted_exe")) { - this->highlightDeletedExe = atoi(option[1]); - } else if (String_eq(option[0], "shadow_distribution_path_prefix")) { - this->shadowDistPathPrefix = atoi(option[1]); - } else if (String_eq(option[0], "highlight_megabytes")) { - this->highlightMegabytes = atoi(option[1]); - } else if (String_eq(option[0], "highlight_threads")) { - this->highlightThreads = atoi(option[1]); - } else if (String_eq(option[0], "highlight_changes")) { - this->highlightChanges = atoi(option[1]); - } else if (String_eq(option[0], "highlight_changes_delay_secs")) { - this->highlightDelaySecs = CLAMP(atoi(option[1]), 1, 24 * 60 * 60); - } else if (String_eq(option[0], "find_comm_in_cmdline")) { - this->findCommInCmdline = atoi(option[1]); - } else if (String_eq(option[0], "strip_exe_from_cmdline")) { - this->stripExeFromCmdline = atoi(option[1]); - } else if (String_eq(option[0], "show_merged_command")) { - this->showMergedCommand = atoi(option[1]); - } else if (String_eq(option[0], "header_margin")) { - this->headerMargin = atoi(option[1]); - } else if (String_eq(option[0], "screen_tabs")) { - this->screenTabs = atoi(option[1]); - } else if (String_eq(option[0], "expand_system_time")) { - // Compatibility option. - this->detailedCPUTime = atoi(option[1]); - } else if (String_eq(option[0], "detailed_cpu_time")) { - this->detailedCPUTime = atoi(option[1]); - } else if (String_eq(option[0], "cpu_count_from_one")) { - this->countCPUsFromOne = atoi(option[1]); - } else if (String_eq(option[0], "cpu_count_from_zero")) { - // old (inverted) naming also supported for backwards compatibility - this->countCPUsFromOne = !atoi(option[1]); - } else if (String_eq(option[0], "show_cpu_usage")) { - this->showCPUUsage = atoi(option[1]); - } else if (String_eq(option[0], "show_cpu_frequency")) { - this->showCPUFrequency = atoi(option[1]); - #ifdef BUILD_WITH_CPU_TEMP - } else if (String_eq(option[0], "show_cpu_temperature")) { - this->showCPUTemperature = atoi(option[1]); - } else if (String_eq(option[0], "degree_fahrenheit")) { - this->degreeFahrenheit = atoi(option[1]); - #endif - } else if (String_eq(option[0], "update_process_names")) { - this->updateProcessNames = atoi(option[1]); - } else if (String_eq(option[0], "account_guest_in_cpu_meter")) { - this->accountGuestInCPUMeter = atoi(option[1]); - } else if (String_eq(option[0], "delay")) { - this->delay = CLAMP(atoi(option[1]), 1, 255); - } else if (String_eq(option[0], "color_scheme")) { - this->colorScheme = atoi(option[1]); - if (this->colorScheme < 0 || this->colorScheme >= LAST_COLORSCHEME) { - this->colorScheme = 0; - } - #ifdef HAVE_GETMOUSE - } else if (String_eq(option[0], "enable_mouse")) { - this->enableMouse = atoi(option[1]); - #endif - } else if (String_eq(option[0], "header_layout")) { - this->hLayout = isdigit((unsigned char)option[1][0]) ? ((HeaderLayout) atoi(option[1])) : HeaderLayout_fromName(option[1]); - if (this->hLayout < 0 || this->hLayout >= LAST_HEADER_LAYOUT) - this->hLayout = HF_TWO_50_50; - free(this->hColumns); - this->hColumns = xCalloc(HeaderLayout_getColumns(this->hLayout), sizeof(MeterColumnSetting)); - } else if (String_eq(option[0], "left_meters")) { - Settings_readMeters(this, option[1], 0); - didReadMeters = true; - } else if (String_eq(option[0], "right_meters")) { - Settings_readMeters(this, option[1], 1); - didReadMeters = true; - } else if (String_eq(option[0], "left_meter_modes")) { - Settings_readMeterModes(this, option[1], 0); - didReadMeters = true; - } else if (String_eq(option[0], "right_meter_modes")) { - Settings_readMeterModes(this, option[1], 1); - didReadMeters = true; - } else if (String_startsWith(option[0], "column_meters_")) { - Settings_readMeters(this, option[1], atoi(option[0] + strlen("column_meters_"))); - didReadMeters = true; - } else if (String_startsWith(option[0], "column_meter_modes_")) { - Settings_readMeterModes(this, option[1], atoi(option[0] + strlen("column_meter_modes_"))); - didReadMeters = true; - } else if (String_eq(option[0], "hide_function_bar")) { - this->hideFunctionBar = atoi(option[1]); - #ifdef HAVE_LIBHWLOC - } else if (String_eq(option[0], "topology_affinity")) { - this->topologyAffinity = !!atoi(option[1]); - #endif - } else if (strncmp(option[0], "screen:", 7) == 0) { - screen = Settings_newScreen(this, &(const ScreenDefaults) { .name = option[0] + 7, .columns = option[1] }); - } else if (String_eq(option[0], ".sort_key")) { - if (screen) { - int key = toFieldIndex(this->dynamicColumns, option[1]); - screen->sortKey = key > 0 ? key : PID; - } - } else if (String_eq(option[0], ".tree_sort_key")) { - if (screen) { - int key = toFieldIndex(this->dynamicColumns, option[1]); - screen->treeSortKey = key > 0 ? key : PID; - } - } else if (String_eq(option[0], ".sort_direction")) { - if (screen) - screen->direction = atoi(option[1]); - } else if (String_eq(option[0], ".tree_sort_direction")) { - if (screen) - screen->treeDirection = atoi(option[1]); - } else if (String_eq(option[0], ".tree_view")) { - if (screen) - screen->treeView = atoi(option[1]); - } else if (String_eq(option[0], ".tree_view_always_by_pid")) { - if (screen) - screen->treeViewAlwaysByPID = atoi(option[1]); - } else if (String_eq(option[0], ".all_branches_collapsed")) { - if (screen) - screen->allBranchesCollapsed = atoi(option[1]); - } - String_freeArray(option); - } - fclose(fd); - if (!didReadMeters || !Settings_validateMeters(this)) - Settings_defaultMeters(this, initialCpuCount); - if (!this->nScreens) - Settings_defaultScreens(this); - return didReadAny; -} - -static void writeFields(FILE* fd, const ProcessField* fields, Hashtable* columns, bool byName, char separator) { - const char* sep = ""; - for (unsigned int i = 0; fields[i]; i++) { - if (fields[i] < LAST_PROCESSFIELD && byName) { - const char* pName = toFieldName(columns, fields[i]); - fprintf(fd, "%s%s", sep, pName); - } else if (fields[i] >= LAST_PROCESSFIELD && byName) { - const char* pName = toFieldName(columns, fields[i]); - fprintf(fd, " Dynamic(%s)", pName); - } else { - // This "-1" is for compatibility with the older enum format. - fprintf(fd, "%s%d", sep, (int) fields[i] - 1); - } - sep = " "; - } - fputc(separator, fd); -} - -static void writeList(FILE* fd, char** list, int len, char separator) { - const char* sep = ""; - for (int i = 0; i < len; i++) { - fprintf(fd, "%s%s", sep, list[i]); - sep = " "; - } - fputc(separator, fd); -} - -static void writeMeters(const Settings* this, FILE* fd, char separator, unsigned int column) { - writeList(fd, this->hColumns[column].names, this->hColumns[column].len, separator); -} - -static void writeMeterModes(const Settings* this, FILE* fd, char separator, unsigned int column) { - const char* sep = ""; - for (size_t i = 0; i < this->hColumns[column].len; i++) { - fprintf(fd, "%s%d", sep, this->hColumns[column].modes[i]); - sep = " "; - } - fputc(separator, fd); -} - -int Settings_write(const Settings* this, bool onCrash) { - FILE* fd; - char separator; - if (onCrash) { - fd = stderr; - separator = ';'; - } else { - fd = fopen(this->filename, "w"); - if (fd == NULL) - return -errno; - separator = '\n'; - } - - #define printSettingInteger(setting_, value_) \ - fprintf(fd, setting_ "=%d%c", (int) (value_), separator) - #define printSettingString(setting_, value_) \ - fprintf(fd, setting_ "=%s%c", value_, separator) - - if (!onCrash) { - fprintf(fd, "# Beware! This file is rewritten by htop when settings are changed in the interface.\n"); - fprintf(fd, "# The parser is also very primitive, and not human-friendly.\n"); - } - printSettingString("htop_version", VERSION); - printSettingInteger("config_reader_min_version", CONFIG_READER_MIN_VERSION); - fprintf(fd, "fields="); writeFields(fd, this->screens[0]->fields, this->dynamicColumns, false, separator); - printSettingInteger("hide_kernel_threads", this->hideKernelThreads); - printSettingInteger("hide_userland_threads", this->hideUserlandThreads); - printSettingInteger("hide_running_in_container", this->hideRunningInContainer); - printSettingInteger("shadow_other_users", this->shadowOtherUsers); - printSettingInteger("show_thread_names", this->showThreadNames); - printSettingInteger("show_program_path", this->showProgramPath); - printSettingInteger("highlight_base_name", this->highlightBaseName); - printSettingInteger("highlight_deleted_exe", this->highlightDeletedExe); - printSettingInteger("shadow_distribution_path_prefix", this->shadowDistPathPrefix); - printSettingInteger("highlight_megabytes", this->highlightMegabytes); - printSettingInteger("highlight_threads", this->highlightThreads); - printSettingInteger("highlight_changes", this->highlightChanges); - printSettingInteger("highlight_changes_delay_secs", this->highlightDelaySecs); - printSettingInteger("find_comm_in_cmdline", this->findCommInCmdline); - printSettingInteger("strip_exe_from_cmdline", this->stripExeFromCmdline); - printSettingInteger("show_merged_command", this->showMergedCommand); - printSettingInteger("header_margin", this->headerMargin); - printSettingInteger("screen_tabs", this->screenTabs); - printSettingInteger("detailed_cpu_time", this->detailedCPUTime); - printSettingInteger("cpu_count_from_one", this->countCPUsFromOne); - printSettingInteger("show_cpu_usage", this->showCPUUsage); - printSettingInteger("show_cpu_frequency", this->showCPUFrequency); - #ifdef BUILD_WITH_CPU_TEMP - printSettingInteger("show_cpu_temperature", this->showCPUTemperature); - printSettingInteger("degree_fahrenheit", this->degreeFahrenheit); - #endif - printSettingInteger("update_process_names", this->updateProcessNames); - printSettingInteger("account_guest_in_cpu_meter", this->accountGuestInCPUMeter); - printSettingInteger("color_scheme", this->colorScheme); - #ifdef HAVE_GETMOUSE - printSettingInteger("enable_mouse", this->enableMouse); - #endif - printSettingInteger("delay", (int) this->delay); - printSettingInteger("hide_function_bar", (int) this->hideFunctionBar); - #ifdef HAVE_LIBHWLOC - printSettingInteger("topology_affinity", this->topologyAffinity); - #endif - - printSettingString("header_layout", HeaderLayout_getName(this->hLayout)); - for (unsigned int i = 0; i < HeaderLayout_getColumns(this->hLayout); i++) { - fprintf(fd, "column_meters_%u=", i); - writeMeters(this, fd, separator, i); - fprintf(fd, "column_meter_modes_%u=", i); - writeMeterModes(this, fd, separator, i); - } - - // Legacy compatibility with older versions of htop - printSettingInteger("tree_view", this->screens[0]->treeView); - // This "-1" is for compatibility with the older enum format. - printSettingInteger("sort_key", this->screens[0]->sortKey - 1); - printSettingInteger("tree_sort_key", this->screens[0]->treeSortKey - 1); - printSettingInteger("sort_direction", this->screens[0]->direction); - printSettingInteger("tree_sort_direction", this->screens[0]->treeDirection); - printSettingInteger("tree_view_always_by_pid", this->screens[0]->treeViewAlwaysByPID); - printSettingInteger("all_branches_collapsed", this->screens[0]->allBranchesCollapsed); - - for (unsigned int i = 0; i < this->nScreens; i++) { - ScreenSettings* ss = this->screens[i]; - fprintf(fd, "screen:%s=", ss->name); - writeFields(fd, ss->fields, this->dynamicColumns, true, separator); - printSettingString(".sort_key", toFieldName(this->dynamicColumns, ss->sortKey)); - printSettingString(".tree_sort_key", toFieldName(this->dynamicColumns, ss->treeSortKey)); - printSettingInteger(".tree_view", ss->treeView); - printSettingInteger(".tree_view_always_by_pid", ss->treeViewAlwaysByPID); - printSettingInteger(".sort_direction", ss->direction); - printSettingInteger(".tree_sort_direction", ss->treeDirection); - printSettingInteger(".all_branches_collapsed", ss->allBranchesCollapsed); - } - - #undef printSettingString - #undef printSettingInteger - - if (onCrash) - return 0; - - int r = 0; - - if (ferror(fd) != 0) - r = (errno != 0) ? -errno : -EBADF; - - if (fclose(fd) != 0) - r = r ? r : -errno; - - return r; -} - -Settings* Settings_new(unsigned int initialCpuCount, Hashtable* dynamicColumns) { - Settings* this = xCalloc(1, sizeof(Settings)); - - this->dynamicColumns = dynamicColumns; - this->hLayout = HF_TWO_50_50; - this->hColumns = xCalloc(HeaderLayout_getColumns(this->hLayout), sizeof(MeterColumnSetting)); - - this->shadowOtherUsers = false; - this->showThreadNames = false; - this->hideKernelThreads = true; - this->hideUserlandThreads = false; - this->hideRunningInContainer = false; - this->highlightBaseName = false; - this->highlightDeletedExe = true; - this->shadowDistPathPrefix = false; - this->highlightMegabytes = true; - this->detailedCPUTime = false; - this->countCPUsFromOne = false; - this->showCPUUsage = true; - this->showCPUFrequency = false; - #ifdef BUILD_WITH_CPU_TEMP - this->showCPUTemperature = false; - this->degreeFahrenheit = false; - #endif - this->updateProcessNames = false; - this->showProgramPath = true; - this->highlightThreads = true; - this->highlightChanges = false; - this->highlightDelaySecs = DEFAULT_HIGHLIGHT_SECS; - this->findCommInCmdline = true; - this->stripExeFromCmdline = true; - this->showMergedCommand = false; - this->hideFunctionBar = 0; - this->headerMargin = true; - #ifdef HAVE_LIBHWLOC - this->topologyAffinity = false; - #endif - - this->screens = xCalloc(Platform_numberOfDefaultScreens * sizeof(ScreenSettings*), 1); - this->nScreens = 0; - - char* legacyDotfile = NULL; - const char* rcfile = getenv("HTOPRC"); - if (rcfile) { - this->filename = xStrdup(rcfile); - } else { - const char* home = getenv("HOME"); - if (!home) { - const struct passwd* pw = getpwuid(getuid()); - home = pw ? pw->pw_dir : ""; - } - const char* xdgConfigHome = getenv("XDG_CONFIG_HOME"); - char* configDir = NULL; - char* htopDir = NULL; - if (xdgConfigHome) { - this->filename = String_cat(xdgConfigHome, "/htop/htoprc"); - configDir = xStrdup(xdgConfigHome); - htopDir = String_cat(xdgConfigHome, "/htop"); - } else { - this->filename = String_cat(home, "/.config/htop/htoprc"); - configDir = String_cat(home, "/.config"); - htopDir = String_cat(home, "/.config/htop"); - } - legacyDotfile = String_cat(home, "/.htoprc"); - (void) mkdir(configDir, 0700); - (void) mkdir(htopDir, 0700); - free(htopDir); - free(configDir); - struct stat st; - int err = lstat(legacyDotfile, &st); - if (err || S_ISLNK(st.st_mode)) { - free(legacyDotfile); - legacyDotfile = NULL; - } - } - this->colorScheme = 0; -#ifdef HAVE_GETMOUSE - this->enableMouse = true; -#endif - this->changed = false; - this->delay = DEFAULT_DELAY; - bool ok = false; - if (legacyDotfile) { - ok = Settings_read(this, legacyDotfile, initialCpuCount); - if (ok) { - // Transition to new location and delete old configuration file - if (Settings_write(this, false) == 0) { - unlink(legacyDotfile); - } - } - free(legacyDotfile); - } - if (!ok) { - ok = Settings_read(this, this->filename, initialCpuCount); - } - if (!ok) { - this->screenTabs = true; - this->changed = true; - ok = Settings_read(this, SYSCONFDIR "/htoprc", initialCpuCount); - } - if (!ok) { - Settings_defaultMeters(this, initialCpuCount); - Settings_defaultScreens(this); - } - - this->ssIndex = 0; - this->ss = this->screens[this->ssIndex]; - - this->lastUpdate = 1; - - return this; -} - -void ScreenSettings_invertSortOrder(ScreenSettings* this) { - int* attr = (this->treeView) ? &(this->treeDirection) : &(this->direction); - *attr = (*attr == 1) ? -1 : 1; -} - -void ScreenSettings_setSortKey(ScreenSettings* this, ProcessField sortKey) { - if (this->treeViewAlwaysByPID || !this->treeView) { - this->sortKey = sortKey; - this->direction = (Process_fields[sortKey].defaultSortDesc) ? -1 : 1; - this->treeView = false; - } else { - this->treeSortKey = sortKey; - this->treeDirection = (Process_fields[sortKey].defaultSortDesc) ? -1 : 1; - } -} - -static bool readonly = false; - -void Settings_enableReadonly(void) { - readonly = true; -} - -bool Settings_isReadonly(void) { - return readonly; -} - -void Settings_setHeaderLayout(Settings* this, HeaderLayout hLayout) { - unsigned int oldColumns = HeaderLayout_getColumns(this->hLayout); - unsigned int newColumns = HeaderLayout_getColumns(hLayout); - - if (newColumns > oldColumns) { - this->hColumns = xReallocArray(this->hColumns, newColumns, sizeof(MeterColumnSetting)); - memset(this->hColumns + oldColumns, 0, (newColumns - oldColumns) * sizeof(MeterColumnSetting)); - } else if (newColumns < oldColumns) { - for (unsigned int i = newColumns; i < oldColumns; i++) { - if (this->hColumns[i].names) { - for (size_t j = 0; j < this->hColumns[i].len; j++) - free(this->hColumns[i].names[j]); - free(this->hColumns[i].names); - } - free(this->hColumns[i].modes); - } - this->hColumns = xReallocArray(this->hColumns, newColumns, sizeof(MeterColumnSetting)); - } - - this->hLayout = hLayout; - this->changed = true; -} diff --git a/fedora/.local/bin/htop-vim/Settings.h b/fedora/.local/bin/htop-vim/Settings.h deleted file mode 100644 index baf05da..0000000 --- a/fedora/.local/bin/htop-vim/Settings.h +++ /dev/null @@ -1,136 +0,0 @@ -#ifndef HEADER_Settings -#define HEADER_Settings -/* -htop - Settings.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include -#include - -#include "Hashtable.h" -#include "HeaderLayout.h" -#include "Process.h" - - -#define DEFAULT_DELAY 15 - -#define CONFIG_READER_MIN_VERSION 3 - -typedef struct { - const char* name; - const char* columns; - const char* sortKey; -} ScreenDefaults; - -typedef struct { - size_t len; - char** names; - int* modes; -} MeterColumnSetting; - -typedef struct { - char* name; - ProcessField* fields; - uint32_t flags; - int direction; - int treeDirection; - ProcessField sortKey; - ProcessField treeSortKey; - bool treeView; - bool treeViewAlwaysByPID; - bool allBranchesCollapsed; -} ScreenSettings; - -typedef struct Settings_ { - char* filename; - int config_version; - HeaderLayout hLayout; - MeterColumnSetting* hColumns; - Hashtable* dynamicColumns; - - ScreenSettings** screens; - unsigned int nScreens; - unsigned int ssIndex; - ScreenSettings* ss; - - int colorScheme; - int delay; - - bool countCPUsFromOne; - bool detailedCPUTime; - bool showCPUUsage; - bool showCPUFrequency; - #ifdef BUILD_WITH_CPU_TEMP - bool showCPUTemperature; - bool degreeFahrenheit; - #endif - bool showProgramPath; - bool shadowOtherUsers; - bool showThreadNames; - bool hideKernelThreads; - bool hideRunningInContainer; - bool hideUserlandThreads; - bool highlightBaseName; - bool highlightDeletedExe; - bool shadowDistPathPrefix; - bool highlightMegabytes; - bool highlightThreads; - bool highlightChanges; - int highlightDelaySecs; - bool findCommInCmdline; - bool stripExeFromCmdline; - bool showMergedCommand; - bool updateProcessNames; - bool accountGuestInCPUMeter; - bool headerMargin; - bool screenTabs; - #ifdef HAVE_GETMOUSE - bool enableMouse; - #endif - int hideFunctionBar; // 0 - off, 1 - on ESC until next input, 2 - permanently - #ifdef HAVE_LIBHWLOC - bool topologyAffinity; - #endif - - bool changed; - uint64_t lastUpdate; -} Settings; - -#define Settings_cpuId(settings, cpu) ((settings)->countCPUsFromOne ? (cpu)+1 : (cpu)) - -static inline ProcessField ScreenSettings_getActiveSortKey(const ScreenSettings* this) { - return (this->treeView) - ? (this->treeViewAlwaysByPID ? PID : this->treeSortKey) - : this->sortKey; -} - -static inline int ScreenSettings_getActiveDirection(const ScreenSettings* this) { - return this->treeView ? this->treeDirection : this->direction; -} - -void Settings_delete(Settings* this); - -int Settings_write(const Settings* this, bool onCrash); - -Settings* Settings_new(unsigned int initialCpuCount, Hashtable* dynamicColumns); - -ScreenSettings* Settings_newScreen(Settings* this, const ScreenDefaults* defaults); - -void ScreenSettings_delete(ScreenSettings* this); - -void ScreenSettings_invertSortOrder(ScreenSettings* this); - -void ScreenSettings_setSortKey(ScreenSettings* this, ProcessField sortKey); - -void Settings_enableReadonly(void); - -bool Settings_isReadonly(void); - -void Settings_setHeaderLayout(Settings* this, HeaderLayout hLayout); - -#endif diff --git a/fedora/.local/bin/htop-vim/SignalsPanel.c b/fedora/.local/bin/htop-vim/SignalsPanel.c deleted file mode 100644 index 7e21ce9..0000000 --- a/fedora/.local/bin/htop-vim/SignalsPanel.c +++ /dev/null @@ -1,48 +0,0 @@ -/* -htop - SignalsPanel.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "SignalsPanel.h" -// the above contains #include so do not add that here again (breaks Solaris build) - -#include - -#include "FunctionBar.h" -#include "ListItem.h" -#include "Object.h" -#include "Panel.h" -#include "Platform.h" -#include "XUtils.h" - - -Panel* SignalsPanel_new(int preSelectedSignal) { - Panel* this = Panel_new(1, 1, 1, 1, Class(ListItem), true, FunctionBar_newEnterEsc("Send ", "Cancel ")); - int defaultPosition = 15; - unsigned int i; - for (i = 0; i < Platform_numberOfSignals; i++) { - Panel_set(this, i, (Object*) ListItem_new(Platform_signals[i].name, Platform_signals[i].number)); - // signal 15 is not always the 15th signal in the table - if (Platform_signals[i].number == preSelectedSignal) { - defaultPosition = i; - } - } - #if (defined(SIGRTMIN) && defined(SIGRTMAX)) - if (SIGRTMAX - SIGRTMIN <= 100) { - static char buf[16]; - for (int sig = SIGRTMIN; sig <= SIGRTMAX; i++, sig++) { - int n = sig - SIGRTMIN; - xSnprintf(buf, sizeof(buf), "%2d SIGRTMIN%-+3d", sig, n); - if (n == 0) { - buf[11] = '\0'; - } - Panel_set(this, i, (Object*) ListItem_new(buf, sig)); - } - } - #endif - Panel_setHeader(this, "Send signal:"); - Panel_setSelected(this, defaultPosition); - return this; -} diff --git a/fedora/.local/bin/htop-vim/SignalsPanel.h b/fedora/.local/bin/htop-vim/SignalsPanel.h deleted file mode 100644 index 529043a..0000000 --- a/fedora/.local/bin/htop-vim/SignalsPanel.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef HEADER_SignalsPanel -#define HEADER_SignalsPanel -/* -htop - SignalsPanel.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#ifndef HTOP_SOLARIS -#include -#endif - -#include "Panel.h" - - -typedef struct SignalItem_ { - const char* name; - int number; -} SignalItem; - -#define SIGNALSPANEL_INITSELECTEDSIGNAL SIGTERM - -Panel* SignalsPanel_new(int preSelectedSignal); - -#endif diff --git a/fedora/.local/bin/htop-vim/SwapMeter.c b/fedora/.local/bin/htop-vim/SwapMeter.c deleted file mode 100644 index c0f4820..0000000 --- a/fedora/.local/bin/htop-vim/SwapMeter.c +++ /dev/null @@ -1,73 +0,0 @@ -/* -htop - SwapMeter.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "SwapMeter.h" - -#include -#include - -#include "CRT.h" -#include "Object.h" -#include "Platform.h" -#include "RichString.h" - - -static const int SwapMeter_attributes[] = { - SWAP, - SWAP_CACHE -}; - -static void SwapMeter_updateValues(Meter* this) { - char* buffer = this->txtBuffer; - size_t size = sizeof(this->txtBuffer); - int written; - - this->values[1] = NAN; /* 'cached' not present on all platforms */ - Platform_setSwapValues(this); - - written = Meter_humanUnit(buffer, this->values[0], size); - METER_BUFFER_CHECK(buffer, size, written); - - METER_BUFFER_APPEND_CHR(buffer, size, '/'); - - Meter_humanUnit(buffer, this->total, size); -} - -static void SwapMeter_display(const Object* cast, RichString* out) { - char buffer[50]; - const Meter* this = (const Meter*)cast; - RichString_writeAscii(out, CRT_colors[METER_TEXT], ":"); - Meter_humanUnit(buffer, this->total, sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_VALUE], buffer); - Meter_humanUnit(buffer, this->values[SWAP_METER_USED], sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " used:"); - RichString_appendAscii(out, CRT_colors[METER_VALUE], buffer); - - if (!isnan(this->values[SWAP_METER_CACHE])) { - Meter_humanUnit(buffer, this->values[SWAP_METER_CACHE], sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " cache:"); - RichString_appendAscii(out, CRT_colors[SWAP_CACHE], buffer); - } -} - -const MeterClass SwapMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = SwapMeter_display, - }, - .updateValues = SwapMeter_updateValues, - .defaultMode = BAR_METERMODE, - .maxItems = 2, - .total = 100.0, - .attributes = SwapMeter_attributes, - .name = "Swap", - .uiName = "Swap", - .caption = "Swp" -}; diff --git a/fedora/.local/bin/htop-vim/SwapMeter.h b/fedora/.local/bin/htop-vim/SwapMeter.h deleted file mode 100644 index b71e83f..0000000 --- a/fedora/.local/bin/htop-vim/SwapMeter.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef HEADER_SwapMeter -#define HEADER_SwapMeter -/* -htop - SwapMeter.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Meter.h" - -typedef enum { - SWAP_METER_USED = 0, - SWAP_METER_CACHE = 1, - SWAP_METER_ITEMCOUNT = 2, // number of entries in this enum -} SwapMeterValues; - -extern const MeterClass SwapMeter_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/SysArchMeter.c b/fedora/.local/bin/htop-vim/SysArchMeter.c deleted file mode 100644 index 1985caa..0000000 --- a/fedora/.local/bin/htop-vim/SysArchMeter.c +++ /dev/null @@ -1,44 +0,0 @@ -/* -htop - SysArchMeter.c -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "SysArchMeter.h" - -#include - -#include "CRT.h" -#include "Object.h" -#include "Platform.h" -#include "XUtils.h" - - -static const int SysArchMeter_attributes[] = {HOSTNAME}; - -static void SysArchMeter_updateValues(Meter* this) { - static char* string; - - if (string == NULL) - Platform_getRelease(&string); - - String_safeStrncpy(this->txtBuffer, string, sizeof(this->txtBuffer)); -} - -const MeterClass SysArchMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete - }, - .updateValues = SysArchMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 0, - .total = 100.0, - .attributes = SysArchMeter_attributes, - .name = "System", - .uiName = "System", - .caption = "System: ", -}; diff --git a/fedora/.local/bin/htop-vim/SysArchMeter.h b/fedora/.local/bin/htop-vim/SysArchMeter.h deleted file mode 100644 index 50b3869..0000000 --- a/fedora/.local/bin/htop-vim/SysArchMeter.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef HEADER_SysArchMeter -#define HEADER_SysArchMeter -/* -htop - SysArchMeter.h -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ -#include "Meter.h" - - -extern const MeterClass SysArchMeter_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/TESTPLAN b/fedora/.local/bin/htop-vim/TESTPLAN deleted file mode 100644 index 88fe039..0000000 --- a/fedora/.local/bin/htop-vim/TESTPLAN +++ /dev/null @@ -1,156 +0,0 @@ - -Main screen: - - For all views, all modes: - - Mouse click header - nothing happens. - - Mouse click on ProcessList title bar - exit Tree view, update FunctionBar, title bar updates, sort by clicked field. -*** FAILING: wrong FB update depending on mode; does not change sort in wip branch - click on same entry - invert sort. - click on another entry - sort another field. - - Mouse click on a process - select that process. - - for each entry in FunctionBar: - Mouse click entry - perform action of associated key. - - In Normal mode, Sorted view: - - <+> or <-> - do nothing. - - - enter SortBy screen. - - In Normal mode, Tree view: - - select process - update F6 in FunctionBar if subtree is collapsed or expanded. - - , <+> or <-> - expand/collapse subtree. - - In Normal mode, either Sorted or Tree view: - - , - activate Search mode. - - , <\> - activate Filter mode. - - , <]> - as root only, decrease process NICE value. - - , <[> - increase process NICE value. - - - enter Affinity screen. - - - do nothing. - - - select process and all its children. - - , , , - do nothing. - - , , - enter Help screen. - - - on Linux, enter IOPriority screen. - - - do nothing. - - , - enter Kill screen. - - - enter LSOF screen. - - , , - do nothing. - -

- enter Sorted view, update function bar, sort by CPU%. - - , - do nothing. - - - enter Sorted view, update function bar, sort by TIME. - - - untag all processes. - - , , , , - do nothing. - - <<>, <>>, <,>, <.> - enter SortBy screen. - - space - tag current process, move down cursor. - - numbers - incremental PID search. - - In Search mode: - - TODO - - In Filter mode: - - TODO - -Setup screen: - - TODO - -SortBy screen: - - TODO - -User screen: - - TODO - -Kill screen: - - TODO - -Affinity screen: - - TODO - -Help screen: - - any key - back to Main screen. - -IOPriority screen: - - TODO - -STrace screen: - - TODO - -LSOF screen: - - TODO diff --git a/fedora/.local/bin/htop-vim/TasksMeter.c b/fedora/.local/bin/htop-vim/TasksMeter.c deleted file mode 100644 index 64c9837..0000000 --- a/fedora/.local/bin/htop-vim/TasksMeter.c +++ /dev/null @@ -1,76 +0,0 @@ -/* -htop - TasksMeter.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "TasksMeter.h" - -#include "CRT.h" -#include "Macros.h" -#include "Object.h" -#include "ProcessList.h" -#include "RichString.h" -#include "Settings.h" -#include "XUtils.h" - - -static const int TasksMeter_attributes[] = { - CPU_SYSTEM, - PROCESS_THREAD, - PROCESS, - TASKS_RUNNING -}; - -static void TasksMeter_updateValues(Meter* this) { - const ProcessList* pl = this->pl; - this->values[0] = pl->kernelThreads; - this->values[1] = pl->userlandThreads; - this->values[2] = pl->totalTasks - pl->kernelThreads - pl->userlandThreads; - this->values[3] = MINIMUM(pl->runningTasks, pl->activeCPUs); - this->total = pl->totalTasks; - - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%u/%u", MINIMUM(pl->runningTasks, pl->activeCPUs), pl->totalTasks); -} - -static void TasksMeter_display(const Object* cast, RichString* out) { - const Meter* this = (const Meter*)cast; - const Settings* settings = this->pl->settings; - char buffer[20]; - int len; - - len = xSnprintf(buffer, sizeof(buffer), "%d", (int)this->values[2]); - RichString_appendnAscii(out, CRT_colors[METER_VALUE], buffer, len); - - RichString_appendAscii(out, settings->hideUserlandThreads ? CRT_colors[METER_SHADOW] : CRT_colors[METER_TEXT], ", "); - len = xSnprintf(buffer, sizeof(buffer), "%d", (int)this->values[1]); - RichString_appendnAscii(out, settings->hideUserlandThreads ? CRT_colors[METER_SHADOW] : CRT_colors[TASKS_RUNNING], buffer, len); - RichString_appendAscii(out, settings->hideUserlandThreads ? CRT_colors[METER_SHADOW] : CRT_colors[METER_TEXT], " thr"); - - RichString_appendAscii(out, settings->hideKernelThreads ? CRT_colors[METER_SHADOW] : CRT_colors[METER_TEXT], ", "); - len = xSnprintf(buffer, sizeof(buffer), "%d", (int)this->values[0]); - RichString_appendnAscii(out, settings->hideKernelThreads ? CRT_colors[METER_SHADOW] : CRT_colors[TASKS_RUNNING], buffer, len); - RichString_appendAscii(out, settings->hideKernelThreads ? CRT_colors[METER_SHADOW] : CRT_colors[METER_TEXT], " kthr"); - - RichString_appendAscii(out, CRT_colors[METER_TEXT], "; "); - len = xSnprintf(buffer, sizeof(buffer), "%d", (int)this->values[3]); - RichString_appendnAscii(out, CRT_colors[TASKS_RUNNING], buffer, len); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " running"); -} - -const MeterClass TasksMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = TasksMeter_display, - }, - .updateValues = TasksMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 4, - .total = 100.0, - .attributes = TasksMeter_attributes, - .name = "Tasks", - .uiName = "Task counter", - .caption = "Tasks: " -}; diff --git a/fedora/.local/bin/htop-vim/TasksMeter.h b/fedora/.local/bin/htop-vim/TasksMeter.h deleted file mode 100644 index 9f9ba63..0000000 --- a/fedora/.local/bin/htop-vim/TasksMeter.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef HEADER_TasksMeter -#define HEADER_TasksMeter -/* -htop - TasksMeter.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Meter.h" - - -extern const MeterClass TasksMeter_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/TraceScreen.c b/fedora/.local/bin/htop-vim/TraceScreen.c deleted file mode 100644 index 2aa0781..0000000 --- a/fedora/.local/bin/htop-vim/TraceScreen.c +++ /dev/null @@ -1,193 +0,0 @@ -/* -htop - TraceScreen.c -(C) 2005-2006 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "TraceScreen.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "CRT.h" -#include "FunctionBar.h" -#include "Panel.h" -#include "ProvideCurses.h" -#include "XUtils.h" - - -static const char* const TraceScreenFunctions[] = {"Search ", "Filter ", "AutoScroll ", "Stop Tracing ", "Done ", NULL}; - -static const char* const TraceScreenKeys[] = {"F3", "F4", "F8", "F9", "Esc"}; - -static const int TraceScreenEvents[] = {KEY_F(3), KEY_F(4), KEY_F(8), KEY_F(9), 27}; - -TraceScreen* TraceScreen_new(const Process* process) { - // This initializes all TraceScreen variables to "false" so only default = true ones need to be set below - TraceScreen* this = xCalloc(1, sizeof(TraceScreen)); - Object_setClass(this, Class(TraceScreen)); - this->tracing = true; - FunctionBar* fuBar = FunctionBar_new(TraceScreenFunctions, TraceScreenKeys, TraceScreenEvents); - CRT_disableDelay(); - return (TraceScreen*) InfoScreen_init(&this->super, process, fuBar, LINES - 2, " "); -} - -void TraceScreen_delete(Object* cast) { - TraceScreen* this = (TraceScreen*) cast; - if (this->child > 0) { - kill(this->child, SIGTERM); - while (waitpid(this->child, NULL, 0) == -1) - if (errno != EINTR) - break; - } - - if (this->strace) { - fclose(this->strace); - } - - CRT_enableDelay(); - free(InfoScreen_done((InfoScreen*)this)); -} - -static void TraceScreen_draw(InfoScreen* this) { - InfoScreen_drawTitled(this, "Trace of process %d - %s", this->process->pid, Process_getCommand(this->process)); -} - -bool TraceScreen_forkTracer(TraceScreen* this) { - int fdpair[2] = {0, 0}; - - if (pipe(fdpair) == -1) - return false; - - if (fcntl(fdpair[0], F_SETFL, O_NONBLOCK) < 0) - goto err; - - if (fcntl(fdpair[1], F_SETFL, O_NONBLOCK) < 0) - goto err; - - pid_t child = fork(); - if (child == -1) - goto err; - - if (child == 0) { - close(fdpair[0]); - - dup2(fdpair[1], STDOUT_FILENO); - dup2(fdpair[1], STDERR_FILENO); - close(fdpair[1]); - - char buffer[32] = {0}; - xSnprintf(buffer, sizeof(buffer), "%d", this->super.process->pid); - // Use of NULL in variadic functions must have a pointer cast. - // The NULL constant is not required by standard to have a pointer type. - execlp("strace", "strace", "-T", "-tt", "-s", "512", "-p", buffer, (char *)NULL); - - // Should never reach here, unless execlp fails ... - const char* message = "Could not execute 'strace'. Please make sure it is available in your $PATH."; - (void)! write(STDERR_FILENO, message, strlen(message)); - - exit(127); - } - - FILE* fd = fdopen(fdpair[0], "r"); - if (!fd) - goto err; - - close(fdpair[1]); - - this->child = child; - this->strace = fd; - return true; - -err: - close(fdpair[1]); - close(fdpair[0]); - return false; -} - -static void TraceScreen_updateTrace(InfoScreen* super) { - TraceScreen* this = (TraceScreen*) super; - char buffer[1025]; - - int fd_strace = fileno(this->strace); - assert(fd_strace != -1); - - fd_set fds; - FD_ZERO(&fds); -// FD_SET(STDIN_FILENO, &fds); - FD_SET(fd_strace, &fds); - - struct timeval tv = { .tv_sec = 0, .tv_usec = 500 }; - int ready = select(fd_strace + 1, &fds, NULL, NULL, &tv); - - size_t nread = 0; - if (ready > 0 && FD_ISSET(fd_strace, &fds)) - nread = fread(buffer, 1, sizeof(buffer) - 1, this->strace); - - if (nread && this->tracing) { - const char* line = buffer; - buffer[nread] = '\0'; - for (size_t i = 0; i < nread; i++) { - if (buffer[i] == '\n') { - buffer[i] = '\0'; - if (this->contLine) { - InfoScreen_appendLine(&this->super, line); - this->contLine = false; - } else { - InfoScreen_addLine(&this->super, line); - } - line = buffer + i + 1; - } - } - if (line < buffer + nread) { - InfoScreen_addLine(&this->super, line); - buffer[nread] = '\0'; - this->contLine = true; - } - if (this->follow) { - Panel_setSelected(this->super.display, Panel_size(this->super.display) - 1); - } - } -} - -static bool TraceScreen_onKey(InfoScreen* super, int ch) { - TraceScreen* this = (TraceScreen*) super; - switch (ch) { - case 'f': - case KEY_F(8): - this->follow = !(this->follow); - if (this->follow) - Panel_setSelected(super->display, Panel_size(super->display) - 1); - return true; - case 't': - case KEY_F(9): - this->tracing = !this->tracing; - FunctionBar_setLabel(super->display->defaultBar, KEY_F(9), this->tracing ? "Stop Tracing " : "Resume Tracing "); - InfoScreen_draw(this); - return true; - } - this->follow = false; - return false; -} - -const InfoScreenClass TraceScreen_class = { - .super = { - .extends = Class(Object), - .delete = TraceScreen_delete - }, - .draw = TraceScreen_draw, - .onErr = TraceScreen_updateTrace, - .onKey = TraceScreen_onKey, -}; diff --git a/fedora/.local/bin/htop-vim/TraceScreen.h b/fedora/.local/bin/htop-vim/TraceScreen.h deleted file mode 100644 index 7b2101e..0000000 --- a/fedora/.local/bin/htop-vim/TraceScreen.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef HEADER_TraceScreen -#define HEADER_TraceScreen -/* -htop - TraceScreen.h -(C) 2005-2006 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include -#include - -#include "InfoScreen.h" -#include "Object.h" -#include "Process.h" - - -typedef struct TraceScreen_ { - InfoScreen super; - bool tracing; - pid_t child; - FILE* strace; - bool contLine; - bool follow; -} TraceScreen; - - -extern const InfoScreenClass TraceScreen_class; - -TraceScreen* TraceScreen_new(const Process* process); - -void TraceScreen_delete(Object* cast); - -bool TraceScreen_forkTracer(TraceScreen* this); - -#endif diff --git a/fedora/.local/bin/htop-vim/UptimeMeter.c b/fedora/.local/bin/htop-vim/UptimeMeter.c deleted file mode 100644 index d4b3175..0000000 --- a/fedora/.local/bin/htop-vim/UptimeMeter.c +++ /dev/null @@ -1,60 +0,0 @@ -/* -htop - UptimeMeter.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "UptimeMeter.h" - -#include "CRT.h" -#include "Object.h" -#include "Platform.h" -#include "XUtils.h" - - -static const int UptimeMeter_attributes[] = { - UPTIME -}; - -static void UptimeMeter_updateValues(Meter* this) { - int totalseconds = Platform_getUptime(); - if (totalseconds <= 0) { - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "(unknown)"); - return; - } - int seconds = totalseconds % 60; - int minutes = (totalseconds / 60) % 60; - int hours = (totalseconds / 3600) % 24; - int days = (totalseconds / 86400); - this->values[0] = days; - if (days > this->total) { - this->total = days; - } - char daysbuf[32]; - if (days > 100) { - xSnprintf(daysbuf, sizeof(daysbuf), "%d days(!), ", days); - } else if (days > 1) { - xSnprintf(daysbuf, sizeof(daysbuf), "%d days, ", days); - } else if (days == 1) { - xSnprintf(daysbuf, sizeof(daysbuf), "1 day, "); - } else { - daysbuf[0] = '\0'; - } - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%s%02d:%02d:%02d", daysbuf, hours, minutes, seconds); -} - -const MeterClass UptimeMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete - }, - .updateValues = UptimeMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 1, - .total = 100.0, - .attributes = UptimeMeter_attributes, - .name = "Uptime", - .uiName = "Uptime", - .caption = "Uptime: " -}; diff --git a/fedora/.local/bin/htop-vim/UptimeMeter.h b/fedora/.local/bin/htop-vim/UptimeMeter.h deleted file mode 100644 index 5a852ad..0000000 --- a/fedora/.local/bin/htop-vim/UptimeMeter.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef HEADER_UptimeMeter -#define HEADER_UptimeMeter -/* -htop - UptimeMeter.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Meter.h" - - -extern const MeterClass UptimeMeter_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/UsersTable.c b/fedora/.local/bin/htop-vim/UsersTable.c deleted file mode 100644 index 6586a4b..0000000 --- a/fedora/.local/bin/htop-vim/UsersTable.c +++ /dev/null @@ -1,46 +0,0 @@ -/* -htop - UsersTable.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "UsersTable.h" - -#include -#include -#include -#include - -#include "XUtils.h" - - -UsersTable* UsersTable_new(void) { - UsersTable* this; - this = xMalloc(sizeof(UsersTable)); - this->users = Hashtable_new(10, true); - return this; -} - -void UsersTable_delete(UsersTable* this) { - Hashtable_delete(this->users); - free(this); -} - -char* UsersTable_getRef(UsersTable* this, unsigned int uid) { - char* name = Hashtable_get(this->users, uid); - if (name == NULL) { - const struct passwd* userData = getpwuid(uid); - if (userData != NULL) { - name = xStrdup(userData->pw_name); - Hashtable_put(this->users, uid, name); - } - } - return name; -} - -inline void UsersTable_foreach(UsersTable* this, Hashtable_PairFunction f, void* userData) { - Hashtable_foreach(this->users, f, userData); -} diff --git a/fedora/.local/bin/htop-vim/UsersTable.h b/fedora/.local/bin/htop-vim/UsersTable.h deleted file mode 100644 index ecfd214..0000000 --- a/fedora/.local/bin/htop-vim/UsersTable.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef HEADER_UsersTable -#define HEADER_UsersTable -/* -htop - UsersTable.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Hashtable.h" - - -typedef struct UsersTable_ { - Hashtable* users; -} UsersTable; - -UsersTable* UsersTable_new(void); - -void UsersTable_delete(UsersTable* this); - -char* UsersTable_getRef(UsersTable* this, unsigned int uid); - -void UsersTable_foreach(UsersTable* this, Hashtable_PairFunction f, void* userData); - -#endif diff --git a/fedora/.local/bin/htop-vim/Vector.c b/fedora/.local/bin/htop-vim/Vector.c deleted file mode 100644 index eddbc9a..0000000 --- a/fedora/.local/bin/htop-vim/Vector.c +++ /dev/null @@ -1,407 +0,0 @@ -/* -htop - Vector.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Vector.h" - -#include -#include -#include - -#include "XUtils.h" - - -Vector* Vector_new(const ObjectClass* type, bool owner, int size) { - Vector* this; - - if (size == DEFAULT_SIZE) { - size = 10; - } - - assert(size > 0); - this = xMalloc(sizeof(Vector)); - this->growthRate = size; - this->array = (Object**) xCalloc(size, sizeof(Object*)); - this->arraySize = size; - this->items = 0; - this->type = type; - this->owner = owner; - this->dirty_index = -1; - this->dirty_count = 0; - return this; -} - -void Vector_delete(Vector* this) { - if (this->owner) { - for (int i = 0; i < this->items; i++) { - if (this->array[i]) { - Object_delete(this->array[i]); - } - } - } - free(this->array); - free(this); -} - -static inline bool Vector_isDirty(const Vector* this) { - if (this->dirty_count > 0) { - assert(0 <= this->dirty_index && this->dirty_index < this->items); - assert(this->dirty_count <= this->items); - return true; - } - assert(this->dirty_index == -1); - return false; -} - -#ifndef NDEBUG - -static bool Vector_isConsistent(const Vector* this) { - assert(this->items <= this->arraySize); - assert(!Vector_isDirty(this)); - - if (this->owner) { - for (int i = 0; i < this->items; i++) { - if (!this->array[i]) { - return false; - } - } - } - - return true; -} - -bool Vector_countEquals(const Vector* this, unsigned int expectedCount) { - unsigned int n = 0; - for (int i = 0; i < this->items; i++) { - if (this->array[i]) { - n++; - } - } - return n == expectedCount; -} - -Object* Vector_get(const Vector* this, int idx) { - assert(idx >= 0 && idx < this->items); - assert(this->array[idx]); - assert(Object_isA(this->array[idx], this->type)); - return this->array[idx]; -} - -int Vector_size(const Vector* this) { - assert(Vector_isConsistent(this)); - return this->items; -} - -#endif /* NDEBUG */ - -void Vector_prune(Vector* this) { - assert(Vector_isConsistent(this)); - if (this->owner) { - for (int i = 0; i < this->items; i++) { - if (this->array[i]) { - Object_delete(this->array[i]); - this->array[i] = NULL; - } - } - } - this->items = 0; - this->dirty_index = -1; - this->dirty_count = 0; -} - -//static int comparisons = 0; - -static void swap(Object** array, int indexA, int indexB) { - assert(indexA >= 0); - assert(indexB >= 0); - Object* tmp = array[indexA]; - array[indexA] = array[indexB]; - array[indexB] = tmp; -} - -static int partition(Object** array, int left, int right, int pivotIndex, Object_Compare compare) { - const Object* pivotValue = array[pivotIndex]; - swap(array, pivotIndex, right); - int storeIndex = left; - for (int i = left; i < right; i++) { - //comparisons++; - if (compare(array[i], pivotValue) <= 0) { - swap(array, i, storeIndex); - storeIndex++; - } - } - swap(array, storeIndex, right); - return storeIndex; -} - -static void quickSort(Object** array, int left, int right, Object_Compare compare) { - if (left >= right) - return; - - int pivotIndex = (left + right) / 2; - int pivotNewIndex = partition(array, left, right, pivotIndex, compare); - quickSort(array, left, pivotNewIndex - 1, compare); - quickSort(array, pivotNewIndex + 1, right, compare); -} - -// If I were to use only one sorting algorithm for both cases, it would probably be this one: -/* - -static void combSort(Object** array, int left, int right, Object_Compare compare) { - int gap = right - left; - bool swapped = true; - while ((gap > 1) || swapped) { - if (gap > 1) { - gap = (int)((double)gap / 1.247330950103979); - } - swapped = false; - for (int i = left; gap + i <= right; i++) { - comparisons++; - if (compare(array[i], array[i+gap]) > 0) { - swap(array, i, i+gap); - swapped = true; - } - } - } -} - -*/ - -static void insertionSort(Object** array, int left, int right, Object_Compare compare) { - for (int i = left + 1; i <= right; i++) { - Object* t = array[i]; - int j = i - 1; - while (j >= left) { - //comparisons++; - if (compare(array[j], t) <= 0) - break; - - array[j + 1] = array[j]; - j--; - } - array[j + 1] = t; - } -} - -void Vector_quickSortCustomCompare(Vector* this, Object_Compare compare) { - assert(compare); - assert(Vector_isConsistent(this)); - quickSort(this->array, 0, this->items - 1, compare); - assert(Vector_isConsistent(this)); -} - -void Vector_insertionSort(Vector* this) { - assert(this->type->compare); - assert(Vector_isConsistent(this)); - insertionSort(this->array, 0, this->items - 1, this->type->compare); - assert(Vector_isConsistent(this)); -} - -static void Vector_checkArraySize(Vector* this) { - assert(Vector_isConsistent(this)); - if (this->items >= this->arraySize) { - //int i; - //i = this->arraySize; - this->arraySize = this->items + this->growthRate; - this->array = (Object**) xRealloc(this->array, sizeof(Object*) * this->arraySize); - //for (; i < this->arraySize; i++) - // this->array[i] = NULL; - } - assert(Vector_isConsistent(this)); -} - -void Vector_insert(Vector* this, int idx, void* data_) { - Object* data = data_; - assert(idx >= 0); - assert(Object_isA(data, this->type)); - assert(Vector_isConsistent(this)); - - if (idx > this->items) { - idx = this->items; - } - - Vector_checkArraySize(this); - //assert(this->array[this->items] == NULL); - if (idx < this->items) { - memmove(&this->array[idx + 1], &this->array[idx], (this->items - idx) * sizeof(this->array[0])); - } - this->array[idx] = data; - this->items++; - assert(Vector_isConsistent(this)); -} - -Object* Vector_take(Vector* this, int idx) { - assert(idx >= 0 && idx < this->items); - assert(Vector_isConsistent(this)); - Object* removed = this->array[idx]; - assert(removed); - this->items--; - if (idx < this->items) { - memmove(&this->array[idx], &this->array[idx + 1], (this->items - idx) * sizeof(this->array[0])); - } - //this->array[this->items] = NULL; - assert(Vector_isConsistent(this)); - return removed; -} - -Object* Vector_remove(Vector* this, int idx) { - Object* removed = Vector_take(this, idx); - if (this->owner) { - Object_delete(removed); - return NULL; - } else { - return removed; - } -} - -Object* Vector_softRemove(Vector* this, int idx) { - assert(idx >= 0 && idx < this->items); - - Object* removed = this->array[idx]; - assert(removed); - if (removed) { - this->array[idx] = NULL; - - this->dirty_count++; - if (this->dirty_index < 0 || idx < this->dirty_index) { - this->dirty_index = idx; - } - - if (this->owner) { - Object_delete(removed); - return NULL; - } - } - - return removed; -} - -void Vector_compact(Vector* this) { - if (!Vector_isDirty(this)) { - return; - } - - const int size = this->items; - assert(0 <= this->dirty_index && this->dirty_index < size); - assert(this->array[this->dirty_index] == NULL); - - int idx = this->dirty_index; - - /* one deletion: use memmove, which should be faster */ - if (this->dirty_count == 1) { - memmove(&this->array[idx], &this->array[idx + 1], (this->items - idx - 1) * sizeof(this->array[0])); - } else { - /* multiple deletions */ - for (int i = idx + 1; i < size; i++) { - if (this->array[i]) { - this->array[idx++] = this->array[i]; - } - } - } - - this->items -= this->dirty_count; - this->dirty_index = -1; - this->dirty_count = 0; - - assert(Vector_isConsistent(this)); -} - -void Vector_moveUp(Vector* this, int idx) { - assert(idx >= 0 && idx < this->items); - assert(Vector_isConsistent(this)); - - if (idx == 0) - return; - - Object* temp = this->array[idx]; - this->array[idx] = this->array[idx - 1]; - this->array[idx - 1] = temp; -} - -void Vector_moveDown(Vector* this, int idx) { - assert(idx >= 0 && idx < this->items); - assert(Vector_isConsistent(this)); - - if (idx == this->items - 1) - return; - - Object* temp = this->array[idx]; - this->array[idx] = this->array[idx + 1]; - this->array[idx + 1] = temp; -} - -void Vector_set(Vector* this, int idx, void* data_) { - Object* data = data_; - assert(idx >= 0); - assert(Object_isA(data, this->type)); - assert(Vector_isConsistent(this)); - - Vector_checkArraySize(this); - if (idx >= this->items) { - this->items = idx + 1; - } else { - if (this->owner) { - Object* removed = this->array[idx]; - assert (removed != NULL); - Object_delete(removed); - } - } - this->array[idx] = data; - assert(Vector_isConsistent(this)); -} - -/* - -static void Vector_merge(Vector* this, Vector* v2) { - int i; - assert(Vector_isConsistent(this)); - - for (i = 0; i < v2->items; i++) - Vector_add(this, v2->array[i]); - v2->items = 0; - Vector_delete(v2); - assert(Vector_isConsistent(this)); -} - -*/ - -void Vector_add(Vector* this, void* data_) { - Object* data = data_; - assert(Object_isA(data, this->type)); - assert(Vector_isConsistent(this)); - int i = this->items; - Vector_set(this, this->items, data); - assert(this->items == i + 1); (void)(i); - assert(Vector_isConsistent(this)); -} - -int Vector_indexOf(const Vector* this, const void* search_, Object_Compare compare) { - const Object* search = search_; - assert(Object_isA(search, this->type)); - assert(compare); - assert(Vector_isConsistent(this)); - for (int i = 0; i < this->items; i++) { - const Object* o = this->array[i]; - assert(o); - if (compare(search, o) == 0) { - return i; - } - } - return -1; -} - -void Vector_splice(Vector* this, Vector* from) { - assert(Vector_isConsistent(this)); - assert(Vector_isConsistent(from)); - assert(!(this->owner && from->owner)); - - int olditems = this->items; - this->items += from->items; - Vector_checkArraySize(this); - for (int j = 0; j < from->items; j++) { - this->array[olditems + j] = from->array[j]; - } -} diff --git a/fedora/.local/bin/htop-vim/Vector.h b/fedora/.local/bin/htop-vim/Vector.h deleted file mode 100644 index b7b3903..0000000 --- a/fedora/.local/bin/htop-vim/Vector.h +++ /dev/null @@ -1,99 +0,0 @@ -#ifndef HEADER_Vector -#define HEADER_Vector -/* -htop - Vector.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Object.h" - -#include - - -#ifndef DEFAULT_SIZE -#define DEFAULT_SIZE (-1) -#endif - -typedef struct Vector_ { - Object** array; - const ObjectClass* type; - int arraySize; - int growthRate; - int items; - /* lowest index of a pending soft remove/delete operation, - used to speed up compaction */ - int dirty_index; - /* count of soft deletes, required for Vector_count to work in debug mode */ - int dirty_count; - bool owner; -} Vector; - -Vector* Vector_new(const ObjectClass* type, bool owner, int size); - -void Vector_delete(Vector* this); - -void Vector_prune(Vector* this); - -void Vector_quickSortCustomCompare(Vector* this, Object_Compare compare); -static inline void Vector_quickSort(Vector* this) { - Vector_quickSortCustomCompare(this, this->type->compare); -} - -void Vector_insertionSort(Vector* this); - -void Vector_insert(Vector* this, int idx, void* data_); - -Object* Vector_take(Vector* this, int idx); - -Object* Vector_remove(Vector* this, int idx); - -/* Vector_softRemove marks the item at index idx for deletion without - reclaiming any space. If owned, the item is immediately freed. - - Vector_compact must be called to reclaim space.*/ -Object* Vector_softRemove(Vector* this, int idx); - -/* Vector_compact reclaims space free'd up by Vector_softRemove, if any. */ -void Vector_compact(Vector* this); - -void Vector_moveUp(Vector* this, int idx); - -void Vector_moveDown(Vector* this, int idx); - -void Vector_set(Vector* this, int idx, void* data_); - -#ifndef NDEBUG - -Object* Vector_get(const Vector* this, int idx); -int Vector_size(const Vector* this); - -/* Vector_countEquals returns true if the number of non-NULL items - in the Vector is equal to expectedCount. This is only for debugging - and consistency checks. */ -bool Vector_countEquals(const Vector* this, unsigned int expectedCount); - -#else /* NDEBUG */ - -static inline Object* Vector_get(const Vector* this, int idx) { - return this->array[idx]; -} - -static inline int Vector_size(const Vector* this) { - return this->items; -} - -#endif /* NDEBUG */ - -static inline const ObjectClass* Vector_type(const Vector* this) { - return this->type; -} - -void Vector_add(Vector* this, void* data_); - -int Vector_indexOf(const Vector* this, const void* search_, Object_Compare compare); - -void Vector_splice(Vector* this, Vector* from); - -#endif diff --git a/fedora/.local/bin/htop-vim/XUtils.c b/fedora/.local/bin/htop-vim/XUtils.c deleted file mode 100644 index 6a021f3..0000000 --- a/fedora/.local/bin/htop-vim/XUtils.c +++ /dev/null @@ -1,338 +0,0 @@ -/* -htop - StringUtils.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "XUtils.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "CRT.h" - - -void fail(void) { - CRT_done(); - abort(); - - _exit(1); // Should never reach here -} - -void* xMalloc(size_t size) { - assert(size > 0); - void* data = malloc(size); - if (!data) { - fail(); - } - return data; -} - -void* xMallocArray(size_t nmemb, size_t size) { - assert(nmemb > 0); - assert(size > 0); - if (SIZE_MAX / nmemb < size) { - fail(); - } - return xMalloc(nmemb * size); -} - -void* xCalloc(size_t nmemb, size_t size) { - assert(nmemb > 0); - assert(size > 0); - if (SIZE_MAX / nmemb < size) { - fail(); - } - void* data = calloc(nmemb, size); - if (!data) { - fail(); - } - return data; -} - -void* xRealloc(void* ptr, size_t size) { - assert(size > 0); - void* data = realloc(ptr, size); // deepcode ignore MemoryLeakOnRealloc: this goes to fail() - if (!data) { - free(ptr); - fail(); - } - return data; -} - -void* xReallocArray(void* ptr, size_t nmemb, size_t size) { - assert(nmemb > 0); - assert(size > 0); - if (SIZE_MAX / nmemb < size) { - fail(); - } - return xRealloc(ptr, nmemb * size); -} - -void* xReallocArrayZero(void* ptr, size_t prevmemb, size_t newmemb, size_t size) { - assert((ptr == NULL) == (prevmemb == 0)); - - if (prevmemb == newmemb) { - return ptr; - } - - void* ret = xReallocArray(ptr, newmemb, size); - - if (newmemb > prevmemb) { - memset((unsigned char*)ret + prevmemb * size, '\0', (newmemb - prevmemb) * size); - } - - return ret; -} - -inline bool String_contains_i(const char* s1, const char* s2, bool multi) { - // we have a multi-string search term, handle as special case for performance reasons - if (multi && strstr(s2, "|")) { - size_t nNeedles; - char** needles = String_split(s2, '|', &nNeedles); - for (size_t i = 0; i < nNeedles; i++) { - if (strcasestr(s1, needles[i]) != NULL) { - String_freeArray(needles); - return true; - } - } - String_freeArray(needles); - return false; - } else { - return strcasestr(s1, s2) != NULL; - } -} - -char* String_cat(const char* s1, const char* s2) { - const size_t l1 = strlen(s1); - const size_t l2 = strlen(s2); - if (SIZE_MAX - l1 <= l2) { - fail(); - } - char* out = xMalloc(l1 + l2 + 1); - memcpy(out, s1, l1); - memcpy(out + l1, s2, l2); - out[l1 + l2] = '\0'; - return out; -} - -char* String_trim(const char* in) { - while (in[0] == ' ' || in[0] == '\t' || in[0] == '\n') { - in++; - } - - size_t len = strlen(in); - while (len > 0 && (in[len - 1] == ' ' || in[len - 1] == '\t' || in[len - 1] == '\n')) { - len--; - } - - return xStrndup(in, len); -} - -char** String_split(const char* s, char sep, size_t* n) { - const size_t rate = 10; - char** out = xCalloc(rate, sizeof(char*)); - size_t ctr = 0; - size_t blocks = rate; - const char* where; - while ((where = strchr(s, sep)) != NULL) { - size_t size = (size_t)(where - s); - out[ctr] = xStrndup(s, size); - ctr++; - if (ctr == blocks) { - blocks += rate; - out = (char**) xRealloc(out, sizeof(char*) * blocks); - } - s += size + 1; - } - if (s[0] != '\0') { - out[ctr] = xStrdup(s); - ctr++; - } - out = xRealloc(out, sizeof(char*) * (ctr + 1)); - out[ctr] = NULL; - - if (n) - *n = ctr; - - return out; -} - -void String_freeArray(char** s) { - if (!s) { - return; - } - for (size_t i = 0; s[i] != NULL; i++) { - free(s[i]); - } - free(s); -} - -char* String_readLine(FILE* fd) { - const size_t step = 1024; - size_t bufSize = step; - char* buffer = xMalloc(step + 1); - char* at = buffer; - for (;;) { - const char* ok = fgets(at, step + 1, fd); - if (!ok) { - free(buffer); - return NULL; - } - char* newLine = strrchr(at, '\n'); - if (newLine) { - *newLine = '\0'; - return buffer; - } else { - if (feof(fd)) { - return buffer; - } - } - bufSize += step; - buffer = xRealloc(buffer, bufSize + 1); - at = buffer + bufSize - step; - } -} - -size_t String_safeStrncpy(char* restrict dest, const char* restrict src, size_t size) { - assert(size > 0); - - size_t i = 0; - for (; i < size - 1 && src[i]; i++) - dest[i] = src[i]; - - dest[i] = '\0'; - - return i; -} - -int xAsprintf(char** strp, const char* fmt, ...) { - va_list vl; - va_start(vl, fmt); - int r = vasprintf(strp, fmt, vl); - va_end(vl); - - if (r < 0 || !*strp) { - fail(); - } - - return r; -} - -int xSnprintf(char* buf, size_t len, const char* fmt, ...) { - va_list vl; - va_start(vl, fmt); - int n = vsnprintf(buf, len, fmt, vl); - va_end(vl); - - if (n < 0 || (size_t)n >= len) { - fail(); - } - - return n; -} - -char* xStrdup(const char* str) { - char* data = strdup(str); - if (!data) { - fail(); - } - return data; -} - -void free_and_xStrdup(char** ptr, const char* str) { - if (*ptr && String_eq(*ptr, str)) - return; - - free(*ptr); - *ptr = xStrdup(str); -} - -char* xStrndup(const char* str, size_t len) { - char* data = strndup(str, len); - if (!data) { - fail(); - } - return data; -} - -static ssize_t readfd_internal(int fd, void* buffer, size_t count) { - if (!count) { - close(fd); - return -EINVAL; - } - - ssize_t alreadyRead = 0; - count--; // reserve one for null-terminator - - for (;;) { - ssize_t res = read(fd, buffer, count); - if (res == -1) { - if (errno == EINTR) - continue; - - close(fd); - return -errno; - } - - if (res > 0) { - buffer = ((char*)buffer) + res; - count -= (size_t)res; - alreadyRead += res; - } - - if (count == 0 || res == 0) { - close(fd); - *((char*)buffer) = '\0'; - return alreadyRead; - } - } -} - -ssize_t xReadfile(const char* pathname, void* buffer, size_t count) { - int fd = open(pathname, O_RDONLY); - if (fd < 0) - return -errno; - - return readfd_internal(fd, buffer, count); -} - -ssize_t xReadfileat(openat_arg_t dirfd, const char* pathname, void* buffer, size_t count) { - int fd = Compat_openat(dirfd, pathname, O_RDONLY); - if (fd < 0) - return -errno; - - return readfd_internal(fd, buffer, count); -} - -ssize_t full_write(int fd, const void* buf, size_t count) { - ssize_t written = 0; - - while (count > 0) { - ssize_t r = write(fd, buf, count); - if (r < 0) { - if (errno == EINTR) - continue; - - return r; - } - - if (r == 0) - break; - - written += r; - buf = (const unsigned char*)buf + r; - count -= (size_t)r; - } - - return written; -} diff --git a/fedora/.local/bin/htop-vim/XUtils.h b/fedora/.local/bin/htop-vim/XUtils.h deleted file mode 100644 index e1c50be..0000000 --- a/fedora/.local/bin/htop-vim/XUtils.h +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef HEADER_XUtils -#define HEADER_XUtils -/* -htop - StringUtils.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include -#include -#include // IWYU pragma: keep -#include // IWYU pragma: keep - -#include "Compat.h" -#include "Macros.h" - - -void fail(void) ATTR_NORETURN; - -void* xMalloc(size_t size) ATTR_ALLOC_SIZE1(1) ATTR_MALLOC; - -void* xMallocArray(size_t nmemb, size_t size) ATTR_ALLOC_SIZE2(1, 2) ATTR_MALLOC; - -void* xCalloc(size_t nmemb, size_t size) ATTR_ALLOC_SIZE2(1, 2) ATTR_MALLOC; - -void* xRealloc(void* ptr, size_t size) ATTR_ALLOC_SIZE1(2); - -void* xReallocArray(void* ptr, size_t nmemb, size_t size) ATTR_ALLOC_SIZE2(2, 3); - -void* xReallocArrayZero(void* ptr, size_t prevmemb, size_t newmemb, size_t size) ATTR_ALLOC_SIZE2(3, 4); - -/* - * String_startsWith gives better performance if strlen(match) can be computed - * at compile time (e.g. when they are immutable string literals). :) - */ -static inline bool String_startsWith(const char* s, const char* match) { - return strncmp(s, match, strlen(match)) == 0; -} - -bool String_contains_i(const char* s1, const char* s2, bool multi); - -static inline bool String_eq(const char* s1, const char* s2) { - return strcmp(s1, s2) == 0; -} - -char* String_cat(const char* s1, const char* s2) ATTR_MALLOC; - -char* String_trim(const char* in) ATTR_MALLOC; - -char** String_split(const char* s, char sep, size_t* n); - -void String_freeArray(char** s); - -char* String_readLine(FILE* fd) ATTR_MALLOC; - -/* Always null-terminates dest. Caller must pass a strictly positive size. */ -size_t String_safeStrncpy(char* restrict dest, const char* restrict src, size_t size); - -ATTR_FORMAT(printf, 2, 3) -int xAsprintf(char** strp, const char* fmt, ...); - -ATTR_FORMAT(printf, 3, 4) -int xSnprintf(char* buf, size_t len, const char* fmt, ...); - -char* xStrdup(const char* str) ATTR_NONNULL ATTR_MALLOC; -void free_and_xStrdup(char** ptr, const char* str); - -char* xStrndup(const char* str, size_t len) ATTR_NONNULL ATTR_MALLOC; - -ssize_t xReadfile(const char* pathname, void* buffer, size_t count); -ssize_t xReadfileat(openat_arg_t dirfd, const char* pathname, void* buffer, size_t count); - -ssize_t full_write(int fd, const void* buf, size_t count); - -#endif diff --git a/fedora/.local/bin/htop-vim/autogen.sh b/fedora/.local/bin/htop-vim/autogen.sh deleted file mode 100755 index fb38e5e..0000000 --- a/fedora/.local/bin/htop-vim/autogen.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -autoreconf --force --install --verbose -Wall diff --git a/fedora/.local/bin/htop-vim/configure.ac b/fedora/.local/bin/htop-vim/configure.ac deleted file mode 100644 index 73a8e91..0000000 --- a/fedora/.local/bin/htop-vim/configure.ac +++ /dev/null @@ -1,779 +0,0 @@ -# -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. - -# ---------------------------------------------------------------------- -# Autoconf initialization. -# ---------------------------------------------------------------------- - -AC_PREREQ([2.69]) -AC_INIT([htop], [3.3.0-dev], [htop@groups.io], [], [https://htop.dev/]) - -AC_CONFIG_SRCDIR([htop.c]) -AC_CONFIG_AUX_DIR([build-aux]) -AC_CONFIG_HEADERS([config.h]) - -AC_CANONICAL_HOST -AM_INIT_AUTOMAKE([-Wall std-options subdir-objects]) - -# ---------------------------------------------------------------------- - - -# ---------------------------------------------------------------------- -# Checks for platform. -# ---------------------------------------------------------------------- - -case "$host_os" in -linux*|gnu*) - my_htop_platform=linux - AC_DEFINE([HTOP_LINUX], [], [Building for Linux.]) - ;; -freebsd*|kfreebsd*) - my_htop_platform=freebsd - AC_DEFINE([HTOP_FREEBSD], [], [Building for FreeBSD.]) - ;; -netbsd*) - my_htop_platform=netbsd - AC_DEFINE([HTOP_NETBSD], [], [Building for NetBSD.]) - ;; -openbsd*) - my_htop_platform=openbsd - AC_DEFINE([HTOP_OPENBSD], [], [Building for OpenBSD.]) - ;; -dragonfly*) - my_htop_platform=dragonflybsd - AC_DEFINE([HTOP_DRAGONFLYBSD], [], [Building for DragonFlyBSD.]) - ;; -darwin*) - my_htop_platform=darwin - AC_DEFINE([HTOP_DARWIN], [], [Building for Darwin.]) - ;; -solaris*) - my_htop_platform=solaris - AC_DEFINE([HTOP_SOLARIS], [], [Building for Solaris.]) - ;; -*) - my_htop_platform=unsupported - AC_DEFINE([HTOP_UNSUPPORTED], [], [Building for an unsupported platform.]) - ;; -esac - -# Enable extensions, required by hwloc scripts -AC_USE_SYSTEM_EXTENSIONS - -# ---------------------------------------------------------------------- - - -# ---------------------------------------------------------------------- -# Checks for compiler. -# ---------------------------------------------------------------------- - -AC_PROG_CC -AM_PROG_CC_C_O -m4_version_prereq([2.70], [], [AC_PROG_CC_C99]) -AS_IF([test "x$ac_cv_prog_cc_c99" = xno], [AC_MSG_ERROR([htop is written in C99. A newer compiler is required.])]) - -# ---------------------------------------------------------------------- - - -# ---------------------------------------------------------------------- -# Checks for static build. -# ---------------------------------------------------------------------- - -AC_ARG_ENABLE([static], - [AS_HELP_STRING([--enable-static], - [build a static htop binary @<:@default=no@:>@])], - [], - [enable_static=no]) -case "$enable_static" in - no) - ;; - yes) - AC_DEFINE([BUILD_STATIC], [1], [Define if building static binary.]) - CFLAGS="$CFLAGS -static" - LDFLAGS="$LDFLAGS -static" - ;; - *) - AC_MSG_ERROR([bad value '$enable_static' for --enable-static option]) - ;; -esac - -# ---------------------------------------------------------------------- - -# ---------------------------------------------------------------------- -# Checks for a PCP-based htop build. (https://pcp.io) -# ---------------------------------------------------------------------- - -AC_ARG_ENABLE([pcp], - [AS_HELP_STRING([--enable-pcp], - [build a pcp-htop binary @<:@default=no@:>@])], - [], - [enable_pcp=no]) -case "$enable_pcp" in - no) - ;; - yes) - AC_CHECK_HEADERS([pcp/pmapi.h], [my_htop_platform=pcp], - [AC_MSG_ERROR([can not find PCP header file])]) - AC_SEARCH_LIBS([pmNewContext], [pcp], [], [AC_MSG_ERROR([can not find PCP library])]) - AC_DEFINE([HTOP_PCP], [1], [Define if building pcp-htop binary.]) - AC_CONFIG_FILES([pcp-htop.5]) - ;; - *) - AC_MSG_ERROR([bad value '$enable_pcp' for --enable-pcp option]) - ;; -esac - -# ---------------------------------------------------------------------- - - -# ---------------------------------------------------------------------- -# Checks for generic header files. -# ---------------------------------------------------------------------- - -AC_HEADER_DIRENT -m4_version_prereq([2.70], [AC_CHECK_INCLUDES_DEFAULT], [AC_HEADER_STDC]) -AC_CHECK_HEADERS([ \ - stdlib.h \ - string.h \ - strings.h \ - sys/param.h \ - sys/time.h \ - sys/utsname.h \ - unistd.h - ], [], [AC_MSG_ERROR([can not find required generic header files])]) - -AC_HEADER_MAJOR -dnl glibc 2.25 deprecates 'major' and 'minor' in and requires to -dnl include . However the logic in AC_HEADER_MAJOR has not yet -dnl been updated in Autoconf 2.69, so use a workaround: -m4_version_prereq([2.70], [], -[if test "x$ac_cv_header_sys_mkdev_h" != xyes; then - AC_CHECK_HEADER([sys/sysmacros.h], [AC_DEFINE([MAJOR_IN_SYSMACROS], [1], - [Define to 1 if `major', `minor', and `makedev' are declared in .])]) -fi]) - -# Optional Section - -AC_CHECK_HEADERS([execinfo.h]) - -if test "$my_htop_platform" = darwin; then - AC_CHECK_HEADERS([mach/mach_time.h]) -fi - -# ---------------------------------------------------------------------- - - -# ---------------------------------------------------------------------- -# Checks for typedefs, structures, and compiler characteristics. -# ---------------------------------------------------------------------- - -AC_TYPE_PID_T -AC_TYPE_UID_T -AC_TYPE_UINT8_T -AC_TYPE_UINT16_T -AC_TYPE_UINT32_T -AC_TYPE_UINT64_T - -AC_MSG_CHECKING(for alloc_size) -old_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wno-error -Werror=attributes" -AC_COMPILE_IFELSE([ - AC_LANG_SOURCE( - [ - __attribute__((alloc_size(1))) char* my_alloc(int size) { return 0; } - ],[] - )], - AC_DEFINE([HAVE_ATTR_ALLOC_SIZE], 1, [The alloc_size attribute is supported.]) - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no)) -CFLAGS="$old_CFLAGS" - -AC_MSG_CHECKING(for NaN support) -AC_RUN_IFELSE([ - AC_LANG_PROGRAM( - [[ - #include - ]], - [[ - double x = NAN; return !isnan(x); - ]] - )], - [AC_MSG_RESULT(yes)], - [ - AC_MSG_RESULT(no) - AC_MSG_WARN([Compiler does not respect NaN, some functionality might break; consider using '-fno-finite-math-only']) - ], - [AC_MSG_RESULT(skipped)]) - -# ---------------------------------------------------------------------- - - -# ---------------------------------------------------------------------- -# Checks for generic library functions. -# ---------------------------------------------------------------------- - -AC_SEARCH_LIBS([ceil], [m], [], [AC_MSG_ERROR([can not find required function ceil()])]) - -if test "$my_htop_platform" = dragonflybsd; then - AC_SEARCH_LIBS([kvm_open], [kvm], [], [AC_MSG_ERROR([can not find required function kvm_open()])]) -fi - -if test "$my_htop_platform" = freebsd; then - if test "$enable_static" = yes; then - AC_SEARCH_LIBS([elf_version], [elf], [], [AC_MSG_ERROR([can not find required function elf_version()])]) - fi - AC_SEARCH_LIBS([kvm_open], [kvm], [], [AC_MSG_ERROR([can not find required function kvm_open()])]) - AC_SEARCH_LIBS([devstat_checkversion], [devstat], [], [AC_MSG_ERROR([can not find required function devstat_checkversion()])]) -fi - -if test "$my_htop_platform" = linux; then - if test "$enable_static" != yes; then - AC_SEARCH_LIBS([dlopen], [dl dld], [], [AC_MSG_ERROR([can not find required function dlopen()])]) - fi -fi - -if test "$my_htop_platform" = netbsd; then - AC_SEARCH_LIBS([kvm_open], [kvm], [], [AC_MSG_ERROR([can not find required function kvm_open()])]) - AC_SEARCH_LIBS([prop_dictionary_get], [prop], [], [AC_MSG_ERROR([can not find required function prop_dictionary_get()])]) -fi - -if test "$my_htop_platform" = openbsd; then - AC_SEARCH_LIBS([kvm_open], [kvm], [], [AC_MSG_ERROR([can not find required function kvm_open()])]) -fi - -if test "$my_htop_platform" = solaris; then - AC_SEARCH_LIBS([kstat_open], [kstat], [], [AC_MSG_ERROR([can not find required function kstat_open()])]) - AC_SEARCH_LIBS([Pgrab_error], [proc], [], [AC_MSG_ERROR([can not find required function Pgrab_error()])]) - AC_SEARCH_LIBS([free], [malloc], [], [AC_MSG_ERROR([can not find required function free()])]) -fi - -# Optional Section - -AC_SEARCH_LIBS([clock_gettime], [rt]) - -AC_CHECK_FUNCS([ \ - clock_gettime \ - dladdr \ - faccessat \ - fstatat \ - host_get_clock_service \ - memfd_create\ - openat \ - readlinkat \ - sched_getscheduler \ - sched_setscheduler \ - ]) - -if test "$my_htop_platform" = darwin; then - AC_CHECK_FUNCS([mach_timebase_info]) -fi - -if test "$my_htop_platform" = pcp; then - AC_CHECK_FUNCS([pmLookupDescs]) -fi - -if test "$my_htop_platform" = linux && test "x$enable_static" = xyes; then - AC_CHECK_LIB([systemd], [sd_bus_open_system]) -fi - -# ---------------------------------------------------------------------- - - -# ---------------------------------------------------------------------- -# Checks for cross-platform features and flags. -# ---------------------------------------------------------------------- - -# HTOP_CHECK_SCRIPT(LIBNAME, FUNCTION, DEFINE, CONFIG_SCRIPT, ELSE_PART) -m4_define([HTOP_CHECK_SCRIPT], -[ - if test ! -z "m4_toupper($HTOP_[$1]_CONFIG_SCRIPT)"; then - # to be used to set the path to ncurses*-config when cross-compiling - htop_config_script_libs=$(m4_toupper($HTOP_[$1]_CONFIG_SCRIPT) --libs 2> /dev/null) - htop_config_script_cflags=$(m4_toupper($HTOP_[$1]_CONFIG_SCRIPT) --cflags 2> /dev/null) - else - htop_config_script_libs=$([$4] --libs 2> /dev/null) - htop_config_script_cflags=$([$4] --cflags 2> /dev/null) - fi - htop_script_success=no - htop_save_CFLAGS="$CFLAGS" - if test ! "x$htop_config_script_libs" = x; then - CFLAGS="$htop_config_script_cflags $CFLAGS" - AC_CHECK_LIB([$1], [$2], [ - AC_DEFINE([$3], 1, [The library is present.]) - LIBS="$htop_config_script_libs $LIBS " - htop_script_success=yes - ], [ - CFLAGS="$htop_save_CFLAGS" - ], [ - $htop_config_script_libs - ]) - fi - if test "x$htop_script_success" = xno; then - [$5] - fi -]) - -# HTOP_CHECK_LIB(LIBNAME, FUNCTION, DEFINE, ELSE_PART) -m4_define([HTOP_CHECK_LIB], -[ - AC_CHECK_LIB([$1], [$2], [ - AC_DEFINE([$3], [1], [The library is present.]) - LIBS="-l[$1] $LIBS " - ], [$4]) -]) - -AC_ARG_ENABLE([unicode], - [AS_HELP_STRING([--enable-unicode], - [enable Unicode support @<:@default=yes@:>@])], - [], - [enable_unicode=yes]) -if test "x$enable_unicode" = xyes; then - HTOP_CHECK_SCRIPT([ncursesw6], [waddwstr], [HAVE_LIBNCURSESW], "ncursesw6-config", - HTOP_CHECK_SCRIPT([ncursesw], [waddwstr], [HAVE_LIBNCURSESW], "ncursesw6-config", - HTOP_CHECK_SCRIPT([ncursesw], [wadd_wch], [HAVE_LIBNCURSESW], "ncursesw5-config", - HTOP_CHECK_SCRIPT([ncurses], [wadd_wch], [HAVE_LIBNCURSESW], "ncurses5-config", - HTOP_CHECK_LIB([ncursesw6], [addnwstr], [HAVE_LIBNCURSESW], - HTOP_CHECK_LIB([ncursesw], [addnwstr], [HAVE_LIBNCURSESW], - HTOP_CHECK_LIB([ncurses], [addnwstr], [HAVE_LIBNCURSESW], - AC_MSG_ERROR([can not find required library libncursesw; you may want to use --disable-unicode]) - ))))))) - - AC_CHECK_HEADERS([ncursesw/curses.h], [], - [AC_CHECK_HEADERS([ncurses/ncurses.h], [], - [AC_CHECK_HEADERS([ncurses/curses.h], [], - [AC_CHECK_HEADERS([ncurses.h], [], - [AC_MSG_ERROR([can not find required ncurses header file])])])])]) - - # check if additional linker flags are needed for keypad(3) - # (at this point we already link against a working ncurses library with wide character support) - AC_SEARCH_LIBS([keypad], [tinfow tinfo]) -else - HTOP_CHECK_SCRIPT([ncurses6], [wnoutrefresh], [HAVE_LIBNCURSES], [ncurses6-config], - HTOP_CHECK_SCRIPT([ncurses], [wnoutrefresh], [HAVE_LIBNCURSES], [ncurses5-config], - HTOP_CHECK_LIB([ncurses6], [doupdate], [HAVE_LIBNCURSES], - HTOP_CHECK_LIB([ncurses], [doupdate], [HAVE_LIBNCURSES], - HTOP_CHECK_LIB([curses], [doupdate], [HAVE_LIBNCURSES], - AC_MSG_ERROR([can not find required curses/ncurses library]) - ))))) - - AC_CHECK_HEADERS([curses.h], [], - [AC_CHECK_HEADERS([ncurses/curses.h], [], - [AC_CHECK_HEADERS([ncurses/ncurses.h], [], - [AC_CHECK_HEADERS([ncurses.h] ,[], - [AC_MSG_ERROR([can not find required ncurses header file])])])])]) - - # check if additional linker flags are needed for keypad(3) - # (at this point we already link against a working ncurses library) - AC_SEARCH_LIBS([keypad], [tinfo]) -fi -if test "$enable_static" = yes; then - AC_SEARCH_LIBS([Gpm_GetEvent], [gpm]) -fi -if test "$my_htop_platform" = "solaris"; then - # On OmniOS /usr/include/sys/regset.h redefines ERR to 13 - \r, breaking the Enter key. - # Since ncurses macros use the ERR macro, we can not use another name. - AC_DEFINE([ERR], [(-1)], [Predefine ncurses macro.]) -fi -AC_CHECK_FUNCS( [set_escdelay] ) -AC_CHECK_FUNCS( [getmouse] ) - - -AC_ARG_ENABLE([affinity], - [AS_HELP_STRING([--enable-affinity], - [enable sched_setaffinity and sched_getaffinity for affinity support, conflicts with hwloc @<:@default=check@:>@])], - [], - [enable_affinity=check]) -if test "x$enable_affinity" = xcheck; then - if test "x$enable_hwloc" = xyes; then - enable_affinity=no - else - AC_MSG_CHECKING([for usable sched_setaffinity]) - AC_RUN_IFELSE([ - AC_LANG_PROGRAM([[ - #include - #include - static cpu_set_t cpuset; - ]], [[ - CPU_ZERO(&cpuset); - sched_setaffinity(0, sizeof(cpu_set_t), &cpuset); - if (errno == ENOSYS) return 1; - ]])], - [enable_affinity=yes - AC_MSG_RESULT([yes])], - [enable_affinity=no - AC_MSG_RESULT([no])], - [AC_MSG_RESULT([yes (assumed while cross compiling)])]) - fi -fi -if test "x$enable_affinity" = xyes; then - if test "x$enable_hwloc" = xyes; then - AC_MSG_ERROR([--enable-hwloc and --enable-affinity are mutual exclusive. Specify at most one of them.]) - fi - AC_DEFINE([HAVE_AFFINITY], [1], [Define if sched_setaffinity and sched_getaffinity are to be used.]) -fi - - -AC_ARG_ENABLE([unwind], - [AS_HELP_STRING([--enable-unwind], - [enable unwind support for printing backtraces; requires libunwind @<:@default=check@:>@])], - [], - [enable_unwind=check]) -case "$enable_unwind" in - check) - enable_unwind=yes - if test "$enable_static" = yes; then - AC_CHECK_LIB([lzma], [lzma_index_buffer_decode]) - fi - AC_CHECK_LIB([unwind], [backtrace], [], [enable_unwind=no]) - AC_CHECK_HEADERS([libunwind.h], [], [ - old_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -I/usr/include/libunwind" - AC_CHECK_HEADERS([libunwind/libunwind.h], [], [ - enable_unwind=no - CFLAGS="$old_CFLAGS" - ]) - ]) - ;; - no) - ;; - yes) - AC_CHECK_LIB([unwind], [backtrace], [], [AC_MSG_ERROR([can not find required library libunwind])]) - AC_CHECK_HEADERS([libunwind.h], [], [ - CFLAGS="$CFLAGS -I/usr/include/libunwind" - AC_CHECK_HEADERS([libunwind/libunwind.h], [], [AC_MSG_ERROR([can not find required header file libunwind.h])]) - ]) - ;; - *) - AC_MSG_ERROR([bad value '$enable_unwind' for --enable-unwind]) - ;; -esac -if test "x$enable_unwind" = xno; then - # Fall back to backtrace(3) and add -lexecinfo if needed - AC_SEARCH_LIBS([backtrace], [execinfo]) -fi - - -AC_ARG_ENABLE([hwloc], - [AS_HELP_STRING([--enable-hwloc], - [enable hwloc support for CPU affinity; disables affinity support; requires libhwloc @<:@default=no@:>@])], - [], - [enable_hwloc=no]) -case "$enable_hwloc" in - no) - ;; - yes) - m4_ifdef([PKG_PROG_PKG_CONFIG], [ - PKG_PROG_PKG_CONFIG() - PKG_CHECK_MODULES(HWLOC, hwloc, [ - CFLAGS="$CFLAGS $HWLOC_CFLAGS" LIBS="$LIBS $HWLOC_LIBS" - ], [ - AC_CHECK_LIB([hwloc], [hwloc_get_proc_cpubind], [], [AC_MSG_ERROR([can not find required library libhwloc])]) - AC_CHECK_HEADERS([hwloc.h], [], [AC_MSG_ERROR([can not find require header file hwloc.h])]) - ]) - ], [ - AC_CHECK_LIB([hwloc], [hwloc_get_proc_cpubind], [], [AC_MSG_ERROR([can not find required library libhwloc])]) - AC_CHECK_HEADERS([hwloc.h], [], [AC_MSG_ERROR([can not find require header file hwloc.h])]) - ]) - ;; - *) - AC_MSG_ERROR([bad value '$enable_hwloc' for --enable-hwloc]) - ;; -esac - - -AC_ARG_WITH([os-release], - [AS_HELP_STRING([--with-os-release=FILE], - [location of an os-release file @<:@default=/etc/os-release@:>@])], - [], - [with_os_release=/etc/os-release]) -if test -n "$with_os_release" && test ! -f "$with_os_release"; then - if test -f "/usr/lib/os-release"; then - with_os_release="/usr/lib/os-release" - fi -fi -AC_DEFINE_UNQUOTED([OSRELEASEFILE], ["$with_os_release"], [File with OS release details.]) - -# ---------------------------------------------------------------------- - - -# ---------------------------------------------------------------------- -# Checks for Linux features and flags. -# ---------------------------------------------------------------------- - -AC_ARG_WITH([proc], - [AS_HELP_STRING([--with-proc=DIR], - [location of a Linux-compatible proc filesystem @<:@default=/proc@:>@])], - [], - [with_proc=/proc]) -if test -z "$with_proc"; then - AC_MSG_ERROR([bad empty value for --with-proc option]) -fi -AC_DEFINE_UNQUOTED([PROCDIR], ["$with_proc"], [Path of proc filesystem.]) - - -AC_ARG_ENABLE([openvz], - [AS_HELP_STRING([--enable-openvz], - [enable OpenVZ support @<:@default=no@:>@])], - [], - [enable_openvz=no]) -if test "x$enable_openvz" = xyes; then - AC_DEFINE([HAVE_OPENVZ], [1], [Define if openvz support enabled.]) -fi - - -AC_ARG_ENABLE([vserver], - [AS_HELP_STRING([--enable-vserver], - [enable VServer support @<:@default=no@:>@])], - [], - [enable_vserver=no]) -if test "x$enable_vserver" = xyes; then - AC_DEFINE([HAVE_VSERVER], [1], [Define if VServer support enabled.]) -fi - - -AC_ARG_ENABLE([ancient_vserver], - [AS_HELP_STRING([--enable-ancient-vserver], - [enable ancient VServer support (implies --enable-vserver) @<:@default=no@:>@])], - [], - [enable_ancient_vserver=no]) -if test "x$enable_ancient_vserver" = xyes; then - if test "x$enable_vserver" != xyes; then - enable_vserver=implied - fi - AC_DEFINE([HAVE_VSERVER], [1], [Define if VServer support enabled.]) - AC_DEFINE([HAVE_ANCIENT_VSERVER], [1], [Define if ancient vserver support enabled.]) -fi - - -AC_ARG_ENABLE([capabilities], - [AS_HELP_STRING([--enable-capabilities], - [enable Linux capabilities support; requires libcap @<:@default=check@:>@])], - [], - [enable_capabilities=check]) -case "$enable_capabilities" in - no) - ;; - check) - enable_capabilities=yes - AC_CHECK_LIB([cap], [cap_init], [], [enable_capabilities=no]) - AC_CHECK_HEADERS([sys/capability.h], [], [enable_capabilities=no]) - ;; - yes) - AC_CHECK_LIB([cap], [cap_init], [], [AC_MSG_ERROR([can not find required library libcap])]) - AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([can not find required header file sys/capability.h])]) - ;; - *) - AC_MSG_ERROR([bad value '$enable_capabilities' for --enable-capabilities]) - ;; -esac - - -AC_ARG_ENABLE([delayacct], - [AS_HELP_STRING([--enable-delayacct], - [enable Linux delay accounting support; requires pkg-config, libnl-3 and libnl-genl-3 @<:@default=check@:>@])], - [], - [enable_delayacct=check]) -case "$enable_delayacct" in - no) - ;; - check) - if test "$my_htop_platform" != linux; then - enable_delayacct=no - elif test "$enable_static" = yes; then - enable_delayacct=no - else - m4_ifdef([PKG_PROG_PKG_CONFIG], [ - enable_delayacct=yes - PKG_PROG_PKG_CONFIG() - PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [], [enable_delayacct=no]) - PKG_CHECK_MODULES(LIBNL3GENL, libnl-genl-3.0, [], [enable_delayacct=no]) - if test "$enable_delayacct" = yes; then - CFLAGS="$CFLAGS $LIBNL3_CFLAGS $LIBNL3GENL_CFLAGS" - LIBS="$LIBS $LIBNL3_LIBS $LIBNL3GENL_LIBS" - AC_DEFINE([HAVE_DELAYACCT], [1], [Define if delay accounting support should be enabled.]) - fi - ], [ - enable_delayacct=no - AC_MSG_NOTICE([Linux delay accounting support can not be enabled, cause pkg-config is required for checking its availability]) - ]) - fi - ;; - yes) - m4_ifdef([PKG_PROG_PKG_CONFIG], [ - PKG_PROG_PKG_CONFIG() - PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [], [AC_MSG_ERROR([can not find required library libnl3])]) - PKG_CHECK_MODULES(LIBNL3GENL, libnl-genl-3.0, [], [AC_MSG_ERROR([can not find required library libnl3genl])]) - CFLAGS="$CFLAGS $LIBNL3_CFLAGS $LIBNL3GENL_CFLAGS" - LIBS="$LIBS $LIBNL3_LIBS $LIBNL3GENL_LIBS" - AC_DEFINE([HAVE_DELAYACCT], [1], [Define if delay accounting support should be enabled.]) - ], [ - pkg_m4_absent=1 - m4_warning([configure is generated without pkg.m4. 'make dist' target will be disabled.]) - AC_MSG_ERROR([htop on Linux requires pkg-config for checking delayacct requirements. Please install pkg-config and run ./autogen.sh to rebuild the configure script.]) - ]) - ;; - *) - AC_MSG_ERROR([bad value '$enable_delayacct' for --enable-delayacct]) - ;; -esac - - -AC_ARG_ENABLE([sensors], - [AS_HELP_STRING([--enable-sensors], - [enable libsensors support for reading temperature data; requires only libsensors headers at compile time, at runtime libsensors is loaded via dlopen @<:@default=check@:>@])], - [], - [enable_sensors=check]) -case "$enable_sensors" in - no) - ;; - check) - enable_sensors=yes - if test "$enable_static" = yes; then - AC_CHECK_LIB([sensors], [sensors_init], [], [enable_sensors=no]) - fi - AC_CHECK_HEADERS([sensors/sensors.h], [], [enable_sensors=no]) - ;; - yes) - if test "$enable_static" = yes; then - AC_CHECK_LIB([sensors], [sensors_init], [], [AC_MSG_ERROR([can not find required library libsensors])]) - fi - AC_CHECK_HEADERS([sensors/sensors.h], [], [AC_MSG_ERROR([can not find required header file sensors/sensors.h])]) - ;; - *) - AC_MSG_ERROR([bad value '$enable_sensors' for --enable-sensors]) - ;; -esac -if test "$enable_sensors" = yes || test "$my_htop_platform" = freebsd; then - AC_DEFINE([BUILD_WITH_CPU_TEMP], [1], [Define if CPU temperature option should be enabled.]) -fi - -# ---------------------------------------------------------------------- - - -# ---------------------------------------------------------------------- -# Checks for compiler warnings. -# ---------------------------------------------------------------------- - -AM_CFLAGS="\ - -Wall\ - -Wcast-align\ - -Wcast-qual\ - -Wextra\ - -Wfloat-equal\ - -Wformat=2\ - -Winit-self\ - -Wmissing-format-attribute\ - -Wmissing-noreturn\ - -Wmissing-prototypes\ - -Wpointer-arith\ - -Wshadow\ - -Wstrict-prototypes\ - -Wundef\ - -Wunused\ - -Wwrite-strings" - -# FreeBSD uses C11 _Generic in its isnan implementation, even with -std=c99 -if test "$my_htop_platform" = freebsd; then - AM_CFLAGS="$AM_CFLAGS -Wno-c11-extensions" -fi - -dnl https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html -AC_DEFUN([AX_CHECK_COMPILE_FLAG], -[ -AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl -AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ - ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS - _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" - AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], - [AS_VAR_SET(CACHEVAR,[yes])], - [AS_VAR_SET(CACHEVAR,[no])]) - _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) -AS_VAR_IF(CACHEVAR,yes, - [m4_default([$2], :)], - [m4_default([$3], :)]) -AS_VAR_POPDEF([CACHEVAR])dnl -])dnl AX_CHECK_COMPILE_FLAGS - -AX_CHECK_COMPILE_FLAG([-Wextra-semi-stmt], [AM_CFLAGS="$AM_CFLAGS -Wextra-semi-stmt"], , [-Werror=unknown-warning-option]) dnl the autoconf check itself generates -Wextra-semi-stmt -AX_CHECK_COMPILE_FLAG([-Wimplicit-int-conversion], [AM_CFLAGS="$AM_CFLAGS -Wimplicit-int-conversion"], , [-Werror]) -AX_CHECK_COMPILE_FLAG([-Wnull-dereference], [AM_CFLAGS="$AM_CFLAGS -Wnull-dereference"], , [-Werror]) - -AC_ARG_ENABLE([werror], - [AS_HELP_STRING([--enable-werror], - [Treat warnings as errors @<:@default=no@:>@])], - [], - [enable_werror=no]) -if test "x$enable_werror" = xyes; then - AM_CFLAGS="$AM_CFLAGS -Werror" -fi - -AC_ARG_ENABLE([debug], - [AS_HELP_STRING([--enable-debug], - [Enable compiling with maximum debug info, asserts and internal sanity checks @<:@default=no@:>@])], - [], - [enable_debug=no]) -if test "x$enable_debug" != xyes; then - AM_CPPFLAGS="$AM_CPPFLAGS -DNDEBUG" -else - AM_CPPFLAGS="$AM_CPPFLAGS -ggdb3" -fi - - -AC_SUBST([AM_CFLAGS]) -AC_SUBST([AM_CPPFLAGS]) - -# ---------------------------------------------------------------------- - - -# ---------------------------------------------------------------------- -# We're done, let's go! -# ---------------------------------------------------------------------- - -AC_DEFINE_UNQUOTED([COPYRIGHT], ["(C) 2004-2019 Hisham Muhammad. (C) 2020-2023 htop dev team."], [Copyright message.]) - -AM_CONDITIONAL([HTOP_LINUX], [test "$my_htop_platform" = linux]) -AM_CONDITIONAL([HTOP_FREEBSD], [test "$my_htop_platform" = freebsd]) -AM_CONDITIONAL([HTOP_DRAGONFLYBSD], [test "$my_htop_platform" = dragonflybsd]) -AM_CONDITIONAL([HTOP_NETBSD], [test "$my_htop_platform" = netbsd]) -AM_CONDITIONAL([HTOP_OPENBSD], [test "$my_htop_platform" = openbsd]) -AM_CONDITIONAL([HTOP_DARWIN], [test "$my_htop_platform" = darwin]) -AM_CONDITIONAL([HTOP_SOLARIS], [test "$my_htop_platform" = solaris]) -AM_CONDITIONAL([HTOP_PCP], [test "$my_htop_platform" = pcp]) -AM_CONDITIONAL([HTOP_UNSUPPORTED], [test "$my_htop_platform" = unsupported]) - -AC_SUBST(my_htop_platform) -AC_CONFIG_FILES([Makefile htop.1]) -AC_OUTPUT - -if test "$my_htop_platform" = unsupported; then - echo "" - echo "****************************************************************" - echo "WARNING! This platform is not currently supported by htop." - echo "" - echo "The code will build, but it will produce a dummy version of htop" - echo "which shows no processes, using the files from the unsupported/" - echo "directory. This is meant to be a skeleton, to be used as a" - echo "starting point if you are porting htop to a new platform." - echo "****************************************************************" - echo "" -fi - -AC_MSG_RESULT([ - ${PACKAGE_NAME} ${VERSION} - - platform: $my_htop_platform - os-release file: $with_os_release - (Linux) proc directory: $with_proc - (Linux) openvz: $enable_openvz - (Linux) vserver: $enable_vserver - (Linux) ancient vserver: $enable_ancient_vserver - (Linux) delay accounting: $enable_delayacct - (Linux) sensors: $enable_sensors - (Linux) capabilities: $enable_capabilities - unicode: $enable_unicode - affinity: $enable_affinity - unwind: $enable_unwind - hwloc: $enable_hwloc - debug: $enable_debug - static: $enable_static -]) diff --git a/fedora/.local/bin/htop-vim/darwin/DarwinProcess.c b/fedora/.local/bin/htop-vim/darwin/DarwinProcess.c deleted file mode 100644 index 6027c25..0000000 --- a/fedora/.local/bin/htop-vim/darwin/DarwinProcess.c +++ /dev/null @@ -1,478 +0,0 @@ -/* -htop - DarwinProcess.c -(C) 2015 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "darwin/DarwinProcess.h" - -#include -#include -#include -#include -#include -#include - -#include "CRT.h" -#include "Process.h" -#include "darwin/Platform.h" - - -const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { - [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, - [PID] = { .name = "PID", .title = "PID", .description = "Process/thread ID", .flags = 0, .pidColumn = true, }, - [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, - [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging)", .flags = 0, }, - [PPID] = { .name = "PPID", .title = "PPID", .description = "Parent process ID", .flags = 0, .pidColumn = true, }, - [PGRP] = { .name = "PGRP", .title = "PGRP", .description = "Process group ID", .flags = 0, .pidColumn = true, }, - [SESSION] = { .name = "SESSION", .title = "SID", .description = "Process's session ID", .flags = 0, .pidColumn = true, }, - [TTY] = { .name = "TTY", .title = "TTY ", .description = "Controlling terminal", .flags = PROCESS_FLAG_TTY, }, - [TPGID] = { .name = "TPGID", .title = "TPGID", .description = "Process ID of the fg process group of the controlling terminal", .flags = 0, .pidColumn = true, }, - [MINFLT] = { .name = "MINFLT", .title = " MINFLT ", .description = "Number of minor faults which have not required loading a memory page from disk", .flags = 0, .defaultSortDesc = true, }, - [MAJFLT] = { .name = "MAJFLT", .title = " MAJFLT ", .description = "Number of major faults which have required loading a memory page from disk", .flags = 0, .defaultSortDesc = true, }, - [PRIORITY] = { .name = "PRIORITY", .title = "PRI ", .description = "Kernel's internal priority for the process", .flags = 0, }, - [NICE] = { .name = "NICE", .title = " NI ", .description = "Nice value (the higher the value, the more it lets other processes take priority)", .flags = 0, }, - [STARTTIME] = { .name = "STARTTIME", .title = "START ", .description = "Time the process was started", .flags = 0, }, - [ELAPSED] = { .name = "ELAPSED", .title = "ELAPSED ", .description = "Time since the process was started", .flags = 0, }, - [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, }, - [M_VIRT] = { .name = "M_VIRT", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, .defaultSortDesc = true, }, - [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, .defaultSortDesc = true, }, - [ST_UID] = { .name = "ST_UID", .title = "UID", .description = "User ID of the process owner", .flags = 0, }, - [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = " CPU%", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, .defaultSortDesc = true, .autoWidth = true, }, - [PERCENT_NORM_CPU] = { .name = "PERCENT_NORM_CPU", .title = "NCPU%", .description = "Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)", .flags = 0, .defaultSortDesc = true, .autoWidth = true, }, - [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, .defaultSortDesc = true, }, - [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, - [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, .defaultSortDesc = true, }, - [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, }, - [TGID] = { .name = "TGID", .title = "TGID", .description = "Thread group ID (i.e. process ID)", .flags = 0, .pidColumn = true, }, - [PROC_EXE] = { .name = "EXE", .title = "EXE ", .description = "Basename of exe of the process from /proc/[pid]/exe", .flags = 0, }, - [CWD] = { .name = "CWD", .title = "CWD ", .description = "The current working directory of the process", .flags = PROCESS_FLAG_CWD, }, - [TRANSLATED] = { .name = "TRANSLATED", .title = "T ", .description = "Translation info (T translated, N native)", .flags = 0, }, -}; - -Process* DarwinProcess_new(const Settings* settings) { - DarwinProcess* this = xCalloc(1, sizeof(DarwinProcess)); - Object_setClass(this, Class(DarwinProcess)); - Process_init(&this->super, settings); - - this->utime = 0; - this->stime = 0; - this->taskAccess = true; - this->translated = false; - - return &this->super; -} - -void Process_delete(Object* cast) { - DarwinProcess* this = (DarwinProcess*) cast; - Process_done(&this->super); - // free platform-specific fields here - free(this); -} - -static void DarwinProcess_writeField(const Process* this, RichString* str, ProcessField field) { - const DarwinProcess* dp = (const DarwinProcess*) this; - char buffer[256]; buffer[255] = '\0'; - int attr = CRT_colors[DEFAULT_COLOR]; - int n = sizeof(buffer) - 1; - switch (field) { - // add Platform-specific fields here - case TRANSLATED: xSnprintf(buffer, n, "%c ", dp->translated ? 'T' : 'N'); break; - default: - Process_writeField(this, str, field); - return; - } - RichString_appendWide(str, attr, buffer); -} - -static int DarwinProcess_compareByKey(const Process* v1, const Process* v2, ProcessField key) { - const DarwinProcess* p1 = (const DarwinProcess*)v1; - const DarwinProcess* p2 = (const DarwinProcess*)v2; - - switch (key) { - // add Platform-specific fields here - case TRANSLATED: - return SPACESHIP_NUMBER(p1->translated, p2->translated); - default: - return Process_compareByKey_Base(v1, v2, key); - } -} - -static void DarwinProcess_updateExe(pid_t pid, Process* proc) { - char path[PROC_PIDPATHINFO_MAXSIZE]; - - int r = proc_pidpath(pid, path, sizeof(path)); - if (r <= 0) - return; - - Process_updateExe(proc, path); -} - -static void DarwinProcess_updateCwd(pid_t pid, Process* proc) { - struct proc_vnodepathinfo vpi; - - int r = proc_pidinfo(pid, PROC_PIDVNODEPATHINFO, 0, &vpi, sizeof(vpi)); - if (r <= 0) { - free(proc->procCwd); - proc->procCwd = NULL; - return; - } - - if (!vpi.pvi_cdir.vip_path[0]) { - free(proc->procCwd); - proc->procCwd = NULL; - return; - } - - free_and_xStrdup(&proc->procCwd, vpi.pvi_cdir.vip_path); -} - -static void DarwinProcess_updateCmdLine(const struct kinfo_proc* k, Process* proc) { - Process_updateComm(proc, k->kp_proc.p_comm); - - /* This function is from the old Mac version of htop. Originally from ps? */ - int mib[3], argmax, nargs, c = 0; - size_t size; - char *procargs, *sp, *np, *cp; - - /* Get the maximum process arguments size. */ - mib[0] = CTL_KERN; - mib[1] = KERN_ARGMAX; - - size = sizeof( argmax ); - if ( sysctl( mib, 2, &argmax, &size, NULL, 0 ) == -1 ) { - goto ERROR_A; - } - - /* Allocate space for the arguments. */ - procargs = (char*)malloc(argmax); - if ( procargs == NULL ) { - goto ERROR_A; - } - - /* - * Make a sysctl() call to get the raw argument space of the process. - * The layout is documented in start.s, which is part of the Csu - * project. In summary, it looks like: - * - * /---------------\ 0x00000000 - * : : - * : : - * |---------------| - * | argc | - * |---------------| - * | arg[0] | - * |---------------| - * : : - * : : - * |---------------| - * | arg[argc - 1] | - * |---------------| - * | 0 | - * |---------------| - * | env[0] | - * |---------------| - * : : - * : : - * |---------------| - * | env[n] | - * |---------------| - * | 0 | - * |---------------| <-- Beginning of data returned by sysctl() is here. - * | argc | - * |---------------| - * | exec_path | - * |:::::::::::::::| - * | | - * | String area. | - * | | - * |---------------| <-- Top of stack. - * : : - * : : - * \---------------/ 0xffffffff - */ - mib[0] = CTL_KERN; - mib[1] = KERN_PROCARGS2; - mib[2] = k->kp_proc.p_pid; - - size = ( size_t ) argmax; - if ( sysctl( mib, 3, procargs, &size, NULL, 0 ) == -1 ) { - goto ERROR_B; - } - - memcpy( &nargs, procargs, sizeof( nargs ) ); - cp = procargs + sizeof( nargs ); - - /* Skip the saved exec_path. */ - for ( ; cp < &procargs[size]; cp++ ) { - if ( *cp == '\0' ) { - /* End of exec_path reached. */ - break; - } - } - if ( cp == &procargs[size] ) { - goto ERROR_B; - } - - /* Skip trailing '\0' characters. */ - for ( ; cp < &procargs[size]; cp++ ) { - if ( *cp != '\0' ) { - /* Beginning of first argument reached. */ - break; - } - } - if ( cp == &procargs[size] ) { - goto ERROR_B; - } - /* Save where the argv[0] string starts. */ - sp = cp; - - int end = 0; - for ( np = NULL; c < nargs && cp < &procargs[size]; cp++ ) { - if ( *cp == '\0' ) { - c++; - if ( np != NULL ) { - /* Convert previous '\0'. */ - *np = ' '; - } - /* Note location of current '\0'. */ - np = cp; - if (end == 0) { - end = cp - sp; - } - } - } - - /* - * sp points to the beginning of the arguments/environment string, and - * np should point to the '\0' terminator for the string. - */ - if ( np == NULL || np == sp ) { - /* Empty or unterminated string. */ - goto ERROR_B; - } - if (end == 0) { - end = np - sp; - } - - Process_updateCmdline(proc, sp, 0, end); - - /* Clean up. */ - free( procargs ); - - return; - -ERROR_B: - free( procargs ); - -ERROR_A: - Process_updateCmdline(proc, k->kp_proc.p_comm, 0, strlen(k->kp_proc.p_comm)); -} - -// Converts nanoseconds to hundredths of a second (centiseconds) as needed by the "time" field of the Process struct. -static long long int nanosecondsToCentiseconds(uint64_t nanoseconds) { - const uint64_t centiseconds_per_second = 100; - const uint64_t nanoseconds_per_second = 1e9; - return nanoseconds / nanoseconds_per_second * centiseconds_per_second; -} - -static char* DarwinProcess_getDevname(dev_t dev) { - if (dev == NODEV) { - return NULL; - } - char buf[sizeof("/dev/") + MAXNAMLEN]; - char* name = devname_r(dev, S_IFCHR, buf, MAXNAMLEN); - if (name) { - return xStrdup(name); - } - return NULL; -} - -void DarwinProcess_setFromKInfoProc(Process* proc, const struct kinfo_proc* ps, bool exists) { - DarwinProcess* dp = (DarwinProcess*)proc; - - const struct extern_proc* ep = &ps->kp_proc; - - /* UNSET HERE : - * - * processor - * user (set at ProcessList level) - * nlwp - * percent_cpu - * percent_mem - * m_virt - * m_resident - * minflt - * majflt - */ - - /* First, the "immutable" parts */ - if (!exists) { - /* Set the PID/PGID/etc. */ - proc->pid = ep->p_pid; - proc->ppid = ps->kp_eproc.e_ppid; - proc->pgrp = ps->kp_eproc.e_pgid; - proc->session = 0; /* TODO Get the session id */ - proc->tpgid = ps->kp_eproc.e_tpgid; - proc->tgid = proc->pid; - proc->isKernelThread = false; - proc->isUserlandThread = false; - dp->translated = ps->kp_proc.p_flag & P_TRANSLATED; - proc->tty_nr = ps->kp_eproc.e_tdev; - proc->tty_name = NULL; - - proc->starttime_ctime = ep->p_starttime.tv_sec; - Process_fillStarttimeBuffer(proc); - - DarwinProcess_updateExe(ep->p_pid, proc); - DarwinProcess_updateCmdLine(ps, proc); - - if (proc->settings->ss->flags & PROCESS_FLAG_CWD) { - DarwinProcess_updateCwd(ep->p_pid, proc); - } - } - - if (proc->tty_name == NULL && (dev_t)proc->tty_nr != NODEV) { - /* The call to devname() is extremely expensive (due to lstat) - * and represents ~95% of htop's CPU usage when there is high - * process turnover. - * - * To mitigate this we only fetch TTY information if the TTY - * field is enabled in the settings. - */ - if (proc->settings->ss->flags & PROCESS_FLAG_TTY) { - proc->tty_name = DarwinProcess_getDevname(proc->tty_nr); - if (!proc->tty_name) { - /* devname failed: prevent us from calling it again */ - proc->tty_nr = NODEV; - } - } - } - - /* Mutable information */ - proc->nice = ep->p_nice; - proc->priority = ep->p_priority; - - proc->state = (ep->p_stat == SZOMB) ? ZOMBIE : UNKNOWN; - - /* Make sure the updated flag is set */ - proc->updated = true; -} - -void DarwinProcess_setFromLibprocPidinfo(DarwinProcess* proc, DarwinProcessList* dpl, double timeIntervalNS) { - struct proc_taskinfo pti; - - if (sizeof(pti) == proc_pidinfo(proc->super.pid, PROC_PIDTASKINFO, 0, &pti, sizeof(pti))) { - uint64_t total_existing_time_ns = proc->stime + proc->utime; - - uint64_t user_time_ns = Platform_machTicksToNanoseconds(pti.pti_total_user); - uint64_t system_time_ns = Platform_machTicksToNanoseconds(pti.pti_total_system); - - uint64_t total_current_time_ns = user_time_ns + system_time_ns; - - if (total_existing_time_ns && 1E-6 < timeIntervalNS) { - uint64_t total_time_diff_ns = total_current_time_ns - total_existing_time_ns; - proc->super.percent_cpu = ((double)total_time_diff_ns / timeIntervalNS) * 100.0; - } else { - proc->super.percent_cpu = 0.0; - } - Process_updateCPUFieldWidths(proc->super.percent_cpu); - - proc->super.time = nanosecondsToCentiseconds(total_current_time_ns); - proc->super.nlwp = pti.pti_threadnum; - proc->super.m_virt = pti.pti_virtual_size / ONE_K; - proc->super.m_resident = pti.pti_resident_size / ONE_K; - proc->super.majflt = pti.pti_faults; - proc->super.percent_mem = (double)pti.pti_resident_size * 100.0 - / (double)dpl->host_info.max_mem; - - proc->stime = system_time_ns; - proc->utime = user_time_ns; - - dpl->super.kernelThreads += 0; /*pti.pti_threads_system;*/ - dpl->super.userlandThreads += pti.pti_threadnum; /*pti.pti_threads_user;*/ - dpl->super.totalTasks += pti.pti_threadnum; - dpl->super.runningTasks += pti.pti_numrunning; - } -} - -/* - * Scan threads for process state information. - * Based on: http://stackoverflow.com/questions/6788274/ios-mac-cpu-usage-for-thread - * and https://github.com/max-horvath/htop-osx/blob/e86692e869e30b0bc7264b3675d2a4014866ef46/ProcessList.c - */ -void DarwinProcess_scanThreads(DarwinProcess* dp) { - Process* proc = (Process*) dp; - kern_return_t ret; - - if (!dp->taskAccess) { - return; - } - - if (proc->state == ZOMBIE) { - return; - } - - task_t port; - ret = task_for_pid(mach_task_self(), proc->pid, &port); - if (ret != KERN_SUCCESS) { - dp->taskAccess = false; - return; - } - - task_info_data_t tinfo; - mach_msg_type_number_t task_info_count = TASK_INFO_MAX; - ret = task_info(port, TASK_BASIC_INFO, (task_info_t) tinfo, &task_info_count); - if (ret != KERN_SUCCESS) { - dp->taskAccess = false; - return; - } - - thread_array_t thread_list; - mach_msg_type_number_t thread_count; - ret = task_threads(port, &thread_list, &thread_count); - if (ret != KERN_SUCCESS) { - dp->taskAccess = false; - mach_port_deallocate(mach_task_self(), port); - return; - } - - integer_t run_state = 999; - for (unsigned int i = 0; i < thread_count; i++) { - thread_info_data_t thinfo; - mach_msg_type_number_t thread_info_count = THREAD_BASIC_INFO_COUNT; - ret = thread_info(thread_list[i], THREAD_BASIC_INFO, (thread_info_t)thinfo, &thread_info_count); - if (ret == KERN_SUCCESS) { - thread_basic_info_t basic_info_th = (thread_basic_info_t) thinfo; - if (basic_info_th->run_state < run_state) { - run_state = basic_info_th->run_state; - } - mach_port_deallocate(mach_task_self(), thread_list[i]); - } - } - vm_deallocate(mach_task_self(), (vm_address_t) thread_list, sizeof(thread_port_array_t) * thread_count); - mach_port_deallocate(mach_task_self(), port); - - /* Taken from: https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/osfmk/mach/thread_info.h#L129 */ - switch (run_state) { - case TH_STATE_RUNNING: proc->state = RUNNING; break; - case TH_STATE_STOPPED: proc->state = STOPPED; break; - case TH_STATE_WAITING: proc->state = WAITING; break; - case TH_STATE_UNINTERRUPTIBLE: proc->state = UNINTERRUPTIBLE_WAIT; break; - case TH_STATE_HALTED: proc->state = BLOCKED; break; - default: proc->state = UNKNOWN; - } -} - - -const ProcessClass DarwinProcess_class = { - .super = { - .extends = Class(Process), - .display = Process_display, - .delete = Process_delete, - .compare = Process_compare - }, - .writeField = DarwinProcess_writeField, - .compareByKey = DarwinProcess_compareByKey, -}; diff --git a/fedora/.local/bin/htop-vim/darwin/DarwinProcess.h b/fedora/.local/bin/htop-vim/darwin/DarwinProcess.h deleted file mode 100644 index bd17974..0000000 --- a/fedora/.local/bin/htop-vim/darwin/DarwinProcess.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef HEADER_DarwinProcess -#define HEADER_DarwinProcess -/* -htop - DarwinProcess.h -(C) 2015 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include - -#include "Settings.h" -#include "darwin/DarwinProcessList.h" - - -#define PROCESS_FLAG_TTY 0x00000100 - -typedef struct DarwinProcess_ { - Process super; - - uint64_t utime; - uint64_t stime; - bool taskAccess; - bool translated; -} DarwinProcess; - -extern const ProcessClass DarwinProcess_class; - -extern const ProcessFieldData Process_fields[LAST_PROCESSFIELD]; - -Process* DarwinProcess_new(const Settings* settings); - -void Process_delete(Object* cast); - -void DarwinProcess_setFromKInfoProc(Process* proc, const struct kinfo_proc* ps, bool exists); - -void DarwinProcess_setFromLibprocPidinfo(DarwinProcess* proc, DarwinProcessList* dpl, double timeIntervalNS); - -/* - * Scan threads for process state information. - * Based on: http://stackoverflow.com/questions/6788274/ios-mac-cpu-usage-for-thread - * and https://github.com/max-horvath/htop-osx/blob/e86692e869e30b0bc7264b3675d2a4014866ef46/ProcessList.c - */ -void DarwinProcess_scanThreads(DarwinProcess* dp); - -#endif diff --git a/fedora/.local/bin/htop-vim/darwin/DarwinProcessList.c b/fedora/.local/bin/htop-vim/darwin/DarwinProcessList.c deleted file mode 100644 index dae588b..0000000 --- a/fedora/.local/bin/htop-vim/darwin/DarwinProcessList.c +++ /dev/null @@ -1,203 +0,0 @@ -/* -htop - DarwinProcessList.c -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "darwin/DarwinProcessList.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "CRT.h" -#include "ProcessList.h" -#include "darwin/DarwinProcess.h" -#include "darwin/Platform.h" -#include "darwin/PlatformHelpers.h" -#include "generic/openzfs_sysctl.h" -#include "zfs/ZfsArcStats.h" - - -static void ProcessList_getHostInfo(host_basic_info_data_t* p) { - mach_msg_type_number_t info_size = HOST_BASIC_INFO_COUNT; - - if (0 != host_info(mach_host_self(), HOST_BASIC_INFO, (host_info_t)p, &info_size)) { - CRT_fatalError("Unable to retrieve host info"); - } -} - -static void ProcessList_freeCPULoadInfo(processor_cpu_load_info_t* p) { - if (NULL != p && NULL != *p) { - if (0 != munmap(*p, vm_page_size)) { - CRT_fatalError("Unable to free old CPU load information"); - } - *p = NULL; - } -} - -static unsigned ProcessList_allocateCPULoadInfo(processor_cpu_load_info_t* p) { - mach_msg_type_number_t info_size = sizeof(processor_cpu_load_info_t); - unsigned cpu_count; - - // TODO Improving the accuracy of the load counts woule help a lot. - if (0 != host_processor_info(mach_host_self(), PROCESSOR_CPU_LOAD_INFO, &cpu_count, (processor_info_array_t*)p, &info_size)) { - CRT_fatalError("Unable to retrieve CPU info"); - } - - return cpu_count; -} - -static void ProcessList_getVMStats(vm_statistics_t p) { - mach_msg_type_number_t info_size = HOST_VM_INFO_COUNT; - - if (host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t)p, &info_size) != 0) { - CRT_fatalError("Unable to retrieve VM statistics"); - } -} - -static struct kinfo_proc* ProcessList_getKInfoProcs(size_t* count) { - int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0 }; - struct kinfo_proc* processes = NULL; - - for (unsigned int retry = 0; retry < 4; retry++) { - size_t size = 0; - if (sysctl(mib, 4, NULL, &size, NULL, 0) < 0 || size == 0) { - CRT_fatalError("Unable to get size of kproc_infos"); - } - - size += 16 * retry * retry * sizeof(struct kinfo_proc); - processes = xRealloc(processes, size); - - if (sysctl(mib, 4, processes, &size, NULL, 0) == 0) { - *count = size / sizeof(struct kinfo_proc); - return processes; - } - - if (errno != ENOMEM) - break; - } - - CRT_fatalError("Unable to get kinfo_procs"); -} - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId) { - DarwinProcessList* this = xCalloc(1, sizeof(DarwinProcessList)); - - ProcessList_init(&this->super, Class(DarwinProcess), usersTable, dynamicMeters, dynamicColumns, pidMatchList, userId); - - /* Initialize the CPU information */ - this->super.activeCPUs = ProcessList_allocateCPULoadInfo(&this->prev_load); - // TODO: support offline CPUs and hot swapping - this->super.existingCPUs = this->super.activeCPUs; - ProcessList_getHostInfo(&this->host_info); - ProcessList_allocateCPULoadInfo(&this->curr_load); - - /* Initialize the VM statistics */ - ProcessList_getVMStats(&this->vm_stats); - - /* Initialize the ZFS kstats, if zfs.kext loaded */ - openzfs_sysctl_init(&this->zfs); - openzfs_sysctl_updateArcStats(&this->zfs); - - this->super.kernelThreads = 0; - this->super.userlandThreads = 0; - this->super.totalTasks = 0; - this->super.runningTasks = 0; - - return &this->super; -} - -void ProcessList_delete(ProcessList* this) { - ProcessList_done(this); - free(this); -} - -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { - DarwinProcessList* dpl = (DarwinProcessList*)super; - bool preExisting = true; - struct kinfo_proc* ps; - size_t count; - DarwinProcess* proc; - - /* Update the global data (CPU times and VM stats) */ - ProcessList_freeCPULoadInfo(&dpl->prev_load); - dpl->prev_load = dpl->curr_load; - ProcessList_allocateCPULoadInfo(&dpl->curr_load); - ProcessList_getVMStats(&dpl->vm_stats); - openzfs_sysctl_updateArcStats(&dpl->zfs); - - // in pause mode only gather global data for meters (CPU/memory/...) - if (pauseProcessUpdate) { - return; - } - - /* Get the time difference */ - dpl->global_diff = 0; - for (unsigned int i = 0; i < dpl->super.existingCPUs; ++i) { - for (size_t j = 0; j < CPU_STATE_MAX; ++j) { - dpl->global_diff += dpl->curr_load[i].cpu_ticks[j] - dpl->prev_load[i].cpu_ticks[j]; - } - } - - const double time_interval_ns = Platform_schedulerTicksToNanoseconds(dpl->global_diff) / (double) dpl->super.activeCPUs; - - /* Clear the thread counts */ - super->kernelThreads = 0; - super->userlandThreads = 0; - super->totalTasks = 0; - super->runningTasks = 0; - - /* We use kinfo_procs for initial data since : - * - * 1) They always succeed. - * 2) The contain the basic information. - * - * We attempt to fill-in additional information with libproc. - */ - ps = ProcessList_getKInfoProcs(&count); - - for (size_t i = 0; i < count; ++i) { - proc = (DarwinProcess*)ProcessList_getProcess(super, ps[i].kp_proc.p_pid, &preExisting, DarwinProcess_new); - - DarwinProcess_setFromKInfoProc(&proc->super, &ps[i], preExisting); - DarwinProcess_setFromLibprocPidinfo(proc, dpl, time_interval_ns); - - if (proc->super.st_uid != ps[i].kp_eproc.e_ucred.cr_uid) { - proc->super.st_uid = ps[i].kp_eproc.e_ucred.cr_uid; - proc->super.user = UsersTable_getRef(super->usersTable, proc->super.st_uid); - } - - // Disabled for High Sierra due to bug in macOS High Sierra - bool isScanThreadSupported = !Platform_KernelVersionIsBetween((KernelVersion) {17, 0, 0}, (KernelVersion) {17, 5, 0}); - - if (isScanThreadSupported) { - DarwinProcess_scanThreads(proc); - } - - super->totalTasks += 1; - - if (!preExisting) { - ProcessList_add(super, &proc->super); - } - } - - free(ps); -} - -bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id) { - assert(id < super->existingCPUs); - - // TODO: support offline CPUs and hot swapping - (void) super; (void) id; - - return true; -} diff --git a/fedora/.local/bin/htop-vim/darwin/DarwinProcessList.h b/fedora/.local/bin/htop-vim/darwin/DarwinProcessList.h deleted file mode 100644 index 393e656..0000000 --- a/fedora/.local/bin/htop-vim/darwin/DarwinProcessList.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef HEADER_DarwinProcessList -#define HEADER_DarwinProcessList -/* -htop - DarwinProcessList.h -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include - -#include "ProcessList.h" -#include "zfs/ZfsArcStats.h" - - -typedef struct DarwinProcessList_ { - ProcessList super; - - host_basic_info_data_t host_info; - vm_statistics_data_t vm_stats; - processor_cpu_load_info_t prev_load; - processor_cpu_load_info_t curr_load; - uint64_t kernel_threads; - uint64_t user_threads; - uint64_t global_diff; - - ZfsArcStats zfs; -} DarwinProcessList; - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId); - -void ProcessList_delete(ProcessList* this); - -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate); - -bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id); - -#endif diff --git a/fedora/.local/bin/htop-vim/darwin/Platform.c b/fedora/.local/bin/htop-vim/darwin/Platform.c deleted file mode 100644 index 332752b..0000000 --- a/fedora/.local/bin/htop-vim/darwin/Platform.c +++ /dev/null @@ -1,437 +0,0 @@ -/* -htop - darwin/Platform.c -(C) 2014 Hisham H. Muhammad -(C) 2015 David C. Hunt -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "darwin/Platform.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ClockMeter.h" -#include "CPUMeter.h" -#include "CRT.h" -#include "DateMeter.h" -#include "DateTimeMeter.h" -#include "HostnameMeter.h" -#include "LoadAverageMeter.h" -#include "Macros.h" -#include "MemoryMeter.h" -#include "MemorySwapMeter.h" -#include "ProcessLocksScreen.h" -#include "SwapMeter.h" -#include "SysArchMeter.h" -#include "TasksMeter.h" -#include "UptimeMeter.h" -#include "darwin/DarwinProcessList.h" -#include "darwin/PlatformHelpers.h" -#include "zfs/ZfsArcMeter.h" -#include "zfs/ZfsCompressedArcMeter.h" - -#ifdef HAVE_HOST_GET_CLOCK_SERVICE -#include -#include -#endif - -#ifdef HAVE_MACH_MACH_TIME_H -#include -#endif - - -const ScreenDefaults Platform_defaultScreens[] = { - { - .name = "Main", - .columns = "PID USER PRIORITY NICE M_VIRT M_RESIDENT STATE PERCENT_CPU PERCENT_MEM TIME Command", - .sortKey = "PERCENT_CPU", - }, -}; - -const unsigned int Platform_numberOfDefaultScreens = ARRAYSIZE(Platform_defaultScreens); - -const SignalItem Platform_signals[] = { - { .name = " 0 Cancel", .number = 0 }, - { .name = " 1 SIGHUP", .number = 1 }, - { .name = " 2 SIGINT", .number = 2 }, - { .name = " 3 SIGQUIT", .number = 3 }, - { .name = " 4 SIGILL", .number = 4 }, - { .name = " 5 SIGTRAP", .number = 5 }, - { .name = " 6 SIGABRT", .number = 6 }, - { .name = " 6 SIGIOT", .number = 6 }, - { .name = " 7 SIGEMT", .number = 7 }, - { .name = " 8 SIGFPE", .number = 8 }, - { .name = " 9 SIGKILL", .number = 9 }, - { .name = "10 SIGBUS", .number = 10 }, - { .name = "11 SIGSEGV", .number = 11 }, - { .name = "12 SIGSYS", .number = 12 }, - { .name = "13 SIGPIPE", .number = 13 }, - { .name = "14 SIGALRM", .number = 14 }, - { .name = "15 SIGTERM", .number = 15 }, - { .name = "16 SIGURG", .number = 16 }, - { .name = "17 SIGSTOP", .number = 17 }, - { .name = "18 SIGTSTP", .number = 18 }, - { .name = "19 SIGCONT", .number = 19 }, - { .name = "20 SIGCHLD", .number = 20 }, - { .name = "21 SIGTTIN", .number = 21 }, - { .name = "22 SIGTTOU", .number = 22 }, - { .name = "23 SIGIO", .number = 23 }, - { .name = "24 SIGXCPU", .number = 24 }, - { .name = "25 SIGXFSZ", .number = 25 }, - { .name = "26 SIGVTALRM", .number = 26 }, - { .name = "27 SIGPROF", .number = 27 }, - { .name = "28 SIGWINCH", .number = 28 }, - { .name = "29 SIGINFO", .number = 29 }, - { .name = "30 SIGUSR1", .number = 30 }, - { .name = "31 SIGUSR2", .number = 31 }, -}; - -const unsigned int Platform_numberOfSignals = ARRAYSIZE(Platform_signals); - -const MeterClass* const Platform_meterTypes[] = { - &CPUMeter_class, - &ClockMeter_class, - &DateMeter_class, - &DateTimeMeter_class, - &LoadAverageMeter_class, - &LoadMeter_class, - &MemoryMeter_class, - &SwapMeter_class, - &MemorySwapMeter_class, - &TasksMeter_class, - &BatteryMeter_class, - &HostnameMeter_class, - &SysArchMeter_class, - &UptimeMeter_class, - &AllCPUsMeter_class, - &AllCPUs2Meter_class, - &AllCPUs4Meter_class, - &AllCPUs8Meter_class, - &LeftCPUsMeter_class, - &RightCPUsMeter_class, - &LeftCPUs2Meter_class, - &RightCPUs2Meter_class, - &LeftCPUs4Meter_class, - &RightCPUs4Meter_class, - &LeftCPUs8Meter_class, - &RightCPUs8Meter_class, - &ZfsArcMeter_class, - &ZfsCompressedArcMeter_class, - &BlankMeter_class, - NULL -}; - -static double Platform_nanosecondsPerMachTick = 1.0; - -static double Platform_nanosecondsPerSchedulerTick = -1; - -bool Platform_init(void) { - Platform_nanosecondsPerMachTick = Platform_calculateNanosecondsPerMachTick(); - - // Determine the number of scheduler clock ticks per second - errno = 0; - long scheduler_ticks_per_sec = sysconf(_SC_CLK_TCK); - - if (errno || scheduler_ticks_per_sec < 1) { - CRT_fatalError("Unable to retrieve clock tick rate"); - } - - const double nanos_per_sec = 1e9; - Platform_nanosecondsPerSchedulerTick = nanos_per_sec / scheduler_ticks_per_sec; - - return true; -} - -// Converts ticks in the Mach "timebase" to nanoseconds. -// See `mach_timebase_info`, as used to define the `Platform_nanosecondsPerMachTick` constant. -uint64_t Platform_machTicksToNanoseconds(uint64_t mach_ticks) { - return (uint64_t) ((double) mach_ticks * Platform_nanosecondsPerMachTick); -} - -// Converts "scheduler ticks" to nanoseconds. -// See `sysconf(_SC_CLK_TCK)`, as used to define the `Platform_nanosecondsPerSchedulerTick` constant. -double Platform_schedulerTicksToNanoseconds(const double scheduler_ticks) { - return scheduler_ticks * Platform_nanosecondsPerSchedulerTick; -} - -void Platform_done(void) { - /* no platform-specific cleanup needed */ -} - -void Platform_setBindings(Htop_Action* keys) { - /* no platform-specific key bindings */ - (void) keys; -} - -int Platform_getUptime(void) { - struct timeval bootTime, currTime; - int mib[2] = { CTL_KERN, KERN_BOOTTIME }; - size_t size = sizeof(bootTime); - - int err = sysctl(mib, 2, &bootTime, &size, NULL, 0); - if (err) { - return -1; - } - gettimeofday(&currTime, NULL); - - return (int) difftime(currTime.tv_sec, bootTime.tv_sec); -} - -void Platform_getLoadAverage(double* one, double* five, double* fifteen) { - double results[3]; - - if (3 == getloadavg(results, 3)) { - *one = results[0]; - *five = results[1]; - *fifteen = results[2]; - } else { - *one = 0; - *five = 0; - *fifteen = 0; - } -} - -int Platform_getMaxPid(void) { - /* http://opensource.apple.com/source/xnu/xnu-2782.1.97/bsd/sys/proc_internal.hh */ - return 99999; -} - -static double Platform_setCPUAverageValues(Meter* mtr) { - const ProcessList* dpl = mtr->pl; - unsigned int activeCPUs = dpl->activeCPUs; - double sumNice = 0.0; - double sumNormal = 0.0; - double sumKernel = 0.0; - double sumPercent = 0.0; - for (unsigned int i = 1; i <= dpl->existingCPUs; i++) { - sumPercent += Platform_setCPUValues(mtr, i); - sumNice += mtr->values[CPU_METER_NICE]; - sumNormal += mtr->values[CPU_METER_NORMAL]; - sumKernel += mtr->values[CPU_METER_KERNEL]; - } - mtr->values[CPU_METER_NICE] = sumNice / activeCPUs; - mtr->values[CPU_METER_NORMAL] = sumNormal / activeCPUs; - mtr->values[CPU_METER_KERNEL] = sumKernel / activeCPUs; - return sumPercent / activeCPUs; -} - -double Platform_setCPUValues(Meter* mtr, unsigned int cpu) { - - if (cpu == 0) { - return Platform_setCPUAverageValues(mtr); - } - - const DarwinProcessList* dpl = (const DarwinProcessList*)mtr->pl; - const processor_cpu_load_info_t prev = &dpl->prev_load[cpu - 1]; - const processor_cpu_load_info_t curr = &dpl->curr_load[cpu - 1]; - double total = 0; - - /* Take the sums */ - for (size_t i = 0; i < CPU_STATE_MAX; ++i) { - total += (double)curr->cpu_ticks[i] - (double)prev->cpu_ticks[i]; - } - - mtr->values[CPU_METER_NICE] - = ((double)curr->cpu_ticks[CPU_STATE_NICE] - (double)prev->cpu_ticks[CPU_STATE_NICE]) * 100.0 / total; - mtr->values[CPU_METER_NORMAL] - = ((double)curr->cpu_ticks[CPU_STATE_USER] - (double)prev->cpu_ticks[CPU_STATE_USER]) * 100.0 / total; - mtr->values[CPU_METER_KERNEL] - = ((double)curr->cpu_ticks[CPU_STATE_SYSTEM] - (double)prev->cpu_ticks[CPU_STATE_SYSTEM]) * 100.0 / total; - - mtr->curItems = 3; - - /* Convert to percent and return */ - total = mtr->values[CPU_METER_NICE] + mtr->values[CPU_METER_NORMAL] + mtr->values[CPU_METER_KERNEL]; - - mtr->values[CPU_METER_FREQUENCY] = NAN; - mtr->values[CPU_METER_TEMPERATURE] = NAN; - - return CLAMP(total, 0.0, 100.0); -} - -void Platform_setMemoryValues(Meter* mtr) { - const DarwinProcessList* dpl = (const DarwinProcessList*)mtr->pl; - const struct vm_statistics* vm = &dpl->vm_stats; - double page_K = (double)vm_page_size / (double)1024; - - mtr->total = dpl->host_info.max_mem / 1024; - mtr->values[MEMORY_METER_USED] = (double)(vm->active_count + vm->wire_count) * page_K; - mtr->values[MEMORY_METER_BUFFERS] = (double)vm->purgeable_count * page_K; - // mtr->values[MEMORY_METER_SHARED] = "shared memory, like tmpfs and shm" - mtr->values[MEMORY_METER_CACHE] = (double)vm->inactive_count * page_K; - // mtr->values[MEMORY_METER_AVAILABLE] = "available memory" -} - -void Platform_setSwapValues(Meter* mtr) { - int mib[2] = {CTL_VM, VM_SWAPUSAGE}; - struct xsw_usage swapused; - size_t swlen = sizeof(swapused); - sysctl(mib, 2, &swapused, &swlen, NULL, 0); - - mtr->total = swapused.xsu_total / 1024; - mtr->values[SWAP_METER_USED] = swapused.xsu_used / 1024; -} - -void Platform_setZfsArcValues(Meter* this) { - const DarwinProcessList* dpl = (const DarwinProcessList*) this->pl; - - ZfsArcMeter_readStats(this, &(dpl->zfs)); -} - -void Platform_setZfsCompressedArcValues(Meter* this) { - const DarwinProcessList* dpl = (const DarwinProcessList*) this->pl; - - ZfsCompressedArcMeter_readStats(this, &(dpl->zfs)); -} - -char* Platform_getProcessEnv(pid_t pid) { - char* env = NULL; - - int argmax; - size_t bufsz = sizeof(argmax); - - int mib[3]; - mib[0] = CTL_KERN; - mib[1] = KERN_ARGMAX; - if (sysctl(mib, 2, &argmax, &bufsz, 0, 0) == 0) { - char* buf = xMalloc(argmax); - if (buf) { - mib[0] = CTL_KERN; - mib[1] = KERN_PROCARGS2; - mib[2] = pid; - bufsz = argmax; - if (sysctl(mib, 3, buf, &bufsz, 0, 0) == 0) { - if (bufsz > sizeof(int)) { - char *p = buf, *endp = buf + bufsz; - int argc = *(int*)(void*)p; - p += sizeof(int); - - // skip exe - p = strchr(p, 0) + 1; - - // skip padding - while (!*p && p < endp) - ++p; - - // skip argv - for (; argc-- && p < endp; p = strrchr(p, 0) + 1) - ; - - // skip padding - while (!*p && p < endp) - ++p; - - size_t size = endp - p; - env = xMalloc(size + 2); - memcpy(env, p, size); - env[size] = 0; - env[size + 1] = 0; - } - } - free(buf); - } - } - - return env; -} - -FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) { - (void)pid; - return NULL; -} - -bool Platform_getDiskIO(DiskIOData* data) { - // TODO - (void)data; - return false; -} - -bool Platform_getNetworkIO(NetworkIOData* data) { - // TODO - (void)data; - return false; -} - -void Platform_getBattery(double* percent, ACPresence* isOnAC) { - *percent = NAN; - *isOnAC = AC_ERROR; - - CFArrayRef list = NULL; - - CFTypeRef power_sources = IOPSCopyPowerSourcesInfo(); - if (!power_sources) - goto cleanup; - - list = IOPSCopyPowerSourcesList(power_sources); - if (!list) - goto cleanup; - - double cap_current = 0.0; - double cap_max = 0.0; - - /* Get the battery */ - for (int i = 0, len = CFArrayGetCount(list); i < len; ++i) { - CFDictionaryRef power_source = IOPSGetPowerSourceDescription(power_sources, CFArrayGetValueAtIndex(list, i)); /* GET rule */ - - if (!power_source) - continue; - - CFStringRef power_type = CFDictionaryGetValue(power_source, CFSTR(kIOPSTransportTypeKey)); /* GET rule */ - - if (kCFCompareEqualTo != CFStringCompare(power_type, CFSTR(kIOPSInternalType), 0)) - continue; - - /* Determine the AC state */ - CFStringRef power_state = CFDictionaryGetValue(power_source, CFSTR(kIOPSPowerSourceStateKey)); - - if (*isOnAC != AC_PRESENT) - *isOnAC = (kCFCompareEqualTo == CFStringCompare(power_state, CFSTR(kIOPSACPowerValue), 0)) ? AC_PRESENT : AC_ABSENT; - - /* Get the percentage remaining */ - double tmp; - CFNumberGetValue(CFDictionaryGetValue(power_source, CFSTR(kIOPSCurrentCapacityKey)), kCFNumberDoubleType, &tmp); - cap_current += tmp; - CFNumberGetValue(CFDictionaryGetValue(power_source, CFSTR(kIOPSMaxCapacityKey)), kCFNumberDoubleType, &tmp); - cap_max += tmp; - } - - if (cap_max > 0.0) - *percent = 100.0 * cap_current / cap_max; - -cleanup: - if (list) - CFRelease(list); - - if (power_sources) - CFRelease(power_sources); -} - -void Platform_gettime_monotonic(uint64_t* msec) { - -#ifdef HAVE_HOST_GET_CLOCK_SERVICE - - clock_serv_t cclock; - mach_timespec_t mts; - - host_get_clock_service(mach_host_self(), SYSTEM_CLOCK, &cclock); - clock_get_time(cclock, &mts); - mach_port_deallocate(mach_task_self(), cclock); - - *msec = ((uint64_t)mts.tv_sec * 1000) + ((uint64_t)mts.tv_nsec / 1000000); - -#else - - Generic_gettime_monotonic(msec); - -#endif - -} diff --git a/fedora/.local/bin/htop-vim/darwin/Platform.h b/fedora/.local/bin/htop-vim/darwin/Platform.h deleted file mode 100644 index 6636207..0000000 --- a/fedora/.local/bin/htop-vim/darwin/Platform.h +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef HEADER_Platform -#define HEADER_Platform -/* -htop - darwin/Platform.h -(C) 2014 Hisham H. Muhammad -(C) 2015 David C. Hunt -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include - -#include "Action.h" -#include "BatteryMeter.h" -#include "CPUMeter.h" -#include "DiskIOMeter.h" -#include "Hashtable.h" -#include "NetworkIOMeter.h" -#include "ProcessLocksScreen.h" -#include "SignalsPanel.h" -#include "CommandLine.h" -#include "darwin/DarwinProcess.h" -#include "generic/gettime.h" -#include "generic/hostname.h" -#include "generic/uname.h" - - -extern const ScreenDefaults Platform_defaultScreens[]; - -extern const unsigned int Platform_numberOfDefaultScreens; - -extern const SignalItem Platform_signals[]; - -extern const unsigned int Platform_numberOfSignals; - -extern const MeterClass* const Platform_meterTypes[]; - -bool Platform_init(void); - -// Converts ticks in the Mach "timebase" to nanoseconds. -// See `mach_timebase_info`, as used to define the `Platform_nanosecondsPerMachTick` constant. -uint64_t Platform_machTicksToNanoseconds(uint64_t mach_ticks); - -// Converts "scheduler ticks" to nanoseconds. -// See `sysconf(_SC_CLK_TCK)`, as used to define the `Platform_nanosecondsPerSchedulerTick` constant. -double Platform_schedulerTicksToNanoseconds(const double scheduler_ticks); - -void Platform_done(void); - -void Platform_setBindings(Htop_Action* keys); - -int Platform_getUptime(void); - -void Platform_getLoadAverage(double* one, double* five, double* fifteen); - -int Platform_getMaxPid(void); - -double Platform_setCPUValues(Meter* mtr, unsigned int cpu); - -void Platform_setMemoryValues(Meter* mtr); - -void Platform_setSwapValues(Meter* mtr); - -void Platform_setZfsArcValues(Meter* this); - -void Platform_setZfsCompressedArcValues(Meter* this); - -char* Platform_getProcessEnv(pid_t pid); - -FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid); - -bool Platform_getDiskIO(DiskIOData* data); - -bool Platform_getNetworkIO(NetworkIOData* data); - -void Platform_getBattery(double* percent, ACPresence* isOnAC); - -static inline void Platform_getHostname(char* buffer, size_t size) { - Generic_hostname(buffer, size); -} - -static inline void Platform_getRelease(char** string) { - *string = Generic_uname(); -} - -#define PLATFORM_LONG_OPTIONS - -static inline void Platform_longOptionsUsage(ATTR_UNUSED const char* name) { } - -static inline CommandLineStatus Platform_getLongOption(ATTR_UNUSED int opt, ATTR_UNUSED int argc, ATTR_UNUSED char** argv) { - return STATUS_ERROR_EXIT; -} - -static inline void Platform_gettime_realtime(struct timeval* tv, uint64_t* msec) { - Generic_gettime_realtime(tv, msec); -} - -void Platform_gettime_monotonic(uint64_t* msec); - -static inline Hashtable* Platform_dynamicMeters(void) { - return NULL; -} - -static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* table) { } - -static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { } - -static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* meter) { } - -static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter* meter, ATTR_UNUSED RichString* out) { } - -static inline Hashtable* Platform_dynamicColumns(void) { - return NULL; -} - -static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* table) { } - -static inline const char* Platform_dynamicColumnInit(ATTR_UNUSED unsigned int key) { - return NULL; -} - -static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Process* proc, ATTR_UNUSED RichString* str, ATTR_UNUSED unsigned int key) { - return false; -} - -#endif diff --git a/fedora/.local/bin/htop-vim/darwin/PlatformHelpers.c b/fedora/.local/bin/htop-vim/darwin/PlatformHelpers.c deleted file mode 100644 index 97f0741..0000000 --- a/fedora/.local/bin/htop-vim/darwin/PlatformHelpers.c +++ /dev/null @@ -1,126 +0,0 @@ -/* -htop - darwin/PlatformHelpers.c -(C) 2018 Pierre Malhaire, 2020-2021 htop dev team, 2021 Alexander Momchilov -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "darwin/PlatformHelpers.h" - -#include -#include -#include -#include -#include - -#include "CRT.h" - -#ifdef HAVE_MACH_MACH_TIME_H -#include -#endif - - -void Platform_GetKernelVersion(KernelVersion* k) { - static KernelVersion cachedKernelVersion; - - if (!cachedKernelVersion.major) { - // just in case it fails someday - cachedKernelVersion = (KernelVersion) { -1, -1, -1 }; - char str[256] = {0}; - size_t size = sizeof(str); - int ret = sysctlbyname("kern.osrelease", str, &size, NULL, 0); - if (ret == 0) { - sscanf(str, "%hd.%hd.%hd", &cachedKernelVersion.major, &cachedKernelVersion.minor, &cachedKernelVersion.patch); - } - } - memcpy(k, &cachedKernelVersion, sizeof(cachedKernelVersion)); -} - -int Platform_CompareKernelVersion(KernelVersion v) { - struct KernelVersion actualVersion; - Platform_GetKernelVersion(&actualVersion); - - if (actualVersion.major != v.major) { - return actualVersion.major - v.major; - } - if (actualVersion.minor != v.minor) { - return actualVersion.minor - v.minor; - } - if (actualVersion.patch != v.patch) { - return actualVersion.patch - v.patch; - } - - return 0; -} - -bool Platform_KernelVersionIsBetween(KernelVersion lowerBound, KernelVersion upperBound) { - return 0 <= Platform_CompareKernelVersion(lowerBound) - && Platform_CompareKernelVersion(upperBound) < 0; -} - -void Platform_getCPUBrandString(char* cpuBrandString, size_t cpuBrandStringSize) { - if (sysctlbyname("machdep.cpu.brand_string", cpuBrandString, &cpuBrandStringSize, NULL, 0) == -1) { - fprintf(stderr, - "WARN: Unable to determine the CPU brand string.\n" - "errno: %i, %s\n", errno, strerror(errno)); - - String_safeStrncpy(cpuBrandString, "UNKNOWN!", cpuBrandStringSize); - } -} - -// Adapted from https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment -bool Platform_isRunningTranslated(void) { - int ret = 0; - size_t size = sizeof(ret); - errno = 0; - if (sysctlbyname("sysctl.proc_translated", &ret, &size, NULL, 0) == -1) { - if (errno == ENOENT) - return false; - - fprintf(stderr, - "WARN: Could not determine if this process was running in a translation environment like Rosetta 2.\n" - "Assuming that we're not.\n" - "errno: %i, %s\n", errno, strerror(errno)); - - return false; - } - return ret; -} - -double Platform_calculateNanosecondsPerMachTick(void) { - // Check if we can determine the timebase used on this system. - // If the API is unavailable assume we get our timebase in nanoseconds. -#ifndef HAVE_MACH_TIMEBASE_INFO - return 1.0; -#else - mach_timebase_info_data_t info; - - /* WORKAROUND for `mach_timebase_info` giving incorrect values on M1 under Rosetta 2. - * rdar://FB9546856 https://openradar.appspot.com/radar?id=5055988478509056 - * - * We don't know exactly what feature/attribute of the M1 chip causes this mistake under Rosetta 2. - * Until we have more Apple ARM chips to compare against, the best we can do is special-case - * the "Apple M1" chip specifically when running under Rosetta 2. - */ - - size_t cpuBrandStringSize = 1024; - char cpuBrandString[cpuBrandStringSize]; - Platform_getCPUBrandString(cpuBrandString, cpuBrandStringSize); - - bool isRunningUnderRosetta2 = Platform_isRunningTranslated(); - - // Kernel version 20.0.0 is macOS 11.0 (Big Sur) - bool isBuggedVersion = Platform_KernelVersionIsBetween((KernelVersion) {20, 0, 0}, (KernelVersion) {999, 999, 999}); - - if (isRunningUnderRosetta2 && String_eq(cpuBrandString, "Apple M1") && isBuggedVersion) { - // In this case `mach_timebase_info` provides the wrong value, so we hard-code the correct factor, - // as determined from `mach_timebase_info` when the process running natively. - info = (mach_timebase_info_data_t) { .numer = 125, .denom = 3 }; - } else { - // No workarounds needed, use the OS-provided value. - mach_timebase_info(&info); - } - - return (double)info.numer / (double)info.denom; -#endif -} diff --git a/fedora/.local/bin/htop-vim/darwin/PlatformHelpers.h b/fedora/.local/bin/htop-vim/darwin/PlatformHelpers.h deleted file mode 100644 index 45aea1a..0000000 --- a/fedora/.local/bin/htop-vim/darwin/PlatformHelpers.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef HEADER_PlatformHelpers -#define HEADER_PlatformHelpers -/* -htop - darwin/PlatformHelpers.h -(C) 2018 Pierre Malhaire, 2020-2022 htop dev team, 2021 Alexander Momchilov -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include - - -typedef struct KernelVersion { - short int major; - short int minor; - short int patch; -} KernelVersion; - -void Platform_GetKernelVersion(KernelVersion* k); - -/* compare the given os version with the one installed returns: -0 if equals the installed version -positive value if less than the installed version -negative value if more than the installed version -*/ -int Platform_CompareKernelVersion(KernelVersion v); - -// lowerBound <= currentVersion < upperBound -bool Platform_KernelVersionIsBetween(KernelVersion lowerBound, KernelVersion upperBound); - -double Platform_calculateNanosecondsPerMachTick(void); - -void Platform_getCPUBrandString(char* cpuBrandString, size_t cpuBrandStringSize); - -bool Platform_isRunningTranslated(void); - -double Platform_calculateNanosecondsPerMachTick(void); - -#endif diff --git a/fedora/.local/bin/htop-vim/darwin/ProcessField.h b/fedora/.local/bin/htop-vim/darwin/ProcessField.h deleted file mode 100644 index 05fbc3b..0000000 --- a/fedora/.local/bin/htop-vim/darwin/ProcessField.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef HEADER_DarwinProcessField -#define HEADER_DarwinProcessField -/* -htop - darwin/ProcessField.h -(C) 2020 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - - -#define PLATFORM_PROCESS_FIELDS \ - TRANSLATED = 100, \ - \ - DUMMY_BUMP_FIELD = CWD, \ - // End of list - - -#endif /* HEADER_DarwinProcessField */ diff --git a/fedora/.local/bin/htop-vim/docs/images/screenshot.png b/fedora/.local/bin/htop-vim/docs/images/screenshot.png deleted file mode 100644 index 85cb9dd..0000000 Binary files a/fedora/.local/bin/htop-vim/docs/images/screenshot.png and /dev/null differ diff --git a/fedora/.local/bin/htop-vim/docs/styleguide.md b/fedora/.local/bin/htop-vim/docs/styleguide.md deleted file mode 100644 index 977ee38..0000000 --- a/fedora/.local/bin/htop-vim/docs/styleguide.md +++ /dev/null @@ -1,243 +0,0 @@ -htop coding style guide -======================= - -Naming conventions ------------------- - -Names are important to convey what all those things inside the project are for. -Filenames for source code traditionally used camel-case naming with the first letter written in uppercase. -The file extension is always lowercase. - -The only exception here is `htop.c` which is the main entrance point into the code. - -Folders for e.g. platform-specific code or complex features spawning multiple files are written in lowercase, e.g. `linux`, `freebsd`, `zfs`. - -Inside files, the naming somewhat depends on the context. -For functions names should include a camel-case prefix before the actual name, separated by an underscore. -While this prefix usually coincides with the module name, this is not required, yet strongly advised. -One important exception to this rule are the memory management and the string utility functions from `XUtils.h`. - -Variable names inside functions should be short and precise. -Using `i` for some loop counter is totally fine, using `someCounterValueForThisSimpleLoop` is not. -On the other hand, when you need to hold global storage try to keep this local to your module, i.e. declare such variables `static` within the C source file. -Only if your variable really needs to be visible for the whole project (which is really rare) it deserves a declaration in the header, marked `extern`. - -File content structure ----------------------- - -The content within each file is usually structured according to the following loose template: - -* Copyright declaration -* Inclusion of used headers -* Necessary data structures and forward declarations -* Static module-private function implementations -* Externally visible function implementations -* Externally visible constant structures (pseudo-OOP definitions) - -For header files header guards based on `#ifdef` should be used. -These header guards are historically placed **before** the Copyright declaration. -Stick to that for consistency please. - -Example: - -```c -#ifndef HEADER_FILENAME -#define HEADER_FILENAME -/* -htop - Filename.h -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ -``` - -Import and use of headers -------------------------- - -We use the GPLv2+ as a shorthand indication that we release `htop` under the GNU Public license version 2 but are totally fine with users opting to apply the "any later version" clause. - -Every file should import headers for all symbols it's using. -Thus when using a symbol from a header, even if that symbol is already imported by something else you use, you should declare an import for that header. -Doing so allows for easier restructuring of the code when things need to be moved around. -If you are unsure if all necessary headers are included you might use IWYU to tell you. - -The list of includes should be the first thing in the file, after the copyright comment and be followed by two blank lines. -The include list should be in the following order, with each group separated by one blank line: - -1. `include "config.h" // IWYU pragma: keep` if the global configuration - from automake&autoconfigure or any of the feature guards for C library headers - (like `__GNU_SOURCE`) are required, optional otherwise. Beware of the IWYU comment. -2. Accompanying module header file (for C source files only, missing inside headers) -3. List of used system headers (non-conditional includes) -4. List of used program headers -5. Conditionally included header files, system headers first - -The list of headers should be sorted with includes from subdirectories following after files inside their parent directory. -Thus `unistd.h` sorts before `sys/time.h`. - -Symbol Exports --------------- - -Exports of symbols should be used sparingly. -Thus unless a function you write is intended to become public API of a module you should mark it as `static`. -If a function should be public API an appropriate declaration for that function has to be placed in the accompanying header file. - -Please avoid function-like macros, in particular when exporting them in a header file. -They have several downsides (re-evaluation of arguments, syntactic escapes, weak typing) for which usually a better alternative like an actual function exists. -Furthermore when using function-like `define`s you may need to mark certain headers for IWYU so tracking of used symbols works. - -Memory Management ------------------ - -When allocating memory make sure to free resources properly. -For allocation this project uses a set of tiny wrappers around the common functions `malloc`, `calloc` and `realloc` named `xMalloc`, `xCalloc` and `xRealloc`. -These functions check that memory allocation worked and error out on failure. - -Allocation functions assert the amount of memory requested is non-zero. -Trying to allocate 0 bytes of memory is an error. -Please use the explicit value `NULL` in this case and handle it in your code accordingly. - -Working with Strings --------------------- - -It is strongly encouraged to use the functions starting with `String_` from `XUtils.h` for working with zero-terminated strings as these make the API easier to use and are intended to make the intent of your code easier to grasp. - -Thus instead of `!strcmp(foo, "foo")` it's preferred to use `String_eq(foo, "foo")` instead. -While sometimes a bit more to type, this helps a lot with making the code easier to follow. - -Styling the code ----------------- - -Now for the style details that can mostly be automated: Indentation, spacing and bracing. -While there is no definitive code style we use, a set of rules loosely enforced has evolved. - -Indentation in the code is done by three (3) spaces. No tabs are used. Ever. - -Before and after keywords should be a space, e.g. `if (condition)` and `do { โ€ฆ } while (condition);`. - -After opening and before closing braces a new line should be started. -Content of such encoded blocks should be indented one level further than their enclosing block. - -If a line of source code becomes too long, or when structuring it into multiple parts for clarity, the continuation line should be indented one more level than the first line it continues: - -```c -if (very_long_condition && - another_very_complex_expression && - something_else_to_check) { - // Code follows as normal ... -} else { - -} -``` - -Braces around simple single code statements (return, break, continue, goto, trivial assignments) are usually left out. - -```c -if (answer) - return 42; -``` - -If it helps readability (with several unrelated if statements in a row) or to avoid dangling-else situations braces can be added. - -Control flow statements and the instruction making up their body should not be put on a single line, -i.e. after the condition of an if statement a new line should be inserted and the body indented accordingly. - -```c -if (answer) - return 42; -else if (again) - continue; -else - break; -``` - -When the statements that form control flow constructs are complex (e.g. more than just a simple assignment or jump) or need explanatory comments you should use braces. -If any block of such a statement uses braces then all blocks of that statement must have braces too. - -```c -if ((fd = open(filename, O_RDONLY)) >= 0 && - (amtRead = read(buffer, sizeof(buffer))) > 0) { - // Parse the information further ... - metric = handleBufferContent(buffer, amtRead); -} else { - metric = -1; -} - -if (fd >= 0) - close(fd); -``` - -While the existing code base isn't fully consistent with this code style yet it is strongly recommended that new code follows these rules. -Adapting surrounding code near places you need to touch is encouraged. -Try to separate such changes into a single, clean-up only commit to reduce noise while reviewing your changes. - -When writing your code consistency with the surrounding codebase is favoured. - -Don't shy away from leaving (single) blank lines to separate different groups of related statements. -They can be a great asset to structure the flow of a method. - -```c - int stuff = 0; - - // If asked for gives only half the answer ... - if (param) - stuff = 21; - - // Compute the answer - stuff %= 2; - stuff *= 4; - stuff *= 5; - stuff += !!stuff; - stuff *= 2; - - return stuff; -``` - -If you want to automate formatting your code, the following command gives you a good baseline of how it should look: - -```bash -astyle -r -xb -s3 -p -xg -c -k1 -W1 -H \*.c \*.h -``` - -Working with System APIs ------------------------- - -Please try to be considerate when using modern platform features. -While they usually provide quite a performance gain or make your life easier, it is beneficial if `htop` runs on rather ancient systems. -Thus when you want to use such features you should try to have an alternative available that works as a fallback. - -An example for this are functions like `fstatat` on Linux that extend the kernel API on modern systems. -But even though it has been around for over a decade you are asked to provide a POSIX alternative like emulating such calls by `fstat` if this is doable. -If an alternative can not be provided you should gracefully downgrade. That could make a feature that requires this shiny API unavailable on systems that lack support for that API. Make this case visually clear to the user. - -In general, code written for the project should be able to compile on any C99-compliant compiler. - -Writing documentation ---------------------- - -The primary user documentation should be the man file which you can find in `htop.1.in`. - -Additional documentation, like this file, should be written in gh-style markdown. -Make each sentence one line. -Markdown will combine these in output formats. -It does only insert a paragraph if you insert a blank line into the source file. -This way git can better diff and present the changes when documentation is altered. - -Documentation files reside in the `docs/` directory and have a `.md` extension. - -Writing pull-requests (PRs) ---------------------------- - -When writing your PR or patch, the set of patches should contain the minimal changes required. -Each patch in itself should ideally be self-contained and runable. - -A PR should not contain any merge commits. -To follow the upstream branch of your PR rebase your work instead. - -Avoid small commits that just fix typos that another of your commits introduced. -Instead squash those changes in the appropriate commit that introduced that mistake. -Git offers `git commit --fixup=` and `git rebase -i --autosquash` to help you with this. - -Your final PR should contain a minimal set of reasonably sized commits that by themselves are easy to review. - -Rebase early. Rebase often. diff --git a/fedora/.local/bin/htop-vim/dragonflybsd/DragonFlyBSDProcess.c b/fedora/.local/bin/htop-vim/dragonflybsd/DragonFlyBSDProcess.c deleted file mode 100644 index 7ff9245..0000000 --- a/fedora/.local/bin/htop-vim/dragonflybsd/DragonFlyBSDProcess.c +++ /dev/null @@ -1,110 +0,0 @@ -/* -htop - dragonflybsd/DragonFlyBSDProcess.c -(C) 2015 Hisham H. Muhammad -(C) 2017 Diederik de Groot -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "dragonflybsd/DragonFlyBSDProcess.h" - -#include -#include -#include -#include - -#include "CRT.h" - -#include "dragonflybsd/Platform.h" - - -const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { - [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, - [PID] = { .name = "PID", .title = "PID", .description = "Process/thread ID", .flags = 0, .pidColumn = true, }, - [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, - [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping (<20s), I Idle, Q Queued for Run, R running, D disk, Z zombie, T traced, W paging, B Blocked, A AskedPage, C Core, J Jailed)", .flags = 0, }, - [PPID] = { .name = "PPID", .title = "PPID", .description = "Parent process ID", .flags = 0, .pidColumn = true, }, - [PGRP] = { .name = "PGRP", .title = "PGRP", .description = "Process group ID", .flags = 0, .pidColumn = true, }, - [SESSION] = { .name = "SESSION", .title = "SID", .description = "Process's session ID", .flags = 0, .pidColumn = true, }, - [TTY] = { .name = "TTY", .title = "TTY ", .description = "Controlling terminal", .flags = 0, }, - [TPGID] = { .name = "TPGID", .title = "TPGID", .description = "Process ID of the fg process group of the controlling terminal", .flags = 0, .pidColumn = true, }, - [MINFLT] = { .name = "MINFLT", .title = " MINFLT ", .description = "Number of minor faults which have not required loading a memory page from disk", .flags = 0, .defaultSortDesc = true, }, - [MAJFLT] = { .name = "MAJFLT", .title = " MAJFLT ", .description = "Number of major faults which have required loading a memory page from disk", .flags = 0, .defaultSortDesc = true, }, - [PRIORITY] = { .name = "PRIORITY", .title = "PRI ", .description = "Kernel's internal priority for the process", .flags = 0, }, - [NICE] = { .name = "NICE", .title = " NI ", .description = "Nice value (the higher the value, the more it lets other processes take priority)", .flags = 0, }, - [STARTTIME] = { .name = "STARTTIME", .title = "START ", .description = "Time the process was started", .flags = 0, }, - [ELAPSED] = { .name = "ELAPSED", .title = "ELAPSED ", .description = "Time since the process was started", .flags = 0, }, - [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, }, - [M_VIRT] = { .name = "M_VIRT", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, .defaultSortDesc = true, }, - [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, .defaultSortDesc = true, }, - [ST_UID] = { .name = "ST_UID", .title = "UID", .description = "User ID of the process owner", .flags = 0, }, - [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = " CPU%", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, .defaultSortDesc = true, .autoWidth = true, }, - [PERCENT_NORM_CPU] = { .name = "PERCENT_NORM_CPU", .title = "NCPU%", .description = "Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)", .flags = 0, .defaultSortDesc = true, .autoWidth = true, }, - [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, .defaultSortDesc = true, }, - [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, - [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, .defaultSortDesc = true, }, - [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, }, - [TGID] = { .name = "TGID", .title = "TGID", .description = "Thread group ID (i.e. process ID)", .flags = 0, .pidColumn = true, }, - [PROC_COMM] = { .name = "COMM", .title = "COMM ", .description = "comm string of the process", .flags = 0, }, - [PROC_EXE] = { .name = "EXE", .title = "EXE ", .description = "Basename of exe of the process", .flags = 0, }, - [CWD] = { .name = "CWD", .title = "CWD ", .description = "The current working directory of the process", .flags = PROCESS_FLAG_CWD, }, - [JID] = { .name = "JID", .title = "JID", .description = "Jail prison ID", .flags = 0, .pidColumn = true, }, - [JAIL] = { .name = "JAIL", .title = "JAIL ", .description = "Jail prison name", .flags = 0, }, -}; - -Process* DragonFlyBSDProcess_new(const Settings* settings) { - DragonFlyBSDProcess* this = xCalloc(1, sizeof(DragonFlyBSDProcess)); - Object_setClass(this, Class(DragonFlyBSDProcess)); - Process_init(&this->super, settings); - return &this->super; -} - -void Process_delete(Object* cast) { - DragonFlyBSDProcess* this = (DragonFlyBSDProcess*) cast; - Process_done((Process*)cast); - free(this->jname); - free(this); -} - -static void DragonFlyBSDProcess_writeField(const Process* this, RichString* str, ProcessField field) { - const DragonFlyBSDProcess* fp = (const DragonFlyBSDProcess*) this; - char buffer[256]; buffer[255] = '\0'; - int attr = CRT_colors[DEFAULT_COLOR]; - size_t n = sizeof(buffer) - 1; - switch (field) { - // add Platform-specific fields here - case PID: xSnprintf(buffer, n, "%*d ", Process_pidDigits, Process_isKernelThread(this) ? -1 : this->pid); break; - case JID: xSnprintf(buffer, n, "%*d ", Process_pidDigits, fp->jid); break; - case JAIL: Process_printLeftAlignedField(str, attr, fp->jname, 11); return; - default: - Process_writeField(this, str, field); - return; - } - RichString_appendWide(str, attr, buffer); -} - -static int DragonFlyBSDProcess_compareByKey(const Process* v1, const Process* v2, ProcessField key) { - const DragonFlyBSDProcess* p1 = (const DragonFlyBSDProcess*)v1; - const DragonFlyBSDProcess* p2 = (const DragonFlyBSDProcess*)v2; - - switch (key) { - // add Platform-specific fields here - case JID: - return SPACESHIP_NUMBER(p1->jid, p2->jid); - case JAIL: - return SPACESHIP_NULLSTR(p1->jname, p2->jname); - default: - return Process_compareByKey_Base(v1, v2, key); - } -} - -const ProcessClass DragonFlyBSDProcess_class = { - .super = { - .extends = Class(Process), - .display = Process_display, - .delete = Process_delete, - .compare = Process_compare - }, - .writeField = DragonFlyBSDProcess_writeField, - .compareByKey = DragonFlyBSDProcess_compareByKey -}; diff --git a/fedora/.local/bin/htop-vim/dragonflybsd/DragonFlyBSDProcess.h b/fedora/.local/bin/htop-vim/dragonflybsd/DragonFlyBSDProcess.h deleted file mode 100644 index e0a77ef..0000000 --- a/fedora/.local/bin/htop-vim/dragonflybsd/DragonFlyBSDProcess.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef HEADER_DragonFlyBSDProcess -#define HEADER_DragonFlyBSDProcess -/* -htop - dragonflybsd/DragonFlyBSDProcess.h -(C) 2015 Hisham H. Muhammad -(C) 2017 Diederik de Groot -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include - -#include "Object.h" -#include "Process.h" -#include "Settings.h" - - -typedef struct DragonFlyBSDProcess_ { - Process super; - int jid; - char* jname; -} DragonFlyBSDProcess; - -extern const ProcessClass DragonFlyBSDProcess_class; - -extern const ProcessFieldData Process_fields[LAST_PROCESSFIELD]; - -Process* DragonFlyBSDProcess_new(const Settings* settings); - -void Process_delete(Object* cast); - -#endif diff --git a/fedora/.local/bin/htop-vim/dragonflybsd/DragonFlyBSDProcessList.c b/fedora/.local/bin/htop-vim/dragonflybsd/DragonFlyBSDProcessList.c deleted file mode 100644 index f46d6ce..0000000 --- a/fedora/.local/bin/htop-vim/dragonflybsd/DragonFlyBSDProcessList.c +++ /dev/null @@ -1,615 +0,0 @@ -/* -htop - DragonFlyBSDProcessList.c -(C) 2014 Hisham H. Muhammad -(C) 2017 Diederik de Groot -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "dragonflybsd/DragonFlyBSDProcessList.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "CRT.h" -#include "Macros.h" - -#include "dragonflybsd/DragonFlyBSDProcess.h" - - -static int MIB_hw_physmem[2]; -static int MIB_vm_stats_vm_v_page_count[4]; -static int pageSize; -static int pageSizeKb; - -static int MIB_vm_stats_vm_v_wire_count[4]; -static int MIB_vm_stats_vm_v_active_count[4]; -static int MIB_vm_stats_vm_v_cache_count[4]; -static int MIB_vm_stats_vm_v_inactive_count[4]; -static int MIB_vm_stats_vm_v_free_count[4]; - -static int MIB_vfs_bufspace[2]; - -static int MIB_kern_cp_time[2]; -static int MIB_kern_cp_times[2]; -static int kernelFScale; - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId) { - size_t len; - char errbuf[_POSIX2_LINE_MAX]; - DragonFlyBSDProcessList* dfpl = xCalloc(1, sizeof(DragonFlyBSDProcessList)); - ProcessList* pl = (ProcessList*) dfpl; - ProcessList_init(pl, Class(DragonFlyBSDProcess), usersTable, dynamicMeters, dynamicColumns, pidMatchList, userId); - - // physical memory in system: hw.physmem - // physical page size: hw.pagesize - // usable pagesize : vm.stats.vm.v_page_size - len = 2; sysctlnametomib("hw.physmem", MIB_hw_physmem, &len); - - len = sizeof(pageSize); - if (sysctlbyname("vm.stats.vm.v_page_size", &pageSize, &len, NULL, 0) == -1) - CRT_fatalError("Cannot get pagesize by sysctl"); - pageSizeKb = pageSize / ONE_K; - - // usable page count vm.stats.vm.v_page_count - // actually usable memory : vm.stats.vm.v_page_count * vm.stats.vm.v_page_size - len = 4; sysctlnametomib("vm.stats.vm.v_page_count", MIB_vm_stats_vm_v_page_count, &len); - - len = 4; sysctlnametomib("vm.stats.vm.v_wire_count", MIB_vm_stats_vm_v_wire_count, &len); - len = 4; sysctlnametomib("vm.stats.vm.v_active_count", MIB_vm_stats_vm_v_active_count, &len); - len = 4; sysctlnametomib("vm.stats.vm.v_cache_count", MIB_vm_stats_vm_v_cache_count, &len); - len = 4; sysctlnametomib("vm.stats.vm.v_inactive_count", MIB_vm_stats_vm_v_inactive_count, &len); - len = 4; sysctlnametomib("vm.stats.vm.v_free_count", MIB_vm_stats_vm_v_free_count, &len); - - len = 2; sysctlnametomib("vfs.bufspace", MIB_vfs_bufspace, &len); - - int cpus = 1; - len = sizeof(cpus); - if (sysctlbyname("hw.ncpu", &cpus, &len, NULL, 0) != 0) { - cpus = 1; - } - - size_t sizeof_cp_time_array = sizeof(unsigned long) * CPUSTATES; - len = 2; sysctlnametomib("kern.cp_time", MIB_kern_cp_time, &len); - dfpl->cp_time_o = xCalloc(CPUSTATES, sizeof(unsigned long)); - dfpl->cp_time_n = xCalloc(CPUSTATES, sizeof(unsigned long)); - len = sizeof_cp_time_array; - - // fetch initial single (or average) CPU clicks from kernel - sysctl(MIB_kern_cp_time, 2, dfpl->cp_time_o, &len, NULL, 0); - - // on smp box, fetch rest of initial CPU's clicks - if (cpus > 1) { - len = 2; sysctlnametomib("kern.cp_times", MIB_kern_cp_times, &len); - dfpl->cp_times_o = xCalloc(cpus, sizeof_cp_time_array); - dfpl->cp_times_n = xCalloc(cpus, sizeof_cp_time_array); - len = cpus * sizeof_cp_time_array; - sysctl(MIB_kern_cp_times, 2, dfpl->cp_times_o, &len, NULL, 0); - } - - pl->existingCPUs = MAXIMUM(cpus, 1); - // TODO: support offline CPUs and hot swapping - pl->activeCPUs = pl->existingCPUs; - - if (cpus == 1 ) { - dfpl->cpus = xRealloc(dfpl->cpus, sizeof(CPUData)); - } else { - // on smp we need CPUs + 1 to store averages too (as kernel kindly provides that as well) - dfpl->cpus = xRealloc(dfpl->cpus, (pl->existingCPUs + 1) * sizeof(CPUData)); - } - - len = sizeof(kernelFScale); - if (sysctlbyname("kern.fscale", &kernelFScale, &len, NULL, 0) == -1) { - //sane default for kernel provided CPU percentage scaling, at least on x86 machines, in case this sysctl call failed - kernelFScale = 2048; - } - - dfpl->kd = kvm_openfiles(NULL, "/dev/null", NULL, 0, errbuf); - if (dfpl->kd == NULL) { - CRT_fatalError("kvm_openfiles() failed"); - } - - return pl; -} - -void ProcessList_delete(ProcessList* this) { - const DragonFlyBSDProcessList* dfpl = (DragonFlyBSDProcessList*) this; - if (dfpl->kd) { - kvm_close(dfpl->kd); - } - - if (dfpl->jails) { - Hashtable_delete(dfpl->jails); - } - free(dfpl->cp_time_o); - free(dfpl->cp_time_n); - free(dfpl->cp_times_o); - free(dfpl->cp_times_n); - free(dfpl->cpus); - - ProcessList_done(this); - free(this); -} - -static inline void DragonFlyBSDProcessList_scanCPUTime(ProcessList* pl) { - const DragonFlyBSDProcessList* dfpl = (DragonFlyBSDProcessList*) pl; - - unsigned int cpus = pl->existingCPUs; // actual CPU count - unsigned int maxcpu = cpus; // max iteration (in case we have average + smp) - int cp_times_offset; - - assert(cpus > 0); - - size_t sizeof_cp_time_array; - - unsigned long* cp_time_n; // old clicks state - unsigned long* cp_time_o; // current clicks state - - unsigned long cp_time_d[CPUSTATES]; - double cp_time_p[CPUSTATES]; - - // get averages or single CPU clicks - sizeof_cp_time_array = sizeof(unsigned long) * CPUSTATES; - sysctl(MIB_kern_cp_time, 2, dfpl->cp_time_n, &sizeof_cp_time_array, NULL, 0); - - // get rest of CPUs - if (cpus > 1) { - // on smp systems DragonFlyBSD kernel concats all CPU states into one long array in - // kern.cp_times sysctl OID - // we store averages in dfpl->cpus[0], and actual cores after that - maxcpu = cpus + 1; - sizeof_cp_time_array = cpus * sizeof(unsigned long) * CPUSTATES; - sysctl(MIB_kern_cp_times, 2, dfpl->cp_times_n, &sizeof_cp_time_array, NULL, 0); - } - - for (unsigned int i = 0; i < maxcpu; i++) { - if (cpus == 1) { - // single CPU box - cp_time_n = dfpl->cp_time_n; - cp_time_o = dfpl->cp_time_o; - } else { - if (i == 0 ) { - // average - cp_time_n = dfpl->cp_time_n; - cp_time_o = dfpl->cp_time_o; - } else { - // specific smp cores - cp_times_offset = i - 1; - cp_time_n = dfpl->cp_times_n + (cp_times_offset * CPUSTATES); - cp_time_o = dfpl->cp_times_o + (cp_times_offset * CPUSTATES); - } - } - - // diff old vs new - unsigned long long total_o = 0; - unsigned long long total_n = 0; - unsigned long long total_d = 0; - for (int s = 0; s < CPUSTATES; s++) { - cp_time_d[s] = cp_time_n[s] - cp_time_o[s]; - total_o += cp_time_o[s]; - total_n += cp_time_n[s]; - } - - // totals - total_d = total_n - total_o; - if (total_d < 1 ) { - total_d = 1; - } - - // save current state as old and calc percentages - for (int s = 0; s < CPUSTATES; ++s) { - cp_time_o[s] = cp_time_n[s]; - cp_time_p[s] = ((double)cp_time_d[s]) / ((double)total_d) * 100; - } - - CPUData* cpuData = &(dfpl->cpus[i]); - cpuData->userPercent = cp_time_p[CP_USER]; - cpuData->nicePercent = cp_time_p[CP_NICE]; - cpuData->systemPercent = cp_time_p[CP_SYS]; - cpuData->irqPercent = cp_time_p[CP_INTR]; - cpuData->systemAllPercent = cp_time_p[CP_SYS] + cp_time_p[CP_INTR]; - // this one is not really used, but we store it anyway - cpuData->idlePercent = cp_time_p[CP_IDLE]; - } -} - -static inline void DragonFlyBSDProcessList_scanMemoryInfo(ProcessList* pl) { - DragonFlyBSDProcessList* dfpl = (DragonFlyBSDProcessList*) pl; - - // @etosan: - // memory counter relationships seem to be these: - // total = active + wired + inactive + cache + free - // htop_used (unavail to anybody) = active + wired - // htop_cache (for cache meter) = buffers + cache - // user_free (avail to procs) = buffers + inactive + cache + free - size_t len = sizeof(pl->totalMem); - - //disabled for now, as it is always smaller than phycal amount of memory... - //...to avoid "where is my memory?" questions - //sysctl(MIB_vm_stats_vm_v_page_count, 4, &(pl->totalMem), &len, NULL, 0); - //pl->totalMem *= pageSizeKb; - sysctl(MIB_hw_physmem, 2, &(pl->totalMem), &len, NULL, 0); - pl->totalMem /= 1024; - - sysctl(MIB_vm_stats_vm_v_active_count, 4, &(dfpl->memActive), &len, NULL, 0); - dfpl->memActive *= pageSizeKb; - - sysctl(MIB_vm_stats_vm_v_wire_count, 4, &(dfpl->memWire), &len, NULL, 0); - dfpl->memWire *= pageSizeKb; - - sysctl(MIB_vfs_bufspace, 2, &(pl->buffersMem), &len, NULL, 0); - pl->buffersMem /= 1024; - - sysctl(MIB_vm_stats_vm_v_cache_count, 4, &(pl->cachedMem), &len, NULL, 0); - pl->cachedMem *= pageSizeKb; - pl->usedMem = dfpl->memActive + dfpl->memWire; - - struct kvm_swap swap[16]; - int nswap = kvm_getswapinfo(dfpl->kd, swap, ARRAYSIZE(swap), 0); - pl->totalSwap = 0; - pl->usedSwap = 0; - for (int i = 0; i < nswap; i++) { - pl->totalSwap += swap[i].ksw_total; - pl->usedSwap += swap[i].ksw_used; - } - pl->totalSwap *= pageSizeKb; - pl->usedSwap *= pageSizeKb; -} - -//static void DragonFlyBSDProcessList_updateExe(const struct kinfo_proc* kproc, Process* proc) { -// const int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, kproc->kp_pid }; -// char buffer[2048]; -// size_t size = sizeof(buffer); -// if (sysctl(mib, 4, buffer, &size, NULL, 0) != 0) { -// Process_updateExe(proc, NULL); -// return; -// } -// -// /* Kernel threads return an empty buffer */ -// if (buffer[0] == '\0') { -// Process_updateExe(proc, NULL); -// return; -// } -// -// Process_updateExe(proc, buffer); -//} - -static void DragonFlyBSDProcessList_updateExe(const struct kinfo_proc* kproc, Process* proc) { - if (Process_isKernelThread(proc)) - return; - - char path[32]; - xSnprintf(path, sizeof(path), "/proc/%d/file", kproc->kp_pid); - - char target[PATH_MAX]; - ssize_t ret = readlink(path, target, sizeof(target) - 1); - if (ret <= 0) - return; - - target[ret] = '\0'; - Process_updateExe(proc, target); -} - -static void DragonFlyBSDProcessList_updateCwd(const struct kinfo_proc* kproc, Process* proc) { - const int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_CWD, kproc->kp_pid }; - char buffer[2048]; - size_t size = sizeof(buffer); - if (sysctl(mib, 4, buffer, &size, NULL, 0) != 0) { - free(proc->procCwd); - proc->procCwd = NULL; - return; - } - - /* Kernel threads return an empty buffer */ - if (buffer[0] == '\0') { - free(proc->procCwd); - proc->procCwd = NULL; - return; - } - - free_and_xStrdup(&proc->procCwd, buffer); -} - -static void DragonFlyBSDProcessList_updateProcessName(kvm_t* kd, const struct kinfo_proc* kproc, Process* proc) { - Process_updateComm(proc, kproc->kp_comm); - - char** argv = kvm_getargv(kd, kproc, 0); - if (!argv || !argv[0]) { - Process_updateCmdline(proc, kproc->kp_comm, 0, strlen(kproc->kp_comm)); - return; - } - - size_t len = 0; - for (int i = 0; argv[i]; i++) { - len += strlen(argv[i]) + 1; - } - - char* cmdline = xMalloc(len); - - char* at = cmdline; - int end = 0; - for (int i = 0; argv[i]; i++) { - at = stpcpy(at, argv[i]); - if (end == 0) { - end = at - cmdline; - } - *at++ = ' '; - } - at--; - *at = '\0'; - - Process_updateCmdline(proc, cmdline, 0, end); - - free(cmdline); -} - -static inline void DragonFlyBSDProcessList_scanJails(DragonFlyBSDProcessList* dfpl) { - size_t len; - char* jls; /* Jail list */ - char* curpos; - char* nextpos; - - if (sysctlbyname("jail.list", NULL, &len, NULL, 0) == -1) { - CRT_fatalError("initial sysctlbyname / jail.list failed"); - } - -retry: - if (len == 0) - return; - - jls = xMalloc(len); - - if (sysctlbyname("jail.list", jls, &len, NULL, 0) == -1) { - if (errno == ENOMEM) { - free(jls); - goto retry; - } - CRT_fatalError("sysctlbyname / jail.list failed"); - } - - if (dfpl->jails) { - Hashtable_delete(dfpl->jails); - } - - dfpl->jails = Hashtable_new(20, true); - curpos = jls; - while (curpos) { - int jailid; - char* str_hostname; - - nextpos = strchr(curpos, '\n'); - if (nextpos) { - *nextpos++ = 0; - } - - jailid = atoi(strtok(curpos, " ")); - str_hostname = strtok(NULL, " "); - - char* jname = (char*) (Hashtable_get(dfpl->jails, jailid)); - if (jname == NULL) { - jname = xStrdup(str_hostname); - Hashtable_put(dfpl->jails, jailid, jname); - } - - curpos = nextpos; - } - - free(jls); -} - -static char* DragonFlyBSDProcessList_readJailName(DragonFlyBSDProcessList* dfpl, int jailid) { - char* hostname; - char* jname; - - if (jailid != 0 && dfpl->jails && (hostname = (char*)Hashtable_get(dfpl->jails, jailid))) { - jname = xStrdup(hostname); - } else { - jname = xStrdup("-"); - } - - return jname; -} - -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { - DragonFlyBSDProcessList* dfpl = (DragonFlyBSDProcessList*) super; - const Settings* settings = super->settings; - bool hideKernelThreads = settings->hideKernelThreads; - bool hideUserlandThreads = settings->hideUserlandThreads; - - DragonFlyBSDProcessList_scanMemoryInfo(super); - DragonFlyBSDProcessList_scanCPUTime(super); - DragonFlyBSDProcessList_scanJails(dfpl); - - // in pause mode only gather global data for meters (CPU/memory/...) - if (pauseProcessUpdate) { - return; - } - - int count = 0; - - const struct kinfo_proc* kprocs = kvm_getprocs(dfpl->kd, KERN_PROC_ALL | (!hideUserlandThreads ? KERN_PROC_FLAG_LWP : 0), 0, &count); - - for (int i = 0; i < count; i++) { - const struct kinfo_proc* kproc = &kprocs[i]; - bool preExisting = false; - bool ATTR_UNUSED isIdleProcess = false; - - // note: dragonflybsd kernel processes all have the same pid, so we misuse the kernel thread address to give them a unique identifier - Process* proc = ProcessList_getProcess(super, kproc->kp_ktaddr ? (pid_t)kproc->kp_ktaddr : kproc->kp_pid, &preExisting, DragonFlyBSDProcess_new); - DragonFlyBSDProcess* dfp = (DragonFlyBSDProcess*) proc; - - if (!preExisting) { - dfp->jid = kproc->kp_jailid; - if (kproc->kp_ktaddr && kproc->kp_flags & P_SYSTEM) { - // dfb kernel threads all have the same pid, so we misuse the kernel thread address to give them a unique identifier - proc->pid = (pid_t)kproc->kp_ktaddr; - proc->isKernelThread = true; - } else { - proc->pid = kproc->kp_pid; // process ID - proc->isKernelThread = false; - } - proc->isUserlandThread = kproc->kp_nthreads > 1; - proc->ppid = kproc->kp_ppid; // parent process id - proc->tpgid = kproc->kp_tpgid; // tty process group id - //proc->tgid = kproc->kp_lwp.kl_tid; // thread group id - proc->tgid = kproc->kp_pid; // thread group id - proc->pgrp = kproc->kp_pgid; // process group id - proc->session = kproc->kp_sid; - proc->st_uid = kproc->kp_uid; // user ID - proc->processor = kproc->kp_lwp.kl_origcpu; - proc->starttime_ctime = kproc->kp_start.tv_sec; - Process_fillStarttimeBuffer(proc); - proc->user = UsersTable_getRef(super->usersTable, proc->st_uid); - - proc->tty_nr = kproc->kp_tdev; // control terminal device number - const char* name = (kproc->kp_tdev != NODEV) ? devname(kproc->kp_tdev, S_IFCHR) : NULL; - if (!name) { - free(proc->tty_name); - proc->tty_name = NULL; - } else { - free_and_xStrdup(&proc->tty_name, name); - } - - DragonFlyBSDProcessList_updateExe(kproc, proc); - DragonFlyBSDProcessList_updateProcessName(dfpl->kd, kproc, proc); - - if (settings->ss->flags & PROCESS_FLAG_CWD) { - DragonFlyBSDProcessList_updateCwd(kproc, proc); - } - - ProcessList_add(super, proc); - - dfp->jname = DragonFlyBSDProcessList_readJailName(dfpl, kproc->kp_jailid); - } else { - proc->processor = kproc->kp_lwp.kl_cpuid; - if (dfp->jid != kproc->kp_jailid) { // process can enter jail anytime - dfp->jid = kproc->kp_jailid; - free(dfp->jname); - dfp->jname = DragonFlyBSDProcessList_readJailName(dfpl, kproc->kp_jailid); - } - // if there are reapers in the system, process can get reparented anytime - proc->ppid = kproc->kp_ppid; - if (proc->st_uid != kproc->kp_uid) { // some processes change users (eg. to lower privs) - proc->st_uid = kproc->kp_uid; - proc->user = UsersTable_getRef(super->usersTable, proc->st_uid); - } - if (settings->updateProcessNames) { - DragonFlyBSDProcessList_updateProcessName(dfpl->kd, kproc, proc); - } - } - - proc->m_virt = kproc->kp_vm_map_size / ONE_K; - proc->m_resident = kproc->kp_vm_rssize * pageSizeKb; - proc->nlwp = kproc->kp_nthreads; // number of lwp thread - proc->time = (kproc->kp_lwp.kl_uticks + kproc->kp_lwp.kl_sticks + kproc->kp_lwp.kl_iticks) / 10000; - - proc->percent_cpu = 100.0 * ((double)kproc->kp_lwp.kl_pctcpu / (double)kernelFScale); - proc->percent_mem = 100.0 * proc->m_resident / (double)(super->totalMem); - Process_updateCPUFieldWidths(proc->percent_cpu); - - if (proc->percent_cpu > 0.1) { - // system idle process should own all CPU time left regardless of CPU count - if (String_eq("idle", kproc->kp_comm)) { - isIdleProcess = true; - } - } - - if (kproc->kp_lwp.kl_pid != -1) - proc->priority = kproc->kp_lwp.kl_prio; - else - proc->priority = -kproc->kp_lwp.kl_tdprio; - - switch (kproc->kp_lwp.kl_rtprio.type) { - case RTP_PRIO_REALTIME: - proc->nice = PRIO_MIN - 1 - RTP_PRIO_MAX + kproc->kp_lwp.kl_rtprio.prio; - break; - case RTP_PRIO_IDLE: - proc->nice = PRIO_MAX + 1 + kproc->kp_lwp.kl_rtprio.prio; - break; - case RTP_PRIO_THREAD: - proc->nice = PRIO_MIN - 1 - RTP_PRIO_MAX - kproc->kp_lwp.kl_rtprio.prio; - break; - default: - proc->nice = kproc->kp_nice; - break; - } - - // would be nice if we could store multiple states in proc->state (as enum) and have writeField render them - /* Taken from: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/c163a4d7ee9c6857ee4e04a3a2cbb50c3de29da1/sys/sys/proc_common.h */ - switch (kproc->kp_stat) { - case SIDL: proc->state = IDLE; isIdleProcess = true; break; - case SACTIVE: - switch (kproc->kp_lwp.kl_stat) { - case LSSLEEP: - if (kproc->kp_lwp.kl_flags & LWP_SINTR) // interruptible wait short/long - if (kproc->kp_lwp.kl_slptime >= MAXSLP) { - proc->state = IDLE; - isIdleProcess = true; - } else { - proc->state = SLEEPING; - } - else if (kproc->kp_lwp.kl_tdflags & TDF_SINTR) // interruptible lwkt wait - proc->state = SLEEPING; - else if (kproc->kp_paddr) // uninterruptible wait - proc->state = UNINTERRUPTIBLE_WAIT; - else // uninterruptible lwkt wait - proc->state = UNINTERRUPTIBLE_WAIT; - break; - case LSRUN: - if (kproc->kp_lwp.kl_stat == LSRUN) { - if (!(kproc->kp_lwp.kl_tdflags & (TDF_RUNNING | TDF_RUNQ))) - proc->state = QUEUED; - else - proc->state = RUNNING; - } - break; - case LSSTOP: - proc->state = STOPPED; - break; - default: - proc->state = PAGING; - break; - } - break; - case SSTOP: proc->state = STOPPED; break; - case SZOMB: proc->state = ZOMBIE; break; - case SCORE: proc->state = BLOCKED; break; - default: proc->state = UNKNOWN; - } - - if (kproc->kp_flags & P_SWAPPEDOUT) - proc->state = SLEEPING; - if (kproc->kp_flags & P_TRACED) - proc->state = TRACED; - if (kproc->kp_flags & P_JAILED) - proc->state = TRACED; - - if (Process_isKernelThread(proc)) - super->kernelThreads++; - - super->totalTasks++; - - if (proc->state == RUNNING) - super->runningTasks++; - - proc->show = ! ((hideKernelThreads && Process_isKernelThread(proc)) || (hideUserlandThreads && Process_isUserlandThread(proc))); - proc->updated = true; - } -} - -bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id) { - assert(id < super->existingCPUs); - - // TODO: support offline CPUs and hot swapping - (void) super; (void) id; - - return true; -} diff --git a/fedora/.local/bin/htop-vim/dragonflybsd/DragonFlyBSDProcessList.h b/fedora/.local/bin/htop-vim/dragonflybsd/DragonFlyBSDProcessList.h deleted file mode 100644 index c1bf2d1..0000000 --- a/fedora/.local/bin/htop-vim/dragonflybsd/DragonFlyBSDProcessList.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef HEADER_DragonFlyBSDProcessList -#define HEADER_DragonFlyBSDProcessList -/* -htop - DragonFlyBSDProcessList.h -(C) 2014 Hisham H. Muhammad -(C) 2017 Diederik de Groot -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include // required for kvm.h -#include -#include -#include -#include -#include -#include -#include - -#include "Hashtable.h" -#include "ProcessList.h" -#include "UsersTable.h" - -#include "dragonflybsd/DragonFlyBSDProcess.h" - - -typedef struct CPUData_ { - double userPercent; - double nicePercent; - double systemPercent; - double irqPercent; - double idlePercent; - double systemAllPercent; -} CPUData; - -typedef struct DragonFlyBSDProcessList_ { - ProcessList super; - kvm_t* kd; - - unsigned long long int memWire; - unsigned long long int memActive; - unsigned long long int memInactive; - unsigned long long int memFree; - - CPUData* cpus; - - unsigned long* cp_time_o; - unsigned long* cp_time_n; - - unsigned long* cp_times_o; - unsigned long* cp_times_n; - - Hashtable* jails; -} DragonFlyBSDProcessList; - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId); - -void ProcessList_delete(ProcessList* this); - -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate); - -bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id); - -#endif diff --git a/fedora/.local/bin/htop-vim/dragonflybsd/Platform.c b/fedora/.local/bin/htop-vim/dragonflybsd/Platform.c deleted file mode 100644 index 8a684d8..0000000 --- a/fedora/.local/bin/htop-vim/dragonflybsd/Platform.c +++ /dev/null @@ -1,262 +0,0 @@ -/* -htop - dragonflybsd/Platform.c -(C) 2014 Hisham H. Muhammad -(C) 2017 Diederik de Groot -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "dragonflybsd/Platform.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "ClockMeter.h" -#include "CPUMeter.h" -#include "DateMeter.h" -#include "DateTimeMeter.h" -#include "HostnameMeter.h" -#include "LoadAverageMeter.h" -#include "MemoryMeter.h" -#include "MemorySwapMeter.h" -#include "ProcessList.h" -#include "SwapMeter.h" -#include "SysArchMeter.h" -#include "TasksMeter.h" -#include "UptimeMeter.h" -#include "dragonflybsd/DragonFlyBSDProcess.h" -#include "dragonflybsd/DragonFlyBSDProcessList.h" - -const ScreenDefaults Platform_defaultScreens[] = { - { - .name = "Main", - .columns = "PID USER PRIORITY NICE M_VIRT M_RESIDENT STATE PERCENT_CPU PERCENT_MEM TIME Command", - .sortKey = "PERCENT_CPU", - }, -}; - -const unsigned int Platform_numberOfDefaultScreens = ARRAYSIZE(Platform_defaultScreens); - -const SignalItem Platform_signals[] = { - { .name = " 0 Cancel", .number = 0 }, - { .name = " 1 SIGHUP", .number = 1 }, - { .name = " 2 SIGINT", .number = 2 }, - { .name = " 3 SIGQUIT", .number = 3 }, - { .name = " 4 SIGILL", .number = 4 }, - { .name = " 5 SIGTRAP", .number = 5 }, - { .name = " 6 SIGABRT", .number = 6 }, - { .name = " 7 SIGEMT", .number = 7 }, - { .name = " 8 SIGFPE", .number = 8 }, - { .name = " 9 SIGKILL", .number = 9 }, - { .name = "10 SIGBUS", .number = 10 }, - { .name = "11 SIGSEGV", .number = 11 }, - { .name = "12 SIGSYS", .number = 12 }, - { .name = "13 SIGPIPE", .number = 13 }, - { .name = "14 SIGALRM", .number = 14 }, - { .name = "15 SIGTERM", .number = 15 }, - { .name = "16 SIGURG", .number = 16 }, - { .name = "17 SIGSTOP", .number = 17 }, - { .name = "18 SIGTSTP", .number = 18 }, - { .name = "19 SIGCONT", .number = 19 }, - { .name = "20 SIGCHLD", .number = 20 }, - { .name = "21 SIGTTIN", .number = 21 }, - { .name = "22 SIGTTOU", .number = 22 }, - { .name = "23 SIGIO", .number = 23 }, - { .name = "24 SIGXCPU", .number = 24 }, - { .name = "25 SIGXFSZ", .number = 25 }, - { .name = "26 SIGVTALRM", .number = 26 }, - { .name = "27 SIGPROF", .number = 27 }, - { .name = "28 SIGWINCH", .number = 28 }, - { .name = "29 SIGINFO", .number = 29 }, - { .name = "30 SIGUSR1", .number = 30 }, - { .name = "31 SIGUSR2", .number = 31 }, - { .name = "32 SIGTHR", .number = 32 }, - { .name = "33 SIGLIBRT", .number = 33 }, -}; - -const unsigned int Platform_numberOfSignals = ARRAYSIZE(Platform_signals); - -const MeterClass* const Platform_meterTypes[] = { - &CPUMeter_class, - &ClockMeter_class, - &DateMeter_class, - &DateTimeMeter_class, - &LoadAverageMeter_class, - &LoadMeter_class, - &MemoryMeter_class, - &MemorySwapMeter_class, - &SwapMeter_class, - &TasksMeter_class, - &UptimeMeter_class, - &BatteryMeter_class, - &HostnameMeter_class, - &SysArchMeter_class, - &AllCPUsMeter_class, - &AllCPUs2Meter_class, - &AllCPUs4Meter_class, - &AllCPUs8Meter_class, - &LeftCPUsMeter_class, - &RightCPUsMeter_class, - &LeftCPUs2Meter_class, - &RightCPUs2Meter_class, - &LeftCPUs4Meter_class, - &RightCPUs4Meter_class, - &LeftCPUs8Meter_class, - &RightCPUs8Meter_class, - &BlankMeter_class, - NULL -}; - -bool Platform_init(void) { - /* no platform-specific setup needed */ - return true; -} - -void Platform_done(void) { - /* no platform-specific cleanup needed */ -} - -void Platform_setBindings(Htop_Action* keys) { - /* no platform-specific key bindings */ - (void) keys; -} - -int Platform_getUptime(void) { - struct timeval bootTime, currTime; - int mib[2] = { CTL_KERN, KERN_BOOTTIME }; - size_t size = sizeof(bootTime); - - int err = sysctl(mib, 2, &bootTime, &size, NULL, 0); - if (err) { - return -1; - } - gettimeofday(&currTime, NULL); - - return (int) difftime(currTime.tv_sec, bootTime.tv_sec); -} - -void Platform_getLoadAverage(double* one, double* five, double* fifteen) { - struct loadavg loadAverage; - int mib[2] = { CTL_VM, VM_LOADAVG }; - size_t size = sizeof(loadAverage); - - int err = sysctl(mib, 2, &loadAverage, &size, NULL, 0); - if (err) { - *one = 0; - *five = 0; - *fifteen = 0; - return; - } - *one = (double) loadAverage.ldavg[0] / loadAverage.fscale; - *five = (double) loadAverage.ldavg[1] / loadAverage.fscale; - *fifteen = (double) loadAverage.ldavg[2] / loadAverage.fscale; -} - -int Platform_getMaxPid(void) { - int maxPid; - size_t size = sizeof(maxPid); - int err = sysctlbyname("kern.pid_max", &maxPid, &size, NULL, 0); - if (err) { - return 999999; - } - return maxPid; -} - -double Platform_setCPUValues(Meter* this, unsigned int cpu) { - const DragonFlyBSDProcessList* fpl = (const DragonFlyBSDProcessList*) this->pl; - unsigned int cpus = this->pl->activeCPUs; - const CPUData* cpuData; - - if (cpus == 1) { - // single CPU box has everything in fpl->cpus[0] - cpuData = &(fpl->cpus[0]); - } else { - cpuData = &(fpl->cpus[cpu]); - } - - double percent; - double* v = this->values; - - v[CPU_METER_NICE] = cpuData->nicePercent; - v[CPU_METER_NORMAL] = cpuData->userPercent; - if (this->pl->settings->detailedCPUTime) { - v[CPU_METER_KERNEL] = cpuData->systemPercent; - v[CPU_METER_IRQ] = cpuData->irqPercent; - this->curItems = 4; - percent = v[0] + v[1] + v[2] + v[3]; - } else { - v[2] = cpuData->systemAllPercent; - this->curItems = 3; - percent = v[0] + v[1] + v[2]; - } - - percent = isnan(percent) ? 0.0 : CLAMP(percent, 0.0, 100.0); - - v[CPU_METER_FREQUENCY] = NAN; - v[CPU_METER_TEMPERATURE] = NAN; - - return percent; -} - -void Platform_setMemoryValues(Meter* this) { - // TODO - const ProcessList* pl = this->pl; - - this->total = pl->totalMem; - this->values[MEMORY_METER_USED] = pl->usedMem; - this->values[MEMORY_METER_BUFFERS] = pl->buffersMem; - // this->values[MEMORY_METER_SHARED] = "shared memory, like tmpfs and shm" - this->values[MEMORY_METER_CACHE] = pl->cachedMem; - // this->values[MEMORY_METER_AVAILABLE] = "available memory" -} - -void Platform_setSwapValues(Meter* this) { - const ProcessList* pl = this->pl; - this->total = pl->totalSwap; - this->values[SWAP_METER_USED] = pl->usedSwap; - this->values[SWAP_METER_CACHE] = NAN; -} - -char* Platform_getProcessEnv(pid_t pid) { - // TODO - (void)pid; // prevent unused warning - return NULL; -} - -FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) { - (void)pid; - return NULL; -} - -bool Platform_getDiskIO(DiskIOData* data) { - // TODO - (void)data; - return false; -} - -bool Platform_getNetworkIO(NetworkIOData* data) { - // TODO - (void)data; - return false; -} - -void Platform_getBattery(double* percent, ACPresence* isOnAC) { - int life; - size_t life_len = sizeof(life); - if (sysctlbyname("hw.acpi.battery.life", &life, &life_len, NULL, 0) == -1) - *percent = NAN; - else - *percent = life; - - int acline; - size_t acline_len = sizeof(acline); - if (sysctlbyname("hw.acpi.acline", &acline, &acline_len, NULL, 0) == -1) - *isOnAC = AC_ERROR; - else - *isOnAC = acline == 0 ? AC_ABSENT : AC_PRESENT; -} diff --git a/fedora/.local/bin/htop-vim/dragonflybsd/Platform.h b/fedora/.local/bin/htop-vim/dragonflybsd/Platform.h deleted file mode 100644 index cf69356..0000000 --- a/fedora/.local/bin/htop-vim/dragonflybsd/Platform.h +++ /dev/null @@ -1,120 +0,0 @@ -#ifndef HEADER_Platform -#define HEADER_Platform -/* -htop - dragonflybsd/Platform.h -(C) 2014 Hisham H. Muhammad -(C) 2017 Diederik de Groot -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include -#include -#include - -#include "Action.h" -#include "BatteryMeter.h" -#include "DiskIOMeter.h" -#include "Hashtable.h" -#include "Macros.h" -#include "Meter.h" -#include "NetworkIOMeter.h" -#include "Process.h" -#include "ProcessLocksScreen.h" -#include "SignalsPanel.h" -#include "CommandLine.h" -#include "generic/gettime.h" -#include "generic/hostname.h" -#include "generic/uname.h" - - -extern const ScreenDefaults Platform_defaultScreens[]; - -extern const unsigned int Platform_numberOfDefaultScreens; - -extern const SignalItem Platform_signals[]; - -extern const unsigned int Platform_numberOfSignals; - -extern const MeterClass* const Platform_meterTypes[]; - -bool Platform_init(void); - -void Platform_done(void); - -void Platform_setBindings(Htop_Action* keys); - -int Platform_getUptime(void); - -void Platform_getLoadAverage(double* one, double* five, double* fifteen); - -int Platform_getMaxPid(void); - -double Platform_setCPUValues(Meter* this, unsigned int cpu); - -void Platform_setMemoryValues(Meter* this); - -void Platform_setSwapValues(Meter* this); - -char* Platform_getProcessEnv(pid_t pid); - -FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid); - -bool Platform_getDiskIO(DiskIOData* data); - -bool Platform_getNetworkIO(NetworkIOData* data); - -void Platform_getBattery(double* percent, ACPresence* isOnAC); - -static inline void Platform_getHostname(char* buffer, size_t size) { - Generic_hostname(buffer, size); -} - -static inline void Platform_getRelease(char** string) { - *string = Generic_uname(); -} - -#define PLATFORM_LONG_OPTIONS - -static inline void Platform_longOptionsUsage(ATTR_UNUSED const char* name) { } - -static inline CommandLineStatus Platform_getLongOption(ATTR_UNUSED int opt, ATTR_UNUSED int argc, ATTR_UNUSED char** argv) { - return STATUS_ERROR_EXIT; -} - -static inline void Platform_gettime_realtime(struct timeval* tv, uint64_t* msec) { - Generic_gettime_realtime(tv, msec); -} - -static inline void Platform_gettime_monotonic(uint64_t* msec) { - Generic_gettime_monotonic(msec); -} - -static inline Hashtable* Platform_dynamicMeters(void) { - return NULL; -} - -static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* table) { } - -static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { } - -static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* meter) { } - -static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter* meter, ATTR_UNUSED RichString* out) { } - -static inline Hashtable* Platform_dynamicColumns(void) { - return NULL; -} - -static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* table) { } - -static inline const char* Platform_dynamicColumnInit(ATTR_UNUSED unsigned int key) { - return NULL; -} - -static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Process* proc, ATTR_UNUSED RichString* str, ATTR_UNUSED unsigned int key) { - return false; -} - -#endif diff --git a/fedora/.local/bin/htop-vim/dragonflybsd/ProcessField.h b/fedora/.local/bin/htop-vim/dragonflybsd/ProcessField.h deleted file mode 100644 index 1409675..0000000 --- a/fedora/.local/bin/htop-vim/dragonflybsd/ProcessField.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef HEADER_DragonFlyBSDProcessField -#define HEADER_DragonFlyBSDProcessField -/* -htop - dragonflybsd/ProcessField.h -(C) 2020 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - - -#define PLATFORM_PROCESS_FIELDS \ - JID = 100, \ - JAIL = 101, \ - \ - DUMMY_BUMP_FIELD = CWD, \ - // End of list - - -#endif /* HEADER_DragonFlyBSDProcessField */ diff --git a/fedora/.local/bin/htop-vim/freebsd/FreeBSDProcess.c b/fedora/.local/bin/htop-vim/freebsd/FreeBSDProcess.c deleted file mode 100644 index 90bc1f2..0000000 --- a/fedora/.local/bin/htop-vim/freebsd/FreeBSDProcess.c +++ /dev/null @@ -1,122 +0,0 @@ -/* -htop - FreeBSDProcess.c -(C) 2015 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "freebsd/FreeBSDProcess.h" - -#include - -#include "CRT.h" -#include "Macros.h" -#include "Process.h" -#include "RichString.h" -#include "Scheduling.h" -#include "XUtils.h" - - -const char* const nodevStr = "nodev"; - -const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { - [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, - [PID] = { .name = "PID", .title = "PID", .description = "Process/thread ID", .flags = 0, .pidColumn = true, }, - [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, - [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging)", .flags = 0, }, - [PPID] = { .name = "PPID", .title = "PPID", .description = "Parent process ID", .flags = 0, .pidColumn = true, }, - [PGRP] = { .name = "PGRP", .title = "PGRP", .description = "Process group ID", .flags = 0, .pidColumn = true, }, - [SESSION] = { .name = "SESSION", .title = "SID", .description = "Process's session ID", .flags = 0, .pidColumn = true, }, - [TTY] = { .name = "TTY", .title = "TTY ", .description = "Controlling terminal", .flags = 0, }, - [TPGID] = { .name = "TPGID", .title = "TPGID", .description = "Process ID of the fg process group of the controlling terminal", .flags = 0, .pidColumn = true, }, - [MAJFLT] = { .name = "MAJFLT", .title = " MAJFLT ", .description = "Number of copy-on-write faults", .flags = 0, .defaultSortDesc = true, }, - [PRIORITY] = { .name = "PRIORITY", .title = "PRI ", .description = "Kernel's internal priority for the process", .flags = 0, }, - [NICE] = { .name = "NICE", .title = " NI ", .description = "Nice value (the higher the value, the more it lets other processes take priority)", .flags = 0, }, - [STARTTIME] = { .name = "STARTTIME", .title = "START ", .description = "Time the process was started", .flags = 0, }, - [ELAPSED] = { .name = "ELAPSED", .title = "ELAPSED ", .description = "Time since the process was started", .flags = 0, }, - [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, }, - [M_VIRT] = { .name = "M_VIRT", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, .defaultSortDesc = true, }, - [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, .defaultSortDesc = true, }, - [ST_UID] = { .name = "ST_UID", .title = "UID", .description = "User ID of the process owner", .flags = 0, }, - [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = " CPU%", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, .defaultSortDesc = true, .autoWidth = true, }, - [PERCENT_NORM_CPU] = { .name = "PERCENT_NORM_CPU", .title = "NCPU%", .description = "Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)", .flags = 0, .defaultSortDesc = true, .autoWidth = true, }, - [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, .defaultSortDesc = true, }, - [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, - [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, .defaultSortDesc = true, }, - [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, .defaultSortDesc = true, }, - [TGID] = { .name = "TGID", .title = "TGID", .description = "Thread group ID (i.e. process ID)", .flags = 0, .pidColumn = true, }, - [PROC_COMM] = { .name = "COMM", .title = "COMM ", .description = "comm string of the process", .flags = 0, }, - [PROC_EXE] = { .name = "EXE", .title = "EXE ", .description = "Basename of exe of the process", .flags = 0, }, - [CWD] = { .name = "CWD", .title = "CWD ", .description = "The current working directory of the process", .flags = PROCESS_FLAG_CWD, }, -#ifdef SCHEDULER_SUPPORT - [SCHEDULERPOLICY] = { .name = "SCHEDULERPOLICY", .title = "SCHED ", .description = "Current scheduling policy of the process", .flags = PROCESS_FLAG_SCHEDPOL, }, -#endif - [JID] = { .name = "JID", .title = "JID", .description = "Jail prison ID", .flags = 0, .pidColumn = true, }, - [JAIL] = { .name = "JAIL", .title = "JAIL ", .description = "Jail prison name", .flags = 0, }, - [EMULATION] = { .name = "EMULATION", .title = "EMULATION ", .description = "System call emulation environment (ABI)", .flags = 0, }, -}; - -Process* FreeBSDProcess_new(const Settings* settings) { - FreeBSDProcess* this = xCalloc(1, sizeof(FreeBSDProcess)); - Object_setClass(this, Class(FreeBSDProcess)); - Process_init(&this->super, settings); - return &this->super; -} - -void Process_delete(Object* cast) { - FreeBSDProcess* this = (FreeBSDProcess*) cast; - Process_done((Process*)cast); - free(this->emul); - free(this->jname); - free(this); -} - -static void FreeBSDProcess_writeField(const Process* this, RichString* str, ProcessField field) { - const FreeBSDProcess* fp = (const FreeBSDProcess*) this; - char buffer[256]; - size_t n = sizeof(buffer); - int attr = CRT_colors[DEFAULT_COLOR]; - - switch (field) { - // add FreeBSD-specific fields here - case JID: xSnprintf(buffer, n, "%*d ", Process_pidDigits, fp->jid); break; - case JAIL: - Process_printLeftAlignedField(str, attr, fp->jname ? fp->jname : "N/A", 11); - return; - case EMULATION: - Process_printLeftAlignedField(str, attr, fp->emul ? fp->emul : "N/A", 16); - return; - default: - Process_writeField(this, str, field); - return; - } - RichString_appendWide(str, attr, buffer); -} - -static int FreeBSDProcess_compareByKey(const Process* v1, const Process* v2, ProcessField key) { - const FreeBSDProcess* p1 = (const FreeBSDProcess*)v1; - const FreeBSDProcess* p2 = (const FreeBSDProcess*)v2; - - switch (key) { - // add FreeBSD-specific fields here - case JID: - return SPACESHIP_NUMBER(p1->jid, p2->jid); - case JAIL: - return SPACESHIP_NULLSTR(p1->jname, p2->jname); - case EMULATION: - return SPACESHIP_NULLSTR(p1->emul, p2->emul); - default: - return Process_compareByKey_Base(v1, v2, key); - } -} - -const ProcessClass FreeBSDProcess_class = { - .super = { - .extends = Class(Process), - .display = Process_display, - .delete = Process_delete, - .compare = Process_compare - }, - .writeField = FreeBSDProcess_writeField, - .compareByKey = FreeBSDProcess_compareByKey -}; diff --git a/fedora/.local/bin/htop-vim/freebsd/FreeBSDProcess.h b/fedora/.local/bin/htop-vim/freebsd/FreeBSDProcess.h deleted file mode 100644 index 654f9cf..0000000 --- a/fedora/.local/bin/htop-vim/freebsd/FreeBSDProcess.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef HEADER_FreeBSDProcess -#define HEADER_FreeBSDProcess -/* -htop - FreeBSDProcess.h -(C) 2015 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include - -#include "Object.h" -#include "Process.h" -#include "Settings.h" - - -typedef struct FreeBSDProcess_ { - Process super; - int jid; - char* jname; - char* emul; -} FreeBSDProcess; - -extern const ProcessClass FreeBSDProcess_class; - -extern const ProcessFieldData Process_fields[LAST_PROCESSFIELD]; - -Process* FreeBSDProcess_new(const Settings* settings); - -void Process_delete(Object* cast); - -#endif diff --git a/fedora/.local/bin/htop-vim/freebsd/FreeBSDProcessList.c b/fedora/.local/bin/htop-vim/freebsd/FreeBSDProcessList.c deleted file mode 100644 index 98447df..0000000 --- a/fedora/.local/bin/htop-vim/freebsd/FreeBSDProcessList.c +++ /dev/null @@ -1,631 +0,0 @@ -/* -htop - FreeBSDProcessList.c -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "freebsd/FreeBSDProcessList.h" - -#include -#include -#include -#include -#include -#include -#include -#include // needs to be included before for MAXPATHLEN -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "CRT.h" -#include "Compat.h" -#include "FreeBSDProcess.h" -#include "Macros.h" -#include "Object.h" -#include "Process.h" -#include "ProcessList.h" -#include "Scheduling.h" -#include "Settings.h" -#include "XUtils.h" -#include "generic/openzfs_sysctl.h" -#include "zfs/ZfsArcStats.h" - - -static int MIB_hw_physmem[2]; -static int MIB_vm_stats_vm_v_page_count[4]; -static int pageSize; -static int pageSizeKb; - -static int MIB_vm_stats_vm_v_wire_count[4]; -static int MIB_vm_stats_vm_v_active_count[4]; -static int MIB_vm_stats_vm_v_cache_count[4]; -static int MIB_vm_stats_vm_v_inactive_count[4]; -static int MIB_vm_stats_vm_v_free_count[4]; -static int MIB_vm_vmtotal[2]; - -static int MIB_vfs_bufspace[2]; - -static int MIB_kern_cp_time[2]; -static int MIB_kern_cp_times[2]; -static int kernelFScale; - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* DynamicColumns, Hashtable* pidMatchList, uid_t userId) { - size_t len; - char errbuf[_POSIX2_LINE_MAX]; - FreeBSDProcessList* fpl = xCalloc(1, sizeof(FreeBSDProcessList)); - ProcessList* pl = (ProcessList*) fpl; - ProcessList_init(pl, Class(FreeBSDProcess), usersTable, dynamicMeters, DynamicColumns, pidMatchList, userId); - - // physical memory in system: hw.physmem - // physical page size: hw.pagesize - // usable pagesize : vm.stats.vm.v_page_size - len = 2; sysctlnametomib("hw.physmem", MIB_hw_physmem, &len); - - len = sizeof(pageSize); - if (sysctlbyname("vm.stats.vm.v_page_size", &pageSize, &len, NULL, 0) == -1) - CRT_fatalError("Cannot get pagesize by sysctl"); - pageSizeKb = pageSize / ONE_K; - - // usable page count vm.stats.vm.v_page_count - // actually usable memory : vm.stats.vm.v_page_count * vm.stats.vm.v_page_size - len = 4; sysctlnametomib("vm.stats.vm.v_page_count", MIB_vm_stats_vm_v_page_count, &len); - - len = 4; sysctlnametomib("vm.stats.vm.v_wire_count", MIB_vm_stats_vm_v_wire_count, &len); - len = 4; sysctlnametomib("vm.stats.vm.v_active_count", MIB_vm_stats_vm_v_active_count, &len); - len = 4; sysctlnametomib("vm.stats.vm.v_cache_count", MIB_vm_stats_vm_v_cache_count, &len); - len = 4; sysctlnametomib("vm.stats.vm.v_inactive_count", MIB_vm_stats_vm_v_inactive_count, &len); - len = 4; sysctlnametomib("vm.stats.vm.v_free_count", MIB_vm_stats_vm_v_free_count, &len); - len = 2; sysctlnametomib("vm.vmtotal", MIB_vm_vmtotal, &len); - - len = 2; sysctlnametomib("vfs.bufspace", MIB_vfs_bufspace, &len); - - openzfs_sysctl_init(&fpl->zfs); - openzfs_sysctl_updateArcStats(&fpl->zfs); - - int smp = 0; - len = sizeof(smp); - - if (sysctlbyname("kern.smp.active", &smp, &len, NULL, 0) != 0 || len != sizeof(smp)) { - smp = 0; - } - - int cpus = 1; - len = sizeof(cpus); - - if (smp) { - int err = sysctlbyname("kern.smp.cpus", &cpus, &len, NULL, 0); - if (err) { - cpus = 1; - } - } else { - cpus = 1; - } - - size_t sizeof_cp_time_array = sizeof(unsigned long) * CPUSTATES; - len = 2; sysctlnametomib("kern.cp_time", MIB_kern_cp_time, &len); - fpl->cp_time_o = xCalloc(CPUSTATES, sizeof(unsigned long)); - fpl->cp_time_n = xCalloc(CPUSTATES, sizeof(unsigned long)); - len = sizeof_cp_time_array; - - // fetch initial single (or average) CPU clicks from kernel - sysctl(MIB_kern_cp_time, 2, fpl->cp_time_o, &len, NULL, 0); - - // on smp box, fetch rest of initial CPU's clicks - if (cpus > 1) { - len = 2; sysctlnametomib("kern.cp_times", MIB_kern_cp_times, &len); - fpl->cp_times_o = xCalloc(cpus, sizeof_cp_time_array); - fpl->cp_times_n = xCalloc(cpus, sizeof_cp_time_array); - len = cpus * sizeof_cp_time_array; - sysctl(MIB_kern_cp_times, 2, fpl->cp_times_o, &len, NULL, 0); - } - - pl->existingCPUs = MAXIMUM(cpus, 1); - // TODO: support offline CPUs and hot swapping - pl->activeCPUs = pl->existingCPUs; - - if (cpus == 1 ) { - fpl->cpus = xRealloc(fpl->cpus, sizeof(CPUData)); - } else { - // on smp we need CPUs + 1 to store averages too (as kernel kindly provides that as well) - fpl->cpus = xRealloc(fpl->cpus, (pl->existingCPUs + 1) * sizeof(CPUData)); - } - - - len = sizeof(kernelFScale); - if (sysctlbyname("kern.fscale", &kernelFScale, &len, NULL, 0) == -1) { - //sane default for kernel provided CPU percentage scaling, at least on x86 machines, in case this sysctl call failed - kernelFScale = 2048; - } - - fpl->kd = kvm_openfiles(NULL, "/dev/null", NULL, 0, errbuf); - if (fpl->kd == NULL) { - CRT_fatalError("kvm_openfiles() failed"); - } - - return pl; -} - -void ProcessList_delete(ProcessList* this) { - const FreeBSDProcessList* fpl = (FreeBSDProcessList*) this; - - if (fpl->kd) { - kvm_close(fpl->kd); - } - - free(fpl->cp_time_o); - free(fpl->cp_time_n); - free(fpl->cp_times_o); - free(fpl->cp_times_n); - free(fpl->cpus); - - ProcessList_done(this); - free(this); -} - -static inline void FreeBSDProcessList_scanCPU(ProcessList* pl) { - const FreeBSDProcessList* fpl = (FreeBSDProcessList*) pl; - - unsigned int cpus = pl->existingCPUs; // actual CPU count - unsigned int maxcpu = cpus; // max iteration (in case we have average + smp) - int cp_times_offset; - - assert(cpus > 0); - - size_t sizeof_cp_time_array; - - unsigned long* cp_time_n; // old clicks state - unsigned long* cp_time_o; // current clicks state - - unsigned long cp_time_d[CPUSTATES]; - double cp_time_p[CPUSTATES]; - - // get averages or single CPU clicks - sizeof_cp_time_array = sizeof(unsigned long) * CPUSTATES; - sysctl(MIB_kern_cp_time, 2, fpl->cp_time_n, &sizeof_cp_time_array, NULL, 0); - - // get rest of CPUs - if (cpus > 1) { - // on smp systems FreeBSD kernel concats all CPU states into one long array in - // kern.cp_times sysctl OID - // we store averages in fpl->cpus[0], and actual cores after that - maxcpu = cpus + 1; - sizeof_cp_time_array = cpus * sizeof(unsigned long) * CPUSTATES; - sysctl(MIB_kern_cp_times, 2, fpl->cp_times_n, &sizeof_cp_time_array, NULL, 0); - } - - for (unsigned int i = 0; i < maxcpu; i++) { - if (cpus == 1) { - // single CPU box - cp_time_n = fpl->cp_time_n; - cp_time_o = fpl->cp_time_o; - } else { - if (i == 0 ) { - // average - cp_time_n = fpl->cp_time_n; - cp_time_o = fpl->cp_time_o; - } else { - // specific smp cores - cp_times_offset = i - 1; - cp_time_n = fpl->cp_times_n + (cp_times_offset * CPUSTATES); - cp_time_o = fpl->cp_times_o + (cp_times_offset * CPUSTATES); - } - } - - // diff old vs new - unsigned long long total_o = 0; - unsigned long long total_n = 0; - unsigned long long total_d = 0; - for (int s = 0; s < CPUSTATES; s++) { - cp_time_d[s] = cp_time_n[s] - cp_time_o[s]; - total_o += cp_time_o[s]; - total_n += cp_time_n[s]; - } - - // totals - total_d = total_n - total_o; - if (total_d < 1 ) { - total_d = 1; - } - - // save current state as old and calc percentages - for (int s = 0; s < CPUSTATES; ++s) { - cp_time_o[s] = cp_time_n[s]; - cp_time_p[s] = ((double)cp_time_d[s]) / ((double)total_d) * 100; - } - - CPUData* cpuData = &(fpl->cpus[i]); - cpuData->userPercent = cp_time_p[CP_USER]; - cpuData->nicePercent = cp_time_p[CP_NICE]; - cpuData->systemPercent = cp_time_p[CP_SYS]; - cpuData->irqPercent = cp_time_p[CP_INTR]; - cpuData->systemAllPercent = cp_time_p[CP_SYS] + cp_time_p[CP_INTR]; - // this one is not really used - //cpuData->idlePercent = cp_time_p[CP_IDLE]; - - cpuData->temperature = NAN; - cpuData->frequency = NAN; - - const int coreId = (cpus == 1) ? 0 : ((int)i - 1); - if (coreId < 0) - continue; - - // TODO: test with hyperthreading and multi-cpu systems - if (pl->settings->showCPUTemperature) { - int temperature; - size_t len = sizeof(temperature); - char mibBuffer[32]; - xSnprintf(mibBuffer, sizeof(mibBuffer), "dev.cpu.%d.temperature", coreId); - int r = sysctlbyname(mibBuffer, &temperature, &len, NULL, 0); - if (r == 0) - cpuData->temperature = (double)(temperature - 2732) / 10.0; // convert from deci-Kelvin to Celsius - } - - // TODO: test with hyperthreading and multi-cpu systems - if (pl->settings->showCPUFrequency) { - int frequency; - size_t len = sizeof(frequency); - char mibBuffer[32]; - xSnprintf(mibBuffer, sizeof(mibBuffer), "dev.cpu.%d.freq", coreId); - int r = sysctlbyname(mibBuffer, &frequency, &len, NULL, 0); - if (r == 0) - cpuData->frequency = frequency; // keep in MHz - } - } - - // calculate max temperature and avg frequency for average meter and - // propagate frequency to all cores if only supplied for CPU 0 - if (cpus > 1) { - if (pl->settings->showCPUTemperature) { - double maxTemp = NAN; - for (unsigned int i = 1; i < maxcpu; i++) { - const double coreTemp = fpl->cpus[i].temperature; - if (isnan(coreTemp)) - continue; - - maxTemp = MAXIMUM(maxTemp, coreTemp); - } - - fpl->cpus[0].temperature = maxTemp; - } - - if (pl->settings->showCPUFrequency) { - const double coreZeroFreq = fpl->cpus[1].frequency; - double freqSum = coreZeroFreq; - if (!isnan(coreZeroFreq)) { - for (unsigned int i = 2; i < maxcpu; i++) { - if (isnan(fpl->cpus[i].frequency)) - fpl->cpus[i].frequency = coreZeroFreq; - - freqSum += fpl->cpus[i].frequency; - } - - fpl->cpus[0].frequency = freqSum / (maxcpu - 1); - } - } - } -} - -static inline void FreeBSDProcessList_scanMemoryInfo(ProcessList* pl) { - FreeBSDProcessList* fpl = (FreeBSDProcessList*) pl; - - // @etosan: - // memory counter relationships seem to be these: - // total = active + wired + inactive + cache + free - // htop_used (unavail to anybody) = active + wired - // htop_cache (for cache meter) = buffers + cache - // user_free (avail to procs) = buffers + inactive + cache + free - // - // with ZFS ARC situation becomes bit muddled, as ARC behaves like "user_free" - // and belongs into cache, but is reported as wired by kernel - // - // htop_used = active + (wired - arc) - // htop_cache = buffers + cache + arc - u_long totalMem; - u_int memActive, memWire, cachedMem; - long buffersMem; - size_t len; - struct vmtotal vmtotal; - - //disabled for now, as it is always smaller than phycal amount of memory... - //...to avoid "where is my memory?" questions - //sysctl(MIB_vm_stats_vm_v_page_count, 4, &(pl->totalMem), &len, NULL, 0); - //pl->totalMem *= pageSizeKb; - len = sizeof(totalMem); - sysctl(MIB_hw_physmem, 2, &(totalMem), &len, NULL, 0); - totalMem /= 1024; - pl->totalMem = totalMem; - - len = sizeof(memActive); - sysctl(MIB_vm_stats_vm_v_active_count, 4, &(memActive), &len, NULL, 0); - memActive *= pageSizeKb; - fpl->memActive = memActive; - - len = sizeof(memWire); - sysctl(MIB_vm_stats_vm_v_wire_count, 4, &(memWire), &len, NULL, 0); - memWire *= pageSizeKb; - fpl->memWire = memWire; - - len = sizeof(buffersMem); - sysctl(MIB_vfs_bufspace, 2, &(buffersMem), &len, NULL, 0); - buffersMem /= 1024; - pl->buffersMem = buffersMem; - - len = sizeof(cachedMem); - sysctl(MIB_vm_stats_vm_v_cache_count, 4, &(cachedMem), &len, NULL, 0); - cachedMem *= pageSizeKb; - pl->cachedMem = cachedMem; - - len = sizeof(vmtotal); - sysctl(MIB_vm_vmtotal, 2, &(vmtotal), &len, NULL, 0); - pl->sharedMem = vmtotal.t_vmshr * pageSizeKb; - - pl->usedMem = fpl->memActive + fpl->memWire; - - struct kvm_swap swap[16]; - int nswap = kvm_getswapinfo(fpl->kd, swap, ARRAYSIZE(swap), 0); - pl->totalSwap = 0; - pl->usedSwap = 0; - for (int i = 0; i < nswap; i++) { - pl->totalSwap += swap[i].ksw_total; - pl->usedSwap += swap[i].ksw_used; - } - pl->totalSwap *= pageSizeKb; - pl->usedSwap *= pageSizeKb; -} - -static void FreeBSDProcessList_updateExe(const struct kinfo_proc* kproc, Process* proc) { - if (Process_isKernelThread(proc)) { - Process_updateExe(proc, NULL); - return; - } - - const int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, kproc->ki_pid }; - char buffer[2048]; - size_t size = sizeof(buffer); - if (sysctl(mib, 4, buffer, &size, NULL, 0) != 0) { - Process_updateExe(proc, NULL); - return; - } - - Process_updateExe(proc, buffer); -} - -static void FreeBSDProcessList_updateCwd(const struct kinfo_proc* kproc, Process* proc) { -#ifdef KERN_PROC_CWD - const int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_CWD, kproc->ki_pid }; - char buffer[2048]; - size_t size = sizeof(buffer); - if (sysctl(mib, 4, buffer, &size, NULL, 0) != 0) { - free(proc->procCwd); - proc->procCwd = NULL; - return; - } - - /* Kernel threads return an empty buffer */ - if (buffer[0] == '\0') { - free(proc->procCwd); - proc->procCwd = NULL; - return; - } - - free_and_xStrdup(&proc->procCwd, buffer); -#else - proc->procCwd = NULL; -#endif -} - -static void FreeBSDProcessList_updateProcessName(kvm_t* kd, const struct kinfo_proc* kproc, Process* proc) { - Process_updateComm(proc, kproc->ki_comm); - - char** argv = kvm_getargv(kd, kproc, 0); - if (!argv || !argv[0]) { - Process_updateCmdline(proc, kproc->ki_comm, 0, strlen(kproc->ki_comm)); - return; - } - - size_t len = 0; - for (int i = 0; argv[i]; i++) { - len += strlen(argv[i]) + 1; - } - - char* cmdline = xMalloc(len); - char* at = cmdline; - int end = 0; - for (int i = 0; argv[i]; i++) { - at = stpcpy(at, argv[i]); - if (end == 0) { - end = at - cmdline; - } - *at++ = ' '; - } - at--; - *at = '\0'; - - Process_updateCmdline(proc, cmdline, 0, end); - - free(cmdline); -} - -static char* FreeBSDProcessList_readJailName(const struct kinfo_proc* kproc) { - if (kproc->ki_jid == 0) - return xStrdup("-"); - - char jnamebuf[MAXHOSTNAMELEN] = {0}; - struct iovec jiov[4]; - -IGNORE_WCASTQUAL_BEGIN - *(const void**)&jiov[0].iov_base = "jid"; - jiov[0].iov_len = sizeof("jid"); - jiov[1].iov_base = (void*) &kproc->ki_jid; - jiov[1].iov_len = sizeof(kproc->ki_jid); - *(const void**)&jiov[2].iov_base = "name"; - jiov[2].iov_len = sizeof("name"); - jiov[3].iov_base = jnamebuf; - jiov[3].iov_len = sizeof(jnamebuf); -IGNORE_WCASTQUAL_END - - int jid = jail_get(jiov, 4, 0); - if (jid == kproc->ki_jid) - return xStrdup(jnamebuf); - - return NULL; -} - -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { - FreeBSDProcessList* fpl = (FreeBSDProcessList*) super; - const Settings* settings = super->settings; - bool hideKernelThreads = settings->hideKernelThreads; - bool hideUserlandThreads = settings->hideUserlandThreads; - - openzfs_sysctl_updateArcStats(&fpl->zfs); - FreeBSDProcessList_scanMemoryInfo(super); - FreeBSDProcessList_scanCPU(super); - - // in pause mode only gather global data for meters (CPU/memory/...) - if (pauseProcessUpdate) { - return; - } - - int count = 0; - const struct kinfo_proc* kprocs = kvm_getprocs(fpl->kd, KERN_PROC_PROC, 0, &count); - - for (int i = 0; i < count; i++) { - const struct kinfo_proc* kproc = &kprocs[i]; - bool preExisting = false; - Process* proc = ProcessList_getProcess(super, kproc->ki_pid, &preExisting, FreeBSDProcess_new); - FreeBSDProcess* fp = (FreeBSDProcess*) proc; - - if (!preExisting) { - fp->jid = kproc->ki_jid; - proc->pid = kproc->ki_pid; - proc->isKernelThread = kproc->ki_pid != 1 && (kproc->ki_flag & P_SYSTEM); - proc->isUserlandThread = false; - proc->ppid = kproc->ki_ppid; - proc->tpgid = kproc->ki_tpgid; - proc->tgid = kproc->ki_pid; - proc->session = kproc->ki_sid; - proc->pgrp = kproc->ki_pgid; - proc->st_uid = kproc->ki_uid; - proc->starttime_ctime = kproc->ki_start.tv_sec; - if (proc->starttime_ctime < 0) { - proc->starttime_ctime = super->realtimeMs / 1000; - } - Process_fillStarttimeBuffer(proc); - proc->user = UsersTable_getRef(super->usersTable, proc->st_uid); - ProcessList_add(super, proc); - - FreeBSDProcessList_updateExe(kproc, proc); - FreeBSDProcessList_updateProcessName(fpl->kd, kproc, proc); - - if (settings->ss->flags & PROCESS_FLAG_CWD) { - FreeBSDProcessList_updateCwd(kproc, proc); - } - - fp->jname = FreeBSDProcessList_readJailName(kproc); - - proc->tty_nr = kproc->ki_tdev; - const char* name = (kproc->ki_tdev != NODEV) ? devname(kproc->ki_tdev, S_IFCHR) : NULL; - if (!name) { - free(proc->tty_name); - proc->tty_name = NULL; - } else { - free_and_xStrdup(&proc->tty_name, name); - } - } else { - if (fp->jid != kproc->ki_jid) { - // process can enter jail anytime - fp->jid = kproc->ki_jid; - free(fp->jname); - fp->jname = FreeBSDProcessList_readJailName(kproc); - } - // if there are reapers in the system, process can get reparented anytime - proc->ppid = kproc->ki_ppid; - if (proc->st_uid != kproc->ki_uid) { - // some processes change users (eg. to lower privs) - proc->st_uid = kproc->ki_uid; - proc->user = UsersTable_getRef(super->usersTable, proc->st_uid); - } - if (settings->updateProcessNames) { - FreeBSDProcessList_updateProcessName(fpl->kd, kproc, proc); - } - } - - free_and_xStrdup(&fp->emul, kproc->ki_emul); - - // from FreeBSD source /src/usr.bin/top/machine.c - proc->m_virt = kproc->ki_size / ONE_K; - proc->m_resident = kproc->ki_rssize * pageSizeKb; - proc->nlwp = kproc->ki_numthreads; - proc->time = (kproc->ki_runtime + 5000) / 10000; - - proc->percent_cpu = 100.0 * ((double)kproc->ki_pctcpu / (double)kernelFScale); - proc->percent_mem = 100.0 * proc->m_resident / (double)(super->totalMem); - Process_updateCPUFieldWidths(proc->percent_cpu); - - if (kproc->ki_stat == SRUN && kproc->ki_oncpu != NOCPU) { - proc->processor = kproc->ki_oncpu; - } else { - proc->processor = kproc->ki_lastcpu; - } - - proc->majflt = kproc->ki_cow; - - proc->priority = kproc->ki_pri.pri_level - PZERO; - - if (String_eq("intr", kproc->ki_comm) && (kproc->ki_flag & P_SYSTEM)) { - proc->nice = 0; //@etosan: intr kernel process (not thread) has weird nice value - } else if (kproc->ki_pri.pri_class == PRI_TIMESHARE) { - proc->nice = kproc->ki_nice - NZERO; - } else if (PRI_IS_REALTIME(kproc->ki_pri.pri_class)) { - proc->nice = PRIO_MIN - 1 - (PRI_MAX_REALTIME - kproc->ki_pri.pri_level); - } else { - proc->nice = PRIO_MAX + 1 + kproc->ki_pri.pri_level - PRI_MIN_IDLE; - } - - /* Taken from: https://github.com/freebsd/freebsd-src/blob/1ad2d87778970582854082bcedd2df0394fd4933/sys/sys/proc.h#L851 */ - switch (kproc->ki_stat) { - case SIDL: proc->state = IDLE; break; - case SRUN: proc->state = RUNNING; break; - case SSLEEP: proc->state = SLEEPING; break; - case SSTOP: proc->state = STOPPED; break; - case SZOMB: proc->state = ZOMBIE; break; - case SWAIT: proc->state = WAITING; break; - case SLOCK: proc->state = BLOCKED; break; - default: proc->state = UNKNOWN; - } - - if (Process_isKernelThread(proc)) - super->kernelThreads++; - -#ifdef SCHEDULER_SUPPORT - if (settings->ss->flags & PROCESS_FLAG_SCHEDPOL) - Scheduling_readProcessPolicy(proc); -#endif - - proc->show = ! ((hideKernelThreads && Process_isKernelThread(proc)) || (hideUserlandThreads && Process_isUserlandThread(proc))); - - super->totalTasks++; - if (proc->state == RUNNING) - super->runningTasks++; - proc->updated = true; - } -} - -bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id) { - assert(id < super->existingCPUs); - - // TODO: support offline CPUs and hot swapping - (void) super; (void) id; - - return true; -} diff --git a/fedora/.local/bin/htop-vim/freebsd/FreeBSDProcessList.h b/fedora/.local/bin/htop-vim/freebsd/FreeBSDProcessList.h deleted file mode 100644 index adc70e4..0000000 --- a/fedora/.local/bin/htop-vim/freebsd/FreeBSDProcessList.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef HEADER_FreeBSDProcessList -#define HEADER_FreeBSDProcessList -/* -htop - FreeBSDProcessList.h -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include -#include - -#include "Hashtable.h" -#include "ProcessList.h" -#include "UsersTable.h" -#include "zfs/ZfsArcStats.h" - - -typedef struct CPUData_ { - double userPercent; - double nicePercent; - double systemPercent; - double irqPercent; - double systemAllPercent; - - double frequency; - double temperature; -} CPUData; - -typedef struct FreeBSDProcessList_ { - ProcessList super; - kvm_t* kd; - - unsigned long long int memWire; - unsigned long long int memActive; - - ZfsArcStats zfs; - - CPUData* cpus; - - unsigned long* cp_time_o; - unsigned long* cp_time_n; - - unsigned long* cp_times_o; - unsigned long* cp_times_n; - -} FreeBSDProcessList; - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId); - -void ProcessList_delete(ProcessList* this); - -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate); - -bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id); - -#endif diff --git a/fedora/.local/bin/htop-vim/freebsd/Platform.c b/fedora/.local/bin/htop-vim/freebsd/Platform.c deleted file mode 100644 index 646163a..0000000 --- a/fedora/.local/bin/htop-vim/freebsd/Platform.c +++ /dev/null @@ -1,383 +0,0 @@ -/* -htop - freebsd/Platform.c -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "freebsd/Platform.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "CPUMeter.h" -#include "ClockMeter.h" -#include "DateMeter.h" -#include "DateTimeMeter.h" -#include "DiskIOMeter.h" -#include "HostnameMeter.h" -#include "LoadAverageMeter.h" -#include "Macros.h" -#include "MemoryMeter.h" -#include "MemorySwapMeter.h" -#include "Meter.h" -#include "NetworkIOMeter.h" -#include "ProcessList.h" -#include "Settings.h" -#include "SwapMeter.h" -#include "SysArchMeter.h" -#include "TasksMeter.h" -#include "UptimeMeter.h" -#include "XUtils.h" -#include "freebsd/FreeBSDProcess.h" -#include "freebsd/FreeBSDProcessList.h" -#include "zfs/ZfsArcMeter.h" -#include "zfs/ZfsCompressedArcMeter.h" - -const ScreenDefaults Platform_defaultScreens[] = { - { - .name = "Main", - .columns = "PID USER PRIORITY NICE M_VIRT M_RESIDENT STATE PERCENT_CPU PERCENT_MEM TIME Command", - .sortKey = "PERCENT_CPU", - }, -}; - -const unsigned int Platform_numberOfDefaultScreens = ARRAYSIZE(Platform_defaultScreens); - -const SignalItem Platform_signals[] = { - { .name = " 0 Cancel", .number = 0 }, - { .name = " 1 SIGHUP", .number = 1 }, - { .name = " 2 SIGINT", .number = 2 }, - { .name = " 3 SIGQUIT", .number = 3 }, - { .name = " 4 SIGILL", .number = 4 }, - { .name = " 5 SIGTRAP", .number = 5 }, - { .name = " 6 SIGABRT", .number = 6 }, - { .name = " 7 SIGEMT", .number = 7 }, - { .name = " 8 SIGFPE", .number = 8 }, - { .name = " 9 SIGKILL", .number = 9 }, - { .name = "10 SIGBUS", .number = 10 }, - { .name = "11 SIGSEGV", .number = 11 }, - { .name = "12 SIGSYS", .number = 12 }, - { .name = "13 SIGPIPE", .number = 13 }, - { .name = "14 SIGALRM", .number = 14 }, - { .name = "15 SIGTERM", .number = 15 }, - { .name = "16 SIGURG", .number = 16 }, - { .name = "17 SIGSTOP", .number = 17 }, - { .name = "18 SIGTSTP", .number = 18 }, - { .name = "19 SIGCONT", .number = 19 }, - { .name = "20 SIGCHLD", .number = 20 }, - { .name = "21 SIGTTIN", .number = 21 }, - { .name = "22 SIGTTOU", .number = 22 }, - { .name = "23 SIGIO", .number = 23 }, - { .name = "24 SIGXCPU", .number = 24 }, - { .name = "25 SIGXFSZ", .number = 25 }, - { .name = "26 SIGVTALRM", .number = 26 }, - { .name = "27 SIGPROF", .number = 27 }, - { .name = "28 SIGWINCH", .number = 28 }, - { .name = "29 SIGINFO", .number = 29 }, - { .name = "30 SIGUSR1", .number = 30 }, - { .name = "31 SIGUSR2", .number = 31 }, - { .name = "32 SIGTHR", .number = 32 }, - { .name = "33 SIGLIBRT", .number = 33 }, -}; - -const unsigned int Platform_numberOfSignals = ARRAYSIZE(Platform_signals); - -const MeterClass* const Platform_meterTypes[] = { - &CPUMeter_class, - &ClockMeter_class, - &DateMeter_class, - &DateTimeMeter_class, - &LoadAverageMeter_class, - &LoadMeter_class, - &MemoryMeter_class, - &SwapMeter_class, - &MemorySwapMeter_class, - &TasksMeter_class, - &UptimeMeter_class, - &BatteryMeter_class, - &HostnameMeter_class, - &SysArchMeter_class, - &AllCPUsMeter_class, - &AllCPUs2Meter_class, - &AllCPUs4Meter_class, - &AllCPUs8Meter_class, - &LeftCPUsMeter_class, - &RightCPUsMeter_class, - &LeftCPUs2Meter_class, - &RightCPUs2Meter_class, - &LeftCPUs4Meter_class, - &RightCPUs4Meter_class, - &LeftCPUs8Meter_class, - &RightCPUs8Meter_class, - &BlankMeter_class, - &ZfsArcMeter_class, - &ZfsCompressedArcMeter_class, - &DiskIOMeter_class, - &NetworkIOMeter_class, - NULL -}; - -bool Platform_init(void) { - /* no platform-specific setup needed */ - return true; -} - -void Platform_done(void) { - /* no platform-specific cleanup needed */ -} - -void Platform_setBindings(Htop_Action* keys) { - /* no platform-specific key bindings */ - (void) keys; -} - -int Platform_getUptime(void) { - struct timeval bootTime, currTime; - const int mib[2] = { CTL_KERN, KERN_BOOTTIME }; - size_t size = sizeof(bootTime); - - int err = sysctl(mib, 2, &bootTime, &size, NULL, 0); - if (err) { - return -1; - } - gettimeofday(&currTime, NULL); - - return (int) difftime(currTime.tv_sec, bootTime.tv_sec); -} - -void Platform_getLoadAverage(double* one, double* five, double* fifteen) { - struct loadavg loadAverage; - const int mib[2] = { CTL_VM, VM_LOADAVG }; - size_t size = sizeof(loadAverage); - - int err = sysctl(mib, 2, &loadAverage, &size, NULL, 0); - if (err) { - *one = 0; - *five = 0; - *fifteen = 0; - return; - } - *one = (double) loadAverage.ldavg[0] / loadAverage.fscale; - *five = (double) loadAverage.ldavg[1] / loadAverage.fscale; - *fifteen = (double) loadAverage.ldavg[2] / loadAverage.fscale; -} - -int Platform_getMaxPid(void) { - int maxPid; - size_t size = sizeof(maxPid); - int err = sysctlbyname("kern.pid_max", &maxPid, &size, NULL, 0); - if (err) { - return 99999; - } - return maxPid; -} - -double Platform_setCPUValues(Meter* this, unsigned int cpu) { - const FreeBSDProcessList* fpl = (const FreeBSDProcessList*) this->pl; - unsigned int cpus = this->pl->activeCPUs; - const CPUData* cpuData; - - if (cpus == 1) { - // single CPU box has everything in fpl->cpus[0] - cpuData = &(fpl->cpus[0]); - } else { - cpuData = &(fpl->cpus[cpu]); - } - - double percent; - double* v = this->values; - - v[CPU_METER_NICE] = cpuData->nicePercent; - v[CPU_METER_NORMAL] = cpuData->userPercent; - if (this->pl->settings->detailedCPUTime) { - v[CPU_METER_KERNEL] = cpuData->systemPercent; - v[CPU_METER_IRQ] = cpuData->irqPercent; - this->curItems = 4; - percent = v[0] + v[1] + v[2] + v[3]; - } else { - v[2] = cpuData->systemAllPercent; - this->curItems = 3; - percent = v[0] + v[1] + v[2]; - } - - percent = CLAMP(percent, 0.0, 100.0); - - v[CPU_METER_FREQUENCY] = cpuData->frequency; - v[CPU_METER_TEMPERATURE] = cpuData->temperature; - - return percent; -} - -void Platform_setMemoryValues(Meter* this) { - const ProcessList* pl = this->pl; - const FreeBSDProcessList* fpl = (const FreeBSDProcessList*) pl; - - this->total = pl->totalMem; - this->values[MEMORY_METER_USED] = pl->usedMem; - this->values[MEMORY_METER_BUFFERS] = pl->buffersMem; - this->values[MEMORY_METER_SHARED] = pl->sharedMem; - this->values[MEMORY_METER_CACHE] = pl->cachedMem; - // this->values[MEMORY_METER_AVAILABLE] = "available memory" - - if (fpl->zfs.enabled) { - // ZFS does not shrink below the value of zfs_arc_min. - unsigned long long int shrinkableSize = 0; - if (fpl->zfs.size > fpl->zfs.min) - shrinkableSize = fpl->zfs.size - fpl->zfs.min; - this->values[MEMORY_METER_USED] -= shrinkableSize; - this->values[MEMORY_METER_CACHE] += shrinkableSize; - // this->values[MEMORY_METER_AVAILABLE] += shrinkableSize; - } -} - -void Platform_setSwapValues(Meter* this) { - const ProcessList* pl = this->pl; - this->total = pl->totalSwap; - this->values[SWAP_METER_USED] = pl->usedSwap; - this->values[SWAP_METER_CACHE] = NAN; -} - -void Platform_setZfsArcValues(Meter* this) { - const FreeBSDProcessList* fpl = (const FreeBSDProcessList*) this->pl; - - ZfsArcMeter_readStats(this, &(fpl->zfs)); -} - -void Platform_setZfsCompressedArcValues(Meter* this) { - const FreeBSDProcessList* fpl = (const FreeBSDProcessList*) this->pl; - - ZfsCompressedArcMeter_readStats(this, &(fpl->zfs)); -} - -char* Platform_getProcessEnv(pid_t pid) { - const int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_ENV, pid }; - - size_t capacity = ARG_MAX; - char* env = xMalloc(capacity); - - int err = sysctl(mib, 4, env, &capacity, NULL, 0); - if (err || capacity == 0) { - free(env); - return NULL; - } - - if (env[capacity - 1] || env[capacity - 2]) { - env = xRealloc(env, capacity + 2); - env[capacity] = 0; - env[capacity + 1] = 0; - } - - return env; -} - -FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) { - (void)pid; - return NULL; -} - -bool Platform_getDiskIO(DiskIOData* data) { - - if (devstat_checkversion(NULL) < 0) - return false; - - // use static to plug memory leak; see #841 - static struct devinfo info = { 0 }; - struct statinfo current = { .dinfo = &info }; - - // get number of devices - if (devstat_getdevs(NULL, ¤t) < 0) - return false; - - int count = current.dinfo->numdevs; - - unsigned long long int bytesReadSum = 0, bytesWriteSum = 0, timeSpendSum = 0; - - // get data - for (int i = 0; i < count; i++) { - uint64_t bytes_read, bytes_write; - long double busy_time; - - devstat_compute_statistics(¤t.dinfo->devices[i], - NULL, - 1.0, - DSM_TOTAL_BYTES_READ, &bytes_read, - DSM_TOTAL_BYTES_WRITE, &bytes_write, - DSM_TOTAL_BUSY_TIME, &busy_time, - DSM_NONE); - - bytesReadSum += bytes_read; - bytesWriteSum += bytes_write; - timeSpendSum += 1000 * busy_time; - } - - data->totalBytesRead = bytesReadSum; - data->totalBytesWritten = bytesWriteSum; - data->totalMsTimeSpend = timeSpendSum; - return true; -} - -bool Platform_getNetworkIO(NetworkIOData* data) { - // get number of interfaces - int count; - size_t countLen = sizeof(count); - const int countMib[] = { CTL_NET, PF_LINK, NETLINK_GENERIC, IFMIB_SYSTEM, IFMIB_IFCOUNT }; - - int r = sysctl(countMib, ARRAYSIZE(countMib), &count, &countLen, NULL, 0); - if (r < 0) - return false; - - memset(data, 0, sizeof(NetworkIOData)); - for (int i = 1; i <= count; i++) { - struct ifmibdata ifmd; - size_t ifmdLen = sizeof(ifmd); - - const int dataMib[] = { CTL_NET, PF_LINK, NETLINK_GENERIC, IFMIB_IFDATA, i, IFDATA_GENERAL }; - - r = sysctl(dataMib, ARRAYSIZE(dataMib), &ifmd, &ifmdLen, NULL, 0); - if (r < 0) - continue; - - if (ifmd.ifmd_flags & IFF_LOOPBACK) - continue; - - data->bytesReceived += ifmd.ifmd_data.ifi_ibytes; - data->packetsReceived += ifmd.ifmd_data.ifi_ipackets; - data->bytesTransmitted += ifmd.ifmd_data.ifi_obytes; - data->packetsTransmitted += ifmd.ifmd_data.ifi_opackets; - } - - return true; -} - -void Platform_getBattery(double* percent, ACPresence* isOnAC) { - int life; - size_t life_len = sizeof(life); - if (sysctlbyname("hw.acpi.battery.life", &life, &life_len, NULL, 0) == -1) - *percent = NAN; - else - *percent = life; - - int acline; - size_t acline_len = sizeof(acline); - if (sysctlbyname("hw.acpi.acline", &acline, &acline_len, NULL, 0) == -1) - *isOnAC = AC_ERROR; - else - *isOnAC = acline == 0 ? AC_ABSENT : AC_PRESENT; -} diff --git a/fedora/.local/bin/htop-vim/freebsd/Platform.h b/fedora/.local/bin/htop-vim/freebsd/Platform.h deleted file mode 100644 index 51269c0..0000000 --- a/fedora/.local/bin/htop-vim/freebsd/Platform.h +++ /dev/null @@ -1,120 +0,0 @@ -#ifndef HEADER_Platform -#define HEADER_Platform -/* -htop - freebsd/Platform.h -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include - -#include "Action.h" -#include "BatteryMeter.h" -#include "DiskIOMeter.h" -#include "Hashtable.h" -#include "Meter.h" -#include "NetworkIOMeter.h" -#include "Process.h" -#include "ProcessLocksScreen.h" -#include "SignalsPanel.h" -#include "CommandLine.h" -#include "generic/gettime.h" -#include "generic/hostname.h" -#include "generic/uname.h" - - -extern const ScreenDefaults Platform_defaultScreens[]; - -extern const unsigned int Platform_numberOfDefaultScreens; - -extern const SignalItem Platform_signals[]; - -extern const unsigned int Platform_numberOfSignals; - -extern const MeterClass* const Platform_meterTypes[]; - -bool Platform_init(void); - -void Platform_done(void); - -void Platform_setBindings(Htop_Action* keys); - -int Platform_getUptime(void); - -void Platform_getLoadAverage(double* one, double* five, double* fifteen); - -int Platform_getMaxPid(void); - -double Platform_setCPUValues(Meter* this, unsigned int cpu); - -void Platform_setMemoryValues(Meter* this); - -void Platform_setSwapValues(Meter* this); - -void Platform_setZfsArcValues(Meter* this); - -void Platform_setZfsCompressedArcValues(Meter* this); - -char* Platform_getProcessEnv(pid_t pid); - -FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid); - -bool Platform_getDiskIO(DiskIOData* data); - -bool Platform_getNetworkIO(NetworkIOData* data); - -void Platform_getBattery(double* percent, ACPresence* isOnAC); - -static inline void Platform_getHostname(char* buffer, size_t size) { - Generic_hostname(buffer, size); -} - -static inline void Platform_getRelease(char** string) { - *string = Generic_uname(); -} - -#define PLATFORM_LONG_OPTIONS - -static inline void Platform_longOptionsUsage(ATTR_UNUSED const char* name) { } - -static inline CommandLineStatus Platform_getLongOption(ATTR_UNUSED int opt, ATTR_UNUSED int argc, ATTR_UNUSED char** argv) { - return STATUS_ERROR_EXIT; -} - -static inline void Platform_gettime_realtime(struct timeval* tv, uint64_t* msec) { - Generic_gettime_realtime(tv, msec); -} - -static inline void Platform_gettime_monotonic(uint64_t* msec) { - Generic_gettime_monotonic(msec); -} - -static inline Hashtable* Platform_dynamicMeters(void) { - return NULL; -} - -static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* table) { } - -static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { } - -static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* meter) { } - -static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter* meter, ATTR_UNUSED RichString* out) { } - -static inline Hashtable* Platform_dynamicColumns(void) { - return NULL; -} - -static inline const char* Platform_dynamicColumnInit(ATTR_UNUSED unsigned int key) { - return NULL; -} - -static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* table) { } - -static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Process* proc, ATTR_UNUSED RichString* str, ATTR_UNUSED unsigned int key) { - return false; -} - -#endif diff --git a/fedora/.local/bin/htop-vim/freebsd/ProcessField.h b/fedora/.local/bin/htop-vim/freebsd/ProcessField.h deleted file mode 100644 index d20900d..0000000 --- a/fedora/.local/bin/htop-vim/freebsd/ProcessField.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef HEADER_FreeBSDProcessField -#define HEADER_FreeBSDProcessField -/* -htop - freebsd/ProcessField.h -(C) 2020 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - - -#define PLATFORM_PROCESS_FIELDS \ - JID = 100, \ - JAIL = 101, \ - EMULATION = 102, \ - \ - DUMMY_BUMP_FIELD = CWD, \ - // End of list - - -#endif /* HEADER_FreeBSDProcessField */ diff --git a/fedora/.local/bin/htop-vim/generic/gettime.c b/fedora/.local/bin/htop-vim/generic/gettime.c deleted file mode 100644 index b7c4885..0000000 --- a/fedora/.local/bin/htop-vim/generic/gettime.c +++ /dev/null @@ -1,61 +0,0 @@ -/* -htop - generic/gettime.c -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ -#include "config.h" // IWYU pragma: keep - -#include "generic/gettime.h" - -#include -#include - - -void Generic_gettime_realtime(struct timeval* tvp, uint64_t* msec) { - -#if defined(HAVE_CLOCK_GETTIME) - - struct timespec ts; - if (clock_gettime(CLOCK_REALTIME, &ts) == 0) { - tvp->tv_sec = ts.tv_sec; - tvp->tv_usec = ts.tv_nsec / 1000; - *msec = ((uint64_t)ts.tv_sec * 1000) + ((uint64_t)ts.tv_nsec / 1000000); - } else { - memset(tvp, 0, sizeof(struct timeval)); - *msec = 0; - } - -#else /* lower resolution gettimeofday(2) is always available */ - - struct timeval tv; - if (gettimeofday(&tv, NULL) == 0) { - *tvp = tv; /* struct copy */ - *msec = ((uint64_t)tv.tv_sec * 1000) + ((uint64_t)tv.tv_usec / 1000); - } else { - memset(tvp, 0, sizeof(struct timeval)); - *msec = 0; - } - -#endif -} - -void Generic_gettime_monotonic(uint64_t* msec) { -#if defined(HAVE_CLOCK_GETTIME) - - struct timespec ts; - if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) - *msec = ((uint64_t)ts.tv_sec * 1000) + ((uint64_t)ts.tv_nsec / 1000000); - else - *msec = 0; - -#else /* lower resolution gettimeofday() should be always available */ - - struct timeval tv; - if (gettimeofday(&tv, NULL) == 0) - *msec = ((uint64_t)tv.tv_sec * 1000) + ((uint64_t)tv.tv_usec / 1000); - else - *msec = 0; - -#endif -} diff --git a/fedora/.local/bin/htop-vim/generic/gettime.h b/fedora/.local/bin/htop-vim/generic/gettime.h deleted file mode 100644 index 91fe43d..0000000 --- a/fedora/.local/bin/htop-vim/generic/gettime.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef HEADER_gettime -#define HEADER_gettime -/* -htop - generic/gettime.h -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include - - -void Generic_gettime_realtime(struct timeval* tvp, uint64_t* msec); - -void Generic_gettime_monotonic(uint64_t* msec); - -#endif diff --git a/fedora/.local/bin/htop-vim/generic/hostname.c b/fedora/.local/bin/htop-vim/generic/hostname.c deleted file mode 100644 index 69a4146..0000000 --- a/fedora/.local/bin/htop-vim/generic/hostname.c +++ /dev/null @@ -1,17 +0,0 @@ -/* -htop - generic/hostname.c -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ -#include "config.h" // IWYU pragma: keep - -#include "generic/hostname.h" - -#include - - -void Generic_hostname(char* buffer, size_t size) { - gethostname(buffer, size - 1); - buffer[size - 1] = '\0'; -} diff --git a/fedora/.local/bin/htop-vim/generic/hostname.h b/fedora/.local/bin/htop-vim/generic/hostname.h deleted file mode 100644 index 1e6c52d..0000000 --- a/fedora/.local/bin/htop-vim/generic/hostname.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef HEADER_hostname -#define HEADER_hostname -/* -htop - generic/hostname.h -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include - - -void Generic_hostname(char* buffer, size_t size); - -#endif diff --git a/fedora/.local/bin/htop-vim/generic/openzfs_sysctl.c b/fedora/.local/bin/htop-vim/generic/openzfs_sysctl.c deleted file mode 100644 index bcd37dc..0000000 --- a/fedora/.local/bin/htop-vim/generic/openzfs_sysctl.c +++ /dev/null @@ -1,104 +0,0 @@ -/* -htop - generic/openzfs_sysctl.c -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "generic/openzfs_sysctl.h" - -#include -#include // IWYU pragma: keep -#include // needs for u_int with gcc - -#include "zfs/ZfsArcStats.h" - - -static int MIB_kstat_zfs_misc_arcstats_size[5]; -static int MIB_kstat_zfs_misc_arcstats_c_min[5]; -static int MIB_kstat_zfs_misc_arcstats_c_max[5]; -static int MIB_kstat_zfs_misc_arcstats_mfu_size[5]; -static int MIB_kstat_zfs_misc_arcstats_mru_size[5]; -static int MIB_kstat_zfs_misc_arcstats_anon_size[5]; -static int MIB_kstat_zfs_misc_arcstats_hdr_size[5]; -static int MIB_kstat_zfs_misc_arcstats_other_size[5]; -static int MIB_kstat_zfs_misc_arcstats_compressed_size[5]; -static int MIB_kstat_zfs_misc_arcstats_uncompressed_size[5]; - -void openzfs_sysctl_init(ZfsArcStats* stats) { - size_t len; - unsigned long long int arcSize; - - len = sizeof(arcSize); - if (sysctlbyname("kstat.zfs.misc.arcstats.size", &arcSize, &len, NULL, 0) == 0 && arcSize != 0) { - stats->enabled = 1; - - len = 5; - sysctlnametomib("kstat.zfs.misc.arcstats.size", MIB_kstat_zfs_misc_arcstats_size, &len); - - sysctlnametomib("kstat.zfs.misc.arcstats.c_min", MIB_kstat_zfs_misc_arcstats_c_min, &len); - sysctlnametomib("kstat.zfs.misc.arcstats.c_max", MIB_kstat_zfs_misc_arcstats_c_max, &len); - sysctlnametomib("kstat.zfs.misc.arcstats.mfu_size", MIB_kstat_zfs_misc_arcstats_mfu_size, &len); - sysctlnametomib("kstat.zfs.misc.arcstats.mru_size", MIB_kstat_zfs_misc_arcstats_mru_size, &len); - sysctlnametomib("kstat.zfs.misc.arcstats.anon_size", MIB_kstat_zfs_misc_arcstats_anon_size, &len); - sysctlnametomib("kstat.zfs.misc.arcstats.hdr_size", MIB_kstat_zfs_misc_arcstats_hdr_size, &len); - sysctlnametomib("kstat.zfs.misc.arcstats.other_size", MIB_kstat_zfs_misc_arcstats_other_size, &len); - - if (sysctlnametomib("kstat.zfs.misc.arcstats.compressed_size", MIB_kstat_zfs_misc_arcstats_compressed_size, &len) == 0) { - stats->isCompressed = 1; - sysctlnametomib("kstat.zfs.misc.arcstats.uncompressed_size", MIB_kstat_zfs_misc_arcstats_uncompressed_size, &len); - } else { - stats->isCompressed = 0; - } - } else { - stats->enabled = 0; - } -} - -void openzfs_sysctl_updateArcStats(ZfsArcStats* stats) { - size_t len; - - if (stats->enabled) { - len = sizeof(stats->size); - sysctl(MIB_kstat_zfs_misc_arcstats_size, 5, &(stats->size), &len, NULL, 0); - stats->size /= 1024; - - len = sizeof(stats->min); - sysctl(MIB_kstat_zfs_misc_arcstats_c_min, 5, &(stats->min), &len, NULL, 0); - stats->min /= 1024; - - len = sizeof(stats->max); - sysctl(MIB_kstat_zfs_misc_arcstats_c_max, 5, &(stats->max), &len, NULL, 0); - stats->max /= 1024; - - len = sizeof(stats->MFU); - sysctl(MIB_kstat_zfs_misc_arcstats_mfu_size, 5, &(stats->MFU), &len, NULL, 0); - stats->MFU /= 1024; - - len = sizeof(stats->MRU); - sysctl(MIB_kstat_zfs_misc_arcstats_mru_size, 5, &(stats->MRU), &len, NULL, 0); - stats->MRU /= 1024; - - len = sizeof(stats->anon); - sysctl(MIB_kstat_zfs_misc_arcstats_anon_size, 5, &(stats->anon), &len, NULL, 0); - stats->anon /= 1024; - - len = sizeof(stats->header); - sysctl(MIB_kstat_zfs_misc_arcstats_hdr_size, 5, &(stats->header), &len, NULL, 0); - stats->header /= 1024; - - len = sizeof(stats->other); - sysctl(MIB_kstat_zfs_misc_arcstats_other_size, 5, &(stats->other), &len, NULL, 0); - stats->other /= 1024; - - if (stats->isCompressed) { - len = sizeof(stats->compressed); - sysctl(MIB_kstat_zfs_misc_arcstats_compressed_size, 5, &(stats->compressed), &len, NULL, 0); - stats->compressed /= 1024; - - len = sizeof(stats->uncompressed); - sysctl(MIB_kstat_zfs_misc_arcstats_uncompressed_size, 5, &(stats->uncompressed), &len, NULL, 0); - stats->uncompressed /= 1024; - } - } -} diff --git a/fedora/.local/bin/htop-vim/generic/openzfs_sysctl.h b/fedora/.local/bin/htop-vim/generic/openzfs_sysctl.h deleted file mode 100644 index 27fa720..0000000 --- a/fedora/.local/bin/htop-vim/generic/openzfs_sysctl.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef HEADER_openzfs_sysctl -#define HEADER_openzfs_sysctl -/* -htop - generic/openzfs_sysctl.h -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "zfs/ZfsArcStats.h" - - -void openzfs_sysctl_init(ZfsArcStats* stats); - -void openzfs_sysctl_updateArcStats(ZfsArcStats* stats); - -#endif diff --git a/fedora/.local/bin/htop-vim/generic/uname.c b/fedora/.local/bin/htop-vim/generic/uname.c deleted file mode 100644 index 2a734dc..0000000 --- a/fedora/.local/bin/htop-vim/generic/uname.c +++ /dev/null @@ -1,98 +0,0 @@ -/* -htop - generic/uname.c -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ -#include "config.h" // IWYU pragma: keep - -#include "generic/uname.h" - -#include -#include -#include - -#include "Macros.h" -#include "XUtils.h" - -#ifdef HAVE_SYS_UTSNAME_H -#include -#endif - - -#ifndef OSRELEASEFILE -#define OSRELEASEFILE "/etc/os-release" -#endif - -static void parseOSRelease(char* buffer, size_t bufferLen) { - FILE* stream = fopen(OSRELEASEFILE, "r"); - if (!stream) { - xSnprintf(buffer, bufferLen, "No OS Release"); - return; - } - - char name[64] = {'\0'}; - char version[64] = {'\0'}; - char lineBuffer[256]; - while (fgets(lineBuffer, sizeof(lineBuffer), stream)) { - if (String_startsWith(lineBuffer, "PRETTY_NAME=\"")) { - const char* start = lineBuffer + strlen("PRETTY_NAME=\""); - const char* stop = strrchr(lineBuffer, '"'); - if (!stop || stop <= start) - continue; - String_safeStrncpy(buffer, start, MINIMUM(bufferLen, (size_t)(stop - start + 1))); - fclose(stream); - return; - } - if (String_startsWith(lineBuffer, "NAME=\"")) { - const char* start = lineBuffer + strlen("NAME=\""); - const char* stop = strrchr(lineBuffer, '"'); - if (!stop || stop <= start) - continue; - String_safeStrncpy(name, start, MINIMUM(sizeof(name), (size_t)(stop - start + 1))); - continue; - } - if (String_startsWith(lineBuffer, "VERSION=\"")) { - const char* start = lineBuffer + strlen("VERSION=\""); - const char* stop = strrchr(lineBuffer, '"'); - if (!stop || stop <= start) - continue; - String_safeStrncpy(version, start, MINIMUM(sizeof(version), (size_t)(stop - start + 1))); - continue; - } - } - fclose(stream); - - snprintf(buffer, bufferLen, "%s%s%s", name[0] ? name : "", name[0] && version[0] ? " " : "", version); -} - -char* Generic_uname(void) { - static char savedString[ - /* uname structure fields - manpages recommend sizeof */ - sizeof(((struct utsname*)0)->sysname) + - sizeof(((struct utsname*)0)->release) + - sizeof(((struct utsname*)0)->machine) + - 16/*markup*/ + - 128/*distro*/] = {'\0'}; - static bool loaded_data = false; - - if (!loaded_data) { - struct utsname uname_info; - int uname_result = uname(&uname_info); - - char distro[128]; - parseOSRelease(distro, sizeof(distro)); - - if (uname_result == 0) { - size_t written = xSnprintf(savedString, sizeof(savedString), "%s %s [%s]", uname_info.sysname, uname_info.release, uname_info.machine); - if (!String_contains_i(savedString, distro, false) && sizeof(savedString) > written) - snprintf(savedString + written, sizeof(savedString) - written, " @ %s", distro); - } else { - snprintf(savedString, sizeof(savedString), "%s", distro); - } - - loaded_data = true; - } - - return savedString; -} diff --git a/fedora/.local/bin/htop-vim/generic/uname.h b/fedora/.local/bin/htop-vim/generic/uname.h deleted file mode 100644 index 940d64c..0000000 --- a/fedora/.local/bin/htop-vim/generic/uname.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef HEADER_uname -#define HEADER_uname -/* -htop - generic/uname.h -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -char* Generic_uname(void); - -#endif diff --git a/fedora/.local/bin/htop-vim/htop.1.in b/fedora/.local/bin/htop-vim/htop.1.in deleted file mode 100644 index 72a98fb..0000000 --- a/fedora/.local/bin/htop-vim/htop.1.in +++ /dev/null @@ -1,682 +0,0 @@ -.TH "HTOP" "1" "2023" "@PACKAGE_STRING@" "User Commands" -.SH "NAME" -htop, pcp-htop \- interactive process viewer -.SH "SYNOPSIS" -.B htop -.RB [ \-dCFhpustvH ] -.br -.B pcp\ htop -.RB [ \-dCFhpustvH ] -.RB [ \-\-host/-h\ host ] -.SH "DESCRIPTION" -.B htop -is a cross-platform ncurses-based process viewer. -.LP -It is similar to -.BR top , -but allows you to scroll vertically and horizontally, and interact using -a pointing device (mouse). -You can observe all processes running on the system, along with their -command line arguments, as well as view them in a tree format, select -multiple processes and act on them all at once. -.LP -Tasks related to processes (killing, renicing) can be done without -entering their PIDs. -.LP -.B pcp-htop -is a version of -.B htop -built using the Performance Co-Pilot (PCP) Metrics API (see \c -.BR PCPIntro (1), -.BR PMAPI (3)), -allowing to extend -.B htop -to display values from arbitrary metrics. -See the section below titled -.B "CONFIG FILES" -for further details. -.br -.SH "COMMAND-LINE OPTIONS" -Mandatory arguments to long options are mandatory for short options too. -.TP -\fB\-d \-\-delay=DELAY\fR -Delay between updates, in tenths of a second. If the delay value is -less than 1, it is increased to 1, i.e. 1/10 second. If the delay value -is greater than 100, it is decreased to 100, i.e. 10 seconds. -.TP -\fB\-C \-\-no-color \-\-no-colour\fR -Start -.B htop -in monochrome mode -.TP -\fB\-F \-\-filter=FILTER -Filter processes by terms matching the commands. The terms are matched -case-insensitive and as fixed strings (not regexs). You can separate multiple terms with "|". -.TP -\fB\-h \-\-help -Display a help message and exit -.TP -\fB\-p \-\-pid=PID,PID...\fR -Show only the given PIDs -.TP -\fB\-s \-\-sort\-key COLUMN\fR -Sort by this column (use \-\-sort\-key help for a column list). -This will force a list view unless you specify -t at the same time. -.TP -\fB\-u \-\-user=USERNAME|UID\fR -Show only the processes of a given user -.TP -\fB\-U \-\-no-unicode\fR -Do not use unicode but ASCII characters for graph meters -.TP -\fB\-M \-\-no-mouse\fR -Disable support of mouse control -.TP -\fB\-\-readonly\fR -Disable all system and process changing features -.TP -\fB\-V \-\-version -Output version information and exit -.TP -\fB\-t \-\-tree -Show processes in tree view. This can be used to force a tree view when -requesting a sort order with -s. -.TP -\fB\-H \-\-highlight-changes=DELAY\fR -Highlight new and old processes -.TP -\fB \-\-drop-capabilities[=off|basic|strict]\fR -Linux only; requires libcap support. -.br -Drop unneeded Linux capabilities. -In strict mode features like killing, changing process priorities, and reading -process delay accounting information will not work, due to less capabilities -held. -.SH "INTERACTIVE COMMANDS" -The following commands are supported while in -.BR htop : -.TP 5 -.B Tab, Shift-Tab -Select the next / the previous screen tab to display. -You can enable showing the screen tab names in the Setup screen (F2). -.TP -.B Up, Alt-k -Select (highlight) the previous process in the process list. Scroll the list -if necessary. -.TP -.B Down, Alt-j -Select (highlight) the next process in the process list. Scroll the list if -necessary. -.TP -.B Left, Alt-h -Scroll the process list left. -.TP -.B Right, Alt-l -Scroll the process list right. -.TP -.B PgUp, PgDn -Scroll the process list up or down one window. -.TP -.B Home -Scroll to the top of the process list and select the first process. -.TP -.B End -Scroll to the bottom of the process list and select the last process. -.TP -.B Ctrl-A, ^ -Scroll left to the beginning of the process entry (i.e. beginning of line). -.TP -.B Ctrl-E, $ -Scroll right to the end of the process entry (i.e. end of line). -.TP -.B Space -Tag or untag a process. Commands that can operate on multiple processes, -like "kill", will then apply over the list of tagged processes, instead -of the currently highlighted one. -.TP -.B c -Tag the current process and its children. Commands that can operate on multiple -processes, like "kill", will then apply over the list of tagged processes, -instead of the currently highlighted one. -.TP -.B U -Untag all processes (remove all tags added with the Space or c keys). -.TP -.B s -Trace process system calls: if strace(1) is installed, pressing this key -will attach it to the currently selected process, presenting a live -update of system calls issued by the process. -.TP -.B l -Display open files for a process: if lsof(1) is installed, pressing this key -will display the list of file descriptors opened by the process. -.TP -.B w -Display the command line of the selected process in a separate screen, wrapped -onto multiple lines as needed. -.TP -.B x -Display the active file locks of the selected process in a separate screen. -.TP -.B F1, h, ? -Go to the help screen -.TP -.B F2, S -Go to the setup screen, where you can configure the meters displayed at the top -of the screen, set various display options, choose among color schemes, and -select which columns are displayed, in which order. -.TP -.B F3, / -Incrementally search the command lines of all the displayed processes. The -currently selected (highlighted) command will update as you type. While in -search mode, pressing F3 will cycle through matching occurrences. -Pressing Shift-F3 will cycle backwards. - -Alternatively the search can be started by simply typing the command -you are looking for, although for the first character normal key -bindings take precedence. -.TP -.B F4, \\\\ -Incremental process filtering: type in part of a process command line and -only processes whose names match will be shown. To cancel filtering, -enter the Filter option again and press Esc. -The matching is done case-insensitive. Terms are fixed strings (no regex). -You can separate multiple terms with "|". -.TP -.B F5, t -Tree view: organize processes by parenthood, and layout the relations -between them as a tree. Toggling the key will switch between tree and -your previously selected sort view. Selecting a sort view will exit -tree view. -.TP -.B F6, <, > -Selects a field for sorting, also accessible through < and >. -The current sort field is indicated by a highlight in the header. -.TP -.B F7, ] -Increase the selected process's priority (subtract from 'nice' value). -This can only be done by the superuser. -.TP -.B F8, [ -Decrease the selected process's priority (add to 'nice' value) -.TP -.B Shift-F7, } -Increase the selected process's autogroup priority (subtract from autogroup 'nice' value). -This can only be done by the superuser. -.TP -.B Shift-F8, { -Decrease the selected process's autogroup priority (add to autogroup 'nice' value) -.TP -.B F9, k -"Kill" process: sends a signal which is selected in a menu, to one or a group -of processes. If processes were tagged, sends the signal to all tagged processes. -If none is tagged, sends to the currently selected process. -.TP -.B F10, q -Quit -.TP -.B I -Invert the sort order: if sort order is increasing, switch to decreasing, and -vice-versa. -.TP -.B +, \-, * -When in tree view mode, expand or collapse subtree. When a subtree is collapsed -a "+" sign shows to the left of the process name. -Pressing "*" will expand or collapse all children of PIDs without parents, so -typically PID 1 (init) and PID 2 (kthreadd on Linux, if kernel threads are shown). -.TP -.B a (on multiprocessor machines) -Set CPU affinity: mark which CPUs a process is allowed to use. -.TP -.B u -Show only processes owned by a specified user. -.TP -.B N -Sort by PID. -.TP -.B M -Sort by memory usage (top compatibility key). -.TP -.B P -Sort by processor usage (top compatibility key). -.TP -.B T -Sort by time (top compatibility key). -.TP -.B F -"Follow" process: if the sort order causes the currently selected process -to move in the list, make the selection bar follow it. This is useful for -monitoring a process: this way, you can keep a process always visible on -screen. When a movement key is used, "follow" loses effect. -.TP -.B K -Hide kernel threads: prevent the threads belonging the kernel to be -displayed in the process list. (This is a toggle key.) -.TP -.B H -Hide user threads: on systems that represent them differently than ordinary -processes (such as recent NPTL-based systems), this can hide threads from -userspace processes in the process list. (This is a toggle key.) -.TP -.B p -Show full paths to running programs, where applicable. (This is a toggle key.) -.TP -.B Z -Pause/resume process updates. -.TP -.B m -Merge exe, comm and cmdline, where applicable. (This is a toggle key.) -.TP -.B Ctrl-L -Refresh: redraw screen and recalculate values. -.TP -.B Numbers -PID search: type in process ID and the selection highlight will be moved to it. -.PD -.SH "COLUMNS" -The following columns can display data about each process. A value of '\-' in -all the rows indicates that a column is unsupported on your system, or -currently unimplemented in -.BR htop . -The names below are the ones used in the -"Available Columns" section of the setup screen. If a different name is -shown in -.BR htop 's -main screen, it is shown below in parenthesis. -.TP 5 -.B Command -The full command line of the process (i.e. program name and arguments). - -If the option 'Merge exe, comm and cmdline in Command' (toggled by the 'm' key) -is active, the executable path (/proc/[pid]/exe) and the command name -(/proc/[pid]/comm) are also shown merged with the command line, if available. - -The program basename is highlighted if set in the configuration. Additional -highlighting can be configured for stale executables (cf. EXE column below). -.TP -.B COMM -The command name of the process obtained from /proc/[pid]/comm, if readable. - -Requires Linux kernel 2.6.33 or newer. -.TP -.B EXE -The abbreviated basename of the executable of the process, obtained from -/proc/[pid]/exe, if readable. htop is able to read this file on linux for ALL -the processes only if it has the capability CAP_SYS_PTRACE or root privileges. - -The basename is marked in red if the executable used to run the process has -been replaced or deleted on disk since the process started. The information is -obtained by processing the contents of /proc/[pid]/exe. - -Furthermore the basename is marked in yellow if any library is reported as having -been replaced or deleted on disk since it was last loaded. The information is -obtained by processing the contents of /proc/[pid]/maps. - -When deciding the color the replacement of the main executable always takes -precedence over replacement of any other library. If only the memory map indicates -a replacement of the main executable, this will show as if any other library had -been replaced or deleted. - -This additional color markup can be configured in the "Display Options" section of -the setup screen. - -Displaying EXE requires CAP_SYS_PTRACE and PTRACE_MODE_READ_FSCRED. -.TP -.B PID -The process ID. -.TP -.B STATE (S) -The state of the process: - \fBS\fR for sleeping - \fBI\fR for idle (longer inactivity than sleeping on platforms that distinguish) - \fBR\fR for running - \fBD\fR for disk sleep (uninterruptible) - \fBZ\fR for zombie (waiting for parent to read its exit status) - \fBT\fR for traced or suspended (e.g by SIGTSTP) - \fBW\fR for paging -.TP -.B PPID -The parent process ID. -.TP -.B PGRP -The process's group ID. -.TP -.B SESSION (SID) -The process's session ID. -.TP -.B TTY -The controlling terminal of the process. -.TP -.B TPGID -The process ID of the foreground process group of the controlling terminal. -.TP -.B MINFLT -The number of page faults happening in the main memory. -.TP -.B CMINFLT -The number of minor faults for the process's waited-for children (see MINFLT above). -.TP -.B MAJFLT -The number of page faults happening out of the main memory. -.TP -.B CMAJFLT -The number of major faults for the process's waited-for children (see MAJFLT above). -.TP -.B UTIME (UTIME+) -The user CPU time, which is the amount of time the process has spent executing -on the CPU in user mode (i.e. everything but system calls), measured in clock -ticks. -.TP -.B STIME (STIME+) -The system CPU time, which is the amount of time the kernel has spent -executing system calls on behalf of the process, measured in clock ticks. -.TP -.B CUTIME (CUTIME+) -The children's user CPU time, which is the amount of time the process's -waited-for children have spent executing in user mode (see UTIME above). -.TP -.B CSTIME (CSTIME+) -The children's system CPU time, which is the amount of time the kernel has spent -executing system calls on behalf of all the process's waited-for children (see -STIME above). -.TP -.B PRIORITY (PRI) -The kernel's internal priority for the process, usually just its nice value -plus twenty. Different for real-time processes. -.TP -.B NICE (NI) -The nice value of a process, from 19 (low priority) to -20 (high priority). A -high value means the process is being nice, letting others have a higher -relative priority. The usual OS permission restrictions for adjusting priority apply. -.TP -.B STARTTIME (START) -The time the process was started. -.TP -.B PROCESSOR (CPU) -The ID of the CPU the process last executed on. -.TP -.B M_VIRT (VIRT) -The size of the virtual memory of the process. -.TP -.B M_RESIDENT (RES) -The resident set size (text + data + stack) of the process (i.e. the size of the -process's used physical memory). -.TP -.B M_SHARE (SHR) -The size of the process's shared pages. -.TP -.B M_TRS (CODE) -The text resident set size of the process (i.e. the size of the process's -executable instructions). -.TP -.B M_DRS (DATA) -The data resident set size (data + stack) of the process (i.e. the size of anything -except the process's executable instructions). -.TP -.B M_LRS (LIB) -The library size of the process. -.TP -.B M_SWAP (SWAP) -The size of the process's swapped pages. -.TP -.B M_PSS (PSS) -The proportional set size, same as M_RESIDENT but each page is divided by the -number of processes sharing it. -.TP -.B M_M_PSSWP (PSSWP) -The proportional swap share of this mapping, unlike M_SWAP this does not take -into account swapped out page of underlying shmem objects. -.TP -.B ST_UID (UID) -The user ID of the process owner. -.TP -.B PERCENT_CPU (CPU%) -The percentage of the CPU time that the process is currently using. -This is the default way to represent CPU usage in Linux. Each process can -consume up to 100% which means the full capacity of the core it is running -on. This is sometimes called "Irix mode" e.g. in -.BR top (1). -.TP -.B PERCENT_NORM_CPU (NCPU%) -The percentage of the CPU time that the process is currently using normalized -by CPU count. This is sometimes called "Solaris mode" e.g. in -.BR top (1). -.TP -.B PERCENT_MEM (MEM%) -The percentage of memory the process is currently using (based on the process's -resident memory size, see M_RESIDENT above). -.TP -.B USER -The username of the process owner, or the user ID if the name can't be -determined. - -On Linux the username is highlighted if the process has elevated privileges, -i.e. if it has been started from binaries with file capabilities set or -retained Linux capabilities, via the ambient set, after switching from the -root user. -.TP -.B TIME (TIME+) -The time, measured in clock ticks that the process has spent in user and system -time (see UTIME, STIME above). -.TP -.B NLWP -The number of Light-Weight Processes (=threads) in the process. -.TP -.B TGID -The thread group ID. -.TP -.B CTID -OpenVZ container ID, a.k.a virtual environment ID. -.TP -.B VPID -OpenVZ process ID. -.TP -.B VXID -VServer process ID. -.TP -.B RCHAR (RD_CHAR) -The number of bytes the process has read. -.TP -.B WCHAR (WR_CHAR) -The number of bytes the process has written. -.TP -.B SYSCR (RD_SYSC) -The number of read(2) syscalls for the process. -.TP -.B SYSCW (WR_SYSC) -The number of write(2) syscalls for the process. -.TP -.B RBYTES (IO_RBYTES) -Bytes of read(2) I/O for the process. -.TP -.B WBYTES (IO_WBYTES) -Bytes of write(2) I/O for the process. -.TP -.B CNCLWB (IO_CANCEL) -Bytes of cancelled write(2) I/O. -.TP -.B IO_READ_RATE (DISK READ) -The I/O rate of read(2) in bytes per second, for the process. -.TP -.B IO_WRITE_RATE (DISK WRITE) -The I/O rate of write(2) in bytes per second, for the process. -.TP -.B IO_RATE (DISK R/W) -The I/O rate, IO_READ_RATE + IO_WRITE_RATE (see above). -.TP -.B CGROUP -Which cgroup the process is in. For a shortened view see the CCGROUP column below. -.TP -.B CCGROUP -Shortened view of the cgroup name that the process is in. -This performs some pattern-based replacements to shorten the displayed string and thus condense the information. - \fB/*.slice\fR is shortened to \fB/[*]\fR (exceptions below) - \fB/system.slice\fR is shortened to \fB/[S]\fR - \fB/user.slice\fR is shortened to \fB/[U]\fR - \fB/user-*.slice\fR is shortened to \fB/[U:*]\fR (directly preceding \fB/[U]\fR before dropped) - \fB/machine.slice\fR is shortened to \fB/[M]\fR - \fB/machine-*.scope\fR is shortened to \fB/[SNC:*]\fR (SNC: systemd nspawn container), uppercase for the monitor - \fB/lxc.monitor.*\fR is shortened to \fB/[LXC:*]\fR - \fB/lxc.payload.*\fR is shortened to \fB/[lxc:*]\fR - \fB/*.scope\fR is shortened to \fB/!*\fR - \fB/*.service\fR is shortened to \fB/*\fR (suffix removed) - -Encountered escape sequences (e.g. from systemd) inside the cgroup name are not decoded. -.TP -.B OOM -OOM killer score. -.TP -.B CTXT -Incremental sum of voluntary and nonvoluntary context switches. -.TP -.B IO_PRIORITY (IO) -The I/O scheduling class followed by the priority if the class supports it: - \fBR\fR for Realtime - \fBB\fR for Best-effort - \fBid\fR for Idle -.TP -.B PERCENT_CPU_DELAY (CPUD%) -The percentage of time spent waiting for a CPU (while runnable). Requires CAP_NET_ADMIN. -.TP -.B PERCENT_IO_DELAY (IOD%) -The percentage of time spent waiting for the completion of synchronous block I/O. Requires CAP_NET_ADMIN. -.TP -.B PERCENT_SWAP_DELAY (SWAPD%) -The percentage of time spent swapping in pages. Requires CAP_NET_ADMIN. -.TP -.B AGRP -The autogroup identifier for the process. Requires Linux CFS to be enabled. -.TP -.B ANI -The autogroup nice value for the process autogroup. Requires Linux CFS to be enabled. -.TP -.B All other flags -Currently unsupported (always displays '-'). -.SH "EXTERNAL LIBRARIES" -While -.B htop -depends on most of the libraries it uses at build time there are two -noteworthy exceptions to this rule. These exceptions both relate to -data displayed in meters displayed in the header of -.B htop -and were intentionally created as optional runtime dependencies instead. -These exceptions are described below: -.TP -.B libsystemd -The bindings for libsystemd are used in the SystemD meter to determine -the number of active services and the overall system state. Looking for -the functions to determine these information at runtime allows for -builds to support these meters without forcing the package manager -to install these libraries on systems that otherwise don't use systemd. - -Summary: no build time dependency, optional runtime dependency on -.B libsystemd -via dynamic loading, with -.B systemctl(1) -fallback. -.TP -.B libsensors -The bindings for libsensors are used for the CPU temperature readings -in the CPU usage meters if displaying the temperature is enabled through -the setup screen. In order for -.B htop -to show these temperatures correctly though, a proper configuration -of libsensors through its usual configuration files is assumed and that -all CPU cores correspond to temperature sensors from the -.B coretemp -driver with core 0 corresponding to a sensor labelled "Core 0". The -package temperature may be given as "Package id 0". If missing it is -inferred as the maximum value from the available per-core readings. - -Summary: build time dependency on -.B libsensors(3) -C header files, optional runtime dependency on -.B libsensors(3) -via dynamic loading. -.SH "CONFIG FILES" -By default -.B htop -reads its configuration from the XDG-compliant path -.IR ~/.config/htop/htoprc . -The configuration file is overwritten by -.BR htop 's -in-program Setup configuration, so it should not be hand-edited. -If no user configuration exists -.B htop -tries to read the system-wide configuration from -.I @sysconfdir@/htoprc -and as a last resort, falls back to its hard coded defaults. -.LP -You may override the location of the configuration file using the $HTOPRC -environment variable (so you can have multiple configurations for different -machines that share the same home directory, for example). -.LP -The -.B pcp-htop -utility makes use of -.I htoprc -in exactly the same way. -In addition, it supports additional configuration files allowing -new meters and columns to be added to the display via the usual -Setup function, which will display additional Available Meters -and Available Column entries for each runtime configured meter -or column. -.LP -These -.B pcp-htop -configuration files are read once at startup. -The format of these files is described in detail in the -.BR pcp-htop (5) -manual page. -.LP -This functionality makes available many thousands of Performance -Co-Pilot metrics for display by -.BR pcp-htop , -as well as the ability to display custom metrics added at individual sites. -Applications and services instrumented using the OpenMetrics format -.B https://openmetrics.io -can also be displayed by -.B pcp-htop -if the -.BR pmdaopenmetrics (1) -component is configured. -.SH "MEMORY SIZES" -Memory sizes in -.B htop -are displayed in a human-readable form. -Sizes are printed in powers of 1024. (e.g., 1023M = 1072693248 Bytes) -.LP -The decision to use this convention was made in order to conserve screen -space and make memory size representations consistent throughout -.BR htop . -.SH "SEE ALSO" -.BR proc (5), -.BR top (1), -.BR free (1), -.BR ps (1), -.BR uptime (1) -and -.BR limits.conf (5). -.SH "SEE ALSO FOR PCP" -.BR pmdaopenmetrics (1), -.BR PCPIntro (1), -.BR PMAPI (3), -and -.BR pcp-htop (5). -.SH "AUTHORS" -.B htop -was originally developed by Hisham Muhammad. -Nowadays it is maintained by the community at . -.LP -.B pcp-htop -is maintained as a collaboration between the and -communities, and forms part of the Performance Co-Pilot suite of tools. -.SH "COPYRIGHT" -Copyright \(co 2004-2019 Hisham Muhammad. -.br -Copyright \(co 2020-2023 htop dev team. -.LP -License GPLv2+: GNU General Public License version 2 or, at your option, any later version. -.LP -This is free software: you are free to change and redistribute it. -There is NO WARRANTY, to the extent permitted by law. diff --git a/fedora/.local/bin/htop-vim/htop.c b/fedora/.local/bin/htop-vim/htop.c deleted file mode 100644 index 6b9ea48..0000000 --- a/fedora/.local/bin/htop-vim/htop.c +++ /dev/null @@ -1,16 +0,0 @@ -/* -htop - htop.c -(C) 2004-2011 Hisham H. Muhammad -(C) 2020-2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "CommandLine.h" - - -int main(int argc, char** argv) { - return CommandLine_run(PACKAGE, argc, argv); -} diff --git a/fedora/.local/bin/htop-vim/htop.desktop b/fedora/.local/bin/htop-vim/htop.desktop deleted file mode 100644 index 20bed49..0000000 --- a/fedora/.local/bin/htop-vim/htop.desktop +++ /dev/null @@ -1,67 +0,0 @@ -[Desktop Entry] -Type=Application -Version=1.0 -Name=Htop -GenericName=Process Viewer -GenericName[ca]=Visualitzador de processos -GenericName[da]=Procesfremviser -GenericName[de]=Prozessanzeige -GenericName[en_GB]=Process Viewer -GenericName[es]=Visor de procesos -GenericName[fi]=Prosessikatselin -GenericName[fr]=Visualiseur de processus -GenericName[gl]=Visor de procesos -GenericName[it]=Visore dei processi -GenericName[ko]=ํ”„๋กœ์„ธ์Šค ๋ทฐ์–ด -GenericName[nb]=Prosessviser -GenericName[nl]=Viewer van processen -GenericName[nn]=Prosessvisar -GenericName[pl]=Przeglฤ…darka procesรณw -GenericName[pt]=Visualizador de Processos -GenericName[pt_BR]=Visualizador de processos -GenericName[ru]=ะœะพะฝะธั‚ะพั€ ะฟั€ะพั†ะตััะพะฒ -GenericName[sk]=Prehliadaฤ procesov -GenericName[sl]=Pregledovalnik opravil -GenericName[sr@ijekavian]=ะŸั€ะธะบะฐะทะธะฒะฐั‡ ะฟั€ะพั†ะตัะฐ -GenericName[sr@ijekavianlatin]=Prikazivaฤ procesa -GenericName[sr@latin]=Prikazivaฤ procesa -GenericName[sr]=ะŸั€ะธะบะฐะทะธะฒะฐั‡ ะฟั€ะพั†ะตัะฐ -GenericName[sv]=Processvisning -GenericName[tr]=Sรผreรง Gรถrรผntรผleyici -GenericName[uk]=ะŸะตั€ะตะณะปัะด ะฟั€ะพั†ะตัั–ะฒ -GenericName[zh_CN]=่ฟ›็จ‹ๆŸฅ็œ‹ๅ™จ -GenericName[zh_TW]=่กŒ็จ‹ๆชข่ฆ–ๅ™จ -Comment=Show System Processes -Comment[ca]=Visualitzeu els processos del sistema -Comment[da]=Vis systemprocesser -Comment[de]=Systemprozesse anzeigen -Comment[en_GB]=Show System Processes -Comment[es]=Mostrar procesos del sistema -Comment[fi]=Katsele jรคrjestelmรคn prosesseja -Comment[fr]=Affiche les processus systรจme -Comment[gl]=Mostrar os procesos do sistema. -Comment[it]=Mostra processi di sistema -Comment[ko]=์‹œ์Šคํ…œ ํ”„๋กœ์„ธ์Šค ๋ณด๊ธฐ -Comment[nb]=Vis systemprosesser -Comment[nl]=Systeemprocessen tonen -Comment[nn]=Vis systemprosessar -Comment[pl]=Pokaลผ procesy systemowe -Comment[pt]=Mostrar os Processos do Sistema -Comment[pt_BR]=Mostra os processos do sistema -Comment[ru]=ะŸั€ะพัะผะพั‚ั€ ัะฟะธัะบะฐ ะฟั€ะพั†ะตััะพะฒ ะฒ ัะธัั‚ะตะผะต -Comment[sk]=Zobraziลฅ systรฉmovรฉ procesy -Comment[sl]=Prikaz sistemskih opravil -Comment[sr@ijekavian]=ะŸั€ะธะบะฐะท ัะธัั‚ะตะผัะบะธั… ะฟั€ะพั†ะตัะฐ -Comment[sr@ijekavianlatin]=Prikaz sistemskih procesa -Comment[sr@latin]=Prikaz sistemskih procesa -Comment[sr]=ะŸั€ะธะบะฐะท ัะธัั‚ะตะผัะบะธั… ะฟั€ะพั†ะตัะฐ -Comment[sv]=Visa systemprocesser -Comment[tr]=Sistem Sรผreรงlerini Gรถster -Comment[uk]=ะŸะตั€ะตะณะปัะด ัะธัั‚ะตะผะฝะธั… ะฟั€ะพั†ะตัั–ะฒ -Comment[zh_CN]=ๆ˜พ็คบ็ณป็ปŸ่ฟ›็จ‹ -Comment[zh_TW]=้กฏ็คบ็ณป็ตฑ่กŒ็จ‹ -Icon=htop -Exec=htop -Terminal=true -Categories=System;Monitor;ConsoleOnly; -Keywords=system;process;task diff --git a/fedora/.local/bin/htop-vim/htop.png b/fedora/.local/bin/htop-vim/htop.png deleted file mode 100644 index 7809d22..0000000 Binary files a/fedora/.local/bin/htop-vim/htop.png and /dev/null differ diff --git a/fedora/.local/bin/htop-vim/htop.svg b/fedora/.local/bin/htop-vim/htop.svg deleted file mode 100644 index 80da71b..0000000 --- a/fedora/.local/bin/htop-vim/htop.svg +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fedora/.local/bin/htop-vim/iwyu/htop.imp b/fedora/.local/bin/htop-vim/iwyu/htop.imp deleted file mode 100644 index 1416d74..0000000 --- a/fedora/.local/bin/htop-vim/iwyu/htop.imp +++ /dev/null @@ -1,24 +0,0 @@ -[ - { include: ["", "private", "\"ProvideCurses.h\"", "public"] }, - { include: ["", "private", "\"ProvideCurses.h\"", "public"] }, - { include: ["", "private", "\"ProvideCurses.h\"", "public"] }, - { include: ["", "private", "\"ProvideCurses.h\"", "public"] }, - - { include: ["", "private", "", "public"] }, - - { include: ["", "private", "", "public"] }, - - { include: ["", "private", "", "public"] }, - - { include: ["", "private", "", "public"] }, - - { include: ["", "private", "", "public"] }, - - { include: ["", "private", "", "public"] }, - - { include: ["", "private", "", "public"] }, - - { include: ["", "private", "", "public"] }, - - { include: ["", "private", "", "public"] }, -] diff --git a/fedora/.local/bin/htop-vim/iwyu/run_iwyu.sh b/fedora/.local/bin/htop-vim/iwyu/run_iwyu.sh deleted file mode 100755 index 6139ebe..0000000 --- a/fedora/.local/bin/htop-vim/iwyu/run_iwyu.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -SCRIPT=$(readlink -f "$0") -SCRIPTDIR=$(dirname "$SCRIPT") -SOURCEDIR="$SCRIPTDIR/.." - -PKG_NL3=$(pkg-config --cflags libnl-3.0) - -IWYU=${IWYU:-iwyu} - -cd "$SOURCEDIR" || exit - -make clean -make -k -s CC="$IWYU" CFLAGS="-Xiwyu --no_comments -Xiwyu --no_fwd_decl -Xiwyu --mapping_file='$SCRIPTDIR/htop.imp' $PKG_NL3" diff --git a/fedora/.local/bin/htop-vim/linux/CGroupUtils.c b/fedora/.local/bin/htop-vim/linux/CGroupUtils.c deleted file mode 100644 index c11c460..0000000 --- a/fedora/.local/bin/htop-vim/linux/CGroupUtils.c +++ /dev/null @@ -1,341 +0,0 @@ -/* -htop - CGroupUtils.h -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "linux/CGroupUtils.h" - -#include "XUtils.h" - - -typedef struct StrBuf_state { - char* buf; - size_t size; - size_t pos; -} StrBuf_state; - -typedef bool (*StrBuf_putc_t)(StrBuf_state* p, char c); - -static bool StrBuf_putc_count(StrBuf_state* p, ATTR_UNUSED char c) { - p->pos++; - return true; -} - -static bool StrBuf_putc_write(StrBuf_state* p, char c) { - if (p->pos >= p->size) - return false; - - p->buf[p->pos] = c; - p->pos++; - return true; -} - -static bool StrBuf_putsn(StrBuf_state* p, StrBuf_putc_t w, const char* s, size_t count) { - for (; count; count--) - if (!w(p, *s++)) - return false; - - return true; -} - -static bool StrBuf_putsz(StrBuf_state* p, StrBuf_putc_t w, const char* s) { - while (*s) - if (!w(p, *s++)) - return false; - - return true; -} - -static bool Label_checkEqual(const char* labelStart, size_t labelLen, const char* expected) { - return labelLen == strlen(expected) && String_startsWith(labelStart, expected); -} - -static bool Label_checkPrefix(const char* labelStart, size_t labelLen, const char* expected) { - return labelLen > strlen(expected) && String_startsWith(labelStart, expected); -} - -static bool Label_checkSuffix(const char* labelStart, size_t labelLen, const char* expected) { - return labelLen > strlen(expected) && String_startsWith(labelStart + labelLen - strlen(expected), expected); -} - -static bool CGroup_filterName_internal(const char* cgroup, StrBuf_state* s, StrBuf_putc_t w) { - const char* str_slice_suffix = ".slice"; - const char* str_system_slice = "system.slice"; - const char* str_user_slice = "user.slice"; - const char* str_machine_slice = "machine.slice"; - const char* str_user_slice_prefix = "/user-"; - const char* str_system_slice_prefix = "/system-"; - - const char* str_lxc_monitor_legacy = "lxc.monitor"; - const char* str_lxc_payload_legacy = "lxc.payload"; - const char* str_lxc_monitor_prefix = "lxc.monitor."; - const char* str_lxc_payload_prefix = "lxc.payload."; - - const char* str_nspawn_scope_prefix = "machine-"; - const char* str_nspawn_monitor_label = "/supervisor"; - const char* str_nspawn_payload_label = "/payload"; - - const char* str_snap_scope_prefix = "snap."; - - const char* str_service_suffix = ".service"; - const char* str_scope_suffix = ".scope"; - - while (*cgroup) { - if ('/' == *cgroup) { - while ('/' == *cgroup) - cgroup++; - - if (!w(s, '/')) - return false; - - continue; - } - - const char* labelStart = cgroup; - const char* nextSlash = strchrnul(labelStart, '/'); - const size_t labelLen = nextSlash - labelStart; - - if (Label_checkEqual(labelStart, labelLen, str_system_slice)) { - cgroup = nextSlash; - - if (!StrBuf_putsz(s, w, "[S]")) - return false; - - if (String_startsWith(cgroup, str_system_slice_prefix)) { - cgroup = strchrnul(cgroup + 1, '/'); - continue; - } - - continue; - } - - if (Label_checkEqual(labelStart, labelLen, str_machine_slice)) { - cgroup = nextSlash; - - if (!StrBuf_putsz(s, w, "[M]")) - return false; - - continue; - } - - if (Label_checkEqual(labelStart, labelLen, str_user_slice)) { - cgroup = nextSlash; - - if (!StrBuf_putsz(s, w, "[U]")) - return false; - - if (!String_startsWith(cgroup, str_user_slice_prefix)) - continue; - - const char* userSliceSlash = strchrnul(cgroup + strlen(str_user_slice_prefix), '/'); - const char* sliceSpec = userSliceSlash - strlen(str_slice_suffix); - - if (!String_startsWith(sliceSpec, str_slice_suffix)) - continue; - - const size_t sliceNameLen = sliceSpec - (cgroup + strlen(str_user_slice_prefix)); - - s->pos--; - if (!w(s, ':')) - return false; - - if (!StrBuf_putsn(s, w, cgroup + strlen(str_user_slice_prefix), sliceNameLen)) - return false; - - if (!w(s, ']')) - return false; - - cgroup = userSliceSlash; - - continue; - } - - if (Label_checkSuffix(labelStart, labelLen, str_slice_suffix)) { - const size_t sliceNameLen = labelLen - strlen(str_slice_suffix); - - if (!w(s, '[')) - return false; - - if (!StrBuf_putsn(s, w, cgroup, sliceNameLen)) - return false; - - if (!w(s, ']')) - return false; - - cgroup = nextSlash; - - continue; - } - - if (Label_checkPrefix(labelStart, labelLen, str_lxc_payload_prefix)) { - const size_t cgroupNameLen = labelLen - strlen(str_lxc_payload_prefix); - - if (!StrBuf_putsz(s, w, "[lxc:")) - return false; - - if (!StrBuf_putsn(s, w, cgroup + strlen(str_lxc_payload_prefix), cgroupNameLen)) - return false; - - if (!w(s, ']')) - return false; - - cgroup = nextSlash; - - continue; - } - - if (Label_checkPrefix(labelStart, labelLen, str_lxc_monitor_prefix)) { - const size_t cgroupNameLen = labelLen - strlen(str_lxc_monitor_prefix); - - if (!StrBuf_putsz(s, w, "[LXC:")) - return false; - - if (!StrBuf_putsn(s, w, cgroup + strlen(str_lxc_monitor_prefix), cgroupNameLen)) - return false; - - if (!w(s, ']')) - return false; - - cgroup = nextSlash; - - continue; - } - - // LXC legacy cgroup naming - if (Label_checkEqual(labelStart, labelLen, str_lxc_monitor_legacy) || - Label_checkEqual(labelStart, labelLen, str_lxc_payload_legacy)) { - bool isMonitor = Label_checkEqual(labelStart, labelLen, str_lxc_monitor_legacy); - - labelStart = nextSlash; - while (*labelStart == '/') - labelStart++; - - nextSlash = strchrnul(labelStart, '/'); - if (nextSlash - labelStart > 0) { - if (!StrBuf_putsz(s, w, isMonitor ? "[LXC:" : "[lxc:")) - return false; - - if (!StrBuf_putsn(s, w, labelStart, nextSlash - labelStart)) - return false; - - if (!w(s, ']')) - return false; - - cgroup = nextSlash; - continue; - } - - labelStart = cgroup; - nextSlash = labelStart + labelLen; - } - - if (Label_checkSuffix(labelStart, labelLen, str_service_suffix)) { - const size_t serviceNameLen = labelLen - strlen(str_service_suffix); - - if (String_startsWith(cgroup, "user@")) { - cgroup = nextSlash; - - while (*cgroup == '/') - cgroup++; - - continue; - } - - if (!StrBuf_putsn(s, w, cgroup, serviceNameLen)) - return false; - - cgroup = nextSlash; - - continue; - } - - if (Label_checkSuffix(labelStart, labelLen, str_scope_suffix)) { - const size_t scopeNameLen = labelLen - strlen(str_scope_suffix); - - if (Label_checkPrefix(labelStart, scopeNameLen, str_nspawn_scope_prefix)) { - const size_t machineScopeNameLen = scopeNameLen - strlen(str_nspawn_scope_prefix); - - const bool is_monitor = String_startsWith(nextSlash, str_nspawn_monitor_label); - - if (!StrBuf_putsz(s, w, is_monitor ? "[SNC:" : "[snc:")) - return false; - - if (!StrBuf_putsn(s, w, cgroup + strlen(str_nspawn_scope_prefix), machineScopeNameLen)) - return false; - - if (!w(s, ']')) - return false; - - cgroup = nextSlash; - if (String_startsWith(nextSlash, str_nspawn_monitor_label)) - cgroup += strlen(str_nspawn_monitor_label); - else if (String_startsWith(nextSlash, str_nspawn_payload_label)) - cgroup += strlen(str_nspawn_payload_label); - - continue; - } else if (Label_checkPrefix(labelStart, scopeNameLen, str_snap_scope_prefix)) { - const char* nextDot = strchrnul(labelStart + strlen(str_snap_scope_prefix), '.'); - - if (!StrBuf_putsz(s, w, "!snap:")) - return false; - - if (nextDot >= labelStart + scopeNameLen) { - nextDot = labelStart + scopeNameLen; - } - - if (!StrBuf_putsn(s, w, labelStart + strlen(str_snap_scope_prefix), nextDot - (labelStart + strlen(str_snap_scope_prefix)))) - return false; - - cgroup = nextSlash; - - continue; - } - - if (!w(s, '!')) - return false; - - if (!StrBuf_putsn(s, w, cgroup, scopeNameLen)) - return false; - - cgroup = nextSlash; - - continue; - } - - // Default behavior: Copy the full label - cgroup = labelStart; - - if (!StrBuf_putsn(s, w, cgroup, labelLen)) - return false; - - cgroup = nextSlash; - } - - return true; -} - -char* CGroup_filterName(const char* cgroup) { - StrBuf_state s = { - .buf = NULL, - .size = 0, - .pos = 0, - }; - - if (!CGroup_filterName_internal(cgroup, &s, StrBuf_putc_count)) { - return NULL; - } - - s.buf = xCalloc(s.pos + 1, sizeof(char)); - s.size = s.pos; - s.pos = 0; - - if (!CGroup_filterName_internal(cgroup, &s, StrBuf_putc_write)) { - free(s.buf); - return NULL; - } - - s.buf[s.size] = '\0'; - return s.buf; -} diff --git a/fedora/.local/bin/htop-vim/linux/CGroupUtils.h b/fedora/.local/bin/htop-vim/linux/CGroupUtils.h deleted file mode 100644 index ff13437..0000000 --- a/fedora/.local/bin/htop-vim/linux/CGroupUtils.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef HEADER_CGroupUtils -#define HEADER_CGroupUtils -/* -htop - CGroupUtils.h -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include - - -char* CGroup_filterName(const char* cgroup); - -#endif /* HEADER_CGroupUtils */ diff --git a/fedora/.local/bin/htop-vim/linux/HugePageMeter.c b/fedora/.local/bin/htop-vim/linux/HugePageMeter.c deleted file mode 100644 index 1efde2f..0000000 --- a/fedora/.local/bin/htop-vim/linux/HugePageMeter.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -htop - HugePageMeter.c -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "linux/HugePageMeter.h" - -#include -#include -#include - -#include "CRT.h" -#include "Macros.h" -#include "Object.h" -#include "ProcessList.h" -#include "RichString.h" -#include "linux/LinuxProcessList.h" - - -static const char* HugePageMeter_active_labels[4] = { NULL, NULL, NULL, NULL }; - -static const int HugePageMeter_attributes[] = { - HUGEPAGE_1, - HUGEPAGE_2, - HUGEPAGE_3, - HUGEPAGE_4, -}; - -static const char* const HugePageMeter_labels[] = { - " 64K:", " 128K:", " 256K:", " 512K:", - " 1M:", " 2M:", " 4M:", " 8M:", " 16M:", " 32M:", " 64M:", " 128M:", " 256M:", " 512M:", - " 1G:", " 2G:", " 4G:", " 8G:", " 16G:", " 32G:", " 64G:", " 128G:", " 256G:", " 512G:", -}; - -static void HugePageMeter_updateValues(Meter* this) { - assert(ARRAYSIZE(HugePageMeter_labels) == HTOP_HUGEPAGE_COUNT); - - char* buffer = this->txtBuffer; - size_t size = sizeof(this->txtBuffer); - int written; - memory_t usedTotal = 0; - unsigned nextUsed = 0; - - const LinuxProcessList* lpl = (const LinuxProcessList*) this->pl; - this->total = lpl->totalHugePageMem; - this->values[0] = 0; - HugePageMeter_active_labels[0] = " used:"; - for (unsigned i = 1; i < ARRAYSIZE(HugePageMeter_active_labels); i++) { - this->values[i] = NAN; - HugePageMeter_active_labels[i] = NULL; - } - for (unsigned i = 0; i < HTOP_HUGEPAGE_COUNT; i++) { - memory_t value = lpl->usedHugePageMem[i]; - if (value != MEMORY_MAX) { - this->values[nextUsed] = value; - usedTotal += value; - HugePageMeter_active_labels[nextUsed] = HugePageMeter_labels[i]; - if (++nextUsed == ARRAYSIZE(HugePageMeter_active_labels)) { - break; - } - } - } - - written = Meter_humanUnit(buffer, usedTotal, size); - METER_BUFFER_CHECK(buffer, size, written); - - METER_BUFFER_APPEND_CHR(buffer, size, '/'); - - Meter_humanUnit(buffer, this->total, size); -} - -static void HugePageMeter_display(const Object* cast, RichString* out) { - char buffer[50]; - const Meter* this = (const Meter*)cast; - - RichString_writeAscii(out, CRT_colors[METER_TEXT], ":"); - Meter_humanUnit(buffer, this->total, sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_VALUE], buffer); - - for (unsigned i = 0; i < ARRAYSIZE(HugePageMeter_active_labels); i++) { - if (isnan(this->values[i])) { - break; - } - RichString_appendAscii(out, CRT_colors[METER_TEXT], HugePageMeter_active_labels[i]); - Meter_humanUnit(buffer, this->values[i], sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[HUGEPAGE_1 + i], buffer); - } -} - -const MeterClass HugePageMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = HugePageMeter_display, - }, - .updateValues = HugePageMeter_updateValues, - .defaultMode = BAR_METERMODE, - .maxItems = ARRAYSIZE(HugePageMeter_active_labels), - .total = 100.0, - .attributes = HugePageMeter_attributes, - .name = "HugePages", - .uiName = "HugePages", - .caption = "HP" -}; diff --git a/fedora/.local/bin/htop-vim/linux/HugePageMeter.h b/fedora/.local/bin/htop-vim/linux/HugePageMeter.h deleted file mode 100644 index d74a19e..0000000 --- a/fedora/.local/bin/htop-vim/linux/HugePageMeter.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef HEADER_HugePageMeter -#define HEADER_HugePageMeter -/* -htop - HugePageMeter.h -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Meter.h" - - -extern const MeterClass HugePageMeter_class; - -#endif /* HEADER_HugePageMeter */ diff --git a/fedora/.local/bin/htop-vim/linux/IOPriority.h b/fedora/.local/bin/htop-vim/linux/IOPriority.h deleted file mode 100644 index 78bc470..0000000 --- a/fedora/.local/bin/htop-vim/linux/IOPriority.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef HEADER_IOPriority -#define HEADER_IOPriority -/* -htop - IOPriority.h -(C) 2004-2012 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. - -Based on ionice, -Copyright (C) 2005 Jens Axboe -Released under the terms of the GNU General Public License version 2 -*/ - -enum { - IOPRIO_CLASS_NONE, - IOPRIO_CLASS_RT, - IOPRIO_CLASS_BE, - IOPRIO_CLASS_IDLE, -}; - -#define IOPRIO_WHO_PROCESS 1 - -#define IOPRIO_CLASS_SHIFT (13) -#define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1) - -#define IOPriority_class(ioprio_) ((int) ((ioprio_) >> IOPRIO_CLASS_SHIFT) ) -#define IOPriority_data(ioprio_) ((int) ((ioprio_) & IOPRIO_PRIO_MASK) ) - -typedef int IOPriority; - -#define IOPriority_tuple(class_, data_) (((class_) << IOPRIO_CLASS_SHIFT) | (data_)) - -#define IOPriority_None IOPriority_tuple(IOPRIO_CLASS_NONE, 0) -#define IOPriority_Idle IOPriority_tuple(IOPRIO_CLASS_IDLE, 7) - -#endif diff --git a/fedora/.local/bin/htop-vim/linux/IOPriorityPanel.c b/fedora/.local/bin/htop-vim/linux/IOPriorityPanel.c deleted file mode 100644 index 3e91bc4..0000000 --- a/fedora/.local/bin/htop-vim/linux/IOPriorityPanel.c +++ /dev/null @@ -1,57 +0,0 @@ -/* -htop - IOPriorityPanel.c -(C) 2004-2012 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "linux/IOPriorityPanel.h" - -#include -#include - -#include "FunctionBar.h" -#include "ListItem.h" -#include "Object.h" -#include "XUtils.h" -#include "IOPriority.h" - - -Panel* IOPriorityPanel_new(IOPriority currPrio) { - Panel* this = Panel_new(1, 1, 1, 1, Class(ListItem), true, FunctionBar_newEnterEsc("Set ", "Cancel ")); - - Panel_setHeader(this, "IO Priority:"); - Panel_add(this, (Object*) ListItem_new("None (based on nice)", IOPriority_None)); - if (currPrio == IOPriority_None) { - Panel_setSelected(this, 0); - } - static const struct { - int klass; - const char* name; - } classes[] = { - { .klass = IOPRIO_CLASS_RT, .name = "Realtime" }, - { .klass = IOPRIO_CLASS_BE, .name = "Best-effort" }, - { .klass = 0, .name = NULL } - }; - for (int c = 0; classes[c].name; c++) { - for (int i = 0; i < 8; i++) { - char name[50]; - xSnprintf(name, sizeof(name), "%s %d %s", classes[c].name, i, i == 0 ? "(High)" : (i == 7 ? "(Low)" : "")); - IOPriority ioprio = IOPriority_tuple(classes[c].klass, i); - Panel_add(this, (Object*) ListItem_new(name, ioprio)); - if (currPrio == ioprio) { - Panel_setSelected(this, Panel_size(this) - 1); - } - } - } - Panel_add(this, (Object*) ListItem_new("Idle", IOPriority_Idle)); - if (currPrio == IOPriority_Idle) { - Panel_setSelected(this, Panel_size(this) - 1); - } - return this; -} - -IOPriority IOPriorityPanel_getIOPriority(Panel* this) { - const ListItem* selected = (ListItem*) Panel_getSelected(this); - return selected ? selected->key : IOPriority_None; -} diff --git a/fedora/.local/bin/htop-vim/linux/IOPriorityPanel.h b/fedora/.local/bin/htop-vim/linux/IOPriorityPanel.h deleted file mode 100644 index cb5b338..0000000 --- a/fedora/.local/bin/htop-vim/linux/IOPriorityPanel.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef HEADER_IOPriorityPanel -#define HEADER_IOPriorityPanel -/* -htop - IOPriorityPanel.h -(C) 2004-2012 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Panel.h" -#include "linux/IOPriority.h" - -Panel* IOPriorityPanel_new(IOPriority currPrio); - -IOPriority IOPriorityPanel_getIOPriority(Panel* this); - -#endif diff --git a/fedora/.local/bin/htop-vim/linux/LibSensors.c b/fedora/.local/bin/htop-vim/linux/LibSensors.c deleted file mode 100644 index 9a27fe5..0000000 --- a/fedora/.local/bin/htop-vim/linux/LibSensors.c +++ /dev/null @@ -1,269 +0,0 @@ -#include "linux/LibSensors.h" - -#include "config.h" - -#ifdef HAVE_SENSORS_SENSORS_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Macros.h" -#include "XUtils.h" -#include "linux/LinuxProcessList.h" - - -#ifdef BUILD_STATIC - -#define sym_sensors_init sensors_init -#define sym_sensors_cleanup sensors_cleanup -#define sym_sensors_get_detected_chips sensors_get_detected_chips -#define sym_sensors_get_features sensors_get_features -#define sym_sensors_get_subfeature sensors_get_subfeature -#define sym_sensors_get_value sensors_get_value - -#else - -static int (*sym_sensors_init)(FILE*); -static void (*sym_sensors_cleanup)(void); -static const sensors_chip_name* (*sym_sensors_get_detected_chips)(const sensors_chip_name*, int*); -static const sensors_feature* (*sym_sensors_get_features)(const sensors_chip_name*, int*); -static const sensors_subfeature* (*sym_sensors_get_subfeature)(const sensors_chip_name*, const sensors_feature*, sensors_subfeature_type); -static int (*sym_sensors_get_value)(const sensors_chip_name*, int, double*); - -static void* dlopenHandle = NULL; - -#endif /* BUILD_STATIC */ - -int LibSensors_init(void) { -#ifdef BUILD_STATIC - - return sym_sensors_init(NULL); - -#else - - if (!dlopenHandle) { - /* Find the unversioned libsensors.so (symlink) and prefer that, but Debian has .so.5 and Fedora .so.4 without - matching symlinks (unless people install the -dev packages) */ - dlopenHandle = dlopen("libsensors.so", RTLD_LAZY); - if (!dlopenHandle) - dlopenHandle = dlopen("libsensors.so.5", RTLD_LAZY); - if (!dlopenHandle) - dlopenHandle = dlopen("libsensors.so.4", RTLD_LAZY); - if (!dlopenHandle) - goto dlfailure; - - /* Clear any errors */ - dlerror(); - - #define resolve(symbolname) do { \ - *(void **)(&sym_##symbolname) = dlsym(dlopenHandle, #symbolname); \ - if (!sym_##symbolname || dlerror() != NULL) \ - goto dlfailure; \ - } while(0) - - resolve(sensors_init); - resolve(sensors_cleanup); - resolve(sensors_get_detected_chips); - resolve(sensors_get_features); - resolve(sensors_get_subfeature); - resolve(sensors_get_value); - - #undef resolve - } - - return sym_sensors_init(NULL); - - -dlfailure: - if (dlopenHandle) { - dlclose(dlopenHandle); - dlopenHandle = NULL; - } - return -1; - -#endif /* BUILD_STATIC */ -} - -void LibSensors_cleanup(void) { -#ifdef BUILD_STATIC - - sym_sensors_cleanup(); - -#else - - if (dlopenHandle) { - sym_sensors_cleanup(); - - dlclose(dlopenHandle); - dlopenHandle = NULL; - } - -#endif /* BUILD_STATIC */ -} - -int LibSensors_reload(void) { -#ifndef BUILD_STATIC - if (!dlopenHandle) { - errno = ENOTSUP; - return -1; - } -#endif /* !BUILD_STATIC */ - - sym_sensors_cleanup(); - return sym_sensors_init(NULL); -} - -static int tempDriverPriority(const sensors_chip_name* chip) { - static const struct TempDriverDefs { - const char* prefix; - int priority; - } tempDrivers[] = { - { "coretemp", 0 }, - { "via_cputemp", 0 }, - { "cpu_thermal", 0 }, - { "k10temp", 0 }, - { "zenpower", 0 }, - /* Low priority drivers */ - { "acpitz", 1 }, - }; - - for (size_t i = 0; i < ARRAYSIZE(tempDrivers); i++) - if (String_eq(chip->prefix, tempDrivers[i].prefix)) - return tempDrivers[i].priority; - - return -1; -} - -void LibSensors_getCPUTemperatures(CPUData* cpus, unsigned int existingCPUs, unsigned int activeCPUs) { - assert(existingCPUs > 0 && existingCPUs < 16384); - double data[existingCPUs + 1]; - for (size_t i = 0; i < existingCPUs + 1; i++) - data[i] = NAN; - -#ifndef BUILD_STATIC - if (!dlopenHandle) - goto out; -#endif /* !BUILD_STATIC */ - - unsigned int coreTempCount = 0; - int topPriority = 99; - - int n = 0; - for (const sensors_chip_name* chip = sym_sensors_get_detected_chips(NULL, &n); chip; chip = sym_sensors_get_detected_chips(NULL, &n)) { - const int priority = tempDriverPriority(chip); - if (priority < 0) - continue; - - if (priority > topPriority) - continue; - - if (priority < topPriority) { - /* Clear data from lower priority sensor */ - for (size_t i = 0; i < existingCPUs + 1; i++) - data[i] = NAN; - } - - topPriority = priority; - - int m = 0; - for (const sensors_feature* feature = sym_sensors_get_features(chip, &m); feature; feature = sym_sensors_get_features(chip, &m)) { - if (feature->type != SENSORS_FEATURE_TEMP) - continue; - - if (!feature->name || !String_startsWith(feature->name, "temp")) - continue; - - unsigned long int tempID = strtoul(feature->name + strlen("temp"), NULL, 10); - if (tempID == 0 || tempID == ULONG_MAX) - continue; - - /* Feature name IDs start at 1, adjust to start at 0 to match data indices */ - tempID--; - - if (tempID > existingCPUs) - continue; - - const sensors_subfeature* subFeature = sym_sensors_get_subfeature(chip, feature, SENSORS_SUBFEATURE_TEMP_INPUT); - if (!subFeature) - continue; - - double temp; - int r = sym_sensors_get_value(chip, subFeature->number, &temp); - if (r != 0) - continue; - - /* If already set, e.g. Ryzen reporting platform temperature for each die, use the bigger one */ - if (isnan(data[tempID])) { - data[tempID] = temp; - if (tempID > 0) - coreTempCount++; - } else { - data[tempID] = MAXIMUM(data[tempID], temp); - } - } - } - - /* Adjust data for chips not providing a platform temperature */ - if (coreTempCount + 1 == activeCPUs || coreTempCount + 1 == activeCPUs / 2) { - memmove(&data[1], &data[0], existingCPUs * sizeof(*data)); - data[0] = NAN; - coreTempCount++; - - /* Check for further adjustments */ - } - - /* Only package temperature - copy to all cores */ - if (coreTempCount == 0 && !isnan(data[0])) { - for (unsigned int i = 1; i <= existingCPUs; i++) - data[i] = data[0]; - - /* No further adjustments */ - goto out; - } - - /* No package temperature - set to max core temperature */ - if (isnan(data[0]) && coreTempCount != 0) { - double maxTemp = NAN; - for (unsigned int i = 1; i <= existingCPUs; i++) { - if (isnan(data[i])) - continue; - - maxTemp = MAXIMUM(maxTemp, data[i]); - } - - data[0] = maxTemp; - - /* Check for further adjustments */ - } - - /* Only temperature for core 0, maybe Ryzen - copy to all other cores */ - if (coreTempCount == 1 && !isnan(data[1])) { - for (unsigned int i = 2; i <= existingCPUs; i++) - data[i] = data[1]; - - /* No further adjustments */ - goto out; - } - - /* Half the temperatures, probably HT/SMT - copy to second half */ - const unsigned int delta = activeCPUs / 2; - if (coreTempCount == delta) { - memcpy(&data[delta + 1], &data[1], delta * sizeof(*data)); - - /* No further adjustments */ - goto out; - } - -out: - for (unsigned int i = 0; i <= existingCPUs; i++) - cpus[i].temperature = data[i]; -} - -#endif /* HAVE_SENSORS_SENSORS_H */ diff --git a/fedora/.local/bin/htop-vim/linux/LibSensors.h b/fedora/.local/bin/htop-vim/linux/LibSensors.h deleted file mode 100644 index aa89979..0000000 --- a/fedora/.local/bin/htop-vim/linux/LibSensors.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef HEADER_LibSensors -#define HEADER_LibSensors - -#include "linux/LinuxProcessList.h" - - -int LibSensors_init(void); -void LibSensors_cleanup(void); -int LibSensors_reload(void); - -void LibSensors_getCPUTemperatures(CPUData* cpus, unsigned int existingCPUs, unsigned int activeCPUs); - -#endif /* HEADER_LibSensors */ diff --git a/fedora/.local/bin/htop-vim/linux/LinuxProcess.c b/fedora/.local/bin/htop-vim/linux/LinuxProcess.c deleted file mode 100644 index 8f9c346..0000000 --- a/fedora/.local/bin/htop-vim/linux/LinuxProcess.c +++ /dev/null @@ -1,416 +0,0 @@ -/* -htop - LinuxProcess.c -(C) 2014 Hisham H. Muhammad -(C) 2020 Red Hat, Inc. All Rights Reserved. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "linux/LinuxProcess.h" - -#include -#include -#include -#include -#include - -#include "CRT.h" -#include "Macros.h" -#include "Process.h" -#include "ProvideCurses.h" -#include "RichString.h" -#include "Scheduling.h" -#include "XUtils.h" -#include "linux/IOPriority.h" - - -/* semi-global */ -int pageSize; -int pageSizeKB; - -const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { - [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, - [PID] = { .name = "PID", .title = "PID", .description = "Process/thread ID", .flags = 0, .pidColumn = true, }, - [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, - [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging, I idle)", .flags = 0, }, - [PPID] = { .name = "PPID", .title = "PPID", .description = "Parent process ID", .flags = 0, .pidColumn = true, }, - [PGRP] = { .name = "PGRP", .title = "PGRP", .description = "Process group ID", .flags = 0, .pidColumn = true, }, - [SESSION] = { .name = "SESSION", .title = "SID", .description = "Process's session ID", .flags = 0, .pidColumn = true, }, - [TTY] = { .name = "TTY", .title = "TTY ", .description = "Controlling terminal", .flags = 0, }, - [TPGID] = { .name = "TPGID", .title = "TPGID", .description = "Process ID of the fg process group of the controlling terminal", .flags = 0, .pidColumn = true, }, - [MINFLT] = { .name = "MINFLT", .title = " MINFLT ", .description = "Number of minor faults which have not required loading a memory page from disk", .flags = 0, .defaultSortDesc = true, }, - [CMINFLT] = { .name = "CMINFLT", .title = " CMINFLT ", .description = "Children processes' minor faults", .flags = 0, .defaultSortDesc = true, }, - [MAJFLT] = { .name = "MAJFLT", .title = " MAJFLT ", .description = "Number of major faults which have required loading a memory page from disk", .flags = 0, .defaultSortDesc = true, }, - [CMAJFLT] = { .name = "CMAJFLT", .title = " CMAJFLT ", .description = "Children processes' major faults", .flags = 0, .defaultSortDesc = true, }, - [UTIME] = { .name = "UTIME", .title = " UTIME+ ", .description = "User CPU time - time the process spent executing in user mode", .flags = 0, .defaultSortDesc = true, }, - [STIME] = { .name = "STIME", .title = " STIME+ ", .description = "System CPU time - time the kernel spent running system calls for this process", .flags = 0, .defaultSortDesc = true, }, - [CUTIME] = { .name = "CUTIME", .title = " CUTIME+ ", .description = "Children processes' user CPU time", .flags = 0, .defaultSortDesc = true, }, - [CSTIME] = { .name = "CSTIME", .title = " CSTIME+ ", .description = "Children processes' system CPU time", .flags = 0, .defaultSortDesc = true, }, - [PRIORITY] = { .name = "PRIORITY", .title = "PRI ", .description = "Kernel's internal priority for the process", .flags = 0, }, - [NICE] = { .name = "NICE", .title = " NI ", .description = "Nice value (the higher the value, the more it lets other processes take priority)", .flags = 0, }, - [STARTTIME] = { .name = "STARTTIME", .title = "START ", .description = "Time the process was started", .flags = 0, }, - [ELAPSED] = { .name = "ELAPSED", .title = "ELAPSED ", .description = "Time since the process was started", .flags = 0, }, - [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, }, - [M_VIRT] = { .name = "M_VIRT", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, .defaultSortDesc = true, }, - [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, .defaultSortDesc = true, }, - [M_SHARE] = { .name = "M_SHARE", .title = " SHR ", .description = "Size of the process's shared pages", .flags = 0, .defaultSortDesc = true, }, - [M_TRS] = { .name = "M_TRS", .title = " CODE ", .description = "Size of the .text segment of the process (CODE)", .flags = 0, .defaultSortDesc = true, }, - [M_DRS] = { .name = "M_DRS", .title = " DATA ", .description = "Size of the .data segment plus stack usage of the process (DATA)", .flags = 0, .defaultSortDesc = true, }, - [M_LRS] = { .name = "M_LRS", .title = " LIB ", .description = "The library size of the process (calculated from memory maps)", .flags = PROCESS_FLAG_LINUX_LRS_FIX, .defaultSortDesc = true, }, - [ST_UID] = { .name = "ST_UID", .title = "UID", .description = "User ID of the process owner", .flags = 0, }, - [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = " CPU%", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, .defaultSortDesc = true, .autoWidth = true, }, - [PERCENT_NORM_CPU] = { .name = "PERCENT_NORM_CPU", .title = "NCPU%", .description = "Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)", .flags = 0, .defaultSortDesc = true, .autoWidth = true, }, - [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, .defaultSortDesc = true, }, - [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, - [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, .defaultSortDesc = true, }, - [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, .defaultSortDesc = true, }, - [TGID] = { .name = "TGID", .title = "TGID", .description = "Thread group ID (i.e. process ID)", .flags = 0, .pidColumn = true, }, -#ifdef HAVE_OPENVZ - [CTID] = { .name = "CTID", .title = " CTID ", .description = "OpenVZ container ID (a.k.a. virtual environment ID)", .flags = PROCESS_FLAG_LINUX_OPENVZ, }, - [VPID] = { .name = "VPID", .title = "VPID", .description = "OpenVZ process ID", .flags = PROCESS_FLAG_LINUX_OPENVZ, .pidColumn = true, }, -#endif -#ifdef HAVE_VSERVER - [VXID] = { .name = "VXID", .title = " VXID ", .description = "VServer process ID", .flags = PROCESS_FLAG_LINUX_VSERVER, }, -#endif - [RCHAR] = { .name = "RCHAR", .title = "RCHAR ", .description = "Number of bytes the process has read", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [WCHAR] = { .name = "WCHAR", .title = "WCHAR ", .description = "Number of bytes the process has written", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [SYSCR] = { .name = "SYSCR", .title = " READ_SYSC ", .description = "Number of read(2) syscalls for the process", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [SYSCW] = { .name = "SYSCW", .title = " WRITE_SYSC ", .description = "Number of write(2) syscalls for the process", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [RBYTES] = { .name = "RBYTES", .title = " IO_R ", .description = "Bytes of read(2) I/O for the process", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [WBYTES] = { .name = "WBYTES", .title = " IO_W ", .description = "Bytes of write(2) I/O for the process", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [CNCLWB] = { .name = "CNCLWB", .title = " IO_C ", .description = "Bytes of cancelled write(2) I/O", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [IO_READ_RATE] = { .name = "IO_READ_RATE", .title = " DISK READ ", .description = "The I/O rate of read(2) in bytes per second for the process", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [IO_WRITE_RATE] = { .name = "IO_WRITE_RATE", .title = " DISK WRITE ", .description = "The I/O rate of write(2) in bytes per second for the process", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [IO_RATE] = { .name = "IO_RATE", .title = " DISK R/W ", .description = "Total I/O rate in bytes per second", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [CGROUP] = { .name = "CGROUP", .title = "CGROUP (raw)", .description = "Which cgroup the process is in", .flags = PROCESS_FLAG_LINUX_CGROUP, .autoWidth = true, }, - [CCGROUP] = { .name = "CCGROUP", .title = "CGROUP (compressed)", .description = "Which cgroup the process is in (condensed to essentials)", .flags = PROCESS_FLAG_LINUX_CGROUP, .autoWidth = true, }, - [OOM] = { .name = "OOM", .title = " OOM ", .description = "OOM (Out-of-Memory) killer score", .flags = PROCESS_FLAG_LINUX_OOM, .defaultSortDesc = true, }, - [IO_PRIORITY] = { .name = "IO_PRIORITY", .title = "IO ", .description = "I/O priority", .flags = PROCESS_FLAG_LINUX_IOPRIO, }, -#ifdef HAVE_DELAYACCT - [PERCENT_CPU_DELAY] = { .name = "PERCENT_CPU_DELAY", .title = "CPUD% ", .description = "CPU delay %", .flags = PROCESS_FLAG_LINUX_DELAYACCT, .defaultSortDesc = true, }, - [PERCENT_IO_DELAY] = { .name = "PERCENT_IO_DELAY", .title = " IOD% ", .description = "Block I/O delay %", .flags = PROCESS_FLAG_LINUX_DELAYACCT, .defaultSortDesc = true, }, - [PERCENT_SWAP_DELAY] = { .name = "PERCENT_SWAP_DELAY", .title = "SWPD% ", .description = "Swapin delay %", .flags = PROCESS_FLAG_LINUX_DELAYACCT, .defaultSortDesc = true, }, -#endif - [M_PSS] = { .name = "M_PSS", .title = " PSS ", .description = "proportional set size, same as M_RESIDENT but each page is divided by the number of processes sharing it", .flags = PROCESS_FLAG_LINUX_SMAPS, .defaultSortDesc = true, }, - [M_SWAP] = { .name = "M_SWAP", .title = " SWAP ", .description = "Size of the process's swapped pages", .flags = PROCESS_FLAG_LINUX_SMAPS, .defaultSortDesc = true, }, - [M_PSSWP] = { .name = "M_PSSWP", .title = " PSSWP ", .description = "shows proportional swap share of this mapping, unlike \"Swap\", this does not take into account swapped out page of underlying shmem objects", .flags = PROCESS_FLAG_LINUX_SMAPS, .defaultSortDesc = true, }, - [CTXT] = { .name = "CTXT", .title = " CTXT ", .description = "Context switches (incremental sum of voluntary_ctxt_switches and nonvoluntary_ctxt_switches)", .flags = PROCESS_FLAG_LINUX_CTXT, .defaultSortDesc = true, }, - [SECATTR] = { .name = "SECATTR", .title = "Security Attribute", .description = "Security attribute of the process (e.g. SELinux or AppArmor)", .flags = PROCESS_FLAG_LINUX_SECATTR, .autoWidth = true, }, - [PROC_COMM] = { .name = "COMM", .title = "COMM ", .description = "comm string of the process from /proc/[pid]/comm", .flags = 0, }, - [PROC_EXE] = { .name = "EXE", .title = "EXE ", .description = "Basename of exe of the process from /proc/[pid]/exe", .flags = 0, }, - [CWD] = { .name = "CWD", .title = "CWD ", .description = "The current working directory of the process", .flags = PROCESS_FLAG_CWD, }, - [AUTOGROUP_ID] = { .name = "AUTOGROUP_ID", .title = "AGRP", .description = "The autogroup identifier of the process", .flags = PROCESS_FLAG_LINUX_AUTOGROUP, }, - [AUTOGROUP_NICE] = { .name = "AUTOGROUP_NICE", .title = " ANI", .description = "Nice value (the higher the value, the more other processes take priority) associated with the process autogroup", .flags = PROCESS_FLAG_LINUX_AUTOGROUP, }, -#ifdef SCHEDULER_SUPPORT - [SCHEDULERPOLICY] = { .name = "SCHEDULERPOLICY", .title = "SCHED ", .description = "Current scheduling policy of the process", .flags = PROCESS_FLAG_SCHEDPOL, }, -#endif -}; - -Process* LinuxProcess_new(const Settings* settings) { - LinuxProcess* this = xCalloc(1, sizeof(LinuxProcess)); - Object_setClass(this, Class(LinuxProcess)); - Process_init(&this->super, settings); - return &this->super; -} - -void Process_delete(Object* cast) { - LinuxProcess* this = (LinuxProcess*) cast; - Process_done((Process*)cast); - free(this->cgroup_short); - free(this->cgroup); -#ifdef HAVE_OPENVZ - free(this->ctid); -#endif - free(this->secattr); - free(this); -} - -/* -[1] Note that before kernel 2.6.26 a process that has not asked for -an io priority formally uses "none" as scheduling class, but the -io scheduler will treat such processes as if it were in the best -effort class. The priority within the best effort class will be -dynamically derived from the cpu nice level of the process: -io_priority = (cpu_nice + 20) / 5. -- From ionice(1) man page -*/ -static int LinuxProcess_effectiveIOPriority(const LinuxProcess* this) { - if (IOPriority_class(this->ioPriority) == IOPRIO_CLASS_NONE) { - return IOPriority_tuple(IOPRIO_CLASS_BE, (this->super.nice + 20) / 5); - } - - return this->ioPriority; -} - -#ifdef __ANDROID__ -#define SYS_ioprio_get __NR_ioprio_get -#define SYS_ioprio_set __NR_ioprio_set -#endif - -IOPriority LinuxProcess_updateIOPriority(LinuxProcess* this) { - IOPriority ioprio = 0; -// Other OSes masquerading as Linux (NetBSD?) don't have this syscall -#ifdef SYS_ioprio_get - ioprio = syscall(SYS_ioprio_get, IOPRIO_WHO_PROCESS, this->super.pid); -#endif - this->ioPriority = ioprio; - return ioprio; -} - -bool LinuxProcess_setIOPriority(Process* this, Arg ioprio) { -// Other OSes masquerading as Linux (NetBSD?) don't have this syscall -#ifdef SYS_ioprio_set - syscall(SYS_ioprio_set, IOPRIO_WHO_PROCESS, this->pid, ioprio.i); -#endif - return (LinuxProcess_updateIOPriority((LinuxProcess*)this) == ioprio.i); -} - -bool LinuxProcess_isAutogroupEnabled(void) { - char buf[16]; - if (xReadfile(PROCDIR "/sys/kernel/sched_autogroup_enabled", buf, sizeof(buf)) < 0) - return false; - return buf[0] == '1'; -} - -bool LinuxProcess_changeAutogroupPriorityBy(Process* this, Arg delta) { - char buffer[256]; - xSnprintf(buffer, sizeof(buffer), PROCDIR "/%d/autogroup", this->pid); - - FILE* file = fopen(buffer, "r+"); - if (!file) - return false; - - long int identity; - int nice; - int ok = fscanf(file, "/autogroup-%ld nice %d", &identity, &nice); - bool success; - if (ok == 2) { - rewind(file); - xSnprintf(buffer, sizeof(buffer), "%d", nice + delta.i); - success = fputs(buffer, file) > 0; - } else { - success = false; - } - - fclose(file); - return success; -} - -static void LinuxProcess_writeField(const Process* this, RichString* str, ProcessField field) { - const LinuxProcess* lp = (const LinuxProcess*) this; - bool coloring = this->settings->highlightMegabytes; - char buffer[256]; buffer[255] = '\0'; - int attr = CRT_colors[DEFAULT_COLOR]; - size_t n = sizeof(buffer) - 1; - switch (field) { - case CMINFLT: Process_printCount(str, lp->cminflt, coloring); return; - case CMAJFLT: Process_printCount(str, lp->cmajflt, coloring); return; - case M_DRS: Process_printBytes(str, lp->m_drs * pageSize, coloring); return; - case M_LRS: - if (lp->m_lrs) { - Process_printBytes(str, lp->m_lrs * pageSize, coloring); - return; - } - - attr = CRT_colors[PROCESS_SHADOW]; - xSnprintf(buffer, n, " N/A "); - break; - case M_TRS: Process_printBytes(str, lp->m_trs * pageSize, coloring); return; - case M_SHARE: Process_printBytes(str, lp->m_share * pageSize, coloring); return; - case M_PSS: Process_printKBytes(str, lp->m_pss, coloring); return; - case M_SWAP: Process_printKBytes(str, lp->m_swap, coloring); return; - case M_PSSWP: Process_printKBytes(str, lp->m_psswp, coloring); return; - case UTIME: Process_printTime(str, lp->utime, coloring); return; - case STIME: Process_printTime(str, lp->stime, coloring); return; - case CUTIME: Process_printTime(str, lp->cutime, coloring); return; - case CSTIME: Process_printTime(str, lp->cstime, coloring); return; - case RCHAR: Process_printBytes(str, lp->io_rchar, coloring); return; - case WCHAR: Process_printBytes(str, lp->io_wchar, coloring); return; - case SYSCR: Process_printCount(str, lp->io_syscr, coloring); return; - case SYSCW: Process_printCount(str, lp->io_syscw, coloring); return; - case RBYTES: Process_printBytes(str, lp->io_read_bytes, coloring); return; - case WBYTES: Process_printBytes(str, lp->io_write_bytes, coloring); return; - case CNCLWB: Process_printBytes(str, lp->io_cancelled_write_bytes, coloring); return; - case IO_READ_RATE: Process_printRate(str, lp->io_rate_read_bps, coloring); return; - case IO_WRITE_RATE: Process_printRate(str, lp->io_rate_write_bps, coloring); return; - case IO_RATE: { - double totalRate; - if (!isnan(lp->io_rate_read_bps) && !isnan(lp->io_rate_write_bps)) - totalRate = lp->io_rate_read_bps + lp->io_rate_write_bps; - else if (!isnan(lp->io_rate_read_bps)) - totalRate = lp->io_rate_read_bps; - else if (!isnan(lp->io_rate_write_bps)) - totalRate = lp->io_rate_write_bps; - else - totalRate = NAN; - Process_printRate(str, totalRate, coloring); - return; - } - #ifdef HAVE_OPENVZ - case CTID: xSnprintf(buffer, n, "%-8s ", lp->ctid ? lp->ctid : ""); break; - case VPID: xSnprintf(buffer, n, "%*d ", Process_pidDigits, lp->vpid); break; - #endif - #ifdef HAVE_VSERVER - case VXID: xSnprintf(buffer, n, "%5u ", lp->vxid); break; - #endif - case CGROUP: xSnprintf(buffer, n, "%-*.*s ", Process_fieldWidths[CGROUP], Process_fieldWidths[CGROUP], lp->cgroup ? lp->cgroup : "N/A"); break; - case CCGROUP: xSnprintf(buffer, n, "%-*.*s ", Process_fieldWidths[CCGROUP], Process_fieldWidths[CCGROUP], lp->cgroup_short ? lp->cgroup_short : (lp->cgroup ? lp->cgroup : "N/A")); break; - case OOM: xSnprintf(buffer, n, "%4u ", lp->oom); break; - case IO_PRIORITY: { - int klass = IOPriority_class(lp->ioPriority); - if (klass == IOPRIO_CLASS_NONE) { - // see note [1] above - xSnprintf(buffer, n, "B%1d ", (int) (this->nice + 20) / 5); - } else if (klass == IOPRIO_CLASS_BE) { - xSnprintf(buffer, n, "B%1d ", IOPriority_data(lp->ioPriority)); - } else if (klass == IOPRIO_CLASS_RT) { - attr = CRT_colors[PROCESS_HIGH_PRIORITY]; - xSnprintf(buffer, n, "R%1d ", IOPriority_data(lp->ioPriority)); - } else if (klass == IOPRIO_CLASS_IDLE) { - attr = CRT_colors[PROCESS_LOW_PRIORITY]; - xSnprintf(buffer, n, "id "); - } else { - xSnprintf(buffer, n, "?? "); - } - break; - } - #ifdef HAVE_DELAYACCT - case PERCENT_CPU_DELAY: Process_printPercentage(lp->cpu_delay_percent, buffer, n, 5, &attr); break; - case PERCENT_IO_DELAY: Process_printPercentage(lp->blkio_delay_percent, buffer, n, 5, &attr); break; - case PERCENT_SWAP_DELAY: Process_printPercentage(lp->swapin_delay_percent, buffer, n, 5, &attr); break; - #endif - case CTXT: - if (lp->ctxt_diff > 1000) { - attr |= A_BOLD; - } - xSnprintf(buffer, n, "%5lu ", lp->ctxt_diff); - break; - case SECATTR: snprintf(buffer, n, "%-*.*s ", Process_fieldWidths[SECATTR], Process_fieldWidths[SECATTR], lp->secattr ? lp->secattr : "N/A"); break; - case AUTOGROUP_ID: - if (lp->autogroup_id != -1) { - xSnprintf(buffer, n, "%4ld ", lp->autogroup_id); - } else { - attr = CRT_colors[PROCESS_SHADOW]; - xSnprintf(buffer, n, " N/A "); - } - break; - case AUTOGROUP_NICE: - if (lp->autogroup_id != -1) { - xSnprintf(buffer, n, "%3d ", lp->autogroup_nice); - attr = lp->autogroup_nice < 0 ? CRT_colors[PROCESS_HIGH_PRIORITY] - : lp->autogroup_nice > 0 ? CRT_colors[PROCESS_LOW_PRIORITY] - : CRT_colors[PROCESS_SHADOW]; - } else { - attr = CRT_colors[PROCESS_SHADOW]; - xSnprintf(buffer, n, "N/A "); - } - break; - default: - Process_writeField(this, str, field); - return; - } - RichString_appendAscii(str, attr, buffer); -} - -static double adjustNaN(double num) { - if (isnan(num)) - return -0.0005; - - return num; -} - -static int LinuxProcess_compareByKey(const Process* v1, const Process* v2, ProcessField key) { - const LinuxProcess* p1 = (const LinuxProcess*)v1; - const LinuxProcess* p2 = (const LinuxProcess*)v2; - - switch (key) { - case M_DRS: - return SPACESHIP_NUMBER(p1->m_drs, p2->m_drs); - case M_LRS: - return SPACESHIP_NUMBER(p1->m_lrs, p2->m_lrs); - case M_TRS: - return SPACESHIP_NUMBER(p1->m_trs, p2->m_trs); - case M_SHARE: - return SPACESHIP_NUMBER(p1->m_share, p2->m_share); - case M_PSS: - return SPACESHIP_NUMBER(p1->m_pss, p2->m_pss); - case M_SWAP: - return SPACESHIP_NUMBER(p1->m_swap, p2->m_swap); - case M_PSSWP: - return SPACESHIP_NUMBER(p1->m_psswp, p2->m_psswp); - case UTIME: - return SPACESHIP_NUMBER(p1->utime, p2->utime); - case CUTIME: - return SPACESHIP_NUMBER(p1->cutime, p2->cutime); - case STIME: - return SPACESHIP_NUMBER(p1->stime, p2->stime); - case CSTIME: - return SPACESHIP_NUMBER(p1->cstime, p2->cstime); - case RCHAR: - return SPACESHIP_NUMBER(p1->io_rchar, p2->io_rchar); - case WCHAR: - return SPACESHIP_NUMBER(p1->io_wchar, p2->io_wchar); - case SYSCR: - return SPACESHIP_NUMBER(p1->io_syscr, p2->io_syscr); - case SYSCW: - return SPACESHIP_NUMBER(p1->io_syscw, p2->io_syscw); - case RBYTES: - return SPACESHIP_NUMBER(p1->io_read_bytes, p2->io_read_bytes); - case WBYTES: - return SPACESHIP_NUMBER(p1->io_write_bytes, p2->io_write_bytes); - case CNCLWB: - return SPACESHIP_NUMBER(p1->io_cancelled_write_bytes, p2->io_cancelled_write_bytes); - case IO_READ_RATE: - return SPACESHIP_NUMBER(adjustNaN(p1->io_rate_read_bps), adjustNaN(p2->io_rate_read_bps)); - case IO_WRITE_RATE: - return SPACESHIP_NUMBER(adjustNaN(p1->io_rate_write_bps), adjustNaN(p2->io_rate_write_bps)); - case IO_RATE: - return SPACESHIP_NUMBER(adjustNaN(p1->io_rate_read_bps) + adjustNaN(p1->io_rate_write_bps), adjustNaN(p2->io_rate_read_bps) + adjustNaN(p2->io_rate_write_bps)); - #ifdef HAVE_OPENVZ - case CTID: - return SPACESHIP_NULLSTR(p1->ctid, p2->ctid); - case VPID: - return SPACESHIP_NUMBER(p1->vpid, p2->vpid); - #endif - #ifdef HAVE_VSERVER - case VXID: - return SPACESHIP_NUMBER(p1->vxid, p2->vxid); - #endif - case CGROUP: - return SPACESHIP_NULLSTR(p1->cgroup, p2->cgroup); - case CCGROUP: - return SPACESHIP_NULLSTR(p1->cgroup_short, p2->cgroup_short); - case OOM: - return SPACESHIP_NUMBER(p1->oom, p2->oom); - #ifdef HAVE_DELAYACCT - case PERCENT_CPU_DELAY: - return SPACESHIP_NUMBER(p1->cpu_delay_percent, p2->cpu_delay_percent); - case PERCENT_IO_DELAY: - return SPACESHIP_NUMBER(p1->blkio_delay_percent, p2->blkio_delay_percent); - case PERCENT_SWAP_DELAY: - return SPACESHIP_NUMBER(p1->swapin_delay_percent, p2->swapin_delay_percent); - #endif - case IO_PRIORITY: - return SPACESHIP_NUMBER(LinuxProcess_effectiveIOPriority(p1), LinuxProcess_effectiveIOPriority(p2)); - case CTXT: - return SPACESHIP_NUMBER(p1->ctxt_diff, p2->ctxt_diff); - case SECATTR: - return SPACESHIP_NULLSTR(p1->secattr, p2->secattr); - case AUTOGROUP_ID: - return SPACESHIP_NUMBER(p1->autogroup_id, p2->autogroup_id); - case AUTOGROUP_NICE: - return SPACESHIP_NUMBER(p1->autogroup_nice, p2->autogroup_nice); - default: - return Process_compareByKey_Base(v1, v2, key); - } -} - -const ProcessClass LinuxProcess_class = { - .super = { - .extends = Class(Process), - .display = Process_display, - .delete = Process_delete, - .compare = Process_compare - }, - .writeField = LinuxProcess_writeField, - .compareByKey = LinuxProcess_compareByKey -}; diff --git a/fedora/.local/bin/htop-vim/linux/LinuxProcess.h b/fedora/.local/bin/htop-vim/linux/LinuxProcess.h deleted file mode 100644 index 3e5d380..0000000 --- a/fedora/.local/bin/htop-vim/linux/LinuxProcess.h +++ /dev/null @@ -1,135 +0,0 @@ -#ifndef HEADER_LinuxProcess -#define HEADER_LinuxProcess -/* -htop - LinuxProcess.h -(C) 2014 Hisham H. Muhammad -(C) 2020 Red Hat, Inc. All Rights Reserved. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include -#include - -#include "linux/IOPriority.h" -#include "Object.h" -#include "Process.h" -#include "Settings.h" - - -#define PROCESS_FLAG_LINUX_IOPRIO 0x00000100 -#define PROCESS_FLAG_LINUX_OPENVZ 0x00000200 -#define PROCESS_FLAG_LINUX_VSERVER 0x00000400 -#define PROCESS_FLAG_LINUX_CGROUP 0x00000800 -#define PROCESS_FLAG_LINUX_OOM 0x00001000 -#define PROCESS_FLAG_LINUX_SMAPS 0x00002000 -#define PROCESS_FLAG_LINUX_CTXT 0x00004000 -#define PROCESS_FLAG_LINUX_SECATTR 0x00008000 -#define PROCESS_FLAG_LINUX_LRS_FIX 0x00010000 -#define PROCESS_FLAG_LINUX_DELAYACCT 0x00040000 -#define PROCESS_FLAG_LINUX_AUTOGROUP 0x00080000 - -typedef struct LinuxProcess_ { - Process super; - IOPriority ioPriority; - unsigned long int cminflt; - unsigned long int cmajflt; - unsigned long long int utime; - unsigned long long int stime; - unsigned long long int cutime; - unsigned long long int cstime; - long m_share; - long m_pss; - long m_swap; - long m_psswp; - long m_trs; - long m_drs; - long m_lrs; - - /* Process flags */ - unsigned long int flags; - - /* Data read (in bytes) */ - unsigned long long io_rchar; - - /* Data written (in bytes) */ - unsigned long long io_wchar; - - /* Number of read(2) syscalls */ - unsigned long long io_syscr; - - /* Number of write(2) syscalls */ - unsigned long long io_syscw; - - /* Storage data read (in bytes) */ - unsigned long long io_read_bytes; - - /* Storage data written (in bytes) */ - unsigned long long io_write_bytes; - - /* Storage data cancelled (in bytes) */ - unsigned long long io_cancelled_write_bytes; - - /* Point in time of last io scan (in milliseconds elapsed since the Epoch) */ - unsigned long long io_last_scan_time_ms; - - /* Storage data read (in bytes per second) */ - double io_rate_read_bps; - - /* Storage data written (in bytes per second) */ - double io_rate_write_bps; - - #ifdef HAVE_OPENVZ - char* ctid; - pid_t vpid; - #endif - #ifdef HAVE_VSERVER - unsigned int vxid; - #endif - char* cgroup; - char* cgroup_short; - unsigned int oom; - #ifdef HAVE_DELAYACCT - unsigned long long int delay_read_time; - unsigned long long cpu_delay_total; - unsigned long long blkio_delay_total; - unsigned long long swapin_delay_total; - float cpu_delay_percent; - float blkio_delay_percent; - float swapin_delay_percent; - #endif - unsigned long ctxt_total; - unsigned long ctxt_diff; - char* secattr; - unsigned long long int last_mlrs_calctime; - - /* Autogroup scheduling (CFS) information */ - long int autogroup_id; - int autogroup_nice; -} LinuxProcess; - -extern int pageSize; - -extern int pageSizeKB; - -extern const ProcessFieldData Process_fields[LAST_PROCESSFIELD]; - -extern const ProcessClass LinuxProcess_class; - -Process* LinuxProcess_new(const Settings* settings); - -void Process_delete(Object* cast); - -IOPriority LinuxProcess_updateIOPriority(LinuxProcess* this); - -bool LinuxProcess_setIOPriority(Process* this, Arg ioprio); - -bool LinuxProcess_isAutogroupEnabled(void); - -bool LinuxProcess_changeAutogroupPriorityBy(Process* this, Arg delta); - -bool Process_isThread(const Process* this); - -#endif diff --git a/fedora/.local/bin/htop-vim/linux/LinuxProcessList.c b/fedora/.local/bin/htop-vim/linux/LinuxProcessList.c deleted file mode 100644 index 24b7ea9..0000000 --- a/fedora/.local/bin/htop-vim/linux/LinuxProcessList.c +++ /dev/null @@ -1,2285 +0,0 @@ -/* -htop - LinuxProcessList.c -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "linux/LinuxProcessList.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_DELAYACCT -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif - -#include "Compat.h" -#include "CRT.h" -#include "Macros.h" -#include "Object.h" -#include "Process.h" -#include "Scheduling.h" -#include "Settings.h" -#include "XUtils.h" -#include "linux/CGroupUtils.h" -#include "linux/LinuxProcess.h" -#include "linux/Platform.h" // needed for GNU/hurd to get PATH_MAX // IWYU pragma: keep - -#if defined(MAJOR_IN_MKDEV) -#include -#elif defined(MAJOR_IN_SYSMACROS) -#include -#endif - -#ifdef HAVE_SENSORS_SENSORS_H -#include "LibSensors.h" -#endif - -#ifndef O_PATH -#define O_PATH 010000000 // declare for ancient glibc versions -#endif - -/* Not exposed yet. Defined at include/linux/sched.h */ -#ifndef PF_KTHREAD -#define PF_KTHREAD 0x00200000 -#endif - -static long long btime = -1; - -static long jiffy; - -static FILE* fopenat(openat_arg_t openatArg, const char* pathname, const char* mode) { - assert(String_eq(mode, "r")); /* only currently supported mode */ - - int fd = Compat_openat(openatArg, pathname, O_RDONLY); - if (fd < 0) - return NULL; - - FILE* stream = fdopen(fd, mode); - if (!stream) - close(fd); - - return stream; -} - -static inline uint64_t fast_strtoull_dec(char** str, int maxlen) { - register uint64_t result = 0; - - if (!maxlen) - --maxlen; - - while (maxlen-- && **str >= '0' && **str <= '9') { - result *= 10; - result += **str - '0'; - (*str)++; - } - - return result; -} - -static inline uint64_t fast_strtoull_hex(char** str, int maxlen) { - register uint64_t result = 0; - register int nibble, letter; - const long valid_mask = 0x03FF007E; - - if (!maxlen) - --maxlen; - - while (maxlen--) { - nibble = (unsigned char)**str; - if (!(valid_mask & (1 << (nibble & 0x1F)))) - break; - if ((nibble < '0') || (nibble & ~0x20) > 'F') - break; - letter = (nibble & 0x40) ? 'A' - '9' - 1 : 0; - nibble &=~0x20; // to upper - nibble ^= 0x10; // switch letters and digits - nibble -= letter; - nibble &= 0x0f; - result <<= 4; - result += (uint64_t)nibble; - (*str)++; - } - - return result; -} - -static int sortTtyDrivers(const void* va, const void* vb) { - const TtyDriver* a = (const TtyDriver*) va; - const TtyDriver* b = (const TtyDriver*) vb; - - int r = SPACESHIP_NUMBER(a->major, b->major); - if (r) - return r; - - return SPACESHIP_NUMBER(a->minorFrom, b->minorFrom); -} - -static void LinuxProcessList_initTtyDrivers(LinuxProcessList* this) { - TtyDriver* ttyDrivers; - - char buf[16384]; - ssize_t r = xReadfile(PROCTTYDRIVERSFILE, buf, sizeof(buf)); - if (r < 0) - return; - - int numDrivers = 0; - int allocd = 10; - ttyDrivers = xMallocArray(allocd, sizeof(TtyDriver)); - char* at = buf; - while (*at != '\0') { - at = strchr(at, ' '); // skip first token - while (*at == ' ') at++; // skip spaces - const char* token = at; // mark beginning of path - at = strchr(at, ' '); // find end of path - *at = '\0'; at++; // clear and skip - ttyDrivers[numDrivers].path = xStrdup(token); // save - while (*at == ' ') at++; // skip spaces - token = at; // mark beginning of major - at = strchr(at, ' '); // find end of major - *at = '\0'; at++; // clear and skip - ttyDrivers[numDrivers].major = atoi(token); // save - while (*at == ' ') at++; // skip spaces - token = at; // mark beginning of minorFrom - while (*at >= '0' && *at <= '9') at++; //find end of minorFrom - if (*at == '-') { // if has range - *at = '\0'; at++; // clear and skip - ttyDrivers[numDrivers].minorFrom = atoi(token); // save - token = at; // mark beginning of minorTo - at = strchr(at, ' '); // find end of minorTo - *at = '\0'; at++; // clear and skip - ttyDrivers[numDrivers].minorTo = atoi(token); // save - } else { // no range - *at = '\0'; at++; // clear and skip - ttyDrivers[numDrivers].minorFrom = atoi(token); // save - ttyDrivers[numDrivers].minorTo = atoi(token); // save - } - at = strchr(at, '\n'); // go to end of line - at++; // skip - numDrivers++; - if (numDrivers == allocd) { - allocd += 10; - ttyDrivers = xReallocArray(ttyDrivers, allocd, sizeof(TtyDriver)); - } - } - numDrivers++; - ttyDrivers = xRealloc(ttyDrivers, sizeof(TtyDriver) * numDrivers); - ttyDrivers[numDrivers - 1].path = NULL; - qsort(ttyDrivers, numDrivers - 1, sizeof(TtyDriver), sortTtyDrivers); - this->ttyDrivers = ttyDrivers; -} - -#ifdef HAVE_DELAYACCT - -static void LinuxProcessList_initNetlinkSocket(LinuxProcessList* this) { - this->netlink_socket = nl_socket_alloc(); - if (this->netlink_socket == NULL) { - return; - } - if (nl_connect(this->netlink_socket, NETLINK_GENERIC) < 0) { - return; - } - this->netlink_family = genl_ctrl_resolve(this->netlink_socket, TASKSTATS_GENL_NAME); -} - -#endif - -static unsigned int scanAvailableCPUsFromCPUinfo(LinuxProcessList* this) { - FILE* file = fopen(PROCCPUINFOFILE, "r"); - if (file == NULL) - return this->super.existingCPUs; - - unsigned int availableCPUs = 0; - - while (!feof(file)) { - char buffer[PROC_LINE_LENGTH]; - - if (fgets(buffer, PROC_LINE_LENGTH, file) == NULL) - break; - - if (String_startsWith(buffer, "processor")) - availableCPUs++; - } - - fclose(file); - - return availableCPUs ? availableCPUs : 1; -} - -static void LinuxProcessList_updateCPUcount(ProcessList* super) { - /* Similar to get_nprocs_conf(3) / _SC_NPROCESSORS_CONF - * https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/getsysstats.c;hb=HEAD - */ - - LinuxProcessList* this = (LinuxProcessList*) super; - unsigned int existing = 0, active = 0; - - // Initialize the cpuData array before anything else. - if (!this->cpuData) { - this->cpuData = xCalloc(2, sizeof(CPUData)); - this->cpuData[0].online = true; /* average is always "online" */ - this->cpuData[1].online = true; - super->activeCPUs = 1; - super->existingCPUs = 1; - } - - DIR* dir = opendir("/sys/devices/system/cpu"); - if (!dir) - return; - - unsigned int currExisting = super->existingCPUs; - - const struct dirent* entry; - while ((entry = readdir(dir)) != NULL) { - if (entry->d_type != DT_DIR && entry->d_type != DT_UNKNOWN) - continue; - - if (!String_startsWith(entry->d_name, "cpu")) - continue; - - char* endp; - unsigned long int id = strtoul(entry->d_name + 3, &endp, 10); - if (id == ULONG_MAX || endp == entry->d_name + 3 || *endp != '\0') - continue; - -#ifdef HAVE_OPENAT - int cpuDirFd = openat(dirfd(dir), entry->d_name, O_DIRECTORY | O_PATH | O_NOFOLLOW); - if (cpuDirFd < 0) - continue; -#else - char cpuDirFd[4096]; - xSnprintf(cpuDirFd, sizeof(cpuDirFd), "/sys/devices/system/cpu/%s", entry->d_name); -#endif - - existing++; - - /* readdir() iterates with no specific order */ - unsigned int max = MAXIMUM(existing, id + 1); - if (max > currExisting) { - this->cpuData = xReallocArrayZero(this->cpuData, currExisting ? (currExisting + 1) : 0, max + /* aggregate */ 1, sizeof(CPUData)); - this->cpuData[0].online = true; /* average is always "online" */ - currExisting = max; - } - - char buffer[8]; - ssize_t res = xReadfileat(cpuDirFd, "online", buffer, sizeof(buffer)); - /* If the file "online" does not exist or on failure count as active */ - if (res < 1 || buffer[0] != '0') { - active++; - this->cpuData[id + 1].online = true; - } else { - this->cpuData[id + 1].online = false; - } - - Compat_openatArgClose(cpuDirFd); - } - - closedir(dir); - - // return if no CPU is found - if (existing < 1) - return; - - if (Running_containerized) { - /* LXC munges /proc/cpuinfo but not the /sys/devices/system/cpu/ files, - * so limit the visible CPUs to what the guest has been configured to see: */ - currExisting = active = scanAvailableCPUsFromCPUinfo(this); - } - -#ifdef HAVE_SENSORS_SENSORS_H - /* When started with offline CPUs, libsensors does not monitor those, - * even when they become online. */ - if (super->existingCPUs != 0 && (active > super->activeCPUs || currExisting > super->existingCPUs)) - LibSensors_reload(); -#endif - - super->activeCPUs = active; - assert(Running_containerized || (existing == currExisting)); - super->existingCPUs = currExisting; -} - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId) { - LinuxProcessList* this = xCalloc(1, sizeof(LinuxProcessList)); - ProcessList* pl = &(this->super); - - ProcessList_init(pl, Class(LinuxProcess), usersTable, dynamicMeters, dynamicColumns, pidMatchList, userId); - LinuxProcessList_initTtyDrivers(this); - - // Initialize page size - pageSize = sysconf(_SC_PAGESIZE); - if (pageSize == -1) - CRT_fatalError("Cannot get pagesize by sysconf(_SC_PAGESIZE)"); - pageSizeKB = pageSize / ONE_K; - - // Initialize clock ticks - jiffy = sysconf(_SC_CLK_TCK); - if (jiffy == -1) - CRT_fatalError("Cannot get clock ticks by sysconf(_SC_CLK_TCK)"); - - // Test /proc/PID/smaps_rollup availability (faster to parse, Linux 4.14+) - this->haveSmapsRollup = (access(PROCDIR "/self/smaps_rollup", R_OK) == 0); - - // Read btime (the kernel boot time, as number of seconds since the epoch) - FILE* statfile = fopen(PROCSTATFILE, "r"); - if (statfile == NULL) - CRT_fatalError("Cannot open " PROCSTATFILE); - while (true) { - char buffer[PROC_LINE_LENGTH + 1]; - if (fgets(buffer, sizeof(buffer), statfile) == NULL) - break; - if (String_startsWith(buffer, "btime ") == false) - continue; - if (sscanf(buffer, "btime %lld\n", &btime) == 1) - break; - CRT_fatalError("Failed to parse btime from " PROCSTATFILE); - } - - fclose(statfile); - - if (btime == -1) - CRT_fatalError("No btime in " PROCSTATFILE); - - // Initialize CPU count - LinuxProcessList_updateCPUcount(pl); - - return pl; -} - -void ProcessList_delete(ProcessList* pl) { - LinuxProcessList* this = (LinuxProcessList*) pl; - ProcessList_done(pl); - free(this->cpuData); - if (this->ttyDrivers) { - for (int i = 0; this->ttyDrivers[i].path; i++) { - free(this->ttyDrivers[i].path); - } - free(this->ttyDrivers); - } - #ifdef HAVE_DELAYACCT - if (this->netlink_socket) { - nl_close(this->netlink_socket); - nl_socket_free(this->netlink_socket); - } - #endif - free(this); -} - -static inline unsigned long long LinuxProcessList_adjustTime(unsigned long long t) { - return t * 100 / jiffy; -} - -/* Taken from: https://github.com/torvalds/linux/blob/64570fbc14f8d7cb3fe3995f20e26bc25ce4b2cc/fs/proc/array.c#L120 */ -static inline ProcessState LinuxProcessList_getProcessState(char state) { - switch (state) { - case 'S': return SLEEPING; - case 'X': return DEFUNCT; - case 'Z': return ZOMBIE; - case 't': return TRACED; - case 'T': return STOPPED; - case 'D': return UNINTERRUPTIBLE_WAIT; - case 'R': return RUNNING; - case 'P': return BLOCKED; - case 'I': return IDLE; - default: return UNKNOWN; - } -} - -static bool LinuxProcessList_readStatFile(Process* process, openat_arg_t procFd, char* command, size_t commLen) { - LinuxProcess* lp = (LinuxProcess*) process; - - char buf[MAX_READ + 1]; - ssize_t r = xReadfileat(procFd, "stat", buf, sizeof(buf)); - if (r < 0) - return false; - - /* (1) pid - %d */ - assert(process->pid == atoi(buf)); - char* location = strchr(buf, ' '); - if (!location) - return false; - - /* (2) comm - (%s) */ - location += 2; - char* end = strrchr(location, ')'); - if (!end) - return false; - - String_safeStrncpy(command, location, MINIMUM((size_t)(end - location + 1), commLen)); - - location = end + 2; - - /* (3) state - %c */ - process->state = LinuxProcessList_getProcessState(location[0]); - location += 2; - - /* (4) ppid - %d */ - process->ppid = strtol(location, &location, 10); - location += 1; - - /* (5) pgrp - %d */ - process->pgrp = strtol(location, &location, 10); - location += 1; - - /* (6) session - %d */ - process->session = strtol(location, &location, 10); - location += 1; - - /* (7) tty_nr - %d */ - process->tty_nr = strtoul(location, &location, 10); - location += 1; - - /* (8) tpgid - %d */ - process->tpgid = strtol(location, &location, 10); - location += 1; - - /* (9) flags - %u */ - lp->flags = strtoul(location, &location, 10); - location += 1; - - /* (10) minflt - %lu */ - process->minflt = strtoull(location, &location, 10); - location += 1; - - /* (11) cminflt - %lu */ - lp->cminflt = strtoull(location, &location, 10); - location += 1; - - /* (12) majflt - %lu */ - process->majflt = strtoull(location, &location, 10); - location += 1; - - /* (13) cmajflt - %lu */ - lp->cmajflt = strtoull(location, &location, 10); - location += 1; - - /* (14) utime - %lu */ - lp->utime = LinuxProcessList_adjustTime(strtoull(location, &location, 10)); - location += 1; - - /* (15) stime - %lu */ - lp->stime = LinuxProcessList_adjustTime(strtoull(location, &location, 10)); - location += 1; - - /* (16) cutime - %ld */ - lp->cutime = LinuxProcessList_adjustTime(strtoull(location, &location, 10)); - location += 1; - - /* (17) cstime - %ld */ - lp->cstime = LinuxProcessList_adjustTime(strtoull(location, &location, 10)); - location += 1; - - /* (18) priority - %ld */ - process->priority = strtol(location, &location, 10); - location += 1; - - /* (19) nice - %ld */ - process->nice = strtol(location, &location, 10); - location += 1; - - /* (20) num_threads - %ld */ - process->nlwp = strtol(location, &location, 10); - location += 1; - - /* Skip (21) itrealvalue - %ld */ - location = strchr(location, ' ') + 1; - - /* (22) starttime - %llu */ - if (process->starttime_ctime == 0) { - process->starttime_ctime = btime + LinuxProcessList_adjustTime(strtoll(location, &location, 10)) / 100; - } else { - location = strchr(location, ' '); - } - location += 1; - - /* Skip (23) - (38) */ - for (int i = 0; i < 16; i++) { - location = strchr(location, ' ') + 1; - } - - assert(location != NULL); - - /* (39) processor - %d */ - process->processor = strtol(location, &location, 10); - - /* Ignore further fields */ - - process->time = lp->utime + lp->stime; - - return true; -} - -static bool LinuxProcessList_readStatusFile(Process* process, openat_arg_t procFd) { - LinuxProcess* lp = (LinuxProcess*) process; - - unsigned long ctxt = 0; -#ifdef HAVE_VSERVER - lp->vxid = 0; -#endif - - FILE* statusfile = fopenat(procFd, "status", "r"); - if (!statusfile) - return false; - - char buffer[PROC_LINE_LENGTH + 1]; - - while (fgets(buffer, sizeof(buffer), statusfile)) { - - if (String_startsWith(buffer, "NSpid:")) { - const char* ptr = buffer; - int pid_ns_count = 0; - while (*ptr && *ptr != '\n' && !isdigit((unsigned char)*ptr)) - ++ptr; - - while (*ptr && *ptr != '\n') { - if (isdigit(*ptr)) - pid_ns_count++; - while (isdigit((unsigned char)*ptr)) - ++ptr; - while (*ptr && *ptr != '\n' && !isdigit((unsigned char)*ptr)) - ++ptr; - } - - if (pid_ns_count > 1) - process->isRunningInContainer = true; - - } else if (String_startsWith(buffer, "CapPrm:")) { - char* ptr = buffer + strlen("CapPrm:"); - while (*ptr == ' ' || *ptr == '\t') - ptr++; - - uint64_t cap_permitted = fast_strtoull_hex(&ptr, 16); - process->elevated_priv = cap_permitted != 0 && process->st_uid != 0; - - } else if (String_startsWith(buffer, "voluntary_ctxt_switches:")) { - unsigned long vctxt; - int ok = sscanf(buffer, "voluntary_ctxt_switches:\t%lu", &vctxt); - if (ok >= 1) { - ctxt += vctxt; - } - - } else if (String_startsWith(buffer, "nonvoluntary_ctxt_switches:")) { - unsigned long nvctxt; - int ok = sscanf(buffer, "nonvoluntary_ctxt_switches:\t%lu", &nvctxt); - if (ok >= 1) { - ctxt += nvctxt; - } - -#ifdef HAVE_VSERVER - } else if (String_startsWith(buffer, "VxID:")) { - int vxid; - int ok = sscanf(buffer, "VxID:\t%32d", &vxid); - if (ok >= 1) { - lp->vxid = vxid; - } -#ifdef HAVE_ANCIENT_VSERVER - } else if (String_startsWith(buffer, "s_context:")) { - int vxid; - int ok = sscanf(buffer, "s_context:\t%32d", &vxid); - if (ok >= 1) { - lp->vxid = vxid; - } -#endif /* HAVE_ANCIENT_VSERVER */ -#endif /* HAVE_VSERVER */ - } - } - - fclose(statusfile); - - lp->ctxt_diff = (ctxt > lp->ctxt_total) ? (ctxt - lp->ctxt_total) : 0; - lp->ctxt_total = ctxt; - - return true; -} - -static bool LinuxProcessList_updateUser(ProcessList* processList, Process* process, openat_arg_t procFd) { - struct stat sstat; -#ifdef HAVE_OPENAT - int statok = fstat(procFd, &sstat); -#else - int statok = stat(procFd, &sstat); -#endif - if (statok == -1) - return false; - - if (process->st_uid != sstat.st_uid) { - process->st_uid = sstat.st_uid; - process->user = UsersTable_getRef(processList->usersTable, sstat.st_uid); - } - - return true; -} - -static void LinuxProcessList_readIoFile(LinuxProcess* process, openat_arg_t procFd, unsigned long long realtimeMs) { - char buffer[1024]; - ssize_t r = xReadfileat(procFd, "io", buffer, sizeof(buffer)); - if (r < 0) { - process->io_rate_read_bps = NAN; - process->io_rate_write_bps = NAN; - process->io_rchar = ULLONG_MAX; - process->io_wchar = ULLONG_MAX; - process->io_syscr = ULLONG_MAX; - process->io_syscw = ULLONG_MAX; - process->io_read_bytes = ULLONG_MAX; - process->io_write_bytes = ULLONG_MAX; - process->io_cancelled_write_bytes = ULLONG_MAX; - process->io_last_scan_time_ms = realtimeMs; - return; - } - - unsigned long long last_read = process->io_read_bytes; - unsigned long long last_write = process->io_write_bytes; - unsigned long long time_delta = realtimeMs > process->io_last_scan_time_ms ? realtimeMs - process->io_last_scan_time_ms : 0; - - char* buf = buffer; - const char* line; - while ((line = strsep(&buf, "\n")) != NULL) { - switch (line[0]) { - case 'r': - if (line[1] == 'c' && String_startsWith(line + 2, "har: ")) { - process->io_rchar = strtoull(line + 7, NULL, 10); - } else if (String_startsWith(line + 1, "ead_bytes: ")) { - process->io_read_bytes = strtoull(line + 12, NULL, 10); - process->io_rate_read_bps = time_delta ? (process->io_read_bytes - last_read) * /*ms to s*/1000. / time_delta : NAN; - } - break; - case 'w': - if (line[1] == 'c' && String_startsWith(line + 2, "har: ")) { - process->io_wchar = strtoull(line + 7, NULL, 10); - } else if (String_startsWith(line + 1, "rite_bytes: ")) { - process->io_write_bytes = strtoull(line + 13, NULL, 10); - process->io_rate_write_bps = time_delta ? (process->io_write_bytes - last_write) * /*ms to s*/1000. / time_delta : NAN; - } - break; - case 's': - if (line[4] == 'r' && String_startsWith(line + 1, "yscr: ")) { - process->io_syscr = strtoull(line + 7, NULL, 10); - } else if (String_startsWith(line + 1, "yscw: ")) { - process->io_syscw = strtoull(line + 7, NULL, 10); - } - break; - case 'c': - if (String_startsWith(line + 1, "ancelled_write_bytes: ")) { - process->io_cancelled_write_bytes = strtoull(line + 23, NULL, 10); - } - } - } - - process->io_last_scan_time_ms = realtimeMs; -} - -typedef struct LibraryData_ { - uint64_t size; - bool exec; -} LibraryData; - -static void LinuxProcessList_calcLibSize_helper(ATTR_UNUSED ht_key_t key, void* value, void* data) { - if (!data) - return; - - if (!value) - return; - - const LibraryData* v = (const LibraryData*)value; - uint64_t* d = (uint64_t*)data; - if (!v->exec) - return; - - *d += v->size; -} - -static void LinuxProcessList_readMaps(LinuxProcess* process, openat_arg_t procFd, bool calcSize, bool checkDeletedLib) { - Process* proc = (Process*)process; - - proc->usesDeletedLib = false; - - FILE* mapsfile = fopenat(procFd, "maps", "r"); - if (!mapsfile) - return; - - Hashtable* ht = NULL; - if (calcSize) - ht = Hashtable_new(64, true); - - char buffer[1024]; - while (fgets(buffer, sizeof(buffer), mapsfile)) { - uint64_t map_start; - uint64_t map_end; - bool map_execute; - unsigned int map_devmaj; - unsigned int map_devmin; - uint64_t map_inode; - - // Short circuit test: Look for a slash - if (!strchr(buffer, '/')) - continue; - - // Parse format: "%Lx-%Lx %4s %x %2x:%2x %Ld" - char* readptr = buffer; - - map_start = fast_strtoull_hex(&readptr, 16); - if ('-' != *readptr++) - continue; - - map_end = fast_strtoull_hex(&readptr, 16); - if (' ' != *readptr++) - continue; - - map_execute = (readptr[2] == 'x'); - readptr += 4; - if (' ' != *readptr++) - continue; - - while (*readptr > ' ') - readptr++; // Skip parsing this hex value - if (' ' != *readptr++) - continue; - - map_devmaj = fast_strtoull_hex(&readptr, 4); - if (':' != *readptr++) - continue; - - map_devmin = fast_strtoull_hex(&readptr, 4); - if (' ' != *readptr++) - continue; - - //Minor shortcut: Once we know there's no file for this region, we skip - if (!map_devmaj && !map_devmin) - continue; - - map_inode = fast_strtoull_dec(&readptr, 20); - if (!map_inode) - continue; - - if (calcSize) { - LibraryData* libdata = Hashtable_get(ht, map_inode); - if (!libdata) { - libdata = xCalloc(1, sizeof(LibraryData)); - Hashtable_put(ht, map_inode, libdata); - } - - libdata->size += map_end - map_start; - libdata->exec |= map_execute; - } - - if (checkDeletedLib && map_execute && !proc->usesDeletedLib) { - while (*readptr == ' ') - readptr++; - - if (*readptr != '/') - continue; - - if (String_startsWith(readptr, "/memfd:")) - continue; - - /* Virtualbox maps /dev/zero for memory allocation. That results in - * false positive, so ignore. */ - if (String_eq(readptr, "/dev/zero (deleted)\n")) - continue; - - if (strstr(readptr, " (deleted)\n")) { - proc->usesDeletedLib = true; - if (!calcSize) - break; - } - } - } - - fclose(mapsfile); - - if (calcSize) { - uint64_t total_size = 0; - Hashtable_foreach(ht, LinuxProcessList_calcLibSize_helper, &total_size); - - Hashtable_delete(ht); - - process->m_lrs = total_size / pageSize; - } -} - -static bool LinuxProcessList_readStatmFile(LinuxProcess* process, openat_arg_t procFd) { - FILE* statmfile = fopenat(procFd, "statm", "r"); - if (!statmfile) - return false; - - long int dummy, dummy2; - - int r = fscanf(statmfile, "%ld %ld %ld %ld %ld %ld %ld", - &process->super.m_virt, - &process->super.m_resident, - &process->m_share, - &process->m_trs, - &dummy, /* unused since Linux 2.6; always 0 */ - &process->m_drs, - &dummy2); /* unused since Linux 2.6; always 0 */ - fclose(statmfile); - - if (r == 7) { - process->super.m_virt *= pageSizeKB; - process->super.m_resident *= pageSizeKB; - } - - return r == 7; -} - -static bool LinuxProcessList_readSmapsFile(LinuxProcess* process, openat_arg_t procFd, bool haveSmapsRollup) { - //http://elixir.free-electrons.com/linux/v4.10/source/fs/proc/task_mmu.c#L719 - //kernel will return data in chunks of size PAGE_SIZE or less. - FILE* f = fopenat(procFd, haveSmapsRollup ? "smaps_rollup" : "smaps", "r"); - if (!f) - return false; - - process->m_pss = 0; - process->m_swap = 0; - process->m_psswp = 0; - - char buffer[256]; - while (fgets(buffer, sizeof(buffer), f)) { - if (!strchr(buffer, '\n')) { - // Partial line, skip to end of this line - while (fgets(buffer, sizeof(buffer), f)) { - if (strchr(buffer, '\n')) { - break; - } - } - continue; - } - - if (String_startsWith(buffer, "Pss:")) { - process->m_pss += strtol(buffer + 4, NULL, 10); - } else if (String_startsWith(buffer, "Swap:")) { - process->m_swap += strtol(buffer + 5, NULL, 10); - } else if (String_startsWith(buffer, "SwapPss:")) { - process->m_psswp += strtol(buffer + 8, NULL, 10); - } - } - - fclose(f); - return true; -} - -#ifdef HAVE_OPENVZ - -static void LinuxProcessList_readOpenVZData(LinuxProcess* process, openat_arg_t procFd) { - if (access(PROCDIR "/vz", R_OK) != 0) { - free(process->ctid); - process->ctid = NULL; - process->vpid = process->super.pid; - return; - } - - FILE* file = fopenat(procFd, "status", "r"); - if (!file) { - free(process->ctid); - process->ctid = NULL; - process->vpid = process->super.pid; - return; - } - - bool foundEnvID = false; - bool foundVPid = false; - char linebuf[256]; - while (fgets(linebuf, sizeof(linebuf), file) != NULL) { - if (strchr(linebuf, '\n') == NULL) { - // Partial line, skip to end of this line - while (fgets(linebuf, sizeof(linebuf), file) != NULL) { - if (strchr(linebuf, '\n') != NULL) { - break; - } - } - continue; - } - - char* name_value_sep = strchr(linebuf, ':'); - if (name_value_sep == NULL) { - continue; - } - - int field; - if (0 == strncasecmp(linebuf, "envID", name_value_sep - linebuf)) { - field = 1; - } else if (0 == strncasecmp(linebuf, "VPid", name_value_sep - linebuf)) { - field = 2; - } else { - continue; - } - - do { - name_value_sep++; - } while (*name_value_sep != '\0' && *name_value_sep <= 32); - - char* value_end = name_value_sep; - - while (*value_end > 32) { - value_end++; - } - - if (name_value_sep == value_end) { - continue; - } - - *value_end = '\0'; - - switch (field) { - case 1: - foundEnvID = true; - if (!String_eq(name_value_sep, process->ctid ? process->ctid : "")) - free_and_xStrdup(&process->ctid, name_value_sep); - break; - case 2: - foundVPid = true; - process->vpid = strtoul(name_value_sep, NULL, 0); - break; - default: - //Sanity Check: Should never reach here, or the implementation is missing something! - assert(false && "OpenVZ handling: Unimplemented case for field handling reached."); - } - } - - fclose(file); - - if (!foundEnvID) { - free(process->ctid); - process->ctid = NULL; - } - - if (!foundVPid) { - process->vpid = process->super.pid; - } -} - -#endif - -static void LinuxProcessList_readCGroupFile(LinuxProcess* process, openat_arg_t procFd) { - FILE* file = fopenat(procFd, "cgroup", "r"); - if (!file) { - if (process->cgroup) { - free(process->cgroup); - process->cgroup = NULL; - } - if (process->cgroup_short) { - free(process->cgroup_short); - process->cgroup_short = NULL; - } - return; - } - char output[PROC_LINE_LENGTH + 1]; - output[0] = '\0'; - char* at = output; - int left = PROC_LINE_LENGTH; - while (!feof(file) && left > 0) { - char buffer[PROC_LINE_LENGTH + 1]; - const char* ok = fgets(buffer, PROC_LINE_LENGTH, file); - if (!ok) - break; - - char* group = buffer; - for (size_t i = 0; i < 2; i++) { - group = strchrnul(group, ':'); - if (!*group) - break; - group++; - } - - char* eol = strchrnul(group, '\n'); - *eol = '\0'; - - if (at != output) { - *at = ';'; - at++; - left--; - } - int wrote = snprintf(at, left, "%s", group); - left -= wrote; - } - fclose(file); - - bool changed = !process->cgroup || !String_eq(process->cgroup, output); - - Process_updateFieldWidth(CGROUP, strlen(output)); - free_and_xStrdup(&process->cgroup, output); - - if (!changed) { - if (process->cgroup_short) { - Process_updateFieldWidth(CCGROUP, strlen(process->cgroup_short)); - } else { - //CCGROUP is alias to normal CGROUP if shortening fails - Process_updateFieldWidth(CCGROUP, strlen(process->cgroup)); - } - return; - } - - char* cgroup_short = CGroup_filterName(process->cgroup); - if (cgroup_short) { - Process_updateFieldWidth(CCGROUP, strlen(cgroup_short)); - free_and_xStrdup(&process->cgroup_short, cgroup_short); - free(cgroup_short); - } else { - //CCGROUP is alias to normal CGROUP if shortening fails - Process_updateFieldWidth(CCGROUP, strlen(process->cgroup)); - free(process->cgroup_short); - process->cgroup_short = NULL; - } -} - -static void LinuxProcessList_readOomData(LinuxProcess* process, openat_arg_t procFd) { - FILE* file = fopenat(procFd, "oom_score", "r"); - if (!file) - return; - - char buffer[PROC_LINE_LENGTH + 1]; - if (fgets(buffer, PROC_LINE_LENGTH, file)) { - unsigned int oom; - int ok = sscanf(buffer, "%u", &oom); - if (ok >= 1) { - process->oom = oom; - } - } - fclose(file); -} - -static void LinuxProcessList_readAutogroup(LinuxProcess* process, openat_arg_t procFd) { - process->autogroup_id = -1; - - char autogroup[64]; // space for two numeric values and fixed length strings - ssize_t amtRead = xReadfileat(procFd, "autogroup", autogroup, sizeof(autogroup)); - if (amtRead < 0) - return; - - long int identity; - int nice; - int ok = sscanf(autogroup, "/autogroup-%ld nice %d", &identity, &nice); - if (ok == 2) { - process->autogroup_id = identity; - process->autogroup_nice = nice; - } -} - -static void LinuxProcessList_readSecattrData(LinuxProcess* process, openat_arg_t procFd) { - FILE* file = fopenat(procFd, "attr/current", "r"); - if (!file) { - free(process->secattr); - process->secattr = NULL; - return; - } - - char buffer[PROC_LINE_LENGTH + 1]; - const char* res = fgets(buffer, sizeof(buffer), file); - fclose(file); - if (!res) { - free(process->secattr); - process->secattr = NULL; - return; - } - char* newline = strchr(buffer, '\n'); - if (newline) { - *newline = '\0'; - } - - Process_updateFieldWidth(SECATTR, strlen(buffer)); - - if (process->secattr && String_eq(process->secattr, buffer)) { - return; - } - free_and_xStrdup(&process->secattr, buffer); -} - -static void LinuxProcessList_readCwd(LinuxProcess* process, openat_arg_t procFd) { - char pathBuffer[PATH_MAX + 1] = {0}; - -#if defined(HAVE_READLINKAT) && defined(HAVE_OPENAT) - ssize_t r = readlinkat(procFd, "cwd", pathBuffer, sizeof(pathBuffer) - 1); -#else - ssize_t r = Compat_readlink(procFd, "cwd", pathBuffer, sizeof(pathBuffer) - 1); -#endif - - if (r < 0) { - free(process->super.procCwd); - process->super.procCwd = NULL; - return; - } - - pathBuffer[r] = '\0'; - - if (process->super.procCwd && String_eq(process->super.procCwd, pathBuffer)) - return; - - free_and_xStrdup(&process->super.procCwd, pathBuffer); -} - -#ifdef HAVE_DELAYACCT - -static int handleNetlinkMsg(struct nl_msg* nlmsg, void* linuxProcess) { - struct nlmsghdr* nlhdr; - struct nlattr* nlattrs[TASKSTATS_TYPE_MAX + 1]; - const struct nlattr* nlattr; - struct taskstats stats; - int rem; - LinuxProcess* lp = (LinuxProcess*) linuxProcess; - - nlhdr = nlmsg_hdr(nlmsg); - - if (genlmsg_parse(nlhdr, 0, nlattrs, TASKSTATS_TYPE_MAX, NULL) < 0) { - return NL_SKIP; - } - - if ((nlattr = nlattrs[TASKSTATS_TYPE_AGGR_PID]) || (nlattr = nlattrs[TASKSTATS_TYPE_NULL])) { - memcpy(&stats, nla_data(nla_next(nla_data(nlattr), &rem)), sizeof(stats)); - assert(lp->super.pid == (pid_t)stats.ac_pid); - - unsigned long long int timeDelta = stats.ac_etime * 1000 - lp->delay_read_time; - #define BOUNDS(x) (isnan(x) ? 0.0 : ((x) > 100) ? 100.0 : (x)) - #define DELTAPERC(x,y) BOUNDS((float) ((x) - (y)) / timeDelta * 100) - lp->cpu_delay_percent = DELTAPERC(stats.cpu_delay_total, lp->cpu_delay_total); - lp->blkio_delay_percent = DELTAPERC(stats.blkio_delay_total, lp->blkio_delay_total); - lp->swapin_delay_percent = DELTAPERC(stats.swapin_delay_total, lp->swapin_delay_total); - #undef DELTAPERC - #undef BOUNDS - - lp->swapin_delay_total = stats.swapin_delay_total; - lp->blkio_delay_total = stats.blkio_delay_total; - lp->cpu_delay_total = stats.cpu_delay_total; - lp->delay_read_time = stats.ac_etime * 1000; - } - return NL_OK; -} - -static void LinuxProcessList_readDelayAcctData(LinuxProcessList* this, LinuxProcess* process) { - struct nl_msg* msg; - - if (!this->netlink_socket) { - LinuxProcessList_initNetlinkSocket(this); - if (!this->netlink_socket) { - goto delayacct_failure; - } - } - - if (nl_socket_modify_cb(this->netlink_socket, NL_CB_VALID, NL_CB_CUSTOM, handleNetlinkMsg, process) < 0) { - goto delayacct_failure; - } - - if (! (msg = nlmsg_alloc())) { - goto delayacct_failure; - } - - if (! genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, this->netlink_family, 0, NLM_F_REQUEST, TASKSTATS_CMD_GET, TASKSTATS_VERSION)) { - nlmsg_free(msg); - } - - if (nla_put_u32(msg, TASKSTATS_CMD_ATTR_PID, process->super.pid) < 0) { - nlmsg_free(msg); - } - - if (nl_send_sync(this->netlink_socket, msg) < 0) { - goto delayacct_failure; - } - - if (nl_recvmsgs_default(this->netlink_socket) < 0) { - goto delayacct_failure; - } - - return; - -delayacct_failure: - process->swapin_delay_percent = NAN; - process->blkio_delay_percent = NAN; - process->cpu_delay_percent = NAN; -} - -#endif - -static bool LinuxProcessList_readCmdlineFile(Process* process, openat_arg_t procFd) { - char command[4096 + 1]; // max cmdline length on Linux - ssize_t amtRead = xReadfileat(procFd, "cmdline", command, sizeof(command)); - if (amtRead <= 0) - return false; - - int tokenEnd = 0; - int tokenStart = 0; - int lastChar = 0; - bool argSepNUL = false; - bool argSepSpace = false; - - for (int i = 0; i < amtRead; i++) { - /* newline used as delimiter - when forming the mergedCommand, newline is - * converted to space by Process_makeCommandStr */ - if (command[i] == '\0') { - command[i] = '\n'; - } else { - /* Record some information for the argument parsing heuristic below. */ - if (tokenEnd) - argSepNUL = true; - if (command[i] <= ' ') - argSepSpace = true; - } - - if (command[i] == '\n') { - if (tokenEnd == 0) { - tokenEnd = i; - } - } else { - /* htop considers the next character after the last / that is before - * basenameOffset, as the start of the basename in cmdline - see - * Process_writeCommand */ - if (!tokenEnd && command[i] == '/') { - tokenStart = i + 1; - } - lastChar = i; - } - } - - command[lastChar + 1] = '\0'; - - if (!argSepNUL && argSepSpace) { - /* Argument parsing heuristic. - * - * This heuristic is used for processes that rewrite their command line. - * Normally the command line is split by using NUL bytes between each argument. - * But some programs like chrome flatten this using spaces. - * - * This heuristic tries its best to undo this loss of information. - * To achieve this, we treat every character <= 32 as argument separators - * (i.e. all of ASCII control sequences and space). - * We then search for the basename of the cmdline in the first argument we found that way. - * As path names may contain we try to cross-validate if the path we got that way exists. - */ - - tokenStart = tokenEnd = 0; - - // From initial scan we know there's at least one space. - // Check if that's part of a filename for an existing file. - if (Compat_faccessat(AT_FDCWD, command, F_OK, AT_SYMLINK_NOFOLLOW) != 0) { - // If we reach here the path does not exist. - // Thus begin searching for the part of it that actually is. - - int tokenArg0Start = 0; - - for (int i = 0; i <= lastChar; i++) { - /* Any ASCII control or space used as delimiter */ - char tmpCommandChar = command[i]; - - if (command[i] <= ' ') { - if (!tokenEnd) { - command[i] = '\0'; - - bool found = Compat_faccessat(AT_FDCWD, command, F_OK, AT_SYMLINK_NOFOLLOW) == 0; - - // Restore if this wasn't it - command[i] = found ? '\n' : tmpCommandChar; - - if (found) - tokenEnd = i; - if (!tokenArg0Start) - tokenArg0Start = tokenStart; - } else { - // Split on every further separator, regardless of path correctness - command[i] = '\n'; - } - } else if (!tokenEnd) { - if (command[i] == '/' || (command[i] == '\\' && (!tokenStart || command[tokenStart - 1] == '\\'))) { - tokenStart = i + 1; - } else if (command[i] == ':' && (command[i + 1] != '/' && command[i + 1] != '\\')) { - tokenEnd = i; - } - } - } - - if (!tokenEnd) { - tokenStart = tokenArg0Start; - - // No token delimiter found, forcibly split - for (int i = 0; i <= lastChar; i++) { - if (command[i] <= ' ') { - command[i] = '\n'; - if (!tokenEnd) { - tokenEnd = i; - } - } - } - } - } - - /* Some command lines are hard to parse, like - * file.so [kdeinit5] file local:/run/user/1000/klauncherdqbouY.1.slave-socket local:/run/user/1000/kded5TwsDAx.1.slave-socket - * Reset if start is behind end. - */ - if (tokenStart >= tokenEnd) - tokenStart = tokenEnd = 0; - } - - if (tokenEnd == 0) { - tokenEnd = lastChar + 1; - } - - Process_updateCmdline(process, command, tokenStart, tokenEnd); - - /* /proc/[pid]/comm could change, so should be updated */ - if ((amtRead = xReadfileat(procFd, "comm", command, sizeof(command))) > 0) { - command[amtRead - 1] = '\0'; - Process_updateComm(process, command); - } else { - Process_updateComm(process, NULL); - } - - char filename[MAX_NAME + 1]; - - /* execve could change /proc/[pid]/exe, so procExe should be updated */ -#if defined(HAVE_READLINKAT) && defined(HAVE_OPENAT) - amtRead = readlinkat(procFd, "exe", filename, sizeof(filename) - 1); -#else - amtRead = Compat_readlink(procFd, "exe", filename, sizeof(filename) - 1); -#endif - if (amtRead > 0) { - filename[amtRead] = 0; - if (!process->procExe || - (!process->procExeDeleted && !String_eq(filename, process->procExe)) || - process->procExeDeleted) { - - const char* deletedMarker = " (deleted)"; - const size_t markerLen = strlen(deletedMarker); - const size_t filenameLen = strlen(filename); - - if (filenameLen > markerLen) { - bool oldExeDeleted = process->procExeDeleted; - - process->procExeDeleted = String_eq(filename + filenameLen - markerLen, deletedMarker); - - if (process->procExeDeleted) - filename[filenameLen - markerLen] = '\0'; - - if (oldExeDeleted != process->procExeDeleted) - process->mergedCommand.lastUpdate = 0; - } - - Process_updateExe(process, filename); - } - } else if (process->procExe) { - Process_updateExe(process, NULL); - process->procExeDeleted = false; - } - - return true; -} - -static char* LinuxProcessList_updateTtyDevice(TtyDriver* ttyDrivers, unsigned long int tty_nr) { - unsigned int maj = major(tty_nr); - unsigned int min = minor(tty_nr); - - int i = -1; - for (;;) { - i++; - if ((!ttyDrivers[i].path) || maj < ttyDrivers[i].major) { - break; - } - if (maj > ttyDrivers[i].major) { - continue; - } - if (min < ttyDrivers[i].minorFrom) { - break; - } - if (min > ttyDrivers[i].minorTo) { - continue; - } - unsigned int idx = min - ttyDrivers[i].minorFrom; - struct stat sstat; - char* fullPath; - for (;;) { - xAsprintf(&fullPath, "%s/%d", ttyDrivers[i].path, idx); - int err = stat(fullPath, &sstat); - if (err == 0 && major(sstat.st_rdev) == maj && minor(sstat.st_rdev) == min) { - return fullPath; - } - free(fullPath); - - xAsprintf(&fullPath, "%s%d", ttyDrivers[i].path, idx); - err = stat(fullPath, &sstat); - if (err == 0 && major(sstat.st_rdev) == maj && minor(sstat.st_rdev) == min) { - return fullPath; - } - free(fullPath); - - if (idx == min) { - break; - } - - idx = min; - } - int err = stat(ttyDrivers[i].path, &sstat); - if (err == 0 && tty_nr == sstat.st_rdev) { - return xStrdup(ttyDrivers[i].path); - } - } - char* out; - xAsprintf(&out, "/dev/%u:%u", maj, min); - return out; -} - -static bool isOlderThan(const ProcessList* pl, const Process* proc, unsigned int seconds) { - assert(pl->realtimeMs > 0); - - /* Starttime might not yet be parsed */ - if (proc->starttime_ctime <= 0) - return false; - - uint64_t realtime = pl->realtimeMs / 1000; - - if (realtime < (uint64_t)proc->starttime_ctime) - return false; - - return realtime - proc->starttime_ctime > seconds; -} - -static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, openat_arg_t parentFd, const char* dirname, const Process* parent, double period) { - ProcessList* pl = (ProcessList*) this; - const struct dirent* entry; - const Settings* settings = pl->settings; - const ScreenSettings* ss = settings->ss; - -#ifdef HAVE_OPENAT - int dirFd = openat(parentFd, dirname, O_RDONLY | O_DIRECTORY | O_NOFOLLOW); - if (dirFd < 0) - return false; - DIR* dir = fdopendir(dirFd); -#else - char dirFd[4096]; - xSnprintf(dirFd, sizeof(dirFd), "%s/%s", parentFd, dirname); - DIR* dir = opendir(dirFd); -#endif - if (!dir) { - Compat_openatArgClose(dirFd); - return false; - } - - const unsigned int activeCPUs = pl->activeCPUs; - const bool hideKernelThreads = settings->hideKernelThreads; - const bool hideUserlandThreads = settings->hideUserlandThreads; - const bool hideRunningInContainer = settings->hideRunningInContainer; - while ((entry = readdir(dir)) != NULL) { - const char* name = entry->d_name; - - // Ignore all non-directories - if (entry->d_type != DT_DIR && entry->d_type != DT_UNKNOWN) { - continue; - } - - // The RedHat kernel hides threads with a dot. - // I believe this is non-standard. - if (name[0] == '.') { - name++; - } - - // Just skip all non-number directories. - if (name[0] < '0' || name[0] > '9') { - continue; - } - - // filename is a number: process directory - int pid; - { - char* endptr; - unsigned long parsedPid = strtoul(name, &endptr, 10); - if (parsedPid == 0 || parsedPid == ULONG_MAX || *endptr != '\0') - continue; - pid = parsedPid; - } - - // Skip task directory of main thread - if (parent && pid == parent->pid) - continue; - -#ifdef HAVE_OPENAT - int procFd = openat(dirFd, entry->d_name, O_RDONLY | O_DIRECTORY | O_NOFOLLOW); - if (procFd < 0) - continue; -#else - char procFd[4096]; - xSnprintf(procFd, sizeof(procFd), "%s/%s", dirFd, entry->d_name); -#endif - - bool preExisting; - Process* proc = ProcessList_getProcess(pl, pid, &preExisting, LinuxProcess_new); - LinuxProcess* lp = (LinuxProcess*) proc; - - proc->tgid = parent ? parent->pid : pid; - proc->isUserlandThread = proc->pid != proc->tgid; - - LinuxProcessList_recurseProcTree(this, procFd, "task", proc, period); - - /* - * These conditions will not trigger on first occurrence, cause we need to - * add the process to the ProcessList and do all one time scans - * (e.g. parsing the cmdline to detect a kernel thread) - * But it will short-circuit subsequent scans. - */ - if (preExisting && hideKernelThreads && Process_isKernelThread(proc)) { - proc->updated = true; - proc->show = false; - pl->kernelThreads++; - pl->totalTasks++; - Compat_openatArgClose(procFd); - continue; - } - if (preExisting && hideUserlandThreads && Process_isUserlandThread(proc)) { - proc->updated = true; - proc->show = false; - pl->userlandThreads++; - pl->totalTasks++; - Compat_openatArgClose(procFd); - continue; - } - if (preExisting && hideRunningInContainer && proc->isRunningInContainer) { - proc->updated = true; - proc->show = false; - Compat_openatArgClose(procFd); - continue; - } - - if (ss->flags & PROCESS_FLAG_IO) - LinuxProcessList_readIoFile(lp, procFd, pl->realtimeMs); - - if (!LinuxProcessList_readStatmFile(lp, procFd)) - goto errorReadingProcess; - - { - bool prev = proc->usesDeletedLib; - - if (!proc->isKernelThread && !proc->isUserlandThread && - ((ss->flags & PROCESS_FLAG_LINUX_LRS_FIX) || (settings->highlightDeletedExe && !proc->procExeDeleted && isOlderThan(pl, proc, 10)))) { - - // Check if we really should recalculate the M_LRS value for this process - uint64_t passedTimeInMs = pl->realtimeMs - lp->last_mlrs_calctime; - - uint64_t recheck = ((uint64_t)rand()) % 2048; - - if (passedTimeInMs > recheck) { - lp->last_mlrs_calctime = pl->realtimeMs; - LinuxProcessList_readMaps(lp, procFd, ss->flags & PROCESS_FLAG_LINUX_LRS_FIX, settings->highlightDeletedExe); - } - } else { - /* Copy from process structure in threads and reset if setting got disabled */ - proc->usesDeletedLib = (proc->isUserlandThread && parent) ? parent->usesDeletedLib : false; - lp->m_lrs = (proc->isUserlandThread && parent) ? ((const LinuxProcess*)parent)->m_lrs : 0; - } - - if (prev != proc->usesDeletedLib) - proc->mergedCommand.lastUpdate = 0; - } - - if ((ss->flags & PROCESS_FLAG_LINUX_SMAPS) && !Process_isKernelThread(proc)) { - if (!parent) { - // Read smaps file of each process only every second pass to improve performance - static int smaps_flag = 0; - if ((pid & 1) == smaps_flag) { - LinuxProcessList_readSmapsFile(lp, procFd, this->haveSmapsRollup); - } - if (pid == 1) { - smaps_flag = !smaps_flag; - } - } else { - lp->m_pss = ((const LinuxProcess*)parent)->m_pss; - } - } - - char statCommand[MAX_NAME + 1]; - unsigned long long int lasttimes = (lp->utime + lp->stime); - unsigned long int tty_nr = proc->tty_nr; - if (!LinuxProcessList_readStatFile(proc, procFd, statCommand, sizeof(statCommand))) - goto errorReadingProcess; - - if (lp->flags & PF_KTHREAD) { - proc->isKernelThread = true; - } - - if (tty_nr != proc->tty_nr && this->ttyDrivers) { - free(proc->tty_name); - proc->tty_name = LinuxProcessList_updateTtyDevice(this->ttyDrivers, proc->tty_nr); - } - - if (ss->flags & PROCESS_FLAG_LINUX_IOPRIO) { - LinuxProcess_updateIOPriority(lp); - } - - /* period might be 0 after system sleep */ - float percent_cpu = (period < 1E-6) ? 0.0F : ((lp->utime + lp->stime - lasttimes) / period * 100.0); - proc->percent_cpu = CLAMP(percent_cpu, 0.0F, activeCPUs * 100.0F); - proc->percent_mem = proc->m_resident / (double)(pl->totalMem) * 100.0; - Process_updateCPUFieldWidths(proc->percent_cpu); - - if (! LinuxProcessList_updateUser(pl, proc, procFd)) - goto errorReadingProcess; - - if (!LinuxProcessList_readStatusFile(proc, procFd)) - goto errorReadingProcess; - - if (!preExisting) { - - #ifdef HAVE_OPENVZ - if (ss->flags & PROCESS_FLAG_LINUX_OPENVZ) { - LinuxProcessList_readOpenVZData(lp, procFd); - } - #endif - - if (proc->isKernelThread) { - Process_updateCmdline(proc, NULL, 0, 0); - } else if (!LinuxProcessList_readCmdlineFile(proc, procFd)) { - Process_updateCmdline(proc, statCommand, 0, strlen(statCommand)); - } - - Process_fillStarttimeBuffer(proc); - - ProcessList_add(pl, proc); - } else { - if (settings->updateProcessNames && proc->state != ZOMBIE) { - if (proc->isKernelThread) { - Process_updateCmdline(proc, NULL, 0, 0); - } else if (!LinuxProcessList_readCmdlineFile(proc, procFd)) { - Process_updateCmdline(proc, statCommand, 0, strlen(statCommand)); - } - } - } - - if (ss->flags & PROCESS_FLAG_LINUX_CGROUP) - LinuxProcessList_readCGroupFile(lp, procFd); - - #ifdef HAVE_DELAYACCT - if (ss->flags & PROCESS_FLAG_LINUX_DELAYACCT) { - LinuxProcessList_readDelayAcctData(this, lp); - } - #endif - - if (ss->flags & PROCESS_FLAG_LINUX_OOM) { - LinuxProcessList_readOomData(lp, procFd); - } - - if (ss->flags & PROCESS_FLAG_LINUX_SECATTR) { - LinuxProcessList_readSecattrData(lp, procFd); - } - - if (ss->flags & PROCESS_FLAG_CWD) { - LinuxProcessList_readCwd(lp, procFd); - } - - if ((ss->flags & PROCESS_FLAG_LINUX_AUTOGROUP) && this->haveAutogroup) { - LinuxProcessList_readAutogroup(lp, procFd); - } - - #ifdef SCHEDULER_SUPPORT - if (ss->flags & PROCESS_FLAG_SCHEDPOL) { - Scheduling_readProcessPolicy(proc); - } - #endif - - if (!proc->cmdline && statCommand[0] && - (proc->state == ZOMBIE || Process_isKernelThread(proc) || settings->showThreadNames)) { - Process_updateCmdline(proc, statCommand, 0, strlen(statCommand)); - } - - /* - * Final section after all data has been gathered - */ - - proc->updated = true; - Compat_openatArgClose(procFd); - - if (hideRunningInContainer && proc->isRunningInContainer) { - proc->show = false; - continue; - } - - if (Process_isKernelThread(proc)) { - pl->kernelThreads++; - } else if (Process_isUserlandThread(proc)) { - pl->userlandThreads++; - } - - /* Set at the end when we know if a new entry is a thread */ - proc->show = ! ((hideKernelThreads && Process_isKernelThread(proc)) || (hideUserlandThreads && Process_isUserlandThread(proc))); - - pl->totalTasks++; - /* runningTasks is set in LinuxProcessList_scanCPUTime() from /proc/stat */ - continue; - - // Exception handler. - -errorReadingProcess: - { -#ifdef HAVE_OPENAT - if (procFd >= 0) - close(procFd); -#endif - - if (preExisting) { - /* - * The only real reason for coming here (apart from Linux violating the /proc API) - * would be the process going away with its /proc files disappearing (!HAVE_OPENAT). - * However, we want to keep in the process list for now for the "highlight dying" mode. - */ - } else { - /* A really short-lived process that we don't have full info about */ - Process_delete((Object*)proc); - } - } - } - closedir(dir); - return true; -} - -static inline void LinuxProcessList_scanMemoryInfo(ProcessList* this) { - memory_t availableMem = 0; - memory_t freeMem = 0; - memory_t totalMem = 0; - memory_t buffersMem = 0; - memory_t cachedMem = 0; - memory_t sharedMem = 0; - memory_t swapTotalMem = 0; - memory_t swapCacheMem = 0; - memory_t swapFreeMem = 0; - memory_t sreclaimableMem = 0; - - FILE* file = fopen(PROCMEMINFOFILE, "r"); - if (!file) - CRT_fatalError("Cannot open " PROCMEMINFOFILE); - - char buffer[128]; - while (fgets(buffer, sizeof(buffer), file)) { - - #define tryRead(label, variable) \ - if (String_startsWith(buffer, label)) { \ - memory_t parsed_; \ - if (sscanf(buffer + strlen(label), "%llu kB", &parsed_) == 1) { \ - (variable) = parsed_; \ - } \ - break; \ - } else (void) 0 /* Require a ";" after the macro use. */ - - switch (buffer[0]) { - case 'M': - tryRead("MemAvailable:", availableMem); - tryRead("MemFree:", freeMem); - tryRead("MemTotal:", totalMem); - break; - case 'B': - tryRead("Buffers:", buffersMem); - break; - case 'C': - tryRead("Cached:", cachedMem); - break; - case 'S': - switch (buffer[1]) { - case 'h': - tryRead("Shmem:", sharedMem); - break; - case 'w': - tryRead("SwapTotal:", swapTotalMem); - tryRead("SwapCached:", swapCacheMem); - tryRead("SwapFree:", swapFreeMem); - break; - case 'R': - tryRead("SReclaimable:", sreclaimableMem); - break; - } - break; - } - - #undef tryRead - } - - fclose(file); - - /* - * Compute memory partition like procps(free) - * https://gitlab.com/procps-ng/procps/-/blob/master/proc/sysinfo.c - * - * Adjustments: - * - Shmem in part of Cached (see https://lore.kernel.org/patchwork/patch/648763/), - * do not show twice by subtracting from Cached and do not subtract twice from used. - */ - this->totalMem = totalMem; - this->cachedMem = cachedMem + sreclaimableMem - sharedMem; - this->sharedMem = sharedMem; - const memory_t usedDiff = freeMem + cachedMem + sreclaimableMem + buffersMem; - this->usedMem = (totalMem >= usedDiff) ? totalMem - usedDiff : totalMem - freeMem; - this->buffersMem = buffersMem; - this->availableMem = availableMem != 0 ? MINIMUM(availableMem, totalMem) : freeMem; - this->totalSwap = swapTotalMem; - this->usedSwap = swapTotalMem - swapFreeMem - swapCacheMem; - this->cachedSwap = swapCacheMem; -} - -static void LinuxProcessList_scanHugePages(LinuxProcessList* this) { - this->totalHugePageMem = 0; - for (unsigned i = 0; i < HTOP_HUGEPAGE_COUNT; i++) { - this->usedHugePageMem[i] = MEMORY_MAX; - } - - DIR* dir = opendir("/sys/kernel/mm/hugepages"); - if (!dir) - return; - - const struct dirent* entry; - while ((entry = readdir(dir)) != NULL) { - const char* name = entry->d_name; - - /* Ignore all non-directories */ - if (entry->d_type != DT_DIR && entry->d_type != DT_UNKNOWN) - continue; - - if (!String_startsWith(name, "hugepages-")) - continue; - - char* endptr; - unsigned long int hugePageSize = strtoul(name + strlen("hugepages-"), &endptr, 10); - if (!endptr || *endptr != 'k') - continue; - - char content[64]; - char hugePagePath[128]; - ssize_t r; - - xSnprintf(hugePagePath, sizeof(hugePagePath), "/sys/kernel/mm/hugepages/%s/nr_hugepages", name); - r = xReadfile(hugePagePath, content, sizeof(content)); - if (r <= 0) - continue; - - memory_t total = strtoull(content, NULL, 10); - if (total == 0) - continue; - - xSnprintf(hugePagePath, sizeof(hugePagePath), "/sys/kernel/mm/hugepages/%s/free_hugepages", name); - r = xReadfile(hugePagePath, content, sizeof(content)); - if (r <= 0) - continue; - - memory_t free = strtoull(content, NULL, 10); - - int shift = ffsl(hugePageSize) - 1 - (HTOP_HUGEPAGE_BASE_SHIFT - 10); - assert(shift >= 0 && shift < HTOP_HUGEPAGE_COUNT); - - this->totalHugePageMem += total * hugePageSize; - this->usedHugePageMem[shift] = (total - free) * hugePageSize; - } - - closedir(dir); -} - -static inline void LinuxProcessList_scanZramInfo(LinuxProcessList* this) { - memory_t totalZram = 0; - memory_t usedZramComp = 0; - memory_t usedZramOrig = 0; - - char mm_stat[34]; - char disksize[34]; - - unsigned int i = 0; - for (;;) { - xSnprintf(mm_stat, sizeof(mm_stat), "/sys/block/zram%u/mm_stat", i); - xSnprintf(disksize, sizeof(disksize), "/sys/block/zram%u/disksize", i); - i++; - FILE* disksize_file = fopen(disksize, "r"); - FILE* mm_stat_file = fopen(mm_stat, "r"); - if (disksize_file == NULL || mm_stat_file == NULL) { - if (disksize_file) { - fclose(disksize_file); - } - if (mm_stat_file) { - fclose(mm_stat_file); - } - break; - } - memory_t size = 0; - memory_t orig_data_size = 0; - memory_t compr_data_size = 0; - - if (!fscanf(disksize_file, "%llu\n", &size) || - !fscanf(mm_stat_file, " %llu %llu", &orig_data_size, &compr_data_size)) { - fclose(disksize_file); - fclose(mm_stat_file); - break; - } - - totalZram += size; - usedZramComp += compr_data_size; - usedZramOrig += orig_data_size; - - fclose(disksize_file); - fclose(mm_stat_file); - } - - this->zram.totalZram = totalZram / 1024; - this->zram.usedZramComp = usedZramComp / 1024; - this->zram.usedZramOrig = usedZramOrig / 1024; -} - -static inline void LinuxProcessList_scanZfsArcstats(LinuxProcessList* lpl) { - memory_t dbufSize = 0; - memory_t dnodeSize = 0; - memory_t bonusSize = 0; - - FILE* file = fopen(PROCARCSTATSFILE, "r"); - if (file == NULL) { - lpl->zfs.enabled = 0; - return; - } - char buffer[128]; - while (fgets(buffer, 128, file)) { - #define tryRead(label, variable) \ - if (String_startsWith(buffer, label)) { \ - sscanf(buffer + strlen(label), " %*2u %32llu", variable); \ - break; \ - } else (void) 0 /* Require a ";" after the macro use. */ - #define tryReadFlag(label, variable, flag) \ - if (String_startsWith(buffer, label)) { \ - (flag) = sscanf(buffer + strlen(label), " %*2u %32llu", variable); \ - break; \ - } else (void) 0 /* Require a ";" after the macro use. */ - - switch (buffer[0]) { - case 'c': - tryRead("c_min", &lpl->zfs.min); - tryRead("c_max", &lpl->zfs.max); - tryReadFlag("compressed_size", &lpl->zfs.compressed, lpl->zfs.isCompressed); - break; - case 'u': - tryRead("uncompressed_size", &lpl->zfs.uncompressed); - break; - case 's': - tryRead("size", &lpl->zfs.size); - break; - case 'h': - tryRead("hdr_size", &lpl->zfs.header); - break; - case 'd': - tryRead("dbuf_size", &dbufSize); - tryRead("dnode_size", &dnodeSize); - break; - case 'b': - tryRead("bonus_size", &bonusSize); - break; - case 'a': - tryRead("anon_size", &lpl->zfs.anon); - break; - case 'm': - tryRead("mfu_size", &lpl->zfs.MFU); - tryRead("mru_size", &lpl->zfs.MRU); - break; - } - #undef tryRead - #undef tryReadFlag - } - fclose(file); - - lpl->zfs.enabled = (lpl->zfs.size > 0 ? 1 : 0); - lpl->zfs.size /= 1024; - lpl->zfs.min /= 1024; - lpl->zfs.max /= 1024; - lpl->zfs.MFU /= 1024; - lpl->zfs.MRU /= 1024; - lpl->zfs.anon /= 1024; - lpl->zfs.header /= 1024; - lpl->zfs.other = (dbufSize + dnodeSize + bonusSize) / 1024; - if ( lpl->zfs.isCompressed ) { - lpl->zfs.compressed /= 1024; - lpl->zfs.uncompressed /= 1024; - } -} - -static inline double LinuxProcessList_scanCPUTime(ProcessList* super) { - LinuxProcessList* this = (LinuxProcessList*) super; - - LinuxProcessList_updateCPUcount(super); - - FILE* file = fopen(PROCSTATFILE, "r"); - if (!file) - CRT_fatalError("Cannot open " PROCSTATFILE); - - unsigned int existingCPUs = super->existingCPUs; - unsigned int lastAdjCpuId = 0; - - for (unsigned int i = 0; i <= existingCPUs; i++) { - char buffer[PROC_LINE_LENGTH + 1]; - unsigned long long int usertime, nicetime, systemtime, idletime; - unsigned long long int ioWait = 0, irq = 0, softIrq = 0, steal = 0, guest = 0, guestnice = 0; - - const char* ok = fgets(buffer, sizeof(buffer), file); - if (!ok) - break; - - // cpu fields are sorted first - if (!String_startsWith(buffer, "cpu")) - break; - - // Depending on your kernel version, - // 5, 7, 8 or 9 of these fields will be set. - // The rest will remain at zero. - unsigned int adjCpuId; - if (i == 0) { - (void) sscanf(buffer, "cpu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu", &usertime, &nicetime, &systemtime, &idletime, &ioWait, &irq, &softIrq, &steal, &guest, &guestnice); - adjCpuId = 0; - } else { - unsigned int cpuid; - (void) sscanf(buffer, "cpu%4u %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu", &cpuid, &usertime, &nicetime, &systemtime, &idletime, &ioWait, &irq, &softIrq, &steal, &guest, &guestnice); - adjCpuId = cpuid + 1; - } - - if (adjCpuId > super->existingCPUs) - break; - - for (unsigned int j = lastAdjCpuId + 1; j < adjCpuId; j++) { - // Skipped an ID, but /proc/stat is ordered => got offline CPU - memset(&(this->cpuData[j]), '\0', sizeof(CPUData)); - } - lastAdjCpuId = adjCpuId; - - // Guest time is already accounted in usertime - usertime -= guest; - nicetime -= guestnice; - // Fields existing on kernels >= 2.6 - // (and RHEL's patched kernel 2.4...) - unsigned long long int idlealltime = idletime + ioWait; - unsigned long long int systemalltime = systemtime + irq + softIrq; - unsigned long long int virtalltime = guest + guestnice; - unsigned long long int totaltime = usertime + nicetime + systemalltime + idlealltime + steal + virtalltime; - CPUData* cpuData = &(this->cpuData[adjCpuId]); - // Since we do a subtraction (usertime - guest) and cputime64_to_clock_t() - // used in /proc/stat rounds down numbers, it can lead to a case where the - // integer overflow. - cpuData->userPeriod = saturatingSub(usertime, cpuData->userTime); - cpuData->nicePeriod = saturatingSub(nicetime, cpuData->niceTime); - cpuData->systemPeriod = saturatingSub(systemtime, cpuData->systemTime); - cpuData->systemAllPeriod = saturatingSub(systemalltime, cpuData->systemAllTime); - cpuData->idleAllPeriod = saturatingSub(idlealltime, cpuData->idleAllTime); - cpuData->idlePeriod = saturatingSub(idletime, cpuData->idleTime); - cpuData->ioWaitPeriod = saturatingSub(ioWait, cpuData->ioWaitTime); - cpuData->irqPeriod = saturatingSub(irq, cpuData->irqTime); - cpuData->softIrqPeriod = saturatingSub(softIrq, cpuData->softIrqTime); - cpuData->stealPeriod = saturatingSub(steal, cpuData->stealTime); - cpuData->guestPeriod = saturatingSub(virtalltime, cpuData->guestTime); - cpuData->totalPeriod = saturatingSub(totaltime, cpuData->totalTime); - cpuData->userTime = usertime; - cpuData->niceTime = nicetime; - cpuData->systemTime = systemtime; - cpuData->systemAllTime = systemalltime; - cpuData->idleAllTime = idlealltime; - cpuData->idleTime = idletime; - cpuData->ioWaitTime = ioWait; - cpuData->irqTime = irq; - cpuData->softIrqTime = softIrq; - cpuData->stealTime = steal; - cpuData->guestTime = virtalltime; - cpuData->totalTime = totaltime; - } - - double period = (double)this->cpuData[0].totalPeriod / super->activeCPUs; - - char buffer[PROC_LINE_LENGTH + 1]; - while (fgets(buffer, sizeof(buffer), file)) { - if (String_startsWith(buffer, "procs_running")) { - super->runningTasks = strtoul(buffer + strlen("procs_running"), NULL, 10); - break; - } - } - - fclose(file); - - return period; -} - -static int scanCPUFrequencyFromSysCPUFreq(LinuxProcessList* this) { - unsigned int existingCPUs = this->super.existingCPUs; - int numCPUsWithFrequency = 0; - unsigned long totalFrequency = 0; - - /* - * On some AMD and Intel CPUs read()ing scaling_cur_freq is quite slow (> 1ms). This delay - * accumulates for every core. For details see issue#471. - * If the read on CPU 0 takes longer than 500us bail out and fall back to reading the - * frequencies from /proc/cpuinfo. - * Once the condition has been met, bail out early for the next couple of scans. - */ - static int timeout = 0; - - if (timeout > 0) { - timeout--; - return -1; - } - - for (unsigned int i = 0; i < existingCPUs; ++i) { - if (!ProcessList_isCPUonline(&this->super, i)) - continue; - - char pathBuffer[64]; - xSnprintf(pathBuffer, sizeof(pathBuffer), "/sys/devices/system/cpu/cpu%u/cpufreq/scaling_cur_freq", i); - - struct timespec start; - if (i == 0) - clock_gettime(CLOCK_MONOTONIC, &start); - - FILE* file = fopen(pathBuffer, "r"); - if (!file) - return -errno; - - unsigned long frequency; - if (fscanf(file, "%lu", &frequency) == 1) { - /* convert kHz to MHz */ - frequency = frequency / 1000; - this->cpuData[i + 1].frequency = frequency; - numCPUsWithFrequency++; - totalFrequency += frequency; - } - - fclose(file); - - if (i == 0) { - struct timespec end; - clock_gettime(CLOCK_MONOTONIC, &end); - const time_t timeTakenUs = (end.tv_sec - start.tv_sec) * 1000000 + (end.tv_nsec - start.tv_nsec) / 1000; - if (timeTakenUs > 500) { - timeout = 30; - return -1; - } - } - - } - - if (numCPUsWithFrequency > 0) - this->cpuData[0].frequency = (double)totalFrequency / numCPUsWithFrequency; - - return 0; -} - -static void scanCPUFrequencyFromCPUinfo(LinuxProcessList* this) { - FILE* file = fopen(PROCCPUINFOFILE, "r"); - if (file == NULL) - return; - - unsigned int existingCPUs = this->super.existingCPUs; - int numCPUsWithFrequency = 0; - double totalFrequency = 0; - int cpuid = -1; - - while (!feof(file)) { - double frequency; - char buffer[PROC_LINE_LENGTH]; - - if (fgets(buffer, PROC_LINE_LENGTH, file) == NULL) - break; - - if (sscanf(buffer, "processor : %d", &cpuid) == 1) { - continue; - } else if ( - (sscanf(buffer, "cpu MHz : %lf", &frequency) == 1) || - (sscanf(buffer, "clock : %lfMHz", &frequency) == 1) - ) { - if (cpuid < 0 || (unsigned int)cpuid > (existingCPUs - 1)) { - continue; - } - - CPUData* cpuData = &(this->cpuData[cpuid + 1]); - /* do not override sysfs data */ - if (isnan(cpuData->frequency)) { - cpuData->frequency = frequency; - } - numCPUsWithFrequency++; - totalFrequency += frequency; - } else if (buffer[0] == '\n') { - cpuid = -1; - } - } - fclose(file); - - if (numCPUsWithFrequency > 0) { - this->cpuData[0].frequency = totalFrequency / numCPUsWithFrequency; - } -} - -static void LinuxProcessList_scanCPUFrequency(LinuxProcessList* this) { - unsigned int existingCPUs = this->super.existingCPUs; - - for (unsigned int i = 0; i <= existingCPUs; i++) { - this->cpuData[i].frequency = NAN; - } - - if (scanCPUFrequencyFromSysCPUFreq(this) == 0) { - return; - } - - scanCPUFrequencyFromCPUinfo(this); -} - -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { - LinuxProcessList* this = (LinuxProcessList*) super; - const Settings* settings = super->settings; - - LinuxProcessList_scanMemoryInfo(super); - LinuxProcessList_scanHugePages(this); - LinuxProcessList_scanZfsArcstats(this); - LinuxProcessList_scanZramInfo(this); - - double period = LinuxProcessList_scanCPUTime(super); - - if (settings->showCPUFrequency) { - LinuxProcessList_scanCPUFrequency(this); - } - - #ifdef HAVE_SENSORS_SENSORS_H - if (settings->showCPUTemperature) - LibSensors_getCPUTemperatures(this->cpuData, this->super.existingCPUs, this->super.activeCPUs); - #endif - - // in pause mode only gather global data for meters (CPU/memory/...) - if (pauseProcessUpdate) { - return; - } - - if (settings->ss->flags & PROCESS_FLAG_LINUX_AUTOGROUP) { - // Refer to sched(7) 'autogroup feature' section - // The kernel feature can be enabled/disabled through procfs at - // any time, so check for it at the start of each sample - only - // read from per-process procfs files if it's globally enabled. - this->haveAutogroup = LinuxProcess_isAutogroupEnabled(); - } else { - this->haveAutogroup = false; - } - - /* PROCDIR is an absolute path */ - assert(PROCDIR[0] == '/'); -#ifdef HAVE_OPENAT - openat_arg_t rootFd = AT_FDCWD; -#else - openat_arg_t rootFd = ""; -#endif - - LinuxProcessList_recurseProcTree(this, rootFd, PROCDIR, NULL, period); -} - -bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id) { - assert(id < super->existingCPUs); - - const LinuxProcessList* this = (const LinuxProcessList*) super; - return this->cpuData[id + 1].online; -} diff --git a/fedora/.local/bin/htop-vim/linux/LinuxProcessList.h b/fedora/.local/bin/htop-vim/linux/LinuxProcessList.h deleted file mode 100644 index 6c2f7db..0000000 --- a/fedora/.local/bin/htop-vim/linux/LinuxProcessList.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef HEADER_LinuxProcessList -#define HEADER_LinuxProcessList -/* -htop - LinuxProcessList.h -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" - -#include -#include - -#include "Hashtable.h" -#include "ProcessList.h" -#include "UsersTable.h" -#include "ZramStats.h" -#include "zfs/ZfsArcStats.h" - -#define HTOP_HUGEPAGE_BASE_SHIFT 16 -#define HTOP_HUGEPAGE_COUNT 24 - -typedef struct CPUData_ { - unsigned long long int totalTime; - unsigned long long int userTime; - unsigned long long int systemTime; - unsigned long long int systemAllTime; - unsigned long long int idleAllTime; - unsigned long long int idleTime; - unsigned long long int niceTime; - unsigned long long int ioWaitTime; - unsigned long long int irqTime; - unsigned long long int softIrqTime; - unsigned long long int stealTime; - unsigned long long int guestTime; - - unsigned long long int totalPeriod; - unsigned long long int userPeriod; - unsigned long long int systemPeriod; - unsigned long long int systemAllPeriod; - unsigned long long int idleAllPeriod; - unsigned long long int idlePeriod; - unsigned long long int nicePeriod; - unsigned long long int ioWaitPeriod; - unsigned long long int irqPeriod; - unsigned long long int softIrqPeriod; - unsigned long long int stealPeriod; - unsigned long long int guestPeriod; - - double frequency; - - #ifdef HAVE_SENSORS_SENSORS_H - double temperature; - #endif - - bool online; -} CPUData; - -typedef struct TtyDriver_ { - char* path; - unsigned int major; - unsigned int minorFrom; - unsigned int minorTo; -} TtyDriver; - -typedef struct LinuxProcessList_ { - ProcessList super; - - CPUData* cpuData; - - TtyDriver* ttyDrivers; - bool haveSmapsRollup; - bool haveAutogroup; - - #ifdef HAVE_DELAYACCT - struct nl_sock* netlink_socket; - int netlink_family; - #endif - - memory_t totalHugePageMem; - memory_t usedHugePageMem[HTOP_HUGEPAGE_COUNT]; - - memory_t availableMem; - - ZfsArcStats zfs; - ZramStats zram; -} LinuxProcessList; - -#ifndef PROCDIR -#define PROCDIR "/proc" -#endif - -#ifndef PROCCPUINFOFILE -#define PROCCPUINFOFILE PROCDIR "/cpuinfo" -#endif - -#ifndef PROCSTATFILE -#define PROCSTATFILE PROCDIR "/stat" -#endif - -#ifndef PROCMEMINFOFILE -#define PROCMEMINFOFILE PROCDIR "/meminfo" -#endif - -#ifndef PROCARCSTATSFILE -#define PROCARCSTATSFILE PROCDIR "/spl/kstat/zfs/arcstats" -#endif - -#ifndef PROCTTYDRIVERSFILE -#define PROCTTYDRIVERSFILE PROCDIR "/tty/drivers" -#endif - -#ifndef PROC_LINE_LENGTH -#define PROC_LINE_LENGTH 4096 -#endif - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId); - -void ProcessList_delete(ProcessList* pl); - -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate); - -bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id); - -#endif diff --git a/fedora/.local/bin/htop-vim/linux/Platform.c b/fedora/.local/bin/htop-vim/linux/Platform.c deleted file mode 100644 index ad94381..0000000 --- a/fedora/.local/bin/htop-vim/linux/Platform.c +++ /dev/null @@ -1,1035 +0,0 @@ -/* -htop - linux/Platform.c -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" - -#include "linux/Platform.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "BatteryMeter.h" -#include "ClockMeter.h" -#include "Compat.h" -#include "CPUMeter.h" -#include "DateMeter.h" -#include "DateTimeMeter.h" -#include "DiskIOMeter.h" -#include "HostnameMeter.h" -#include "HugePageMeter.h" -#include "LoadAverageMeter.h" -#include "Macros.h" -#include "MainPanel.h" -#include "Meter.h" -#include "MemoryMeter.h" -#include "MemorySwapMeter.h" -#include "NetworkIOMeter.h" -#include "Object.h" -#include "Panel.h" -#include "PressureStallMeter.h" -#include "ProcessList.h" -#include "ProvideCurses.h" -#include "linux/SELinuxMeter.h" -#include "Settings.h" -#include "SwapMeter.h" -#include "SysArchMeter.h" -#include "TasksMeter.h" -#include "UptimeMeter.h" -#include "XUtils.h" -#include "linux/IOPriority.h" -#include "linux/IOPriorityPanel.h" -#include "linux/LinuxProcess.h" -#include "linux/LinuxProcessList.h" -#include "linux/SystemdMeter.h" -#include "linux/ZramMeter.h" -#include "linux/ZramStats.h" -#include "zfs/ZfsArcMeter.h" -#include "zfs/ZfsArcStats.h" -#include "zfs/ZfsCompressedArcMeter.h" - -#ifdef HAVE_LIBCAP -#include -#include -#endif - -#ifdef HAVE_SENSORS_SENSORS_H -#include "LibSensors.h" -#endif - -#ifndef O_PATH -#define O_PATH 010000000 // declare for ancient glibc versions -#endif - - -#ifdef HAVE_LIBCAP -enum CapMode { - CAP_MODE_OFF, - CAP_MODE_BASIC, - CAP_MODE_STRICT -}; -#endif - -bool Running_containerized = false; - -const ScreenDefaults Platform_defaultScreens[] = { - { - .name = "Main", - .columns = "PID USER PRIORITY NICE M_VIRT M_RESIDENT M_SHARE STATE PERCENT_CPU PERCENT_MEM TIME Command", - .sortKey = "PERCENT_CPU", - }, - { - .name = "I/O", - .columns = "PID USER IO_PRIORITY IO_RATE IO_READ_RATE IO_WRITE_RATE PERCENT_SWAP_DELAY PERCENT_IO_DELAY Command", - .sortKey = "IO_RATE", - }, -}; - -const unsigned int Platform_numberOfDefaultScreens = ARRAYSIZE(Platform_defaultScreens); - -const SignalItem Platform_signals[] = { - { .name = " 0 Cancel", .number = 0 }, - { .name = " 1 SIGHUP", .number = 1 }, - { .name = " 2 SIGINT", .number = 2 }, - { .name = " 3 SIGQUIT", .number = 3 }, - { .name = " 4 SIGILL", .number = 4 }, - { .name = " 5 SIGTRAP", .number = 5 }, - { .name = " 6 SIGABRT", .number = 6 }, - { .name = " 6 SIGIOT", .number = 6 }, - { .name = " 7 SIGBUS", .number = 7 }, - { .name = " 8 SIGFPE", .number = 8 }, - { .name = " 9 SIGKILL", .number = 9 }, - { .name = "10 SIGUSR1", .number = 10 }, - { .name = "11 SIGSEGV", .number = 11 }, - { .name = "12 SIGUSR2", .number = 12 }, - { .name = "13 SIGPIPE", .number = 13 }, - { .name = "14 SIGALRM", .number = 14 }, - { .name = "15 SIGTERM", .number = 15 }, - { .name = "16 SIGSTKFLT", .number = 16 }, - { .name = "17 SIGCHLD", .number = 17 }, - { .name = "18 SIGCONT", .number = 18 }, - { .name = "19 SIGSTOP", .number = 19 }, - { .name = "20 SIGTSTP", .number = 20 }, - { .name = "21 SIGTTIN", .number = 21 }, - { .name = "22 SIGTTOU", .number = 22 }, - { .name = "23 SIGURG", .number = 23 }, - { .name = "24 SIGXCPU", .number = 24 }, - { .name = "25 SIGXFSZ", .number = 25 }, - { .name = "26 SIGVTALRM", .number = 26 }, - { .name = "27 SIGPROF", .number = 27 }, - { .name = "28 SIGWINCH", .number = 28 }, - { .name = "29 SIGIO", .number = 29 }, - { .name = "29 SIGPOLL", .number = 29 }, - { .name = "30 SIGPWR", .number = 30 }, - { .name = "31 SIGSYS", .number = 31 }, -}; - -const unsigned int Platform_numberOfSignals = ARRAYSIZE(Platform_signals); - -static enum { BAT_PROC, BAT_SYS, BAT_ERR } Platform_Battery_method = BAT_PROC; -static time_t Platform_Battery_cacheTime; -static double Platform_Battery_cachePercent = NAN; -static ACPresence Platform_Battery_cacheIsOnAC; - -#ifdef HAVE_LIBCAP -static enum CapMode Platform_capabilitiesMode = CAP_MODE_BASIC; -#endif - -static Htop_Reaction Platform_actionSetIOPriority(State* st) { - if (Settings_isReadonly()) - return HTOP_OK; - - const LinuxProcess* p = (const LinuxProcess*) Panel_getSelected((Panel*)st->mainPanel); - if (!p) - return HTOP_OK; - - IOPriority ioprio1 = p->ioPriority; - Panel* ioprioPanel = IOPriorityPanel_new(ioprio1); - const void* set = Action_pickFromVector(st, ioprioPanel, 20, true); - if (set) { - IOPriority ioprio2 = IOPriorityPanel_getIOPriority(ioprioPanel); - bool ok = MainPanel_foreachProcess(st->mainPanel, LinuxProcess_setIOPriority, (Arg) { .i = ioprio2 }, NULL); - if (!ok) { - beep(); - } - } - Panel_delete((Object*)ioprioPanel); - return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR; -} - -static bool Platform_changeAutogroupPriority(MainPanel* panel, int delta) { - if (LinuxProcess_isAutogroupEnabled() == false) { - beep(); - return false; - } - bool anyTagged; - bool ok = MainPanel_foreachProcess(panel, LinuxProcess_changeAutogroupPriorityBy, (Arg) { .i = delta }, &anyTagged); - if (!ok) - beep(); - return anyTagged; -} - -static Htop_Reaction Platform_actionHigherAutogroupPriority(State* st) { - if (Settings_isReadonly()) - return HTOP_OK; - - bool changed = Platform_changeAutogroupPriority(st->mainPanel, -1); - return changed ? HTOP_REFRESH : HTOP_OK; -} - -static Htop_Reaction Platform_actionLowerAutogroupPriority(State* st) { - if (Settings_isReadonly()) - return HTOP_OK; - - bool changed = Platform_changeAutogroupPriority(st->mainPanel, 1); - return changed ? HTOP_REFRESH : HTOP_OK; -} - -void Platform_setBindings(Htop_Action* keys) { - keys['i'] = Platform_actionSetIOPriority; - keys['{'] = Platform_actionLowerAutogroupPriority; - keys['}'] = Platform_actionHigherAutogroupPriority; - keys[KEY_F(19)] = Platform_actionLowerAutogroupPriority; // Shift-F7 - keys[KEY_F(20)] = Platform_actionHigherAutogroupPriority; // Shift-F8 -} - -const MeterClass* const Platform_meterTypes[] = { - &CPUMeter_class, - &ClockMeter_class, - &DateMeter_class, - &DateTimeMeter_class, - &LoadAverageMeter_class, - &LoadMeter_class, - &MemoryMeter_class, - &SwapMeter_class, - &MemorySwapMeter_class, - &SysArchMeter_class, - &HugePageMeter_class, - &TasksMeter_class, - &UptimeMeter_class, - &BatteryMeter_class, - &HostnameMeter_class, - &AllCPUsMeter_class, - &AllCPUs2Meter_class, - &AllCPUs4Meter_class, - &AllCPUs8Meter_class, - &LeftCPUsMeter_class, - &RightCPUsMeter_class, - &LeftCPUs2Meter_class, - &RightCPUs2Meter_class, - &LeftCPUs4Meter_class, - &RightCPUs4Meter_class, - &LeftCPUs8Meter_class, - &RightCPUs8Meter_class, - &BlankMeter_class, - &PressureStallCPUSomeMeter_class, - &PressureStallIOSomeMeter_class, - &PressureStallIOFullMeter_class, - &PressureStallIRQFullMeter_class, - &PressureStallMemorySomeMeter_class, - &PressureStallMemoryFullMeter_class, - &ZfsArcMeter_class, - &ZfsCompressedArcMeter_class, - &ZramMeter_class, - &DiskIOMeter_class, - &NetworkIOMeter_class, - &SELinuxMeter_class, - &SystemdMeter_class, - &SystemdUserMeter_class, - NULL -}; - -int Platform_getUptime(void) { - double uptime = 0; - FILE* fd = fopen(PROCDIR "/uptime", "r"); - if (fd) { - int n = fscanf(fd, "%64lf", &uptime); - fclose(fd); - if (n <= 0) { - return 0; - } - } - return floor(uptime); -} - -void Platform_getLoadAverage(double* one, double* five, double* fifteen) { - FILE* fd = fopen(PROCDIR "/loadavg", "r"); - if (!fd) - goto err; - - double scanOne, scanFive, scanFifteen; - int r = fscanf(fd, "%lf %lf %lf", &scanOne, &scanFive, &scanFifteen); - fclose(fd); - if (r != 3) - goto err; - - *one = scanOne; - *five = scanFive; - *fifteen = scanFifteen; - return; - -err: - *one = NAN; - *five = NAN; - *fifteen = NAN; -} - -int Platform_getMaxPid(void) { - FILE* file = fopen(PROCDIR "/sys/kernel/pid_max", "r"); - if (!file) - return -1; - - int maxPid = 4194303; - int match = fscanf(file, "%32d", &maxPid); - (void) match; - fclose(file); - return maxPid; -} - -double Platform_setCPUValues(Meter* this, unsigned int cpu) { - const LinuxProcessList* pl = (const LinuxProcessList*) this->pl; - const CPUData* cpuData = &(pl->cpuData[cpu]); - double total = (double) ( cpuData->totalPeriod == 0 ? 1 : cpuData->totalPeriod); - double percent; - double* v = this->values; - - if (!cpuData->online) { - this->curItems = 0; - return NAN; - } - - v[CPU_METER_NICE] = cpuData->nicePeriod / total * 100.0; - v[CPU_METER_NORMAL] = cpuData->userPeriod / total * 100.0; - if (this->pl->settings->detailedCPUTime) { - v[CPU_METER_KERNEL] = cpuData->systemPeriod / total * 100.0; - v[CPU_METER_IRQ] = cpuData->irqPeriod / total * 100.0; - v[CPU_METER_SOFTIRQ] = cpuData->softIrqPeriod / total * 100.0; - v[CPU_METER_STEAL] = cpuData->stealPeriod / total * 100.0; - v[CPU_METER_GUEST] = cpuData->guestPeriod / total * 100.0; - v[CPU_METER_IOWAIT] = cpuData->ioWaitPeriod / total * 100.0; - this->curItems = 8; - if (this->pl->settings->accountGuestInCPUMeter) { - percent = v[0] + v[1] + v[2] + v[3] + v[4] + v[5] + v[6]; - } else { - percent = v[0] + v[1] + v[2] + v[3] + v[4]; - } - } else { - v[2] = cpuData->systemAllPeriod / total * 100.0; - v[3] = (cpuData->stealPeriod + cpuData->guestPeriod) / total * 100.0; - this->curItems = 4; - percent = v[0] + v[1] + v[2] + v[3]; - } - percent = CLAMP(percent, 0.0, 100.0); - if (isnan(percent)) { - percent = 0.0; - } - - v[CPU_METER_FREQUENCY] = cpuData->frequency; - -#ifdef HAVE_SENSORS_SENSORS_H - v[CPU_METER_TEMPERATURE] = cpuData->temperature; -#else - v[CPU_METER_TEMPERATURE] = NAN; -#endif - - return percent; -} - -void Platform_setMemoryValues(Meter* this) { - const ProcessList* pl = this->pl; - const LinuxProcessList* lpl = (const LinuxProcessList*) pl; - - this->total = pl->totalMem; - this->values[MEMORY_METER_USED] = pl->usedMem; - this->values[MEMORY_METER_BUFFERS] = pl->buffersMem; - this->values[MEMORY_METER_SHARED] = pl->sharedMem; - this->values[MEMORY_METER_CACHE] = pl->cachedMem; - this->values[MEMORY_METER_AVAILABLE] = pl->availableMem; - - if (lpl->zfs.enabled != 0 && !Running_containerized) { - // ZFS does not shrink below the value of zfs_arc_min. - unsigned long long int shrinkableSize = 0; - if (lpl->zfs.size > lpl->zfs.min) - shrinkableSize = lpl->zfs.size - lpl->zfs.min; - this->values[MEMORY_METER_USED] -= shrinkableSize; - this->values[MEMORY_METER_CACHE] += shrinkableSize; - this->values[MEMORY_METER_AVAILABLE] += shrinkableSize; - } -} - -void Platform_setSwapValues(Meter* this) { - const ProcessList* pl = this->pl; - this->total = pl->totalSwap; - this->values[0] = pl->usedSwap; - this->values[1] = pl->cachedSwap; -} - -void Platform_setZramValues(Meter* this) { - const LinuxProcessList* lpl = (const LinuxProcessList*) this->pl; - this->total = lpl->zram.totalZram; - this->values[0] = lpl->zram.usedZramComp; - this->values[1] = lpl->zram.usedZramOrig; -} - -void Platform_setZfsArcValues(Meter* this) { - const LinuxProcessList* lpl = (const LinuxProcessList*) this->pl; - - ZfsArcMeter_readStats(this, &(lpl->zfs)); -} - -void Platform_setZfsCompressedArcValues(Meter* this) { - const LinuxProcessList* lpl = (const LinuxProcessList*) this->pl; - - ZfsCompressedArcMeter_readStats(this, &(lpl->zfs)); -} - -char* Platform_getProcessEnv(pid_t pid) { - char procname[128]; - xSnprintf(procname, sizeof(procname), PROCDIR "/%d/environ", pid); - FILE* fd = fopen(procname, "r"); - if (!fd) - return NULL; - - char* env = NULL; - - size_t capacity = 0; - size_t size = 0; - ssize_t bytes = 0; - - do { - size += bytes; - capacity += 4096; - env = xRealloc(env, capacity); - } while ((bytes = fread(env + size, 1, capacity - size, fd)) > 0); - - fclose(fd); - - if (bytes < 0) { - free(env); - return NULL; - } - - size += bytes; - - env = xRealloc(env, size + 2); - - env[size] = '\0'; - env[size + 1] = '\0'; - - return env; -} - -FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) { - FileLocks_ProcessData* pdata = xCalloc(1, sizeof(FileLocks_ProcessData)); - DIR* dirp; - int dfd; - - char path[PATH_MAX]; - xSnprintf(path, sizeof(path), PROCDIR "/%d/fdinfo/", pid); - if (strlen(path) >= (sizeof(path) - 2)) - goto err; - - if (!(dirp = opendir(path))) - goto err; - - if ((dfd = dirfd(dirp)) == -1) { - closedir(dirp); - goto err; - } - - FileLocks_LockData** data_ref = &pdata->locks; - for (struct dirent* de; (de = readdir(dirp)); ) { - if (String_eq(de->d_name, ".") || String_eq(de->d_name, "..")) - continue; - - errno = 0; - char *end = de->d_name; - int file = strtoull(de->d_name, &end, 10); - if (errno || *end) - continue; - - int fd = openat(dfd, de->d_name, O_RDONLY | O_CLOEXEC); - if(fd == -1) - continue; - FILE *f = fdopen(fd, "r"); - if(!f) { - close(fd); - continue; - } - - for (char buffer[1024]; fgets(buffer, sizeof(buffer), f); ) { - if (!strchr(buffer, '\n')) - continue; - - if (strncmp(buffer, "lock:\t", strlen("lock:\t"))) - continue; - - FileLocks_Data data = {.fd = file}; - int _; - unsigned int maj, min; - char lock_end[25], locktype[32], exclusive[32], readwrite[32]; - if (10 != sscanf(buffer + strlen("lock:\t"), "%d: %31s %31s %31s %d %x:%x:%"PRIu64" %"PRIu64" %24s", - &_, locktype, exclusive, readwrite, &_, - &maj, &min, &data.inode, - &data.start, lock_end)) - continue; - - data.locktype = xStrdup(locktype); - data.exclusive = xStrdup(exclusive); - data.readwrite = xStrdup(readwrite); - data.dev = makedev(maj, min); - - if (String_eq(lock_end, "EOF")) - data.end = ULLONG_MAX; - else - data.end = strtoull(lock_end, NULL, 10); - - xSnprintf(path, sizeof(path), PROCDIR "/%d/fd/%s", pid, de->d_name); - char link[PATH_MAX]; - ssize_t link_len; - if (strlen(path) < (sizeof(path) - 2) && (link_len = readlink(path, link, sizeof(link))) != -1) - data.filename = xStrndup(link, link_len); - - *data_ref = xCalloc(1, sizeof(FileLocks_LockData)); - (*data_ref)->data = data; - data_ref = &(*data_ref)->next; - } - - fclose(f); - } - - closedir(dirp); - return pdata; - -err: - pdata->error = true; - return pdata; -} - -void Platform_getPressureStall(const char* file, bool some, double* ten, double* sixty, double* threehundred) { - *ten = *sixty = *threehundred = 0; - char procname[128]; - xSnprintf(procname, sizeof(procname), PROCDIR "/pressure/%s", file); - FILE* fd = fopen(procname, "r"); - if (!fd) { - *ten = *sixty = *threehundred = NAN; - return; - } - int total = fscanf(fd, "some avg10=%32lf avg60=%32lf avg300=%32lf total=%*f ", ten, sixty, threehundred); - if (!some) { - total = fscanf(fd, "full avg10=%32lf avg60=%32lf avg300=%32lf total=%*f ", ten, sixty, threehundred); - } - (void) total; - assert(total == 3); - fclose(fd); -} - -bool Platform_getDiskIO(DiskIOData* data) { - FILE* fd = fopen(PROCDIR "/diskstats", "r"); - if (!fd) - return false; - - char lastTopDisk[32] = { '\0' }; - - unsigned long long int read_sum = 0, write_sum = 0, timeSpend_sum = 0; - char lineBuffer[256]; - while (fgets(lineBuffer, sizeof(lineBuffer), fd)) { - char diskname[32]; - unsigned long long int read_tmp, write_tmp, timeSpend_tmp; - if (sscanf(lineBuffer, "%*d %*d %31s %*u %*u %llu %*u %*u %*u %llu %*u %*u %llu", diskname, &read_tmp, &write_tmp, &timeSpend_tmp) == 4) { - if (String_startsWith(diskname, "dm-")) - continue; - - if (String_startsWith(diskname, "zram")) - continue; - - /* only count root disks, e.g. do not count IO from sda and sda1 twice */ - if (lastTopDisk[0] && String_startsWith(diskname, lastTopDisk)) - continue; - - /* This assumes disks are listed directly before any of their partitions */ - String_safeStrncpy(lastTopDisk, diskname, sizeof(lastTopDisk)); - - read_sum += read_tmp; - write_sum += write_tmp; - timeSpend_sum += timeSpend_tmp; - } - } - fclose(fd); - /* multiply with sector size */ - data->totalBytesRead = 512 * read_sum; - data->totalBytesWritten = 512 * write_sum; - data->totalMsTimeSpend = timeSpend_sum; - return true; -} - -bool Platform_getNetworkIO(NetworkIOData* data) { - FILE* fd = fopen(PROCDIR "/net/dev", "r"); - if (!fd) - return false; - - memset(data, 0, sizeof(NetworkIOData)); - char lineBuffer[512]; - while (fgets(lineBuffer, sizeof(lineBuffer), fd)) { - char interfaceName[32]; - unsigned long long int bytesReceived, packetsReceived, bytesTransmitted, packetsTransmitted; - if (sscanf(lineBuffer, "%31s %llu %llu %*u %*u %*u %*u %*u %*u %llu %llu", - interfaceName, - &bytesReceived, - &packetsReceived, - &bytesTransmitted, - &packetsTransmitted) != 5) - continue; - - if (String_eq(interfaceName, "lo:")) - continue; - - data->bytesReceived += bytesReceived; - data->packetsReceived += packetsReceived; - data->bytesTransmitted += bytesTransmitted; - data->packetsTransmitted += packetsTransmitted; - } - - fclose(fd); - - return true; -} - -// Linux battery reading by Ian P. Hands (iphands@gmail.com, ihands@redhat.com). - -#define PROC_BATTERY_DIR PROCDIR "/acpi/battery" -#define PROC_POWERSUPPLY_DIR PROCDIR "/acpi/ac_adapter" -#define PROC_POWERSUPPLY_ACSTATE_FILE PROC_POWERSUPPLY_DIR "/AC/state" -#define SYS_POWERSUPPLY_DIR "/sys/class/power_supply" - -// ---------------------------------------- -// READ FROM /proc -// ---------------------------------------- - -static double Platform_Battery_getProcBatInfo(void) { - DIR* batteryDir = opendir(PROC_BATTERY_DIR); - if (!batteryDir) - return NAN; - - uint64_t totalFull = 0; - uint64_t totalRemain = 0; - - struct dirent* dirEntry = NULL; - while ((dirEntry = readdir(batteryDir))) { - const char* entryName = dirEntry->d_name; - if (!String_startsWith(entryName, "BAT")) - continue; - - char filePath[256]; - char bufInfo[1024] = {0}; - xSnprintf(filePath, sizeof(filePath), "%s/%s/info", PROC_BATTERY_DIR, entryName); - ssize_t r = xReadfile(filePath, bufInfo, sizeof(bufInfo)); - if (r < 0) - continue; - - char bufState[1024] = {0}; - xSnprintf(filePath, sizeof(filePath), "%s/%s/state", PROC_BATTERY_DIR, entryName); - r = xReadfile(filePath, bufState, sizeof(bufState)); - if (r < 0) - continue; - - const char* line; - - //Getting total charge for all batteries - char* buf = bufInfo; - while ((line = strsep(&buf, "\n")) != NULL) { - char field[100] = {0}; - int val = 0; - if (2 != sscanf(line, "%99[^:]:%d", field, &val)) - continue; - - if (String_eq(field, "last full capacity")) { - totalFull += val; - break; - } - } - - //Getting remaining charge for all batteries - buf = bufState; - while ((line = strsep(&buf, "\n")) != NULL) { - char field[100] = {0}; - int val = 0; - if (2 != sscanf(line, "%99[^:]:%d", field, &val)) - continue; - - if (String_eq(field, "remaining capacity")) { - totalRemain += val; - break; - } - } - } - - closedir(batteryDir); - - return totalFull > 0 ? ((double) totalRemain * 100.0) / (double) totalFull : NAN; -} - -static ACPresence procAcpiCheck(void) { - char buffer[1024] = {0}; - ssize_t r = xReadfile(PROC_POWERSUPPLY_ACSTATE_FILE, buffer, sizeof(buffer)); - if (r < 1) - return AC_ERROR; - - return String_eq(buffer, "on-line") ? AC_PRESENT : AC_ABSENT; -} - -static void Platform_Battery_getProcData(double* percent, ACPresence* isOnAC) { - *isOnAC = procAcpiCheck(); - *percent = AC_ERROR != *isOnAC ? Platform_Battery_getProcBatInfo() : NAN; -} - -// ---------------------------------------- -// READ FROM /sys -// ---------------------------------------- - -static void Platform_Battery_getSysData(double* percent, ACPresence* isOnAC) { - *percent = NAN; - *isOnAC = AC_ERROR; - - DIR* dir = opendir(SYS_POWERSUPPLY_DIR); - if (!dir) - return; - - uint64_t totalFull = 0; - uint64_t totalRemain = 0; - - const struct dirent* dirEntry; - while ((dirEntry = readdir(dir))) { - const char* entryName = dirEntry->d_name; - -#ifdef HAVE_OPENAT - int entryFd = openat(dirfd(dir), entryName, O_DIRECTORY | O_PATH); - if (entryFd < 0) - continue; -#else - char entryFd[4096]; - xSnprintf(entryFd, sizeof(entryFd), SYS_POWERSUPPLY_DIR "/%s", entryName); -#endif - - enum { AC, BAT } type; - if (String_startsWith(entryName, "BAT")) { - type = BAT; - } else if (String_startsWith(entryName, "AC")) { - type = AC; - } else { - char buffer[32]; - ssize_t ret = xReadfileat(entryFd, "type", buffer, sizeof(buffer)); - if (ret <= 0) - goto next; - - /* drop optional trailing newlines */ - for (char* buf = &buffer[(size_t)ret - 1]; *buf == '\n'; buf--) - *buf = '\0'; - - if (String_eq(buffer, "Battery")) - type = BAT; - else if (String_eq(buffer, "Mains")) - type = AC; - else - goto next; - } - - if (type == BAT) { - char buffer[1024]; - ssize_t r = xReadfileat(entryFd, "uevent", buffer, sizeof(buffer)); - if (r < 0) - goto next; - - bool full = false; - bool now = false; - - double fullCharge = 0; - double capacityLevel = NAN; - const char* line; - - char* buf = buffer; - while ((line = strsep(&buf, "\n")) != NULL) { - char field[100] = {0}; - int val = 0; - if (2 != sscanf(line, "POWER_SUPPLY_%99[^=]=%d", field, &val)) - continue; - - if (String_eq(field, "CAPACITY")) { - capacityLevel = val / 100.0; - continue; - } - - if (String_eq(field, "ENERGY_FULL") || String_eq(field, "CHARGE_FULL")) { - fullCharge = val; - totalFull += fullCharge; - full = true; - if (now) - break; - continue; - } - - if (String_eq(field, "ENERGY_NOW") || String_eq(field, "CHARGE_NOW")) { - totalRemain += val; - now = true; - if (full) - break; - continue; - } - } - - if (!now && full && !isnan(capacityLevel)) - totalRemain += capacityLevel * fullCharge; - - } else if (type == AC) { - if (*isOnAC != AC_ERROR) - goto next; - - char buffer[2]; - ssize_t r = xReadfileat(entryFd, "online", buffer, sizeof(buffer)); - if (r < 1) { - *isOnAC = AC_ERROR; - goto next; - } - - if (buffer[0] == '0') - *isOnAC = AC_ABSENT; - else if (buffer[0] == '1') - *isOnAC = AC_PRESENT; - } - -next: - Compat_openatArgClose(entryFd); - } - - closedir(dir); - - *percent = totalFull > 0 ? ((double) totalRemain * 100.0) / (double) totalFull : NAN; -} - -void Platform_getBattery(double* percent, ACPresence* isOnAC) { - time_t now = time(NULL); - // update battery reading is slow. Update it each 10 seconds only. - if (now < Platform_Battery_cacheTime + 10) { - *percent = Platform_Battery_cachePercent; - *isOnAC = Platform_Battery_cacheIsOnAC; - return; - } - - if (Platform_Battery_method == BAT_PROC) { - Platform_Battery_getProcData(percent, isOnAC); - if (isnan(*percent)) - Platform_Battery_method = BAT_SYS; - } - if (Platform_Battery_method == BAT_SYS) { - Platform_Battery_getSysData(percent, isOnAC); - if (isnan(*percent)) - Platform_Battery_method = BAT_ERR; - } - if (Platform_Battery_method == BAT_ERR) { - *percent = NAN; - *isOnAC = AC_ERROR; - } else { - *percent = CLAMP(*percent, 0.0, 100.0); - } - Platform_Battery_cachePercent = *percent; - Platform_Battery_cacheIsOnAC = *isOnAC; - Platform_Battery_cacheTime = now; -} - -void Platform_longOptionsUsage(const char* name) -{ -#ifdef HAVE_LIBCAP - printf( -" --drop-capabilities[=off|basic|strict] Drop Linux capabilities when running as root\n" -" off - do not drop any capabilities\n" -" basic (default) - drop all capabilities not needed by %s\n" -" strict - drop all capabilities except those needed for\n" -" core functionality\n", name); -#else - (void) name; -#endif -} - -CommandLineStatus Platform_getLongOption(int opt, int argc, char** argv) { -#ifndef HAVE_LIBCAP - (void) argc; - (void) argv; -#endif - - switch (opt) { -#ifdef HAVE_LIBCAP - case 160: { - const char* mode = optarg; - if (!mode && optind < argc && argv[optind] != NULL && - (argv[optind][0] != '\0' && argv[optind][0] != '-')) { - mode = argv[optind++]; - } - - if (!mode || String_eq(mode, "basic")) { - Platform_capabilitiesMode = CAP_MODE_BASIC; - } else if (String_eq(mode, "off")) { - Platform_capabilitiesMode = CAP_MODE_OFF; - } else if (String_eq(mode, "strict")) { - Platform_capabilitiesMode = CAP_MODE_STRICT; - } else { - fprintf(stderr, "Error: invalid capabilities mode \"%s\".\n", mode); - return STATUS_ERROR_EXIT; - } - return STATUS_OK; - } -#endif - - default: - break; - } - return STATUS_ERROR_EXIT; -} - -#ifdef HAVE_LIBCAP -static int dropCapabilities(enum CapMode mode) { - - if (mode == CAP_MODE_OFF) - return 0; - - /* capabilities we keep to operate */ - const cap_value_t keepcapsStrict[] = { - CAP_DAC_READ_SEARCH, - CAP_SYS_PTRACE, - }; - const cap_value_t keepcapsBasic[] = { - CAP_DAC_READ_SEARCH, /* read non world-readable process files of other users, like /proc/[pid]/io */ - CAP_KILL, /* send signals to processes of other users */ - CAP_SYS_NICE, /* lower process nice value / change nice value for arbitrary processes */ - CAP_SYS_PTRACE, /* read /proc/[pid]/exe */ -#ifdef HAVE_DELAYACCT - CAP_NET_ADMIN, /* communicate over netlink socket for delay accounting */ -#endif - }; - const cap_value_t* const keepcaps = (mode == CAP_MODE_BASIC) ? keepcapsBasic : keepcapsStrict; - const size_t ncap = (mode == CAP_MODE_BASIC) ? ARRAYSIZE(keepcapsBasic) : ARRAYSIZE(keepcapsStrict); - - cap_t caps = cap_init(); - if (caps == NULL) { - fprintf(stderr, "Error: can not initialize capabilities: %s\n", strerror(errno)); - return -1; - } - - if (cap_clear(caps) < 0) { - fprintf(stderr, "Error: can not clear capabilities: %s\n", strerror(errno)); - cap_free(caps); - return -1; - } - - cap_t currCaps = cap_get_proc(); - if (currCaps == NULL) { - fprintf(stderr, "Error: can not get current process capabilities: %s\n", strerror(errno)); - cap_free(caps); - return -1; - } - - for (size_t i = 0; i < ncap; i++) { - if (!CAP_IS_SUPPORTED(keepcaps[i])) - continue; - - cap_flag_value_t current; - if (cap_get_flag(currCaps, keepcaps[i], CAP_PERMITTED, ¤t) < 0) { - fprintf(stderr, "Error: can not get current value of capability %d: %s\n", keepcaps[i], strerror(errno)); - cap_free(currCaps); - cap_free(caps); - return -1; - } - - if (current != CAP_SET) - continue; - - if (cap_set_flag(caps, CAP_PERMITTED, 1, &keepcaps[i], CAP_SET) < 0) { - fprintf(stderr, "Error: can not set permitted capability %d: %s\n", keepcaps[i], strerror(errno)); - cap_free(currCaps); - cap_free(caps); - return -1; - } - - if (cap_set_flag(caps, CAP_EFFECTIVE, 1, &keepcaps[i], CAP_SET) < 0) { - fprintf(stderr, "Error: can not set effective capability %d: %s\n", keepcaps[i], strerror(errno)); - cap_free(currCaps); - cap_free(caps); - return -1; - } - } - - if (cap_set_proc(caps) < 0) { - fprintf(stderr, "Error: can not set process capabilities: %s\n", strerror(errno)); - cap_free(currCaps); - cap_free(caps); - return -1; - } - - cap_free(currCaps); - cap_free(caps); - - return 0; -} -#endif - -bool Platform_init(void) { -#ifdef HAVE_LIBCAP - if (dropCapabilities(Platform_capabilitiesMode) < 0) - return false; -#endif - - if (access(PROCDIR, R_OK) != 0) { - fprintf(stderr, "Error: could not read procfs (compiled to look in %s).\n", PROCDIR); - return false; - } - -#ifdef HAVE_SENSORS_SENSORS_H - LibSensors_init(); -#endif - - char target[PATH_MAX]; - ssize_t ret = readlink(PROCDIR "/self/ns/pid", target, sizeof(target) - 1); - if (ret > 0) { - target[ret] = '\0'; - - if (!String_eq("pid:[4026531836]", target)) { // magic constant PROC_PID_INIT_INO from include/linux/proc_ns.h#L46 - Running_containerized = true; - return true; // early return - } - } - - FILE* fd = fopen(PROCDIR "/1/mounts", "r"); - if (fd) { - char lineBuffer[256]; - while (fgets(lineBuffer, sizeof(lineBuffer), fd)) { - // detect lxc or overlayfs and guess that this means we are running containerized - if (String_startsWith(lineBuffer, "lxcfs /proc") || String_startsWith(lineBuffer, "overlay ")) { - Running_containerized = true; - break; - } - } - fclose(fd); - } // if (fd) - - return true; -} - -void Platform_done(void) { -#ifdef HAVE_SENSORS_SENSORS_H - LibSensors_cleanup(); -#endif -} diff --git a/fedora/.local/bin/htop-vim/linux/Platform.h b/fedora/.local/bin/htop-vim/linux/Platform.h deleted file mode 100644 index f6ac188..0000000 --- a/fedora/.local/bin/htop-vim/linux/Platform.h +++ /dev/null @@ -1,141 +0,0 @@ -#ifndef HEADER_Platform -#define HEADER_Platform -/* -htop - linux/Platform.h -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" - -#include -#include -#include -#include -#include -#include - -#include "Action.h" -#include "BatteryMeter.h" -#include "DiskIOMeter.h" -#include "Hashtable.h" -#include "Macros.h" -#include "Meter.h" -#include "NetworkIOMeter.h" -#include "Process.h" -#include "ProcessLocksScreen.h" -#include "RichString.h" -#include "SignalsPanel.h" -#include "CommandLine.h" -#include "generic/gettime.h" -#include "generic/hostname.h" -#include "generic/uname.h" - -/* GNU/Hurd does not have PATH_MAX in limits.h */ -#ifndef PATH_MAX - #define PATH_MAX 4096 -#endif - - -extern const ScreenDefaults Platform_defaultScreens[]; - -extern const unsigned int Platform_numberOfDefaultScreens; - -extern const SignalItem Platform_signals[]; - -extern const unsigned int Platform_numberOfSignals; - -extern const MeterClass* const Platform_meterTypes[]; - -bool Platform_init(void); -void Platform_done(void); - -extern bool Running_containerized; - -void Platform_setBindings(Htop_Action* keys); - -int Platform_getUptime(void); - -void Platform_getLoadAverage(double* one, double* five, double* fifteen); - -int Platform_getMaxPid(void); - -double Platform_setCPUValues(Meter* this, unsigned int cpu); - -void Platform_setMemoryValues(Meter* this); - -void Platform_setSwapValues(Meter* this); - -void Platform_setZramValues(Meter* this); - -void Platform_setZfsArcValues(Meter* this); - -void Platform_setZfsCompressedArcValues(Meter* this); - -char* Platform_getProcessEnv(pid_t pid); - -FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid); - -void Platform_getPressureStall(const char* file, bool some, double* ten, double* sixty, double* threehundred); - -bool Platform_getDiskIO(DiskIOData* data); - -bool Platform_getNetworkIO(NetworkIOData* data); - -void Platform_getBattery(double* percent, ACPresence* isOnAC); - -static inline void Platform_getHostname(char* buffer, size_t size) { - Generic_hostname(buffer, size); -} - -static inline void Platform_getRelease(char** string) { - *string = Generic_uname(); -} - -#ifdef HAVE_LIBCAP - #define PLATFORM_LONG_OPTIONS \ - {"drop-capabilities", optional_argument, 0, 160}, -#else - #define PLATFORM_LONG_OPTIONS -#endif - -void Platform_longOptionsUsage(const char* name); - -CommandLineStatus Platform_getLongOption(int opt, int argc, char** argv); - -static inline void Platform_gettime_realtime(struct timeval* tv, uint64_t* msec) { - Generic_gettime_realtime(tv, msec); -} - -static inline void Platform_gettime_monotonic(uint64_t* msec) { - Generic_gettime_monotonic(msec); -} - -static inline Hashtable* Platform_dynamicMeters(void) { - return NULL; -} - -static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* table) { } - -static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { } - -static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* meter) { } - -static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter* meter, ATTR_UNUSED RichString* out) { } - -static inline Hashtable* Platform_dynamicColumns(void) { - return NULL; -} - -static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* table) { } - -static inline const char* Platform_dynamicColumnInit(ATTR_UNUSED unsigned int key) { - return NULL; -} - -static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Process* proc, ATTR_UNUSED RichString* str, ATTR_UNUSED unsigned int key) { - return false; -} - -#endif diff --git a/fedora/.local/bin/htop-vim/linux/PressureStallMeter.c b/fedora/.local/bin/htop-vim/linux/PressureStallMeter.c deleted file mode 100644 index c4f534e..0000000 --- a/fedora/.local/bin/htop-vim/linux/PressureStallMeter.c +++ /dev/null @@ -1,168 +0,0 @@ -/* -htop - PressureStallMeter.c -(C) 2004-2011 Hisham H. Muhammad -(C) 2019 Ran Benita -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "linux/PressureStallMeter.h" - -#include -#include - -#include "CRT.h" -#include "Meter.h" -#include "Object.h" -#include "Platform.h" -#include "RichString.h" -#include "XUtils.h" - - -static const int PressureStallMeter_attributes[] = { - PRESSURE_STALL_TEN, - PRESSURE_STALL_SIXTY, - PRESSURE_STALL_THREEHUNDRED -}; - -static void PressureStallMeter_updateValues(Meter* this) { - const char* file; - if (strstr(Meter_name(this), "CPU")) { - file = "cpu"; - } else if (strstr(Meter_name(this), "IO")) { - file = "io"; - } else if (strstr(Meter_name(this), "IRQ")) { - file = "irq"; - } else { - file = "memory"; - } - - bool some; - if (strstr(Meter_name(this), "Some")) { - some = true; - } else { - some = false; - } - - Platform_getPressureStall(file, some, &this->values[0], &this->values[1], &this->values[2]); - - /* only print bar for ten (not sixty and threehundred), cause the sum is meaningless */ - this->curItems = 1; - - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%s %s %5.2lf%% %5.2lf%% %5.2lf%%", some ? "some" : "full", file, this->values[0], this->values[1], this->values[2]); -} - -static void PressureStallMeter_display(const Object* cast, RichString* out) { - const Meter* this = (const Meter*)cast; - char buffer[20]; - int len; - - len = xSnprintf(buffer, sizeof(buffer), "%5.2lf%% ", this->values[0]); - RichString_appendnAscii(out, CRT_colors[PRESSURE_STALL_TEN], buffer, len); - len = xSnprintf(buffer, sizeof(buffer), "%5.2lf%% ", this->values[1]); - RichString_appendnAscii(out, CRT_colors[PRESSURE_STALL_SIXTY], buffer, len); - len = xSnprintf(buffer, sizeof(buffer), "%5.2lf%% ", this->values[2]); - RichString_appendnAscii(out, CRT_colors[PRESSURE_STALL_THREEHUNDRED], buffer, len); -} - -const MeterClass PressureStallCPUSomeMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = PressureStallMeter_display, - }, - .updateValues = PressureStallMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 3, - .total = 100.0, - .attributes = PressureStallMeter_attributes, - .name = "PressureStallCPUSome", - .uiName = "PSI some CPU", - .caption = "PSI some CPU: ", - .description = "Pressure Stall Information, some cpu" -}; - -const MeterClass PressureStallIOSomeMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = PressureStallMeter_display, - }, - .updateValues = PressureStallMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 3, - .total = 100.0, - .attributes = PressureStallMeter_attributes, - .name = "PressureStallIOSome", - .uiName = "PSI some IO", - .caption = "PSI some IO: ", - .description = "Pressure Stall Information, some io" -}; - -const MeterClass PressureStallIOFullMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = PressureStallMeter_display, - }, - .updateValues = PressureStallMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 3, - .total = 100.0, - .attributes = PressureStallMeter_attributes, - .name = "PressureStallIOFull", - .uiName = "PSI full IO", - .caption = "PSI full IO: ", - .description = "Pressure Stall Information, full io" -}; - -const MeterClass PressureStallIRQFullMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = PressureStallMeter_display, - }, - .updateValues = PressureStallMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 3, - .total = 100.0, - .attributes = PressureStallMeter_attributes, - .name = "PressureStallIRQFull", - .uiName = "PSI full IRQ", - .caption = "PSI full IRQ: ", - .description = "Pressure Stall Information, full irq" -}; - -const MeterClass PressureStallMemorySomeMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = PressureStallMeter_display, - }, - .updateValues = PressureStallMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 3, - .total = 100.0, - .attributes = PressureStallMeter_attributes, - .name = "PressureStallMemorySome", - .uiName = "PSI some memory", - .caption = "PSI some memory: ", - .description = "Pressure Stall Information, some memory" -}; - -const MeterClass PressureStallMemoryFullMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = PressureStallMeter_display, - }, - .updateValues = PressureStallMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 3, - .total = 100.0, - .attributes = PressureStallMeter_attributes, - .name = "PressureStallMemoryFull", - .uiName = "PSI full memory", - .caption = "PSI full memory: ", - .description = "Pressure Stall Information, full memory" -}; diff --git a/fedora/.local/bin/htop-vim/linux/PressureStallMeter.h b/fedora/.local/bin/htop-vim/linux/PressureStallMeter.h deleted file mode 100644 index 93ebd27..0000000 --- a/fedora/.local/bin/htop-vim/linux/PressureStallMeter.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Do not edit this file. It was automatically generated. */ - -#ifndef HEADER_PressureStallMeter -#define HEADER_PressureStallMeter -/* -htop - PressureStallMeter.h -(C) 2004-2011 Hisham H. Muhammad -(C) 2019 Ran Benita -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Meter.h" - - -extern const MeterClass PressureStallCPUSomeMeter_class; - -extern const MeterClass PressureStallIOSomeMeter_class; - -extern const MeterClass PressureStallIOFullMeter_class; - -extern const MeterClass PressureStallIRQFullMeter_class; - -extern const MeterClass PressureStallMemorySomeMeter_class; - -extern const MeterClass PressureStallMemoryFullMeter_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/linux/ProcessField.h b/fedora/.local/bin/htop-vim/linux/ProcessField.h deleted file mode 100644 index 17cafa9..0000000 --- a/fedora/.local/bin/htop-vim/linux/ProcessField.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef HEADER_LinuxProcessField -#define HEADER_LinuxProcessField -/* -htop - linux/ProcessField.h -(C) 2020 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - - -#define PLATFORM_PROCESS_FIELDS \ - CMINFLT = 11, \ - CMAJFLT = 13, \ - UTIME = 14, \ - STIME = 15, \ - CUTIME = 16, \ - CSTIME = 17, \ - M_SHARE = 41, \ - M_TRS = 42, \ - M_DRS = 43, \ - M_LRS = 44, \ - CTID = 100, \ - VPID = 101, \ - VXID = 102, \ - RCHAR = 103, \ - WCHAR = 104, \ - SYSCR = 105, \ - SYSCW = 106, \ - RBYTES = 107, \ - WBYTES = 108, \ - CNCLWB = 109, \ - IO_READ_RATE = 110, \ - IO_WRITE_RATE = 111, \ - IO_RATE = 112, \ - CGROUP = 113, \ - OOM = 114, \ - IO_PRIORITY = 115, \ - PERCENT_CPU_DELAY = 116, \ - PERCENT_IO_DELAY = 117, \ - PERCENT_SWAP_DELAY = 118, \ - M_PSS = 119, \ - M_SWAP = 120, \ - M_PSSWP = 121, \ - CTXT = 122, \ - SECATTR = 123, \ - AUTOGROUP_ID = 127, \ - AUTOGROUP_NICE = 128, \ - CCGROUP = 129, \ - // End of list - - -#endif /* HEADER_LinuxProcessField */ diff --git a/fedora/.local/bin/htop-vim/linux/SELinuxMeter.c b/fedora/.local/bin/htop-vim/linux/SELinuxMeter.c deleted file mode 100644 index c35cb68..0000000 --- a/fedora/.local/bin/htop-vim/linux/SELinuxMeter.c +++ /dev/null @@ -1,93 +0,0 @@ -/* -htop - SELinuxMeter.c -(C) 2020 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "linux/SELinuxMeter.h" - -#include "CRT.h" - -#include -#include -#include -#include -#include -#include - -#include "Object.h" -#include "XUtils.h" - - -static const int SELinuxMeter_attributes[] = { - METER_TEXT, -}; - -static bool enabled = false; -static bool enforcing = false; - -static bool hasSELinuxMount(void) { - struct statfs sfbuf; - int r = statfs("/sys/fs/selinux", &sfbuf); - if (r != 0) { - return false; - } - - if ((uint32_t)sfbuf.f_type != /* SELINUX_MAGIC */ 0xf97cff8cU) { - return false; - } - - struct statvfs vfsbuf; - r = statvfs("/sys/fs/selinux", &vfsbuf); - if (r != 0 || (vfsbuf.f_flag & ST_RDONLY)) { - return false; - } - - return true; -} - -static bool isSelinuxEnabled(void) { - return hasSELinuxMount() && (0 == access("/etc/selinux/config", F_OK)); -} - -static bool isSelinuxEnforcing(void) { - if (!enabled) { - return false; - } - - char buf[20]; - ssize_t r = xReadfile("/sys/fs/selinux/enforce", buf, sizeof(buf)); - if (r < 0) - return false; - - int enforce = 0; - if (sscanf(buf, "%d", &enforce) != 1) { - return false; - } - - return !!enforce; -} - -static void SELinuxMeter_updateValues(Meter* this) { - enabled = isSelinuxEnabled(); - enforcing = isSelinuxEnforcing(); - - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%s%s", enabled ? "enabled" : "disabled", enabled ? (enforcing ? "; mode: enforcing" : "; mode: permissive") : ""); -} - -const MeterClass SELinuxMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - }, - .updateValues = SELinuxMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 0, - .total = 100.0, - .attributes = SELinuxMeter_attributes, - .name = "SELinux", - .uiName = "SELinux", - .description = "SELinux state overview", - .caption = "SELinux: " -}; diff --git a/fedora/.local/bin/htop-vim/linux/SELinuxMeter.h b/fedora/.local/bin/htop-vim/linux/SELinuxMeter.h deleted file mode 100644 index d8a04db..0000000 --- a/fedora/.local/bin/htop-vim/linux/SELinuxMeter.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef HEADER_SELinuxMeter -#define HEADER_SELinuxMeter -/* -htop - SELinuxMeter.h -(C) 2020 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Meter.h" - - -extern const MeterClass SELinuxMeter_class; - -#endif /* HEADER_SELinuxMeter */ diff --git a/fedora/.local/bin/htop-vim/linux/SystemdMeter.c b/fedora/.local/bin/htop-vim/linux/SystemdMeter.c deleted file mode 100644 index 848d1e4..0000000 --- a/fedora/.local/bin/htop-vim/linux/SystemdMeter.c +++ /dev/null @@ -1,433 +0,0 @@ -/* -htop - SystemdMeter.c -(C) 2020 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "linux/SystemdMeter.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "CRT.h" -#include "Macros.h" -#include "Object.h" -#include "RichString.h" -#include "Settings.h" -#include "XUtils.h" - -#if defined(BUILD_STATIC) && defined(HAVE_LIBSYSTEMD) -#include -#endif - - -#ifdef BUILD_STATIC - -#define sym_sd_bus_open_system sd_bus_open_system -#define sym_sd_bus_get_property_string sd_bus_get_property_string -#define sym_sd_bus_get_property_trivial sd_bus_get_property_trivial -#define sym_sd_bus_unref sd_bus_unref - -#else - -typedef void sd_bus; -typedef void sd_bus_error; -static int (*sym_sd_bus_open_system)(sd_bus**); -static int (*sym_sd_bus_open_user)(sd_bus**); -static int (*sym_sd_bus_get_property_string)(sd_bus*, const char*, const char*, const char*, const char*, sd_bus_error*, char**); -static int (*sym_sd_bus_get_property_trivial)(sd_bus*, const char*, const char*, const char*, const char*, sd_bus_error*, char, void*); -static sd_bus* (*sym_sd_bus_unref)(sd_bus*); -static void* dlopenHandle = NULL; - -#endif /* BUILD_STATIC */ - - -#define INVALID_VALUE ((unsigned int)-1) - -typedef struct SystemdMeterContext { -#if !defined(BUILD_STATIC) || defined(HAVE_LIBSYSTEMD) - sd_bus* bus; -#endif /* !BUILD_STATIC || HAVE_LIBSYSTEMD */ - char* systemState; - unsigned int nFailedUnits; - unsigned int nInstalledJobs; - unsigned int nNames; - unsigned int nJobs; -} SystemdMeterContext_t; - -static SystemdMeterContext_t ctx_system; -static SystemdMeterContext_t ctx_user; - -static void SystemdMeter_done(ATTR_UNUSED Meter* this) { - SystemdMeterContext_t* ctx = String_eq(Meter_name(this), "SystemdUser") ? &ctx_user : &ctx_system; - - free(ctx->systemState); - ctx->systemState = NULL; - -#ifdef BUILD_STATIC -# ifdef HAVE_LIBSYSTEMD - if (ctx->bus) { - sym_sd_bus_unref(ctx->bus); - } - ctx->bus = NULL; -# endif /* HAVE_LIBSYSTEMD */ -#else /* BUILD_STATIC */ - if (ctx->bus && dlopenHandle) { - sym_sd_bus_unref(ctx->bus); - } - ctx->bus = NULL; - - if (!ctx_system.systemState && !ctx_user.systemState && dlopenHandle) { - dlclose(dlopenHandle); - dlopenHandle = NULL; - } -#endif /* BUILD_STATIC */ -} - -#if !defined(BUILD_STATIC) || defined(HAVE_LIBSYSTEMD) -static int updateViaLib(bool user) { - SystemdMeterContext_t* ctx = user ? &ctx_user : &ctx_system; -#ifndef BUILD_STATIC - if (!dlopenHandle) { - dlopenHandle = dlopen("libsystemd.so.0", RTLD_LAZY); - if (!dlopenHandle) - goto dlfailure; - - /* Clear any errors */ - dlerror(); - - #define resolve(symbolname) do { \ - *(void **)(&sym_##symbolname) = dlsym(dlopenHandle, #symbolname); \ - if (!sym_##symbolname || dlerror() != NULL) \ - goto dlfailure; \ - } while(0) - - resolve(sd_bus_open_system); - resolve(sd_bus_open_user); - resolve(sd_bus_get_property_string); - resolve(sd_bus_get_property_trivial); - resolve(sd_bus_unref); - - #undef resolve - } -#endif /* !BUILD_STATIC */ - - int r; - /* Connect to the system bus */ - if (!ctx->bus) { - if (user) { - r = sym_sd_bus_open_user(&ctx->bus); - } else { - r = sym_sd_bus_open_system(&ctx->bus); - } - if (r < 0) - goto busfailure; - } - - static const char* const busServiceName = "org.freedesktop.systemd1"; - static const char* const busObjectPath = "/org/freedesktop/systemd1"; - static const char* const busInterfaceName = "org.freedesktop.systemd1.Manager"; - - r = sym_sd_bus_get_property_string(ctx->bus, - busServiceName, /* service to contact */ - busObjectPath, /* object path */ - busInterfaceName, /* interface name */ - "SystemState", /* property name */ - NULL, /* object to return error in */ - &ctx->systemState); - if (r < 0) - goto busfailure; - - r = sym_sd_bus_get_property_trivial(ctx->bus, - busServiceName, /* service to contact */ - busObjectPath, /* object path */ - busInterfaceName, /* interface name */ - "NFailedUnits", /* property name */ - NULL, /* object to return error in */ - 'u', /* property type */ - &ctx->nFailedUnits); - if (r < 0) - goto busfailure; - - r = sym_sd_bus_get_property_trivial(ctx->bus, - busServiceName, /* service to contact */ - busObjectPath, /* object path */ - busInterfaceName, /* interface name */ - "NInstalledJobs", /* property name */ - NULL, /* object to return error in */ - 'u', /* property type */ - &ctx->nInstalledJobs); - if (r < 0) - goto busfailure; - - r = sym_sd_bus_get_property_trivial(ctx->bus, - busServiceName, /* service to contact */ - busObjectPath, /* object path */ - busInterfaceName, /* interface name */ - "NNames", /* property name */ - NULL, /* object to return error in */ - 'u', /* property type */ - &ctx->nNames); - if (r < 0) - goto busfailure; - - r = sym_sd_bus_get_property_trivial(ctx->bus, - busServiceName, /* service to contact */ - busObjectPath, /* object path */ - busInterfaceName, /* interface name */ - "NJobs", /* property name */ - NULL, /* object to return error in */ - 'u', /* property type */ - &ctx->nJobs); - if (r < 0) - goto busfailure; - - /* success */ - return 0; - -busfailure: - sym_sd_bus_unref(ctx->bus); - ctx->bus = NULL; - return -2; - -#ifndef BUILD_STATIC -dlfailure: - if (dlopenHandle) { - dlclose(dlopenHandle); - dlopenHandle = NULL; - } - return -1; -#endif /* !BUILD_STATIC */ -} -#endif /* !BUILD_STATIC || HAVE_LIBSYSTEMD */ - -static void updateViaExec(bool user) { - SystemdMeterContext_t* ctx = user ? &ctx_user : &ctx_system; - - if (Settings_isReadonly()) - return; - - int fdpair[2]; - if (pipe(fdpair) < 0) - return; - - pid_t child = fork(); - if (child < 0) { - close(fdpair[1]); - close(fdpair[0]); - return; - } - - if (child == 0) { - close(fdpair[0]); - dup2(fdpair[1], STDOUT_FILENO); - close(fdpair[1]); - int fdnull = open("/dev/null", O_WRONLY); - if (fdnull < 0) - exit(1); - dup2(fdnull, STDERR_FILENO); - close(fdnull); - // Use of NULL in variadic functions must have a pointer cast. - // The NULL constant is not required by standard to have a pointer type. - execlp( - "systemctl", - "systemctl", - "show", - user ? "--user" : "--system", - "--property=SystemState", - "--property=NFailedUnits", - "--property=NNames", - "--property=NJobs", - "--property=NInstalledJobs", - (char *)NULL); - exit(127); - } - close(fdpair[1]); - - int wstatus; - if (waitpid(child, &wstatus, 0) < 0 || !WIFEXITED(wstatus) || WEXITSTATUS(wstatus) != 0) { - close(fdpair[0]); - return; - } - - FILE* commandOutput = fdopen(fdpair[0], "r"); - if (!commandOutput) { - close(fdpair[0]); - return; - } - - char lineBuffer[128]; - while (fgets(lineBuffer, sizeof(lineBuffer), commandOutput)) { - if (String_startsWith(lineBuffer, "SystemState=")) { - char* newline = strchr(lineBuffer + strlen("SystemState="), '\n'); - if (newline) { - *newline = '\0'; - } - free_and_xStrdup(&ctx->systemState, lineBuffer + strlen("SystemState=")); - } else if (String_startsWith(lineBuffer, "NFailedUnits=")) { - ctx->nFailedUnits = strtoul(lineBuffer + strlen("NFailedUnits="), NULL, 10); - } else if (String_startsWith(lineBuffer, "NNames=")) { - ctx->nNames = strtoul(lineBuffer + strlen("NNames="), NULL, 10); - } else if (String_startsWith(lineBuffer, "NJobs=")) { - ctx->nJobs = strtoul(lineBuffer + strlen("NJobs="), NULL, 10); - } else if (String_startsWith(lineBuffer, "NInstalledJobs=")) { - ctx->nInstalledJobs = strtoul(lineBuffer + strlen("NInstalledJobs="), NULL, 10); - } - } - - fclose(commandOutput); -} - -static void SystemdMeter_updateValues(Meter* this) { - bool user = String_eq(Meter_name(this), "SystemdUser"); - SystemdMeterContext_t* ctx = user ? &ctx_user : &ctx_system; - - free(ctx->systemState); - ctx->systemState = NULL; - ctx->nFailedUnits = ctx->nInstalledJobs = ctx->nNames = ctx->nJobs = INVALID_VALUE; - -#if !defined(BUILD_STATIC) || defined(HAVE_LIBSYSTEMD) - if (updateViaLib(user) < 0) - updateViaExec(user); -#else - updateViaExec(user); -#endif /* !BUILD_STATIC || HAVE_LIBSYSTEMD */ - - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%s", ctx->systemState ? ctx->systemState : "???"); -} - -static int zeroDigitColor(unsigned int value) { - switch (value) { - case 0: - return CRT_colors[METER_VALUE]; - case INVALID_VALUE: - return CRT_colors[METER_VALUE_ERROR]; - default: - return CRT_colors[METER_VALUE_NOTICE]; - } -} - -static int valueDigitColor(unsigned int value) { - switch (value) { - case 0: - return CRT_colors[METER_VALUE_NOTICE]; - case INVALID_VALUE: - return CRT_colors[METER_VALUE_ERROR]; - default: - return CRT_colors[METER_VALUE]; - } -} - - -static void _SystemdMeter_display(ATTR_UNUSED const Object* cast, RichString* out, SystemdMeterContext_t* ctx) { - char buffer[16]; - int len; - int color = METER_VALUE_ERROR; - - if (ctx->systemState) { - color = String_eq(ctx->systemState, "running") ? METER_VALUE_OK : - String_eq(ctx->systemState, "degraded") ? METER_VALUE_ERROR : METER_VALUE_WARN; - } - RichString_writeAscii(out, CRT_colors[color], ctx->systemState ? ctx->systemState : "N/A"); - - RichString_appendAscii(out, CRT_colors[METER_TEXT], " ("); - - if (ctx->nFailedUnits == INVALID_VALUE) { - buffer[0] = '?'; - buffer[1] = '\0'; - len = 1; - } else { - len = xSnprintf(buffer, sizeof(buffer), "%u", ctx->nFailedUnits); - } - RichString_appendnAscii(out, zeroDigitColor(ctx->nFailedUnits), buffer, len); - - RichString_appendAscii(out, CRT_colors[METER_TEXT], "/"); - - if (ctx->nNames == INVALID_VALUE) { - buffer[0] = '?'; - buffer[1] = '\0'; - len = 1; - } else { - len = xSnprintf(buffer, sizeof(buffer), "%u", ctx->nNames); - } - RichString_appendnAscii(out, valueDigitColor(ctx->nNames), buffer, len); - - RichString_appendAscii(out, CRT_colors[METER_TEXT], " failed) ("); - - if (ctx->nJobs == INVALID_VALUE) { - buffer[0] = '?'; - buffer[1] = '\0'; - len = 1; - } else { - len = xSnprintf(buffer, sizeof(buffer), "%u", ctx->nJobs); - } - RichString_appendnAscii(out, zeroDigitColor(ctx->nJobs), buffer, len); - - RichString_appendAscii(out, CRT_colors[METER_TEXT], "/"); - - if (ctx->nInstalledJobs == INVALID_VALUE) { - buffer[0] = '?'; - buffer[1] = '\0'; - len = 1; - } else { - len = xSnprintf(buffer, sizeof(buffer), "%u", ctx->nInstalledJobs); - } - RichString_appendnAscii(out, valueDigitColor(ctx->nInstalledJobs), buffer, len); - - RichString_appendAscii(out, CRT_colors[METER_TEXT], " jobs)"); -} - -static void SystemdMeter_display(ATTR_UNUSED const Object* cast, RichString* out) { - _SystemdMeter_display(cast, out, &ctx_system); -} - -static void SystemdUserMeter_display(ATTR_UNUSED const Object* cast, RichString* out) { - _SystemdMeter_display(cast, out, &ctx_user); -} - -static const int SystemdMeter_attributes[] = { - METER_VALUE -}; - -const MeterClass SystemdMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = SystemdMeter_display - }, - .updateValues = SystemdMeter_updateValues, - .done = SystemdMeter_done, - .defaultMode = TEXT_METERMODE, - .maxItems = 0, - .total = 100.0, - .attributes = SystemdMeter_attributes, - .name = "Systemd", - .uiName = "Systemd state", - .description = "Systemd system state and unit overview", - .caption = "Systemd: ", -}; - -const MeterClass SystemdUserMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = SystemdUserMeter_display - }, - .updateValues = SystemdMeter_updateValues, - .done = SystemdMeter_done, - .defaultMode = TEXT_METERMODE, - .maxItems = 0, - .total = 100.0, - .attributes = SystemdMeter_attributes, - .name = "SystemdUser", - .uiName = "Systemd user state", - .description = "Systemd user state and unit overview", - .caption = "Systemd User: ", -}; diff --git a/fedora/.local/bin/htop-vim/linux/SystemdMeter.h b/fedora/.local/bin/htop-vim/linux/SystemdMeter.h deleted file mode 100644 index 50a793b..0000000 --- a/fedora/.local/bin/htop-vim/linux/SystemdMeter.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef HEADER_SystemdMeter -#define HEADER_SystemdMeter - -/* -htop - SystemdMeter.h -(C) 2020 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Meter.h" - - -extern const MeterClass SystemdMeter_class; - -extern const MeterClass SystemdUserMeter_class; - -#endif /* HEADER_SystemdMeter */ diff --git a/fedora/.local/bin/htop-vim/linux/ZramMeter.c b/fedora/.local/bin/htop-vim/linux/ZramMeter.c deleted file mode 100644 index e1e27b7..0000000 --- a/fedora/.local/bin/htop-vim/linux/ZramMeter.c +++ /dev/null @@ -1,73 +0,0 @@ -#include "linux/ZramMeter.h" - -#include - -#include "CRT.h" -#include "Meter.h" -#include "Object.h" -#include "Platform.h" -#include "RichString.h" - - -static const int ZramMeter_attributes[] = { - ZRAM -}; - -static void ZramMeter_updateValues(Meter* this) { - char* buffer = this->txtBuffer; - size_t size = sizeof(this->txtBuffer); - int written; - - Platform_setZramValues(this); - - /* on print bar for compressed data size, not uncompressed */ - this->curItems = 1; - - written = Meter_humanUnit(buffer, this->values[0], size); - METER_BUFFER_CHECK(buffer, size, written); - - METER_BUFFER_APPEND_CHR(buffer, size, '('); - - written = Meter_humanUnit(buffer, this->values[1], size); - METER_BUFFER_CHECK(buffer, size, written); - - METER_BUFFER_APPEND_CHR(buffer, size, ')'); - - METER_BUFFER_APPEND_CHR(buffer, size, '/'); - - Meter_humanUnit(buffer, this->total, size); -} - -static void ZramMeter_display(const Object* cast, RichString* out) { - char buffer[50]; - const Meter* this = (const Meter*)cast; - - RichString_writeAscii(out, CRT_colors[METER_TEXT], ":"); - - Meter_humanUnit(buffer, this->total, sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_VALUE], buffer); - - Meter_humanUnit(buffer, this->values[0], sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " used:"); - RichString_appendAscii(out, CRT_colors[METER_VALUE], buffer); - - Meter_humanUnit(buffer, this->values[1], sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " uncompressed:"); - RichString_appendAscii(out, CRT_colors[METER_VALUE], buffer); -} - -const MeterClass ZramMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = ZramMeter_display, - }, - .updateValues = ZramMeter_updateValues, - .defaultMode = BAR_METERMODE, - .maxItems = 2, - .total = 100.0, - .attributes = ZramMeter_attributes, - .name = "Zram", - .uiName = "Zram", - .caption = "zrm" -}; diff --git a/fedora/.local/bin/htop-vim/linux/ZramMeter.h b/fedora/.local/bin/htop-vim/linux/ZramMeter.h deleted file mode 100644 index ddba1ba..0000000 --- a/fedora/.local/bin/htop-vim/linux/ZramMeter.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef HEADER_ZramMeter -#define HEADER_ZramMeter - -#include "Meter.h" - - -extern const MeterClass ZramMeter_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/linux/ZramStats.h b/fedora/.local/bin/htop-vim/linux/ZramStats.h deleted file mode 100644 index 67aadcc..0000000 --- a/fedora/.local/bin/htop-vim/linux/ZramStats.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef HEADER_ZramStats -#define HEADER_ZramStats - -typedef struct ZramStats_ { - memory_t totalZram; - memory_t usedZramComp; - memory_t usedZramOrig; -} ZramStats; - -#endif diff --git a/fedora/.local/bin/htop-vim/netbsd/NetBSDProcess.c b/fedora/.local/bin/htop-vim/netbsd/NetBSDProcess.c deleted file mode 100644 index 4d4ac4e..0000000 --- a/fedora/.local/bin/htop-vim/netbsd/NetBSDProcess.c +++ /dev/null @@ -1,264 +0,0 @@ -/* -htop - NetBSDProcess.c -(C) 2015 Hisham H. Muhammad -(C) 2015 Michael McConville -(C) 2021 Santhosh Raju -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "netbsd/NetBSDProcess.h" - -#include - -#include "CRT.h" -#include "Process.h" -#include "RichString.h" -#include "XUtils.h" - - -const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { - [0] = { - .name = "", - .title = NULL, - .description = NULL, - .flags = 0, - }, - [PID] = { - .name = "PID", - .title = "PID", - .description = "Process/thread ID", - .flags = 0, - .pidColumn = true, - }, - [COMM] = { - .name = "Command", - .title = "Command ", - .description = "Command line", - .flags = 0, - }, - [STATE] = { - .name = "STATE", - .title = "S ", - .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging)", - .flags = 0, - }, - [PPID] = { - .name = "PPID", - .title = "PPID", - .description = "Parent process ID", - .flags = 0, - .pidColumn = true, - }, - [PGRP] = { - .name = "PGRP", - .title = "PGRP", - .description = "Process group ID", - .flags = 0, - .pidColumn = true, - }, - [SESSION] = { - .name = "SESSION", - .title = "SESN", - .description = "Process's session ID", - .flags = 0, - .pidColumn = true, - }, - [TTY] = { - .name = "TTY", - .title = "TTY ", - .description = "Controlling terminal", - .flags = 0, - }, - [TPGID] = { - .name = "TPGID", - .title = "TPGID", - .description = "Process ID of the fg process group of the controlling terminal", - .flags = 0, - .pidColumn = true, - }, - [MINFLT] = { - .name = "MINFLT", - .title = " MINFLT ", - .description = "Number of minor faults which have not required loading a memory page from disk", - .flags = 0, - .defaultSortDesc = true, - }, - [MAJFLT] = { - .name = "MAJFLT", - .title = " MAJFLT ", - .description = "Number of major faults which have required loading a memory page from disk", - .flags = 0, - .defaultSortDesc = true, - }, - [PRIORITY] = { - .name = "PRIORITY", - .title = "PRI ", - .description = "Kernel's internal priority for the process", - .flags = 0, - }, - [NICE] = { - .name = "NICE", - .title = " NI ", - .description = "Nice value (the higher the value, the more it lets other processes take priority)", - .flags = 0, - }, - [STARTTIME] = { - .name = "STARTTIME", - .title = "START ", - .description = "Time the process was started", - .flags = 0, - }, - [ELAPSED] = { - .name = "ELAPSED", - .title = "ELAPSED ", - .description = "Time since the process was started", - .flags = 0, - }, - [PROCESSOR] = { - .name = "PROCESSOR", - .title = "CPU ", - .description = "Id of the CPU the process last executed on", - .flags = 0, - }, - [M_VIRT] = { - .name = "M_VIRT", - .title = " VIRT ", - .description = "Total program size in virtual memory", - .flags = 0, - .defaultSortDesc = true, - }, - [M_RESIDENT] = { - .name = "M_RESIDENT", - .title = " RES ", - .description = "Resident set size, size of the text and data sections, plus stack usage", - .flags = 0, - .defaultSortDesc = true, - }, - [ST_UID] = { - .name = "ST_UID", - .title = "UID", - .description = "User ID of the process owner", - .flags = 0, - }, - [PERCENT_CPU] = { - .name = "PERCENT_CPU", - .title = " CPU%", - .description = "Percentage of the CPU time the process used in the last sampling", - .flags = 0, - .defaultSortDesc = true, - .autoWidth = true, - }, - [PERCENT_NORM_CPU] = { - .name = "PERCENT_NORM_CPU", - .title = "NCPU%", - .description = "Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)", - .flags = 0, - .defaultSortDesc = true, - .autoWidth = true, - }, - [PERCENT_MEM] = { - .name = "PERCENT_MEM", - .title = "MEM% ", - .description = "Percentage of the memory the process is using, based on resident memory size", - .flags = 0, - .defaultSortDesc = true, - }, - [USER] = { - .name = "USER", - .title = "USER ", - .description = "Username of the process owner (or user ID if name cannot be determined)", - .flags = 0, - }, - [TIME] = { - .name = "TIME", - .title = " TIME+ ", - .description = "Total time the process has spent in user and system time", - .flags = 0, - .defaultSortDesc = true, - }, - [NLWP] = { - .name = "NLWP", - .title = "NLWP ", - .description = "Number of threads in the process", - .flags = 0, - }, - [TGID] = { - .name = "TGID", - .title = "TGID", - .description = "Thread group ID (i.e. process ID)", - .flags = 0, - .pidColumn = true, - }, - [PROC_COMM] = { - .name = "COMM", - .title = "COMM ", - .description = "comm string of the process", - .flags = 0, - }, - [PROC_EXE] = { - .name = "EXE", - .title = "EXE ", - .description = "Basename of exe of the process", - .flags = 0, - }, - [CWD] = { - .name = "CWD", - .title = "CWD ", - .description = "The current working directory of the process", - .flags = PROCESS_FLAG_CWD, - }, - -}; - -Process* NetBSDProcess_new(const Settings* settings) { - NetBSDProcess* this = xCalloc(1, sizeof(NetBSDProcess)); - Object_setClass(this, Class(NetBSDProcess)); - Process_init(&this->super, settings); - return &this->super; -} - -void Process_delete(Object* cast) { - NetBSDProcess* this = (NetBSDProcess*) cast; - Process_done((Process*)cast); - free(this); -} - -static void NetBSDProcess_writeField(const Process* this, RichString* str, ProcessField field) { - char buffer[256]; buffer[255] = '\0'; - int attr = CRT_colors[DEFAULT_COLOR]; - - switch (field) { - // add NetBSD-specific fields here - default: - Process_writeField(this, str, field); - return; - } - RichString_appendWide(str, attr, buffer); -} - -static int NetBSDProcess_compareByKey(const Process* v1, const Process* v2, ProcessField key) { - const NetBSDProcess* p1 = (const NetBSDProcess*)v1; - const NetBSDProcess* p2 = (const NetBSDProcess*)v2; - - // remove if actually used - (void)p1; (void)p2; - - switch (key) { - // add NetBSD-specific fields here - default: - return Process_compareByKey_Base(v1, v2, key); - } -} - -const ProcessClass NetBSDProcess_class = { - .super = { - .extends = Class(Process), - .display = Process_display, - .delete = Process_delete, - .compare = Process_compare - }, - .writeField = NetBSDProcess_writeField, - .compareByKey = NetBSDProcess_compareByKey -}; diff --git a/fedora/.local/bin/htop-vim/netbsd/NetBSDProcess.h b/fedora/.local/bin/htop-vim/netbsd/NetBSDProcess.h deleted file mode 100644 index b9e6b26..0000000 --- a/fedora/.local/bin/htop-vim/netbsd/NetBSDProcess.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef HEADER_NetBSDProcess -#define HEADER_NetBSDProcess -/* -htop - NetBSDProcess.h -(C) 2015 Hisham H. Muhammad -(C) 2015 Michael McConville -(C) 2021 Santhosh Raju -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include - -#include "Object.h" -#include "Process.h" -#include "Settings.h" - - -typedef struct NetBSDProcess_ { - Process super; -} NetBSDProcess; - -extern const ProcessClass NetBSDProcess_class; - -extern const ProcessFieldData Process_fields[LAST_PROCESSFIELD]; - -Process* NetBSDProcess_new(const Settings* settings); - -void Process_delete(Object* cast); - -#endif diff --git a/fedora/.local/bin/htop-vim/netbsd/NetBSDProcessList.c b/fedora/.local/bin/htop-vim/netbsd/NetBSDProcessList.c deleted file mode 100644 index 197a150..0000000 --- a/fedora/.local/bin/htop-vim/netbsd/NetBSDProcessList.c +++ /dev/null @@ -1,504 +0,0 @@ -/* -htop - NetBSDProcessList.c -(C) 2014 Hisham H. Muhammad -(C) 2015 Michael McConville -(C) 2021 Santhosh Raju -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "netbsd/NetBSDProcessList.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "CRT.h" -#include "Macros.h" -#include "Object.h" -#include "Process.h" -#include "ProcessList.h" -#include "Settings.h" -#include "XUtils.h" -#include "netbsd/NetBSDProcess.h" - - -static long fscale; -static int pageSize; -static int pageSizeKB; - -static const struct { - const char* name; - long int scale; -} freqSysctls[] = { - { "machdep.est.frequency.current", 1 }, - { "machdep.powernow.frequency.current", 1 }, - { "machdep.intrepid.frequency.current", 1 }, - { "machdep.loongson.frequency.current", 1 }, - { "machdep.cpu.frequency.current", 1 }, - { "machdep.frequency.current", 1 }, - { "machdep.tsc_freq", 1000000 }, -}; - -static void NetBSDProcessList_updateCPUcount(ProcessList* super) { - NetBSDProcessList* opl = (NetBSDProcessList*) super; - - // Definitions for sysctl(3), cf. https://nxr.netbsd.org/xref/src/sys/sys/sysctl.h#813 - const int mib_ncpu_existing[] = { CTL_HW, HW_NCPU }; // Number of existing CPUs - const int mib_ncpu_online[] = { CTL_HW, HW_NCPUONLINE }; // Number of online/active CPUs - - int r; - unsigned int value; - size_t size; - - bool change = false; - - // Query the number of active/online CPUs. - size = sizeof(value); - r = sysctl(mib_ncpu_online, 2, &value, &size, NULL, 0); - if (r < 0 || value < 1) { - value = 1; - } - - if (value != super->activeCPUs) { - super->activeCPUs = value; - change = true; - } - - // Query the total number of CPUs. - size = sizeof(value); - r = sysctl(mib_ncpu_existing, 2, &value, &size, NULL, 0); - if (r < 0 || value < 1) { - value = super->activeCPUs; - } - - if (value != super->existingCPUs) { - opl->cpuData = xReallocArray(opl->cpuData, value + 1, sizeof(CPUData)); - super->existingCPUs = value; - change = true; - } - - // Reset CPU stats when number of online/existing CPU cores changed - if (change) { - CPUData* dAvg = &opl->cpuData[0]; - memset(dAvg, '\0', sizeof(CPUData)); - dAvg->totalTime = 1; - dAvg->totalPeriod = 1; - - for (unsigned int i = 0; i < super->existingCPUs; i++) { - CPUData* d = &opl->cpuData[i + 1]; - memset(d, '\0', sizeof(CPUData)); - d->totalTime = 1; - d->totalPeriod = 1; - } - } -} - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId) { - const int fmib[] = { CTL_KERN, KERN_FSCALE }; - size_t size; - char errbuf[_POSIX2_LINE_MAX]; - - NetBSDProcessList* npl = xCalloc(1, sizeof(NetBSDProcessList)); - ProcessList* pl = (ProcessList*) npl; - ProcessList_init(pl, Class(NetBSDProcess), usersTable, dynamicMeters, dynamicColumns, pidMatchList, userId); - - NetBSDProcessList_updateCPUcount(pl); - - size = sizeof(fscale); - if (sysctl(fmib, 2, &fscale, &size, NULL, 0) < 0) { - CRT_fatalError("fscale sysctl call failed"); - } - - if ((pageSize = sysconf(_SC_PAGESIZE)) == -1) - CRT_fatalError("pagesize sysconf call failed"); - pageSizeKB = pageSize / ONE_K; - - npl->kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf); - if (npl->kd == NULL) { - CRT_fatalError("kvm_openfiles() failed"); - } - - return pl; -} - -void ProcessList_delete(ProcessList* this) { - NetBSDProcessList* npl = (NetBSDProcessList*) this; - - if (npl->kd) { - kvm_close(npl->kd); - } - - free(npl->cpuData); - - ProcessList_done(this); - free(this); -} - -static void NetBSDProcessList_scanMemoryInfo(ProcessList* pl) { - static int uvmexp_mib[] = {CTL_VM, VM_UVMEXP2}; - struct uvmexp_sysctl uvmexp; - size_t size_uvmexp = sizeof(uvmexp); - - if (sysctl(uvmexp_mib, 2, &uvmexp, &size_uvmexp, NULL, 0) < 0) { - CRT_fatalError("uvmexp sysctl call failed"); - } - - pl->totalMem = uvmexp.npages * pageSizeKB; - pl->buffersMem = 0; - pl->cachedMem = (uvmexp.filepages + uvmexp.execpages) * pageSizeKB; - pl->usedMem = (uvmexp.active + uvmexp.wired) * pageSizeKB; - pl->totalSwap = uvmexp.swpages * pageSizeKB; - pl->usedSwap = uvmexp.swpginuse * pageSizeKB; -} - -static void NetBSDProcessList_updateExe(const struct kinfo_proc2* kproc, Process* proc) { - const int mib[] = { CTL_KERN, KERN_PROC_ARGS, kproc->p_pid, KERN_PROC_PATHNAME }; - char buffer[2048]; - size_t size = sizeof(buffer); - if (sysctl(mib, 4, buffer, &size, NULL, 0) != 0) { - Process_updateExe(proc, NULL); - return; - } - - /* Kernel threads return an empty buffer */ - if (buffer[0] == '\0') { - Process_updateExe(proc, NULL); - return; - } - - Process_updateExe(proc, buffer); -} - -static void NetBSDProcessList_updateCwd(const struct kinfo_proc2* kproc, Process* proc) { - const int mib[] = { CTL_KERN, KERN_PROC_ARGS, kproc->p_pid, KERN_PROC_CWD }; - char buffer[2048]; - size_t size = sizeof(buffer); - if (sysctl(mib, 4, buffer, &size, NULL, 0) != 0) { - free(proc->procCwd); - proc->procCwd = NULL; - return; - } - - /* Kernel threads return an empty buffer */ - if (buffer[0] == '\0') { - free(proc->procCwd); - proc->procCwd = NULL; - return; - } - - free_and_xStrdup(&proc->procCwd, buffer); -} - -static void NetBSDProcessList_updateProcessName(kvm_t* kd, const struct kinfo_proc2* kproc, Process* proc) { - Process_updateComm(proc, kproc->p_comm); - - /* - * Like NetBSD's top(1), we try to fall back to the command name - * (argv[0]) if we fail to construct the full command. - */ - char** arg = kvm_getargv2(kd, kproc, 500); - if (arg == NULL || *arg == NULL) { - Process_updateCmdline(proc, kproc->p_comm, 0, strlen(kproc->p_comm)); - return; - } - - size_t len = 0; - for (int i = 0; arg[i] != NULL; i++) { - len += strlen(arg[i]) + 1; /* room for arg and trailing space or NUL */ - } - - /* don't use xMalloc here - we want to handle huge argv's gracefully */ - char* s; - if ((s = malloc(len)) == NULL) { - Process_updateCmdline(proc, kproc->p_comm, 0, strlen(kproc->p_comm)); - return; - } - - *s = '\0'; - - int start = 0; - int end = 0; - for (int i = 0; arg[i] != NULL; i++) { - size_t n = strlcat(s, arg[i], len); - if (i == 0) { - end = MINIMUM(n, len - 1); - /* check if cmdline ended earlier, e.g 'kdeinit5: Running...' */ - for (int j = end; j > 0; j--) { - if (arg[0][j] == ' ' && arg[0][j - 1] != '\\') { - end = (arg[0][j - 1] == ':') ? (j - 1) : j; - } - } - } - /* the trailing space should get truncated anyway */ - strlcat(s, " ", len); - } - - Process_updateCmdline(proc, s, start, end); - - free(s); -} - -/* - * Borrowed with modifications from NetBSD's top(1). - */ -static double getpcpu(const struct kinfo_proc2* kp) { - if (fscale == 0) - return 0.0; - - return 100.0 * (double)kp->p_pctcpu / fscale; -} - -static void NetBSDProcessList_scanProcs(NetBSDProcessList* this) { - const Settings* settings = this->super.settings; - bool hideKernelThreads = settings->hideKernelThreads; - bool hideUserlandThreads = settings->hideUserlandThreads; - int count = 0; - - const struct kinfo_proc2* kprocs = kvm_getproc2(this->kd, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc2), &count); - - for (int i = 0; i < count; i++) { - const struct kinfo_proc2* kproc = &kprocs[i]; - - bool preExisting = false; - Process* proc = ProcessList_getProcess(&this->super, kproc->p_pid, &preExisting, NetBSDProcess_new); - - proc->show = ! ((hideKernelThreads && Process_isKernelThread(proc)) || (hideUserlandThreads && Process_isUserlandThread(proc))); - - if (!preExisting) { - proc->pid = kproc->p_pid; - proc->ppid = kproc->p_ppid; - proc->tpgid = kproc->p_tpgid; - proc->tgid = kproc->p_pid; - proc->session = kproc->p_sid; - proc->pgrp = kproc->p__pgid; - proc->isKernelThread = !!(kproc->p_flag & P_SYSTEM); - proc->isUserlandThread = proc->pid != proc->tgid; - proc->starttime_ctime = kproc->p_ustart_sec; - Process_fillStarttimeBuffer(proc); - ProcessList_add(&this->super, proc); - - proc->tty_nr = kproc->p_tdev; - const char* name = ((dev_t)kproc->p_tdev != KERN_PROC_TTY_NODEV) ? devname(kproc->p_tdev, S_IFCHR) : NULL; - if (!name) { - free(proc->tty_name); - proc->tty_name = NULL; - } else { - free_and_xStrdup(&proc->tty_name, name); - } - - NetBSDProcessList_updateExe(kproc, proc); - NetBSDProcessList_updateProcessName(this->kd, kproc, proc); - } else { - if (settings->updateProcessNames) { - NetBSDProcessList_updateProcessName(this->kd, kproc, proc); - } - } - - if (settings->ss->flags & PROCESS_FLAG_CWD) { - NetBSDProcessList_updateCwd(kproc, proc); - } - - if (proc->st_uid != kproc->p_uid) { - proc->st_uid = kproc->p_uid; - proc->user = UsersTable_getRef(this->super.usersTable, proc->st_uid); - } - - proc->m_virt = kproc->p_vm_vsize; - proc->m_resident = kproc->p_vm_rssize; - - proc->percent_mem = (proc->m_resident * pageSizeKB) / (double)(this->super.totalMem) * 100.0; - proc->percent_cpu = CLAMP(getpcpu(kproc), 0.0, this->super.activeCPUs * 100.0); - Process_updateCPUFieldWidths(proc->percent_cpu); - - proc->nlwp = kproc->p_nlwps; - proc->nice = kproc->p_nice - 20; - proc->time = 100 * (kproc->p_rtime_sec + ((kproc->p_rtime_usec + 500000) / 1000000)); - proc->priority = kproc->p_priority - PZERO; - proc->processor = kproc->p_cpuid; - proc->minflt = kproc->p_uru_minflt; - proc->majflt = kproc->p_uru_majflt; - - int nlwps = 0; - const struct kinfo_lwp* klwps = kvm_getlwps(this->kd, kproc->p_pid, kproc->p_paddr, sizeof(struct kinfo_lwp), &nlwps); - - /* TODO: According to the link below, SDYING should be a regarded state */ - /* Taken from: https://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/sys/sys/proc.h */ - switch (kproc->p_realstat) { - case SIDL: proc->state = IDLE; break; - case SACTIVE: - // We only consider the first LWP with a one of the below states. - for (int j = 0; j < nlwps; j++) { - if (klwps) { - switch (klwps[j].l_stat) { - case LSONPROC: proc->state = RUNNING; break; - case LSRUN: proc->state = RUNNABLE; break; - case LSSLEEP: proc->state = SLEEPING; break; - case LSSTOP: proc->state = STOPPED; break; - default: proc->state = UNKNOWN; - } - if (proc->state != UNKNOWN) - break; - } else { - proc->state = UNKNOWN; - break; - } - } - break; - case SSTOP: proc->state = STOPPED; break; - case SZOMB: proc->state = ZOMBIE; break; - case SDEAD: proc->state = DEFUNCT; break; - default: proc->state = UNKNOWN; - } - - if (Process_isKernelThread(proc)) { - this->super.kernelThreads++; - } else if (Process_isUserlandThread(proc)) { - this->super.userlandThreads++; - } - - this->super.totalTasks++; - if (proc->state == RUNNING) { - this->super.runningTasks++; - } - proc->updated = true; - } -} - -static void getKernelCPUTimes(int cpuId, u_int64_t* times) { - const int mib[] = { CTL_KERN, KERN_CP_TIME, cpuId }; - size_t length = sizeof(*times) * CPUSTATES; - if (sysctl(mib, 3, times, &length, NULL, 0) == -1 || length != sizeof(*times) * CPUSTATES) { - CRT_fatalError("sysctl kern.cp_time2 failed"); - } -} - -static void kernelCPUTimesToHtop(const u_int64_t* times, CPUData* cpu) { - unsigned long long totalTime = 0; - for (int i = 0; i < CPUSTATES; i++) { - totalTime += times[i]; - } - - unsigned long long sysAllTime = times[CP_INTR] + times[CP_SYS]; - - cpu->totalPeriod = saturatingSub(totalTime, cpu->totalTime); - cpu->userPeriod = saturatingSub(times[CP_USER], cpu->userTime); - cpu->nicePeriod = saturatingSub(times[CP_NICE], cpu->niceTime); - cpu->sysPeriod = saturatingSub(times[CP_SYS], cpu->sysTime); - cpu->sysAllPeriod = saturatingSub(sysAllTime, cpu->sysAllTime); - cpu->intrPeriod = saturatingSub(times[CP_INTR], cpu->intrTime); - cpu->idlePeriod = saturatingSub(times[CP_IDLE], cpu->idleTime); - - cpu->totalTime = totalTime; - cpu->userTime = times[CP_USER]; - cpu->niceTime = times[CP_NICE]; - cpu->sysTime = times[CP_SYS]; - cpu->sysAllTime = sysAllTime; - cpu->intrTime = times[CP_INTR]; - cpu->idleTime = times[CP_IDLE]; -} - -static void NetBSDProcessList_scanCPUTime(NetBSDProcessList* this) { - u_int64_t kernelTimes[CPUSTATES] = {0}; - u_int64_t avg[CPUSTATES] = {0}; - - for (unsigned int i = 0; i < this->super.existingCPUs; i++) { - getKernelCPUTimes(i, kernelTimes); - CPUData* cpu = &this->cpuData[i + 1]; - kernelCPUTimesToHtop(kernelTimes, cpu); - - avg[CP_USER] += cpu->userTime; - avg[CP_NICE] += cpu->niceTime; - avg[CP_SYS] += cpu->sysTime; - avg[CP_INTR] += cpu->intrTime; - avg[CP_IDLE] += cpu->idleTime; - } - - for (int i = 0; i < CPUSTATES; i++) { - avg[i] /= this->super.activeCPUs; - } - - kernelCPUTimesToHtop(avg, &this->cpuData[0]); -} - -static void NetBSDProcessList_scanCPUFrequency(NetBSDProcessList* this) { - unsigned int cpus = this->super.existingCPUs; - bool match = false; - char name[64]; - long int freq = 0; - size_t freqSize; - - for (unsigned int i = 0; i < cpus; i++) { - this->cpuData[i + 1].frequency = NAN; - } - - /* newer hardware supports per-core frequency, for e.g. ARM big.LITTLE */ - for (unsigned int i = 0; i < cpus; i++) { - xSnprintf(name, sizeof(name), "machdep.cpufreq.cpu%u.current", i); - freqSize = sizeof(freq); - if (sysctlbyname(name, &freq, &freqSize, NULL, 0) != -1) { - this->cpuData[i + 1].frequency = freq; /* already in MHz */ - match = true; - } - } - - if (match) { - return; - } - - /* - * Iterate through legacy sysctl nodes for single-core frequency until - * we find a match... - */ - for (size_t i = 0; i < ARRAYSIZE(freqSysctls); i++) { - freqSize = sizeof(freq); - if (sysctlbyname(freqSysctls[i].name, &freq, &freqSize, NULL, 0) != -1) { - freq /= freqSysctls[i].scale; /* scale to MHz */ - match = true; - break; - } - } - - if (match) { - for (unsigned int i = 0; i < cpus; i++) { - this->cpuData[i + 1].frequency = freq; - } - } -} - -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { - NetBSDProcessList* npl = (NetBSDProcessList*) super; - - NetBSDProcessList_scanMemoryInfo(super); - NetBSDProcessList_scanCPUTime(npl); - - if (super->settings->showCPUFrequency) { - NetBSDProcessList_scanCPUFrequency(npl); - } - - // in pause mode only gather global data for meters (CPU/memory/...) - if (pauseProcessUpdate) { - return; - } - - NetBSDProcessList_scanProcs(npl); -} - -bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id) { - assert(id < super->existingCPUs); - - // TODO: Support detecting online / offline CPUs. - return true; -} diff --git a/fedora/.local/bin/htop-vim/netbsd/NetBSDProcessList.h b/fedora/.local/bin/htop-vim/netbsd/NetBSDProcessList.h deleted file mode 100644 index d228f48..0000000 --- a/fedora/.local/bin/htop-vim/netbsd/NetBSDProcessList.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef HEADER_NetBSDProcessList -#define HEADER_NetBSDProcessList -/* -htop - NetBSDProcessList.h -(C) 2014 Hisham H. Muhammad -(C) 2015 Michael McConville -(C) 2021 Santhosh Raju -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include -#include - -#include "Hashtable.h" -#include "ProcessList.h" -#include "UsersTable.h" - - -typedef struct CPUData_ { - unsigned long long int totalTime; - unsigned long long int userTime; - unsigned long long int niceTime; - unsigned long long int sysTime; - unsigned long long int sysAllTime; - unsigned long long int spinTime; - unsigned long long int intrTime; - unsigned long long int idleTime; - - unsigned long long int totalPeriod; - unsigned long long int userPeriod; - unsigned long long int nicePeriod; - unsigned long long int sysPeriod; - unsigned long long int sysAllPeriod; - unsigned long long int spinPeriod; - unsigned long long int intrPeriod; - unsigned long long int idlePeriod; - - double frequency; -} CPUData; - -typedef struct NetBSDProcessList_ { - ProcessList super; - kvm_t* kd; - - CPUData* cpuData; -} NetBSDProcessList; - - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId); - -void ProcessList_delete(ProcessList* this); - -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate); - -#endif diff --git a/fedora/.local/bin/htop-vim/netbsd/Platform.c b/fedora/.local/bin/htop-vim/netbsd/Platform.c deleted file mode 100644 index ad6050c..0000000 --- a/fedora/.local/bin/htop-vim/netbsd/Platform.c +++ /dev/null @@ -1,509 +0,0 @@ -/* -htop - netbsd/Platform.c -(C) 2014 Hisham H. Muhammad -(C) 2015 Michael McConville -(C) 2021 Santhosh Raju -(C) 2021 Nia Alarie -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "netbsd/Platform.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "CPUMeter.h" -#include "ClockMeter.h" -#include "DateMeter.h" -#include "DateTimeMeter.h" -#include "HostnameMeter.h" -#include "LoadAverageMeter.h" -#include "Macros.h" -#include "MemoryMeter.h" -#include "MemorySwapMeter.h" -#include "Meter.h" -#include "ProcessList.h" -#include "Settings.h" -#include "SignalsPanel.h" -#include "SwapMeter.h" -#include "SysArchMeter.h" -#include "TasksMeter.h" -#include "UptimeMeter.h" -#include "XUtils.h" -#include "netbsd/NetBSDProcess.h" -#include "netbsd/NetBSDProcessList.h" - -/* - * The older proplib APIs will be deprecated in NetBSD 10, but we still - * want to support the 9.x stable branch. - * - * Create aliases for the newer functions that are missing from 9.x. - */ -#if !__NetBSD_Prereq__(9,99,65) -#define prop_string_equals_string prop_string_equals_cstring -#define prop_number_signed_value prop_number_integer_value -#endif - -const ScreenDefaults Platform_defaultScreens[] = { - { - .name = "Main", - .columns = "PID USER PRIORITY NICE M_VIRT M_RESIDENT STATE PERCENT_CPU PERCENT_MEM TIME Command", - .sortKey = "PERCENT_CPU", - }, -}; - -const unsigned int Platform_numberOfDefaultScreens = ARRAYSIZE(Platform_defaultScreens); - -/* - * See /usr/include/sys/signal.h - */ -const SignalItem Platform_signals[] = { - { .name = " 0 Cancel", .number = 0 }, - { .name = " 1 SIGHUP", .number = 1 }, - { .name = " 2 SIGINT", .number = 2 }, - { .name = " 3 SIGQUIT", .number = 3 }, - { .name = " 4 SIGILL", .number = 4 }, - { .name = " 5 SIGTRAP", .number = 5 }, - { .name = " 6 SIGABRT", .number = 6 }, - { .name = " 6 SIGIOT", .number = 6 }, - { .name = " 7 SIGEMT", .number = 7 }, - { .name = " 8 SIGFPE", .number = 8 }, - { .name = " 9 SIGKILL", .number = 9 }, - { .name = "10 SIGBUS", .number = 10 }, - { .name = "11 SIGSEGV", .number = 11 }, - { .name = "12 SIGSYS", .number = 12 }, - { .name = "13 SIGPIPE", .number = 13 }, - { .name = "14 SIGALRM", .number = 14 }, - { .name = "15 SIGTERM", .number = 15 }, - { .name = "16 SIGURG", .number = 16 }, - { .name = "17 SIGSTOP", .number = 17 }, - { .name = "18 SIGTSTP", .number = 18 }, - { .name = "19 SIGCONT", .number = 19 }, - { .name = "20 SIGCHLD", .number = 20 }, - { .name = "21 SIGTTIN", .number = 21 }, - { .name = "22 SIGTTOU", .number = 22 }, - { .name = "23 SIGIO", .number = 23 }, - { .name = "24 SIGXCPU", .number = 24 }, - { .name = "25 SIGXFSZ", .number = 25 }, - { .name = "26 SIGVTALRM", .number = 26 }, - { .name = "27 SIGPROF", .number = 27 }, - { .name = "28 SIGWINCH", .number = 28 }, - { .name = "29 SIGINFO", .number = 29 }, - { .name = "30 SIGUSR1", .number = 30 }, - { .name = "31 SIGUSR2", .number = 31 }, - { .name = "32 SIGPWR", .number = 32 }, - { .name = "33 SIGRTMIN", .number = 33 }, - { .name = "34 SIGRTMIN+1", .number = 34 }, - { .name = "35 SIGRTMIN+2", .number = 35 }, - { .name = "36 SIGRTMIN+3", .number = 36 }, - { .name = "37 SIGRTMIN+4", .number = 37 }, - { .name = "38 SIGRTMIN+5", .number = 38 }, - { .name = "39 SIGRTMIN+6", .number = 39 }, - { .name = "40 SIGRTMIN+7", .number = 40 }, - { .name = "41 SIGRTMIN+8", .number = 41 }, - { .name = "42 SIGRTMIN+9", .number = 42 }, - { .name = "43 SIGRTMIN+10", .number = 43 }, - { .name = "44 SIGRTMIN+11", .number = 44 }, - { .name = "45 SIGRTMIN+12", .number = 45 }, - { .name = "46 SIGRTMIN+13", .number = 46 }, - { .name = "47 SIGRTMIN+14", .number = 47 }, - { .name = "48 SIGRTMIN+15", .number = 48 }, - { .name = "49 SIGRTMIN+16", .number = 49 }, - { .name = "50 SIGRTMIN+17", .number = 50 }, - { .name = "51 SIGRTMIN+18", .number = 51 }, - { .name = "52 SIGRTMIN+19", .number = 52 }, - { .name = "53 SIGRTMIN+20", .number = 53 }, - { .name = "54 SIGRTMIN+21", .number = 54 }, - { .name = "55 SIGRTMIN+22", .number = 55 }, - { .name = "56 SIGRTMIN+23", .number = 56 }, - { .name = "57 SIGRTMIN+24", .number = 57 }, - { .name = "58 SIGRTMIN+25", .number = 58 }, - { .name = "59 SIGRTMIN+26", .number = 59 }, - { .name = "60 SIGRTMIN+27", .number = 60 }, - { .name = "61 SIGRTMIN+28", .number = 61 }, - { .name = "62 SIGRTMIN+29", .number = 62 }, - { .name = "63 SIGRTMAX", .number = 63 }, -}; - -const unsigned int Platform_numberOfSignals = ARRAYSIZE(Platform_signals); - -const MeterClass* const Platform_meterTypes[] = { - &CPUMeter_class, - &ClockMeter_class, - &DateMeter_class, - &DateTimeMeter_class, - &LoadAverageMeter_class, - &LoadMeter_class, - &MemoryMeter_class, - &SwapMeter_class, - &MemorySwapMeter_class, - &TasksMeter_class, - &UptimeMeter_class, - &BatteryMeter_class, - &HostnameMeter_class, - &SysArchMeter_class, - &AllCPUsMeter_class, - &AllCPUs2Meter_class, - &AllCPUs4Meter_class, - &AllCPUs8Meter_class, - &LeftCPUsMeter_class, - &RightCPUsMeter_class, - &LeftCPUs2Meter_class, - &RightCPUs2Meter_class, - &LeftCPUs4Meter_class, - &RightCPUs4Meter_class, - &LeftCPUs8Meter_class, - &RightCPUs8Meter_class, - &BlankMeter_class, - &DiskIOMeter_class, - &NetworkIOMeter_class, - NULL -}; - -bool Platform_init(void) { - /* no platform-specific setup needed */ - return true; -} - -void Platform_done(void) { - /* no platform-specific cleanup needed */ -} - -void Platform_setBindings(Htop_Action* keys) { - /* no platform-specific key bindings */ - (void) keys; -} - -int Platform_getUptime(void) { - struct timeval bootTime, currTime; - const int mib[2] = { CTL_KERN, KERN_BOOTTIME }; - size_t size = sizeof(bootTime); - - int err = sysctl(mib, 2, &bootTime, &size, NULL, 0); - if (err) { - return -1; - } - gettimeofday(&currTime, NULL); - - return (int) difftime(currTime.tv_sec, bootTime.tv_sec); -} - -void Platform_getLoadAverage(double* one, double* five, double* fifteen) { - struct loadavg loadAverage; - const int mib[2] = { CTL_VM, VM_LOADAVG }; - size_t size = sizeof(loadAverage); - - int err = sysctl(mib, 2, &loadAverage, &size, NULL, 0); - if (err) { - *one = 0; - *five = 0; - *fifteen = 0; - return; - } - *one = (double) loadAverage.ldavg[0] / loadAverage.fscale; - *five = (double) loadAverage.ldavg[1] / loadAverage.fscale; - *fifteen = (double) loadAverage.ldavg[2] / loadAverage.fscale; -} - -int Platform_getMaxPid(void) { - // https://nxr.netbsd.org/xref/src/sys/sys/ansi.h#__pid_t - // pid is assigned as a 32bit Integer. - return INT32_MAX; -} - -double Platform_setCPUValues(Meter* this, int cpu) { - const NetBSDProcessList* npl = (const NetBSDProcessList*) this->pl; - const CPUData* cpuData = &npl->cpuData[cpu]; - double total = cpuData->totalPeriod == 0 ? 1 : cpuData->totalPeriod; - double totalPercent; - double* v = this->values; - - v[CPU_METER_NICE] = cpuData->nicePeriod / total * 100.0; - v[CPU_METER_NORMAL] = cpuData->userPeriod / total * 100.0; - if (this->pl->settings->detailedCPUTime) { - v[CPU_METER_KERNEL] = cpuData->sysPeriod / total * 100.0; - v[CPU_METER_IRQ] = cpuData->intrPeriod / total * 100.0; - v[CPU_METER_SOFTIRQ] = 0.0; - v[CPU_METER_STEAL] = 0.0; - v[CPU_METER_GUEST] = 0.0; - v[CPU_METER_IOWAIT] = 0.0; - v[CPU_METER_FREQUENCY] = NAN; - this->curItems = 8; - totalPercent = v[0] + v[1] + v[2] + v[3]; - } else { - v[2] = cpuData->sysAllPeriod / total * 100.0; - v[3] = 0.0; // No steal nor guest on NetBSD - totalPercent = v[0] + v[1] + v[2]; - this->curItems = 4; - } - - totalPercent = CLAMP(totalPercent, 0.0, 100.0); - - v[CPU_METER_FREQUENCY] = cpuData->frequency; - v[CPU_METER_TEMPERATURE] = NAN; - - return totalPercent; -} - -void Platform_setMemoryValues(Meter* this) { - const ProcessList* pl = this->pl; - this->total = pl->totalMem; - this->values[MEMORY_METER_USED] = pl->usedMem; - this->values[MEMORY_METER_BUFFERS] = pl->buffersMem; - // this->values[MEMORY_METER_SHARED] = "shared memory, like tmpfs and shm" - this->values[MEMORY_METER_CACHE] = pl->cachedMem; - // this->values[MEMORY_METER_AVAILABLE] = "available memory" -} - -void Platform_setSwapValues(Meter* this) { - const ProcessList* pl = this->pl; - this->total = pl->totalSwap; - this->values[SWAP_METER_USED] = pl->usedSwap; - this->values[SWAP_METER_CACHE] = NAN; -} - -char* Platform_getProcessEnv(pid_t pid) { - char errbuf[_POSIX2_LINE_MAX]; - char* env; - char** ptr; - int count; - kvm_t* kt; - const struct kinfo_proc2* kproc; - size_t capacity = 4096, size = 0; - - if ((kt = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf)) == NULL) { - return NULL; - } - - if ((kproc = kvm_getproc2(kt, KERN_PROC_PID, pid, sizeof(struct kinfo_proc2), &count)) == NULL) { - (void) kvm_close(kt); - return NULL; - } - - if ((ptr = kvm_getenvv2(kt, kproc, 0)) == NULL) { - (void) kvm_close(kt); - return NULL; - } - - env = xMalloc(capacity); - for (char** p = ptr; *p; p++) { - size_t len = strlen(*p) + 1; - - while (size + len > capacity) { - if (capacity > (SIZE_MAX / 2)) { - free(env); - env = NULL; - goto end; - } - - capacity *= 2; - env = xRealloc(env, capacity); - } - - String_safeStrncpy(env + size, *p, len); - size += len; - } - - if (size < 2 || env[size - 1] || env[size - 2]) { - if (size + 2 < capacity) - env = xRealloc(env, capacity + 2); - env[size] = 0; - env[size + 1] = 0; - } - -end: - (void) kvm_close(kt); - return env; -} - -FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) { - (void)pid; - return NULL; -} - -bool Platform_getDiskIO(DiskIOData* data) { - const int mib[] = { CTL_HW, HW_IOSTATS, sizeof(struct io_sysctl) }; - struct io_sysctl* iostats = NULL; - size_t size = 0; - - for (int retry = 3; retry > 0; retry--) { - /* get the size of the IO statistic array */ - if (sysctl(mib, __arraycount(mib), iostats, &size, NULL, 0) < 0) - CRT_fatalError("Unable to get size of io_sysctl"); - - if (size == 0) { - free(iostats); - return false; - } - - iostats = xRealloc(iostats, size); - - errno = 0; - - if (sysctl(mib, __arraycount(mib), iostats, &size, NULL, 0) == 0) - break; - - if (errno != ENOMEM) - CRT_fatalError("Unable to get disk IO statistics"); - } - - if (errno == ENOMEM) - CRT_fatalError("Unable to get disk IO statistics"); - - uint64_t bytesReadSum = 0; - uint64_t bytesWriteSum = 0; - uint64_t busyTimeSum = 0; - - for (size_t i = 0, count = size / sizeof(struct io_sysctl); i < count; i++) { - /* ignore NFS activity */ - if (iostats[i].type != IOSTAT_DISK) - continue; - - bytesReadSum += iostats[i].rbytes; - bytesWriteSum += iostats[i].wbytes; - busyTimeSum += iostats[i].busysum_usec; - } - - data->totalBytesRead = bytesReadSum; - data->totalBytesWritten = bytesWriteSum; - data->totalMsTimeSpend = busyTimeSum / 1000; - - free(iostats); - return true; -} - -bool Platform_getNetworkIO(NetworkIOData* data) { - struct ifaddrs* ifaddrs = NULL; - - if (getifaddrs(&ifaddrs) != 0) - return false; - - for (const struct ifaddrs* ifa = ifaddrs; ifa; ifa = ifa->ifa_next) { - if (!ifa->ifa_addr) - continue; - if (ifa->ifa_addr->sa_family != AF_LINK) - continue; - if (ifa->ifa_flags & IFF_LOOPBACK) - continue; - - const struct if_data* ifd = (const struct if_data *)ifa->ifa_data; - - data->bytesReceived += ifd->ifi_ibytes; - data->packetsReceived += ifd->ifi_ipackets; - data->bytesTransmitted += ifd->ifi_obytes; - data->packetsTransmitted += ifd->ifi_opackets; - } - - freeifaddrs(ifaddrs); - return true; -} - -void Platform_getBattery(double* percent, ACPresence* isOnAC) { - prop_dictionary_t dict, fields, props; - prop_object_t device, class; - - intmax_t totalCharge = 0; - intmax_t totalCapacity = 0; - - *percent = NAN; - *isOnAC = AC_ERROR; - - int fd = open(_PATH_SYSMON, O_RDONLY); - if (fd == -1) - goto error; - - if (prop_dictionary_recv_ioctl(fd, ENVSYS_GETDICTIONARY, &dict) != 0) - goto error; - - prop_object_iterator_t devIter = prop_dictionary_iterator(dict); - if (devIter == NULL) - goto error; - - while ((device = prop_object_iterator_next(devIter)) != NULL) { - prop_object_t fieldsArray = prop_dictionary_get_keysym(dict, device); - if (fieldsArray == NULL) - goto error; - - prop_object_iterator_t fieldsIter = prop_array_iterator(fieldsArray); - if (fieldsIter == NULL) - goto error; - - bool isACAdapter = false; - bool isBattery = false; - - /* only assume battery is not present if explicitly stated */ - intmax_t isPresent = 1; - intmax_t isConnected = 0; - intmax_t curCharge = 0; - intmax_t maxCharge = 0; - - while ((fields = prop_object_iterator_next(fieldsIter)) != NULL) { - props = prop_dictionary_get(fields, "device-properties"); - if (props != NULL) { - class = prop_dictionary_get(props, "device-class"); - - if (prop_string_equals_string(class, "ac-adapter")) { - isACAdapter = true; - } else if (prop_string_equals_string(class, "battery")) { - isBattery = true; - } - continue; - } - - prop_object_t curValue = prop_dictionary_get(fields, "cur-value"); - prop_object_t maxValue = prop_dictionary_get(fields, "max-value"); - prop_object_t descField = prop_dictionary_get(fields, "description"); - - if (descField == NULL || curValue == NULL) - continue; - - if (prop_string_equals_string(descField, "connected")) { - isConnected = prop_number_signed_value(curValue); - } else if (prop_string_equals_string(descField, "present")) { - isPresent = prop_number_signed_value(curValue); - } else if (prop_string_equals_string(descField, "charge")) { - if (maxValue == NULL) - continue; - curCharge = prop_number_signed_value(curValue); - maxCharge = prop_number_signed_value(maxValue); - } - } - - if (isBattery && isPresent) { - totalCharge += curCharge; - totalCapacity += maxCharge; - } - - if (isACAdapter && *isOnAC != AC_PRESENT) { - *isOnAC = isConnected ? AC_PRESENT : AC_ABSENT; - } - } - - *percent = ((double)totalCharge / (double)totalCapacity) * 100.0; - -error: - if (fd != -1) - close(fd); -} diff --git a/fedora/.local/bin/htop-vim/netbsd/Platform.h b/fedora/.local/bin/htop-vim/netbsd/Platform.h deleted file mode 100644 index 0e53b45..0000000 --- a/fedora/.local/bin/htop-vim/netbsd/Platform.h +++ /dev/null @@ -1,124 +0,0 @@ -#ifndef HEADER_Platform -#define HEADER_Platform -/* -htop - netbsd/Platform.h -(C) 2014 Hisham H. Muhammad -(C) 2015 Michael McConville -(C) 2021 Santhosh Raju -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include -#include -#include -#include - -#include "Action.h" -#include "BatteryMeter.h" -#include "DiskIOMeter.h" -#include "Meter.h" -#include "NetworkIOMeter.h" -#include "Process.h" -#include "ProcessLocksScreen.h" -#include "SignalsPanel.h" -#include "CommandLine.h" -#include "generic/gettime.h" -#include "generic/hostname.h" -#include "generic/uname.h" - - -/* There are no Long Options for NetBSD as of now. */ -#define PLATFORM_LONG_OPTIONS \ - // End of list - -extern const ScreenDefaults Platform_defaultScreens[]; - -extern const unsigned int Platform_numberOfDefaultScreens; - -/* see /usr/include/sys/signal.h */ -extern const SignalItem Platform_signals[]; - -extern const unsigned int Platform_numberOfSignals; - -extern const MeterClass* const Platform_meterTypes[]; - -bool Platform_init(void); - -void Platform_done(void); - -void Platform_setBindings(Htop_Action* keys); - -int Platform_getUptime(void); - -void Platform_getLoadAverage(double* one, double* five, double* fifteen); - -int Platform_getMaxPid(void); - -double Platform_setCPUValues(Meter* this, int cpu); - -void Platform_setMemoryValues(Meter* this); - -void Platform_setSwapValues(Meter* this); - -char* Platform_getProcessEnv(pid_t pid); - -FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid); - -bool Platform_getDiskIO(DiskIOData* data); - -bool Platform_getNetworkIO(NetworkIOData* data); - -void Platform_getBattery(double* percent, ACPresence* isOnAC); - -static inline void Platform_getHostname(char* buffer, size_t size) { - Generic_hostname(buffer, size); -} - -static inline void Platform_getRelease(char** string) { - *string = Generic_uname(); -} - -static inline void Platform_longOptionsUsage(ATTR_UNUSED const char* name) { } - -static inline CommandLineStatus Platform_getLongOption(ATTR_UNUSED int opt, ATTR_UNUSED int argc, ATTR_UNUSED char** argv) { - return STATUS_ERROR_EXIT; -} - -static inline void Platform_gettime_realtime(struct timeval* tv, uint64_t* msec) { - Generic_gettime_realtime(tv, msec); -} - -static inline void Platform_gettime_monotonic(uint64_t* msec) { - Generic_gettime_monotonic(msec); -} - -static inline Hashtable* Platform_dynamicMeters(void) { - return NULL; -} - -static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* table) { } - -static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { } - -static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* meter) { } - -static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter* meter, ATTR_UNUSED RichString* out) { } - -static inline Hashtable* Platform_dynamicColumns(void) { - return NULL; -} - -static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* table) { } - -static inline const char* Platform_dynamicColumnInit(ATTR_UNUSED unsigned int key) { - return NULL; -} - -static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Process* proc, ATTR_UNUSED RichString* str, ATTR_UNUSED unsigned int key) { - return false; -} - -#endif diff --git a/fedora/.local/bin/htop-vim/netbsd/ProcessField.h b/fedora/.local/bin/htop-vim/netbsd/ProcessField.h deleted file mode 100644 index 87d4a69..0000000 --- a/fedora/.local/bin/htop-vim/netbsd/ProcessField.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef HEADER_NetBSDProcessField -#define HEADER_NetBSDProcessField -/* -htop - netbsd/ProcessField.h -(C) 2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - - -#define PLATFORM_PROCESS_FIELDS \ - // End of list - - -#endif /* HEADER_NetBSDProcessField */ diff --git a/fedora/.local/bin/htop-vim/netbsd/README.md b/fedora/.local/bin/htop-vim/netbsd/README.md deleted file mode 100644 index ed7be0a..0000000 --- a/fedora/.local/bin/htop-vim/netbsd/README.md +++ /dev/null @@ -1,32 +0,0 @@ -NetBSD support in htop(1) -=== - -This implementation utilizes kvm_getprocs(3), sysctl(3), etc, eliminating the -need for mount_procfs(8) with Linux compatibility enabled. - -The implementation was initially based on the OpenBSD support in htop(1). - -Notes on NetBSD curses ---- - -NetBSD is one of the last operating systems to use and maintain its own -implementation of Curses. - -htop(1) can be compiled against either ncurses or NetBSD's curses(3). -In order for NetBSD's libcurses to be used, htop(1) must be configured with -`--disable-unicode`. This is necessary because htop(1) with Unicode enabled -directly accesses ncurses's cchar_t struct, which has different contents -in NetBSD's curses. - -Versions of libcurses in NetBSD 9 and prior have no mouse support -(this is an ncurses extension). Newer versions contain no-op mouse functions -for compatibility with ncurses. - -What needs improvement ---- - -* Kernel and userspace threads are not displayed or counted - - maybe look at NetBSD top(1). -* Support for compiling using libcurses's Unicode support. -* Support for fstat(1) (view open files, like lsof(8) on Linux). -* Support for ktrace(1) (like strace(1) on Linux). diff --git a/fedora/.local/bin/htop-vim/openbsd/OpenBSDProcess.c b/fedora/.local/bin/htop-vim/openbsd/OpenBSDProcess.c deleted file mode 100644 index c2f2ed4..0000000 --- a/fedora/.local/bin/htop-vim/openbsd/OpenBSDProcess.c +++ /dev/null @@ -1,257 +0,0 @@ -/* -htop - OpenBSDProcess.c -(C) 2015 Hisham H. Muhammad -(C) 2015 Michael McConville -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "openbsd/OpenBSDProcess.h" - -#include - -#include "CRT.h" -#include "Process.h" -#include "RichString.h" -#include "XUtils.h" - - -const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { - [0] = { - .name = "", - .title = NULL, - .description = NULL, - .flags = 0, - }, - [PID] = { - .name = "PID", - .title = "PID", - .description = "Process/thread ID", - .flags = 0, - .pidColumn = true, - }, - [COMM] = { - .name = "Command", - .title = "Command ", - .description = "Command line", - .flags = 0, - }, - [STATE] = { - .name = "STATE", - .title = "S ", - .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging)", - .flags = 0, - }, - [PPID] = { - .name = "PPID", - .title = "PPID", - .description = "Parent process ID", - .flags = 0, - .pidColumn = true, - }, - [PGRP] = { - .name = "PGRP", - .title = "PGRP", - .description = "Process group ID", - .flags = 0, - .pidColumn = true, - }, - [SESSION] = { - .name = "SESSION", - .title = "SESN", - .description = "Process's session ID", - .flags = 0, - .pidColumn = true, - }, - [TTY] = { - .name = "TTY", - .title = "TTY ", - .description = "Controlling terminal", - .flags = 0, - }, - [TPGID] = { - .name = "TPGID", - .title = "TPGID", - .description = "Process ID of the fg process group of the controlling terminal", - .flags = 0, - .pidColumn = true, - }, - [MINFLT] = { - .name = "MINFLT", - .title = " MINFLT ", - .description = "Number of minor faults which have not required loading a memory page from disk", - .flags = 0, - .defaultSortDesc = true, - }, - [MAJFLT] = { - .name = "MAJFLT", - .title = " MAJFLT ", - .description = "Number of major faults which have required loading a memory page from disk", - .flags = 0, - .defaultSortDesc = true, - }, - [PRIORITY] = { - .name = "PRIORITY", - .title = "PRI ", - .description = "Kernel's internal priority for the process", - .flags = 0, - }, - [NICE] = { - .name = "NICE", - .title = " NI ", - .description = "Nice value (the higher the value, the more it lets other processes take priority)", - .flags = 0, - }, - [STARTTIME] = { - .name = "STARTTIME", - .title = "START ", - .description = "Time the process was started", - .flags = 0, - }, - [ELAPSED] = { - .name = "ELAPSED", - .title = "ELAPSED ", - .description = "Time since the process was started", - .flags = 0, - }, - [PROCESSOR] = { - .name = "PROCESSOR", - .title = "CPU ", - .description = "Id of the CPU the process last executed on", - .flags = 0, - }, - [M_VIRT] = { - .name = "M_VIRT", - .title = " VIRT ", - .description = "Total program size in virtual memory", - .flags = 0, - .defaultSortDesc = true, - }, - [M_RESIDENT] = { - .name = "M_RESIDENT", - .title = " RES ", - .description = "Resident set size, size of the text and data sections, plus stack usage", - .flags = 0, - .defaultSortDesc = true, - }, - [ST_UID] = { - .name = "ST_UID", - .title = "UID", - .description = "User ID of the process owner", - .flags = 0, - }, - [PERCENT_CPU] = { - .name = "PERCENT_CPU", - .title = " CPU%", - .description = "Percentage of the CPU time the process used in the last sampling", - .flags = 0, - .defaultSortDesc = true, - .autoWidth = true, - }, - [PERCENT_NORM_CPU] = { - .name = "PERCENT_NORM_CPU", - .title = "NCPU%", - .description = "Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)", - .flags = 0, - .defaultSortDesc = true, - .autoWidth = true, - }, - [PERCENT_MEM] = { - .name = "PERCENT_MEM", - .title = "MEM% ", - .description = "Percentage of the memory the process is using, based on resident memory size", - .flags = 0, - .defaultSortDesc = true, - }, - [USER] = { - .name = "USER", - .title = "USER ", - .description = "Username of the process owner (or user ID if name cannot be determined)", - .flags = 0, - }, - [TIME] = { - .name = "TIME", - .title = " TIME+ ", - .description = "Total time the process has spent in user and system time", - .flags = 0, - .defaultSortDesc = true, - }, - [NLWP] = { - .name = "NLWP", - .title = "NLWP ", - .description = "Number of threads in the process", - .flags = 0, - }, - [TGID] = { - .name = "TGID", - .title = "TGID", - .description = "Thread group ID (i.e. process ID)", - .flags = 0, - .pidColumn = true, - }, - [PROC_COMM] = { - .name = "COMM", - .title = "COMM ", - .description = "comm string of the process", - .flags = 0, - }, - [CWD] = { - .name = "CWD", - .title = "CWD ", - .description = "The current working directory of the process", - .flags = PROCESS_FLAG_CWD, - }, - -}; - -Process* OpenBSDProcess_new(const Settings* settings) { - OpenBSDProcess* this = xCalloc(1, sizeof(OpenBSDProcess)); - Object_setClass(this, Class(OpenBSDProcess)); - Process_init(&this->super, settings); - return &this->super; -} - -void Process_delete(Object* cast) { - OpenBSDProcess* this = (OpenBSDProcess*) cast; - Process_done((Process*)cast); - free(this); -} - -static void OpenBSDProcess_writeField(const Process* this, RichString* str, ProcessField field) { - //const OpenBSDProcess* op = (const OpenBSDProcess*) this; - char buffer[256]; buffer[255] = '\0'; - int attr = CRT_colors[DEFAULT_COLOR]; - //int n = sizeof(buffer) - 1; - switch (field) { - // add OpenBSD-specific fields here - default: - Process_writeField(this, str, field); - return; - } - RichString_appendWide(str, attr, buffer); -} - -static int OpenBSDProcess_compareByKey(const Process* v1, const Process* v2, ProcessField key) { - const OpenBSDProcess* p1 = (const OpenBSDProcess*)v1; - const OpenBSDProcess* p2 = (const OpenBSDProcess*)v2; - - // remove if actually used - (void)p1; (void)p2; - - switch (key) { - // add OpenBSD-specific fields here - default: - return Process_compareByKey_Base(v1, v2, key); - } -} - -const ProcessClass OpenBSDProcess_class = { - .super = { - .extends = Class(Process), - .display = Process_display, - .delete = Process_delete, - .compare = Process_compare - }, - .writeField = OpenBSDProcess_writeField, - .compareByKey = OpenBSDProcess_compareByKey -}; diff --git a/fedora/.local/bin/htop-vim/openbsd/OpenBSDProcess.h b/fedora/.local/bin/htop-vim/openbsd/OpenBSDProcess.h deleted file mode 100644 index 898c537..0000000 --- a/fedora/.local/bin/htop-vim/openbsd/OpenBSDProcess.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef HEADER_OpenBSDProcess -#define HEADER_OpenBSDProcess -/* -htop - OpenBSDProcess.h -(C) 2015 Hisham H. Muhammad -(C) 2015 Michael McConville -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include - -#include "Object.h" -#include "Process.h" -#include "Settings.h" - - -typedef struct OpenBSDProcess_ { - Process super; - - /* 'Kernel virtual addr of u-area' to detect main threads */ - uint64_t addr; -} OpenBSDProcess; - -extern const ProcessClass OpenBSDProcess_class; - -extern const ProcessFieldData Process_fields[LAST_PROCESSFIELD]; - -Process* OpenBSDProcess_new(const Settings* settings); - -void Process_delete(Object* cast); - -#endif diff --git a/fedora/.local/bin/htop-vim/openbsd/OpenBSDProcessList.c b/fedora/.local/bin/htop-vim/openbsd/OpenBSDProcessList.c deleted file mode 100644 index d070e5e..0000000 --- a/fedora/.local/bin/htop-vim/openbsd/OpenBSDProcessList.c +++ /dev/null @@ -1,486 +0,0 @@ -/* -htop - OpenBSDProcessList.c -(C) 2014 Hisham H. Muhammad -(C) 2015 Michael McConville -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "openbsd/OpenBSDProcessList.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "CRT.h" -#include "Macros.h" -#include "Object.h" -#include "Process.h" -#include "ProcessList.h" -#include "Settings.h" -#include "XUtils.h" -#include "openbsd/OpenBSDProcess.h" - - -static long fscale; -static int pageSize; -static int pageSizeKB; - -static void OpenBSDProcessList_updateCPUcount(ProcessList* super) { - OpenBSDProcessList* opl = (OpenBSDProcessList*) super; - const int nmib[] = { CTL_HW, HW_NCPU }; - const int mib[] = { CTL_HW, HW_NCPUONLINE }; - int r; - unsigned int value; - size_t size; - bool change = false; - - size = sizeof(value); - r = sysctl(mib, 2, &value, &size, NULL, 0); - if (r < 0 || value < 1) { - value = 1; - } - - if (value != super->activeCPUs) { - super->activeCPUs = value; - change = true; - } - - size = sizeof(value); - r = sysctl(nmib, 2, &value, &size, NULL, 0); - if (r < 0 || value < 1) { - value = super->activeCPUs; - } - - if (value != super->existingCPUs) { - opl->cpuData = xReallocArray(opl->cpuData, value + 1, sizeof(CPUData)); - super->existingCPUs = value; - change = true; - } - - if (change) { - CPUData* dAvg = &opl->cpuData[0]; - memset(dAvg, '\0', sizeof(CPUData)); - dAvg->totalTime = 1; - dAvg->totalPeriod = 1; - dAvg->online = true; - - for (unsigned int i = 0; i < super->existingCPUs; i++) { - CPUData* d = &opl->cpuData[i + 1]; - memset(d, '\0', sizeof(CPUData)); - d->totalTime = 1; - d->totalPeriod = 1; - - const int ncmib[] = { CTL_KERN, KERN_CPUSTATS, i }; - struct cpustats cpu_stats; - - size = sizeof(cpu_stats); - if (sysctl(ncmib, 3, &cpu_stats, &size, NULL, 0) < 0) { - CRT_fatalError("ncmib sysctl call failed"); - } - d->online = (cpu_stats.cs_flags & CPUSTATS_ONLINE); - } - } -} - - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId) { - const int fmib[] = { CTL_KERN, KERN_FSCALE }; - size_t size; - char errbuf[_POSIX2_LINE_MAX]; - - OpenBSDProcessList* opl = xCalloc(1, sizeof(OpenBSDProcessList)); - ProcessList* pl = (ProcessList*) opl; - ProcessList_init(pl, Class(OpenBSDProcess), usersTable, dynamicMeters, dynamicColumns, pidMatchList, userId); - - OpenBSDProcessList_updateCPUcount(pl); - - size = sizeof(fscale); - if (sysctl(fmib, 2, &fscale, &size, NULL, 0) < 0) { - CRT_fatalError("fscale sysctl call failed"); - } - - if ((pageSize = sysconf(_SC_PAGESIZE)) == -1) - CRT_fatalError("pagesize sysconf call failed"); - pageSizeKB = pageSize / ONE_K; - - opl->kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf); - if (opl->kd == NULL) { - CRT_fatalError("kvm_openfiles() failed"); - } - - opl->cpuSpeed = -1; - - return pl; -} - -void ProcessList_delete(ProcessList* this) { - OpenBSDProcessList* opl = (OpenBSDProcessList*) this; - - if (opl->kd) { - kvm_close(opl->kd); - } - - free(opl->cpuData); - - ProcessList_done(this); - free(this); -} - -static void OpenBSDProcessList_scanMemoryInfo(ProcessList* pl) { - const int uvmexp_mib[] = { CTL_VM, VM_UVMEXP }; - struct uvmexp uvmexp; - size_t size_uvmexp = sizeof(uvmexp); - - if (sysctl(uvmexp_mib, 2, &uvmexp, &size_uvmexp, NULL, 0) < 0) { - CRT_fatalError("uvmexp sysctl call failed"); - } - - pl->totalMem = uvmexp.npages * pageSizeKB; - pl->usedMem = (uvmexp.npages - uvmexp.free - uvmexp.paging) * pageSizeKB; - - // Taken from OpenBSD systat/iostat.c, top/machine.c and uvm_sysctl(9) - const int bcache_mib[] = { CTL_VFS, VFS_GENERIC, VFS_BCACHESTAT }; - struct bcachestats bcstats; - size_t size_bcstats = sizeof(bcstats); - - if (sysctl(bcache_mib, 3, &bcstats, &size_bcstats, NULL, 0) < 0) { - CRT_fatalError("cannot get vfs.bcachestat"); - } - - pl->cachedMem = bcstats.numbufpages * pageSizeKB; - - /* - * Copyright (c) 1994 Thorsten Lockert - * All rights reserved. - * - * Taken almost directly from OpenBSD's top(1) - * - * Originally released under a BSD-3 license - * Modified through htop developers applying GPL-2 - */ - int nswap = swapctl(SWAP_NSWAP, 0, 0); - if (nswap > 0) { - struct swapent swdev[nswap]; - int rnswap = swapctl(SWAP_STATS, swdev, nswap); - - /* Total things up */ - unsigned long long int total = 0, used = 0; - for (int i = 0; i < rnswap; i++) { - if (swdev[i].se_flags & SWF_ENABLE) { - used += (swdev[i].se_inuse / (1024 / DEV_BSIZE)); - total += (swdev[i].se_nblks / (1024 / DEV_BSIZE)); - } - } - - pl->totalSwap = total; - pl->usedSwap = used; - } else { - pl->totalSwap = pl->usedSwap = 0; - } -} - -static void OpenBSDProcessList_updateCwd(const struct kinfo_proc* kproc, Process* proc) { - const int mib[] = { CTL_KERN, KERN_PROC_CWD, kproc->p_pid }; - char buffer[2048]; - size_t size = sizeof(buffer); - if (sysctl(mib, 3, buffer, &size, NULL, 0) != 0) { - free(proc->procCwd); - proc->procCwd = NULL; - return; - } - - /* Kernel threads return an empty buffer */ - if (buffer[0] == '\0') { - free(proc->procCwd); - proc->procCwd = NULL; - return; - } - - free_and_xStrdup(&proc->procCwd, buffer); -} - -static void OpenBSDProcessList_updateProcessName(kvm_t* kd, const struct kinfo_proc* kproc, Process* proc) { - Process_updateComm(proc, kproc->p_comm); - - /* - * Like OpenBSD's top(1), we try to fall back to the command name - * (argv[0]) if we fail to construct the full command. - */ - char** arg = kvm_getargv(kd, kproc, 500); - if (arg == NULL || *arg == NULL) { - Process_updateCmdline(proc, kproc->p_comm, 0, strlen(kproc->p_comm)); - return; - } - - size_t len = 0; - for (int i = 0; arg[i] != NULL; i++) { - len += strlen(arg[i]) + 1; /* room for arg and trailing space or NUL */ - } - - /* don't use xMalloc here - we want to handle huge argv's gracefully */ - char* s; - if ((s = malloc(len)) == NULL) { - Process_updateCmdline(proc, kproc->p_comm, 0, strlen(kproc->p_comm)); - return; - } - - *s = '\0'; - - int start = 0; - int end = 0; - for (int i = 0; arg[i] != NULL; i++) { - size_t n = strlcat(s, arg[i], len); - if (i == 0) { - end = MINIMUM(n, len - 1); - /* check if cmdline ended earlier, e.g 'kdeinit5: Running...' */ - for (int j = end; j > 0; j--) { - if (arg[0][j] == ' ' && arg[0][j - 1] != '\\') { - end = (arg[0][j - 1] == ':') ? (j - 1) : j; - } - } - } - /* the trailing space should get truncated anyway */ - strlcat(s, " ", len); - } - - Process_updateCmdline(proc, s, start, end); - - free(s); -} - -/* - * Taken from OpenBSD's ps(1). - */ -static double getpcpu(const struct kinfo_proc* kp) { - if (fscale == 0) - return 0.0; - - return 100.0 * (double)kp->p_pctcpu / fscale; -} - -static void OpenBSDProcessList_scanProcs(OpenBSDProcessList* this) { - const Settings* settings = this->super.settings; - const bool hideKernelThreads = settings->hideKernelThreads; - const bool hideUserlandThreads = settings->hideUserlandThreads; - int count = 0; - - const struct kinfo_proc* kprocs = kvm_getprocs(this->kd, KERN_PROC_KTHREAD | KERN_PROC_SHOW_THREADS, 0, sizeof(struct kinfo_proc), &count); - - for (int i = 0; i < count; i++) { - const struct kinfo_proc* kproc = &kprocs[i]; - - /* Ignore main threads */ - if (kproc->p_tid != -1) { - Process* containingProcess = ProcessList_findProcess(&this->super, kproc->p_pid); - if (containingProcess) { - if (((OpenBSDProcess*)containingProcess)->addr == kproc->p_addr) - continue; - - containingProcess->nlwp++; - } - } - - bool preExisting = false; - Process* proc = ProcessList_getProcess(&this->super, (kproc->p_tid == -1) ? kproc->p_pid : kproc->p_tid, &preExisting, OpenBSDProcess_new); - OpenBSDProcess* fp = (OpenBSDProcess*) proc; - - if (!preExisting) { - proc->ppid = kproc->p_ppid; - proc->tpgid = kproc->p_tpgid; - proc->tgid = kproc->p_pid; - proc->session = kproc->p_sid; - proc->pgrp = kproc->p__pgid; - proc->isKernelThread = proc->pgrp == 0; - proc->isUserlandThread = kproc->p_tid != -1; - proc->starttime_ctime = kproc->p_ustart_sec; - Process_fillStarttimeBuffer(proc); - ProcessList_add(&this->super, proc); - - OpenBSDProcessList_updateProcessName(this->kd, kproc, proc); - - if (settings->ss->flags & PROCESS_FLAG_CWD) { - OpenBSDProcessList_updateCwd(kproc, proc); - } - - proc->tty_nr = kproc->p_tdev; - const char* name = ((dev_t)kproc->p_tdev != NODEV) ? devname(kproc->p_tdev, S_IFCHR) : NULL; - if (!name || String_eq(name, "??")) { - free(proc->tty_name); - proc->tty_name = NULL; - } else { - free_and_xStrdup(&proc->tty_name, name); - } - } else { - if (settings->updateProcessNames) { - OpenBSDProcessList_updateProcessName(this->kd, kproc, proc); - } - } - - fp->addr = kproc->p_addr; - proc->m_virt = kproc->p_vm_dsize * pageSizeKB; - proc->m_resident = kproc->p_vm_rssize * pageSizeKB; - - proc->percent_mem = proc->m_resident / (float)this->super.totalMem * 100.0F; - proc->percent_cpu = CLAMP(getpcpu(kproc), 0.0F, this->super.activeCPUs * 100.0F); - Process_updateCPUFieldWidths(proc->percent_cpu); - - proc->nice = kproc->p_nice - 20; - proc->time = 100 * (kproc->p_rtime_sec + ((kproc->p_rtime_usec + 500000) / 1000000)); - proc->priority = kproc->p_priority - PZERO; - proc->processor = kproc->p_cpuid; - proc->minflt = kproc->p_uru_minflt; - proc->majflt = kproc->p_uru_majflt; - proc->nlwp = 1; - - if (proc->st_uid != kproc->p_uid) { - proc->st_uid = kproc->p_uid; - proc->user = UsersTable_getRef(this->super.usersTable, proc->st_uid); - } - - /* Taken from: https://github.com/openbsd/src/blob/6a38af0976a6870911f4b2de19d8da28723a5778/sys/sys/proc.h#L420 */ - switch (kproc->p_stat) { - case SIDL: proc->state = IDLE; break; - case SRUN: proc->state = RUNNABLE; break; - case SSLEEP: proc->state = SLEEPING; break; - case SSTOP: proc->state = STOPPED; break; - case SZOMB: proc->state = ZOMBIE; break; - case SDEAD: proc->state = DEFUNCT; break; - case SONPROC: proc->state = RUNNING; break; - default: proc->state = UNKNOWN; - } - - if (Process_isKernelThread(proc)) { - this->super.kernelThreads++; - } else if (Process_isUserlandThread(proc)) { - this->super.userlandThreads++; - } - - this->super.totalTasks++; - if (proc->state == RUNNING) { - this->super.runningTasks++; - } - - proc->show = ! ((hideKernelThreads && Process_isKernelThread(proc)) || (hideUserlandThreads && Process_isUserlandThread(proc))); - proc->updated = true; - } -} - -static void getKernelCPUTimes(unsigned int cpuId, u_int64_t* times) { - const int mib[] = { CTL_KERN, KERN_CPTIME2, cpuId }; - size_t length = sizeof(*times) * CPUSTATES; - if (sysctl(mib, 3, times, &length, NULL, 0) == -1 || length != sizeof(*times) * CPUSTATES) { - CRT_fatalError("sysctl kern.cp_time2 failed"); - } -} - -static void kernelCPUTimesToHtop(const u_int64_t* times, CPUData* cpu) { - unsigned long long totalTime = 0; - for (int i = 0; i < CPUSTATES; i++) { - totalTime += times[i]; - } - - unsigned long long sysAllTime = times[CP_INTR] + times[CP_SYS]; - - // XXX Not sure if CP_SPIN should be added to sysAllTime. - // See https://github.com/openbsd/src/commit/531d8034253fb82282f0f353c086e9ad827e031c - #ifdef CP_SPIN - sysAllTime += times[CP_SPIN]; - #endif - - cpu->totalPeriod = saturatingSub(totalTime, cpu->totalTime); - cpu->userPeriod = saturatingSub(times[CP_USER], cpu->userTime); - cpu->nicePeriod = saturatingSub(times[CP_NICE], cpu->niceTime); - cpu->sysPeriod = saturatingSub(times[CP_SYS], cpu->sysTime); - cpu->sysAllPeriod = saturatingSub(sysAllTime, cpu->sysAllTime); - #ifdef CP_SPIN - cpu->spinPeriod = saturatingSub(times[CP_SPIN], cpu->spinTime); - #endif - cpu->intrPeriod = saturatingSub(times[CP_INTR], cpu->intrTime); - cpu->idlePeriod = saturatingSub(times[CP_IDLE], cpu->idleTime); - - cpu->totalTime = totalTime; - cpu->userTime = times[CP_USER]; - cpu->niceTime = times[CP_NICE]; - cpu->sysTime = times[CP_SYS]; - cpu->sysAllTime = sysAllTime; - #ifdef CP_SPIN - cpu->spinTime = times[CP_SPIN]; - #endif - cpu->intrTime = times[CP_INTR]; - cpu->idleTime = times[CP_IDLE]; -} - -static void OpenBSDProcessList_scanCPUTime(OpenBSDProcessList* this) { - u_int64_t kernelTimes[CPUSTATES] = {0}; - u_int64_t avg[CPUSTATES] = {0}; - - for (unsigned int i = 0; i < this->super.existingCPUs; i++) { - CPUData* cpu = &this->cpuData[i + 1]; - - if (!cpu->online) { - continue; - } - - getKernelCPUTimes(i, kernelTimes); - kernelCPUTimesToHtop(kernelTimes, cpu); - - avg[CP_USER] += cpu->userTime; - avg[CP_NICE] += cpu->niceTime; - avg[CP_SYS] += cpu->sysTime; - #ifdef CP_SPIN - avg[CP_SPIN] += cpu->spinTime; - #endif - avg[CP_INTR] += cpu->intrTime; - avg[CP_IDLE] += cpu->idleTime; - } - - for (int i = 0; i < CPUSTATES; i++) { - avg[i] /= this->super.activeCPUs; - } - - kernelCPUTimesToHtop(avg, &this->cpuData[0]); - - { - const int mib[] = { CTL_HW, HW_CPUSPEED }; - int cpuSpeed; - size_t size = sizeof(cpuSpeed); - if (sysctl(mib, 2, &cpuSpeed, &size, NULL, 0) == -1) { - this->cpuSpeed = -1; - } else { - this->cpuSpeed = cpuSpeed; - } - } -} - -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { - OpenBSDProcessList* opl = (OpenBSDProcessList*) super; - - OpenBSDProcessList_updateCPUcount(super); - OpenBSDProcessList_scanMemoryInfo(super); - OpenBSDProcessList_scanCPUTime(opl); - - // in pause mode only gather global data for meters (CPU/memory/...) - if (pauseProcessUpdate) { - return; - } - - OpenBSDProcessList_scanProcs(opl); -} - -bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id) { - assert(id < super->existingCPUs); - - const OpenBSDProcessList* opl = (const OpenBSDProcessList*) super; - return opl->cpuData[id + 1].online; -} diff --git a/fedora/.local/bin/htop-vim/openbsd/OpenBSDProcessList.h b/fedora/.local/bin/htop-vim/openbsd/OpenBSDProcessList.h deleted file mode 100644 index 89fdb09..0000000 --- a/fedora/.local/bin/htop-vim/openbsd/OpenBSDProcessList.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef HEADER_OpenBSDProcessList -#define HEADER_OpenBSDProcessList -/* -htop - OpenBSDProcessList.h -(C) 2014 Hisham H. Muhammad -(C) 2015 Michael McConville -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include -#include - -#include "Hashtable.h" -#include "ProcessList.h" -#include "UsersTable.h" - - -typedef struct CPUData_ { - unsigned long long int totalTime; - unsigned long long int userTime; - unsigned long long int niceTime; - unsigned long long int sysTime; - unsigned long long int sysAllTime; - unsigned long long int spinTime; - unsigned long long int intrTime; - unsigned long long int idleTime; - - unsigned long long int totalPeriod; - unsigned long long int userPeriod; - unsigned long long int nicePeriod; - unsigned long long int sysPeriod; - unsigned long long int sysAllPeriod; - unsigned long long int spinPeriod; - unsigned long long int intrPeriod; - unsigned long long int idlePeriod; - - bool online; -} CPUData; - -typedef struct OpenBSDProcessList_ { - ProcessList super; - kvm_t* kd; - - CPUData* cpuData; - int cpuSpeed; - -} OpenBSDProcessList; - - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId); - -void ProcessList_delete(ProcessList* this); - -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate); - -bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id); - -#endif diff --git a/fedora/.local/bin/htop-vim/openbsd/Platform.c b/fedora/.local/bin/htop-vim/openbsd/Platform.c deleted file mode 100644 index 1ce5ba1..0000000 --- a/fedora/.local/bin/htop-vim/openbsd/Platform.c +++ /dev/null @@ -1,371 +0,0 @@ -/* -htop - openbsd/Platform.c -(C) 2014 Hisham H. Muhammad -(C) 2015 Michael McConville -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "openbsd/Platform.h" - -#include -#include -#include -#include -#include -#include -#include -#include // needs to be included before for 'struct sigaltstack' -#include -#include -#include -#include -#include -#include -#include - -#include "CPUMeter.h" -#include "ClockMeter.h" -#include "DateMeter.h" -#include "DateTimeMeter.h" -#include "HostnameMeter.h" -#include "LoadAverageMeter.h" -#include "Macros.h" -#include "MemoryMeter.h" -#include "MemorySwapMeter.h" -#include "Meter.h" -#include "ProcessList.h" -#include "Settings.h" -#include "SignalsPanel.h" -#include "SwapMeter.h" -#include "SysArchMeter.h" -#include "TasksMeter.h" -#include "UptimeMeter.h" -#include "XUtils.h" -#include "openbsd/OpenBSDProcess.h" -#include "openbsd/OpenBSDProcessList.h" - - -const ScreenDefaults Platform_defaultScreens[] = { - { - .name = "Main", - .columns = "PID USER PRIORITY NICE M_VIRT M_RESIDENT STATE PERCENT_CPU PERCENT_MEM TIME Command", - .sortKey = "PERCENT_CPU", - }, -}; - -const unsigned int Platform_numberOfDefaultScreens = ARRAYSIZE(Platform_defaultScreens); - -/* - * See /usr/include/sys/signal.h - */ -const SignalItem Platform_signals[] = { - { .name = " 0 Cancel", .number = 0 }, - { .name = " 1 SIGHUP", .number = 1 }, - { .name = " 2 SIGINT", .number = 2 }, - { .name = " 3 SIGQUIT", .number = 3 }, - { .name = " 4 SIGILL", .number = 4 }, - { .name = " 5 SIGTRAP", .number = 5 }, - { .name = " 6 SIGABRT", .number = 6 }, - { .name = " 6 SIGIOT", .number = 6 }, - { .name = " 7 SIGEMT", .number = 7 }, - { .name = " 8 SIGFPE", .number = 8 }, - { .name = " 9 SIGKILL", .number = 9 }, - { .name = "10 SIGBUS", .number = 10 }, - { .name = "11 SIGSEGV", .number = 11 }, - { .name = "12 SIGSYS", .number = 12 }, - { .name = "13 SIGPIPE", .number = 13 }, - { .name = "14 SIGALRM", .number = 14 }, - { .name = "15 SIGTERM", .number = 15 }, - { .name = "16 SIGURG", .number = 16 }, - { .name = "17 SIGSTOP", .number = 17 }, - { .name = "18 SIGTSTP", .number = 18 }, - { .name = "19 SIGCONT", .number = 19 }, - { .name = "20 SIGCHLD", .number = 20 }, - { .name = "21 SIGTTIN", .number = 21 }, - { .name = "22 SIGTTOU", .number = 22 }, - { .name = "23 SIGIO", .number = 23 }, - { .name = "24 SIGXCPU", .number = 24 }, - { .name = "25 SIGXFSZ", .number = 25 }, - { .name = "26 SIGVTALRM", .number = 26 }, - { .name = "27 SIGPROF", .number = 27 }, - { .name = "28 SIGWINCH", .number = 28 }, - { .name = "29 SIGINFO", .number = 29 }, - { .name = "30 SIGUSR1", .number = 30 }, - { .name = "31 SIGUSR2", .number = 31 }, - { .name = "32 SIGTHR", .number = 32 }, -}; - -const unsigned int Platform_numberOfSignals = ARRAYSIZE(Platform_signals); - -const MeterClass* const Platform_meterTypes[] = { - &CPUMeter_class, - &ClockMeter_class, - &DateMeter_class, - &DateTimeMeter_class, - &LoadAverageMeter_class, - &LoadMeter_class, - &MemoryMeter_class, - &SwapMeter_class, - &MemorySwapMeter_class, - &TasksMeter_class, - &UptimeMeter_class, - &BatteryMeter_class, - &HostnameMeter_class, - &SysArchMeter_class, - &AllCPUsMeter_class, - &AllCPUs2Meter_class, - &AllCPUs4Meter_class, - &AllCPUs8Meter_class, - &LeftCPUsMeter_class, - &RightCPUsMeter_class, - &LeftCPUs2Meter_class, - &RightCPUs2Meter_class, - &LeftCPUs4Meter_class, - &RightCPUs4Meter_class, - &LeftCPUs8Meter_class, - &RightCPUs8Meter_class, - &BlankMeter_class, - NULL -}; - -bool Platform_init(void) { - /* no platform-specific setup needed */ - return true; -} - -void Platform_done(void) { - /* no platform-specific cleanup needed */ -} - -void Platform_setBindings(Htop_Action* keys) { - /* no platform-specific key bindings */ - (void) keys; -} - -int Platform_getUptime(void) { - struct timeval bootTime, currTime; - const int mib[2] = { CTL_KERN, KERN_BOOTTIME }; - size_t size = sizeof(bootTime); - - int err = sysctl(mib, 2, &bootTime, &size, NULL, 0); - if (err) { - return -1; - } - gettimeofday(&currTime, NULL); - - return (int) difftime(currTime.tv_sec, bootTime.tv_sec); -} - -void Platform_getLoadAverage(double* one, double* five, double* fifteen) { - struct loadavg loadAverage; - const int mib[2] = { CTL_VM, VM_LOADAVG }; - size_t size = sizeof(loadAverage); - - int err = sysctl(mib, 2, &loadAverage, &size, NULL, 0); - if (err) { - *one = 0; - *five = 0; - *fifteen = 0; - return; - } - *one = (double) loadAverage.ldavg[0] / loadAverage.fscale; - *five = (double) loadAverage.ldavg[1] / loadAverage.fscale; - *fifteen = (double) loadAverage.ldavg[2] / loadAverage.fscale; -} - -int Platform_getMaxPid(void) { - return 2 * THREAD_PID_OFFSET; -} - -double Platform_setCPUValues(Meter* this, unsigned int cpu) { - const OpenBSDProcessList* pl = (const OpenBSDProcessList*) this->pl; - const CPUData* cpuData = &(pl->cpuData[cpu]); - double total; - double totalPercent; - double* v = this->values; - - if (!cpuData->online) { - this->curItems = 0; - return NAN; - } - - total = cpuData->totalPeriod == 0 ? 1 : cpuData->totalPeriod; - - v[CPU_METER_NICE] = cpuData->nicePeriod / total * 100.0; - v[CPU_METER_NORMAL] = cpuData->userPeriod / total * 100.0; - if (this->pl->settings->detailedCPUTime) { - v[CPU_METER_KERNEL] = cpuData->sysPeriod / total * 100.0; - v[CPU_METER_IRQ] = cpuData->intrPeriod / total * 100.0; - v[CPU_METER_SOFTIRQ] = 0.0; - v[CPU_METER_STEAL] = 0.0; - v[CPU_METER_GUEST] = 0.0; - v[CPU_METER_IOWAIT] = 0.0; - v[CPU_METER_FREQUENCY] = NAN; - this->curItems = 8; - totalPercent = v[0] + v[1] + v[2] + v[3]; - } else { - v[2] = cpuData->sysAllPeriod / total * 100.0; - v[3] = 0.0; // No steal nor guest on OpenBSD - totalPercent = v[0] + v[1] + v[2]; - this->curItems = 4; - } - - totalPercent = CLAMP(totalPercent, 0.0, 100.0); - - v[CPU_METER_TEMPERATURE] = NAN; - - v[CPU_METER_FREQUENCY] = (pl->cpuSpeed != -1) ? pl->cpuSpeed : NAN; - - return totalPercent; -} - -void Platform_setMemoryValues(Meter* this) { - const ProcessList* pl = this->pl; - long int usedMem = pl->usedMem; - long int buffersMem = pl->buffersMem; - long int cachedMem = pl->cachedMem; - usedMem -= buffersMem + cachedMem; - this->total = pl->totalMem; - this->values[MEMORY_METER_USED] = usedMem; - this->values[MEMORY_METER_BUFFERS] = buffersMem; - // this->values[MEMORY_METER_SHARED] = "shared memory, like tmpfs and shm" - this->values[MEMORY_METER_CACHE] = cachedMem; - // this->values[MEMORY_METER_AVAILABLE] = "available memory" -} - -void Platform_setSwapValues(Meter* this) { - const ProcessList* pl = this->pl; - this->total = pl->totalSwap; - this->values[SWAP_METER_USED] = pl->usedSwap; - this->values[SWAP_METER_CACHE] = NAN; -} - -char* Platform_getProcessEnv(pid_t pid) { - char errbuf[_POSIX2_LINE_MAX]; - char* env; - char** ptr; - int count; - kvm_t* kt; - struct kinfo_proc* kproc; - size_t capacity = 4096, size = 0; - - if ((kt = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf)) == NULL) { - return NULL; - } - - if ((kproc = kvm_getprocs(kt, KERN_PROC_PID, pid, - sizeof(struct kinfo_proc), &count)) == NULL) { - (void) kvm_close(kt); - return NULL; - } - - if ((ptr = kvm_getenvv(kt, kproc, 0)) == NULL) { - (void) kvm_close(kt); - return NULL; - } - - env = xMalloc(capacity); - for (char** p = ptr; *p; p++) { - size_t len = strlen(*p) + 1; - - while (size + len > capacity) { - if (capacity > (SIZE_MAX / 2)) { - free(env); - env = NULL; - goto end; - } - - capacity *= 2; - env = xRealloc(env, capacity); - } - - strlcpy(env + size, *p, len); - size += len; - } - - if (size < 2 || env[size - 1] || env[size - 2]) { - if (size + 2 < capacity) - env = xRealloc(env, capacity + 2); - env[size] = 0; - env[size + 1] = 0; - } - -end: - (void) kvm_close(kt); - return env; -} - -FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) { - (void)pid; - return NULL; -} - -bool Platform_getDiskIO(DiskIOData* data) { - // TODO - (void)data; - return false; -} - -bool Platform_getNetworkIO(NetworkIOData* data) { - // TODO - (void)data; - return false; -} - -static bool findDevice(const char* name, int* mib, struct sensordev* snsrdev, size_t* sdlen) { - for (int devn = 0;; devn++) { - mib[2] = devn; - if (sysctl(mib, 3, snsrdev, sdlen, NULL, 0) == -1) { - if (errno == ENXIO) - continue; - if (errno == ENOENT) - return false; - } - if (String_eq(name, snsrdev->xname)) { - return true; - } - } -} - -void Platform_getBattery(double* percent, ACPresence* isOnAC) { - int mib[] = {CTL_HW, HW_SENSORS, 0, 0, 0}; - struct sensor s; - size_t slen = sizeof(struct sensor); - struct sensordev snsrdev; - size_t sdlen = sizeof(struct sensordev); - - bool found = findDevice("acpibat0", mib, &snsrdev, &sdlen); - - *percent = NAN; - if (found) { - /* last full capacity */ - mib[3] = 7; - mib[4] = 0; - double last_full_capacity = 0; - if (sysctl(mib, 5, &s, &slen, NULL, 0) != -1) - last_full_capacity = s.value; - if (last_full_capacity > 0) { - /* remaining capacity */ - mib[3] = 7; - mib[4] = 3; - if (sysctl(mib, 5, &s, &slen, NULL, 0) != -1) { - double charge = s.value; - *percent = 100 * (charge / last_full_capacity); - if (charge >= last_full_capacity) { - *percent = 100; - } - } - } - } - - found = findDevice("acpiac0", mib, &snsrdev, &sdlen); - - *isOnAC = AC_ERROR; - if (found) { - mib[3] = 9; - mib[4] = 0; - if (sysctl(mib, 5, &s, &slen, NULL, 0) != -1) - *isOnAC = s.value; - } -} diff --git a/fedora/.local/bin/htop-vim/openbsd/Platform.h b/fedora/.local/bin/htop-vim/openbsd/Platform.h deleted file mode 100644 index 27d792e..0000000 --- a/fedora/.local/bin/htop-vim/openbsd/Platform.h +++ /dev/null @@ -1,118 +0,0 @@ -#ifndef HEADER_Platform -#define HEADER_Platform -/* -htop - openbsd/Platform.h -(C) 2014 Hisham H. Muhammad -(C) 2015 Michael McConville -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include - -#include "Action.h" -#include "BatteryMeter.h" -#include "DiskIOMeter.h" -#include "Hashtable.h" -#include "Meter.h" -#include "NetworkIOMeter.h" -#include "Process.h" -#include "ProcessLocksScreen.h" -#include "SignalsPanel.h" -#include "CommandLine.h" -#include "generic/gettime.h" -#include "generic/hostname.h" -#include "generic/uname.h" - - -extern const ScreenDefaults Platform_defaultScreens[]; - -extern const unsigned int Platform_numberOfDefaultScreens; - -/* see /usr/include/sys/signal.h */ -extern const SignalItem Platform_signals[]; - -extern const unsigned int Platform_numberOfSignals; - -extern const MeterClass* const Platform_meterTypes[]; - -bool Platform_init(void); - -void Platform_done(void); - -void Platform_setBindings(Htop_Action* keys); - -int Platform_getUptime(void); - -void Platform_getLoadAverage(double* one, double* five, double* fifteen); - -int Platform_getMaxPid(void); - -double Platform_setCPUValues(Meter* this, unsigned int cpu); - -void Platform_setMemoryValues(Meter* this); - -void Platform_setSwapValues(Meter* this); - -char* Platform_getProcessEnv(pid_t pid); - -FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid); - -bool Platform_getDiskIO(DiskIOData* data); - -bool Platform_getNetworkIO(NetworkIOData* data); - -void Platform_getBattery(double* percent, ACPresence* isOnAC); - -static inline void Platform_getHostname(char* buffer, size_t size) { - Generic_hostname(buffer, size); -} - -static inline void Platform_getRelease(char** string) { - *string = Generic_uname(); -} - -#define PLATFORM_LONG_OPTIONS - -static inline void Platform_longOptionsUsage(ATTR_UNUSED const char* name) { } - -static inline CommandLineStatus Platform_getLongOption(ATTR_UNUSED int opt, ATTR_UNUSED int argc, ATTR_UNUSED char** argv) { - return STATUS_ERROR_EXIT; -} - -static inline void Platform_gettime_realtime(struct timeval* tv, uint64_t* msec) { - Generic_gettime_realtime(tv, msec); -} - -static inline void Platform_gettime_monotonic(uint64_t* msec) { - Generic_gettime_monotonic(msec); -} - -static inline Hashtable* Platform_dynamicMeters(void) { - return NULL; -} - -static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* table) { } - -static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { } - -static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* meter) { } - -static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter* meter, ATTR_UNUSED RichString* out) { } - -static inline Hashtable* Platform_dynamicColumns(void) { - return NULL; -} - -static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* table) { } - -static inline const char* Platform_dynamicColumnInit(ATTR_UNUSED unsigned int key) { - return NULL; -} - -static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Process* proc, ATTR_UNUSED RichString* str, ATTR_UNUSED unsigned int key) { - return false; -} - -#endif diff --git a/fedora/.local/bin/htop-vim/openbsd/ProcessField.h b/fedora/.local/bin/htop-vim/openbsd/ProcessField.h deleted file mode 100644 index b8e8d6b..0000000 --- a/fedora/.local/bin/htop-vim/openbsd/ProcessField.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef HEADER_OpenBSDProcessField -#define HEADER_OpenBSDProcessField -/* -htop - openbsd/ProcessField.h -(C) 2020 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - - -#define PLATFORM_PROCESS_FIELDS \ - // End of list - - -#endif /* HEADER_OpenBSDProcessField */ diff --git a/fedora/.local/bin/htop-vim/pcp-htop.5.in b/fedora/.local/bin/htop-vim/pcp-htop.5.in deleted file mode 100644 index dbc0dfb..0000000 --- a/fedora/.local/bin/htop-vim/pcp-htop.5.in +++ /dev/null @@ -1,237 +0,0 @@ -.TH "PCP-HTOP" "5" "2023" "@PACKAGE_STRING@" "File Formats" -.SH "NAME" -\f3pcp-htop\f1 \- pcp-htop configuration file -.SH "DESCRIPTION" -.B pcp-htop -is a customizable performance metrics reporting tool. -It has a dynamic architecture, where a set of configuration files -provide additional, optional meters and columns to extend the fixed -set of display options provided by regular -.BR htop . -.LP -These configuration files can be provided from both system-wide -locations (first -.I @sysconfdir@/pcp/htop -then -.IR @datarootdir@/pcp/htop ) -and below the user's home directory (usually -.IR ~/.config/htop ). -Within these locations the -.I meters -and -.I columns -are scanned for dynamic Meter and Column specifications. -.LP -Meters are displayed in the top part of the -.B pcp-htop -window, and columns are displayed in the lower part. -Meters tend to display system-wide metrics, and Columns -display metrics about individual processes. -.LP -The formats are similar but have slightly different requirements. -Both formats follow the common ini-style. Blank lines are ignored. -Lines starting with the "#" character are treated as comments. -.SH "METERS" -The following is an example configuration for a new Redis meter: -.LP -.ft CW -.nf -.in +0.5i -[redisclient] -caption = Redis clients -type = bar -blocked.metric = redis.blocked_clients -blocked.color = blue -blocked.label = blk -clients.metric = redis.connected_clients -clients.color = green -clients.label = conn -.in -.fi -.ft 1 -.LP -A configuration file can contain multiple meter definitions. -Each definition begins with a identifying name enclosed by -square brackets \- -.I redisclient -in this example. -The name is used internally within -.B pcp-htop -and must be unique, must begin with an alphabetic character, -and may subsequently only contain alphanumeric characters or -the underscore character. -No whitespace or other characters are allowed. -.LP -There are several parameters that define the way the meter -will be displayed to the user. -.TP 5 -.B caption -This value is displayed on the Setup screen once the meter -has been selected. -A truncated version of the -.I caption -will also be displayed (followed by a colon) on the primary -display while the meter is updating. -.TP -.B description -This can be used to provide more detail during the meter -selection process on the Setup screen, and if present it is -displayed in the "Available Meters" column. -If not present, the -.B caption -will be used for this. -If neither is present, the internal (mandatory) -.B name -will be used. -.TP -.B type -This setting allows a preferred default meter type to be specified. -The associated value must be one of -.IR bar , -.IR text , -.IR graph , -or -.IR led . -If no value is provided for a dynamic meter, the default value of -.IR text -will be used. -.TP -.B maximum -A numeric value can also be set to size the meter, such that -values (e.g. for a -.I bar -type meter display) will be scaled within range zero to -.IR maximum . -.LP -The remaining definition syntax describes the individual -metric(s) which will be used to animate the meter. -One or more metrics must be specified for each meter and -there are several properties associated with each. -Once again, these metrics must be named (the same rules -described above for meters apply here) and the following -properties can be configured: -.TP 5 -.B name.metric -This is the only mandatory field and associates a PCP metric -with the meter. -Values sampled for each metric at runtime provide the -animation visible in the -.B pcp-htop -display. -The metric specification can be either a PCP metric name as -listed by -.BR pminfo (1) -or a "derived" metric expression. -The format for derived metric expressions is described on the -.BR pmRegisterDerived (3) -manual page. -.TP -.B name.color -Setting color to be used when rendering metric values. -Possible values are -.IR red , -.IR green , -.IR blue , -.IR cyan , -.IR magenta , -.IR yellow , -.IR gray , -.I darkgray -or -.IR white . -.TP -.B name.label -An optional, short label to display before the metric value. -The ":" character will be appended to the -.I label -before the metric value part of the display. -.TP -.B name.suffix -An optional, short suffix to display after the metric value. -Commonly used to indicate values as a percentage using a "%" -.I suffix -value and to provide the base unit of measurement. -Note that since PCP maintains units for metrics, for those -metrics that have dimension in "space" (bytes, kilobytes, -megabytes, etc), a suffix will be automatically appended. -.SH "COLUMNS" -The following is an example configuration for a new column -showing open file descriptors for each process: -.LP -.ft CW -.nf -.in +0.5i -[openfds] -heading = FDS -caption = FDCOUNT -description = Open file descriptors -metric = proc.fd.count -width = 3 -.in -.fi -.ft 1 -.LP -A configuration file can contain multiple column definitions. -Each definition begins with a identifying name enclosed -by square brackets \- -.I openfds -in this example, and the same rules apply as described above -for meter names. -.LP -Each column must specify a metric. -Optional parameters can also be set. -.TP 5 -.B metric -As with meters, the metric value must be either a PCP metric -name as listed by -.BR pminfo (1) -or a derived metric. -The metric must have an instance domain (set of values) and -that instance domain must map to the set of processes with -the instance identifier being PIDs (process identifiers). -Typically this will be metrics from the -.I proc -or -.I hotproc -namespace (\c -.BR pmdaproc (1)), -but metrics from other domains (\c -.BR pmdabcc (1), -.BR pmdabpf (1), -etc) that have per-process values are equally applicable. -.TP -.B width -Column width to use when displaying values for the metric. -A negative value can be used to specify left alignment. -An upper column limit of 28 characters is enforced. -The default column width is 5 characters. -.TP -.B heading -The short title that will be displayed at the head of the -column \- usually a short, cryptic, all uppercase string. -.TP -.B caption -A short identifying word presented to users on the Setup -screen under both the Available and Active Columns lists. -.TP -.B description -Text that assists users to understand the meaning of this -column when it is being presented via the Setup screen in -the Available Columns list. -.SH "SEE ALSO" -.BR pcp-htop (1), -.BR pminfo (1), -.BR pmcd (1), -.BR pmdaproc (1), -.BR pmdabcc (1), -.BR pmdabpf (1) -and -.BR pmRegisterDerived (3). -.SH "AUTHORS" -.B htop -was originally developed by Hisham Muhammad. -Nowadays it is maintained by the community at . -.LP -.B pcp-htop -is maintained as a collaboration between the and -communities, and forms part of the Performance Co-Pilot suite of tools. diff --git a/fedora/.local/bin/htop-vim/pcp-htop.c b/fedora/.local/bin/htop-vim/pcp-htop.c deleted file mode 100644 index 2713c89..0000000 --- a/fedora/.local/bin/htop-vim/pcp-htop.c +++ /dev/null @@ -1,26 +0,0 @@ -/* -htop - pcp-htop.c -(C) 2004-2011 Hisham H. Muhammad -(C) 2020-2021 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include - -#include "CommandLine.h" -#include "Platform.h" - - -int main(int argc, char** argv) { - const char* name = "pcp-htop"; - pmSetProgname(name); - - /* extract environment variables */ - opts.flags |= PM_OPTFLAG_ENV_ONLY; - (void)pmGetOptions(argc, argv, &opts); - - return CommandLine_run(name, argc, argv); -} diff --git a/fedora/.local/bin/htop-vim/pcp/PCPDynamicColumn.c b/fedora/.local/bin/htop-vim/pcp/PCPDynamicColumn.c deleted file mode 100644 index 33c6d72..0000000 --- a/fedora/.local/bin/htop-vim/pcp/PCPDynamicColumn.c +++ /dev/null @@ -1,348 +0,0 @@ -/* -htop - PCPDynamicColumn.c -(C) 2021 Sohaib Mohammed -(C) 2021 htop dev team -(C) 2021 Red Hat, Inc. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "pcp/PCPDynamicColumn.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "CRT.h" -#include "Macros.h" -#include "Platform.h" -#include "Process.h" -#include "ProcessList.h" -#include "RichString.h" -#include "XUtils.h" - -#include "pcp/PCPProcess.h" -#include "pcp/PCPMetric.h" - - -static bool PCPDynamicColumn_addMetric(PCPDynamicColumns* columns, PCPDynamicColumn* column) { - if (!column->super.name[0]) - return false; - - size_t bytes = 16 + strlen(column->super.name); - char* metricName = xMalloc(bytes); - xSnprintf(metricName, bytes, "htop.column.%s", column->super.name); - - column->metricName = metricName; - column->id = columns->offset + columns->cursor; - columns->cursor++; - - Platform_addMetric(column->id, metricName); - return true; -} - -static void PCPDynamicColumn_parseMetric(PCPDynamicColumns* columns, PCPDynamicColumn* column, const char* path, unsigned int line, char* value) { - /* lookup a dynamic metric with this name, else create */ - if (PCPDynamicColumn_addMetric(columns, column) == false) - return; - - /* derived metrics in all dynamic columns for simplicity */ - char* error; - if (pmRegisterDerivedMetric(column->metricName, value, &error) < 0) { - char* note; - xAsprintf(¬e, - "%s: failed to parse expression in %s at line %u\n%s\n", - pmGetProgname(), path, line, error); - free(error); - errno = EINVAL; - CRT_fatalError(note); - free(note); - } -} - -// Ensure a valid name for use in a PCP metric name and in htoprc -static bool PCPDynamicColumn_validateColumnName(char* key, const char* path, unsigned int line) { - char* p = key; - char* end = strrchr(key, ']'); - - if (end) { - *end = '\0'; - } else { - fprintf(stderr, - "%s: no closing brace on column name at %s line %u\n\"%s\"", - pmGetProgname(), path, line, key); - return false; - } - - while (*p) { - if (p == key) { - if (!isalpha(*p) && *p != '_') - break; - } else { - if (!isalnum(*p) && *p != '_') - break; - } - p++; - } - if (*p != '\0') { /* badness */ - fprintf(stderr, - "%s: invalid column name at %s line %u\n\"%s\"", - pmGetProgname(), path, line, key); - return false; - } - return true; -} - -// Ensure a column name has not been defined previously -static bool PCPDynamicColumn_uniqueName(char* key, PCPDynamicColumns* columns) { - return DynamicColumn_search(columns->table, key, NULL) == NULL; -} - -static PCPDynamicColumn* PCPDynamicColumn_new(PCPDynamicColumns* columns, const char* name) { - PCPDynamicColumn* column = xCalloc(1, sizeof(*column)); - String_safeStrncpy(column->super.name, name, sizeof(column->super.name)); - - size_t id = columns->count + LAST_PROCESSFIELD; - Hashtable_put(columns->table, id, column); - columns->count++; - - return column; -} - -static void PCPDynamicColumn_parseFile(PCPDynamicColumns* columns, const char* path) { - FILE* file = fopen(path, "r"); - if (!file) - return; - - PCPDynamicColumn* column = NULL; - unsigned int lineno = 0; - bool ok = true; - for (;;) { - char* line = String_readLine(file); - if (!line) - break; - lineno++; - - /* cleanup whitespace, skip comment lines */ - char* trimmed = String_trim(line); - free(line); - if (!trimmed || !trimmed[0] || trimmed[0] == '#') { - free(trimmed); - continue; - } - - size_t n; - char** config = String_split(trimmed, '=', &n); - free(trimmed); - if (config == NULL) - continue; - - char* key = String_trim(config[0]); - char* value = n > 1 ? String_trim(config[1]) : NULL; - if (key[0] == '[') { /* new section heading - i.e. new column */ - ok = PCPDynamicColumn_validateColumnName(key + 1, path, lineno); - if (ok) - ok = PCPDynamicColumn_uniqueName(key + 1, columns); - if (ok) - column = PCPDynamicColumn_new(columns, key + 1); - } else if (value && column && String_eq(key, "caption")) { - free_and_xStrdup(&column->super.caption, value); - } else if (value && column && String_eq(key, "heading")) { - free_and_xStrdup(&column->super.heading, value); - } else if (value && column && String_eq(key, "description")) { - free_and_xStrdup(&column->super.description, value); - } else if (value && column && String_eq(key, "width")) { - column->super.width = strtoul(value, NULL, 10); - } else if (value && column && String_eq(key, "metric")) { - PCPDynamicColumn_parseMetric(columns, column, path, lineno, value); - } - String_freeArray(config); - free(value); - free(key); - } - fclose(file); -} - -static void PCPDynamicColumn_scanDir(PCPDynamicColumns* columns, char* path) { - DIR* dir = opendir(path); - if (!dir) - return; - - struct dirent* dirent; - while ((dirent = readdir(dir)) != NULL) { - if (dirent->d_name[0] == '.') - continue; - - char* file = String_cat(path, dirent->d_name); - PCPDynamicColumn_parseFile(columns, file); - free(file); - } - closedir(dir); -} - -void PCPDynamicColumns_init(PCPDynamicColumns* columns) { - const char* share = pmGetConfig("PCP_SHARE_DIR"); - const char* sysconf = pmGetConfig("PCP_SYSCONF_DIR"); - const char* xdgConfigHome = getenv("XDG_CONFIG_HOME"); - const char* override = getenv("PCP_HTOP_DIR"); - const char* home = getenv("HOME"); - char* path; - - if (!xdgConfigHome && !home) { - const struct passwd* pw = getpwuid(getuid()); - if (pw) - home = pw->pw_dir; - } - - columns->table = Hashtable_new(0, true); - - /* developer paths - PCP_HTOP_DIR=./pcp ./pcp-htop */ - if (override) { - path = String_cat(override, "/columns/"); - PCPDynamicColumn_scanDir(columns, path); - free(path); - } - - /* next, search in home directory alongside htoprc */ - if (xdgConfigHome) - path = String_cat(xdgConfigHome, "/htop/columns/"); - else if (home) - path = String_cat(home, "/.config/htop/columns/"); - else - path = NULL; - if (path) { - PCPDynamicColumn_scanDir(columns, path); - free(path); - } - - /* next, search in the system columns directory */ - path = String_cat(sysconf, "/htop/columns/"); - PCPDynamicColumn_scanDir(columns, path); - free(path); - - /* next, try the readonly system columns directory */ - path = String_cat(share, "/htop/columns/"); - PCPDynamicColumn_scanDir(columns, path); - free(path); -} - -static void PCPDynamicColumns_free(ATTR_UNUSED ht_key_t key, void* value, ATTR_UNUSED void* data) { - PCPDynamicColumn* column = (PCPDynamicColumn*) value; - free(column->metricName); - free(column->super.heading); - free(column->super.caption); - free(column->super.description); -} - -void PCPDynamicColumns_done(Hashtable* table) { - Hashtable_foreach(table, PCPDynamicColumns_free, NULL); -} - -void PCPDynamicColumn_writeField(PCPDynamicColumn* this, const Process* proc, RichString* str) { - const PCPProcess* pp = (const PCPProcess*) proc; - unsigned int type = PCPMetric_type(this->id); - - pmAtomValue atom; - if (!PCPMetric_instance(this->id, proc->pid, pp->offset, &atom, type)) { - RichString_appendAscii(str, CRT_colors[METER_VALUE_ERROR], "no data"); - return; - } - - int width = this->super.width; - if (!width || abs(width) > DYNAMIC_MAX_COLUMN_WIDTH) - width = DYNAMIC_DEFAULT_COLUMN_WIDTH; - int abswidth = abs(width); - if (abswidth > DYNAMIC_MAX_COLUMN_WIDTH) { - abswidth = DYNAMIC_MAX_COLUMN_WIDTH; - width = -abswidth; - } - - char buffer[DYNAMIC_MAX_COLUMN_WIDTH + /* space */ 1 + /* null terminator */ + 1]; - int attr = CRT_colors[DEFAULT_COLOR]; - switch (type) { - case PM_TYPE_STRING: - attr = CRT_colors[PROCESS_SHADOW]; - Process_printLeftAlignedField(str, attr, atom.cp, abswidth); - free(atom.cp); - break; - case PM_TYPE_32: - xSnprintf(buffer, sizeof(buffer), "%*d ", width, atom.l); - RichString_appendAscii(str, attr, buffer); - break; - case PM_TYPE_U32: - xSnprintf(buffer, sizeof(buffer), "%*u ", width, atom.ul); - RichString_appendAscii(str, attr, buffer); - break; - case PM_TYPE_64: - xSnprintf(buffer, sizeof(buffer), "%*lld ", width, (long long) atom.ll); - RichString_appendAscii(str, attr, buffer); - break; - case PM_TYPE_U64: - xSnprintf(buffer, sizeof(buffer), "%*llu ", width, (unsigned long long) atom.ull); - RichString_appendAscii(str, attr, buffer); - break; - case PM_TYPE_FLOAT: - xSnprintf(buffer, sizeof(buffer), "%*.2f ", width, (double) atom.f); - RichString_appendAscii(str, attr, buffer); - break; - case PM_TYPE_DOUBLE: - xSnprintf(buffer, sizeof(buffer), "%*.2f ", width, atom.d); - RichString_appendAscii(str, attr, buffer); - break; - default: - attr = CRT_colors[METER_VALUE_ERROR]; - RichString_appendAscii(str, attr, "no type"); - break; - } -} - -int PCPDynamicColumn_compareByKey(const PCPProcess* p1, const PCPProcess* p2, ProcessField key) { - const PCPDynamicColumn* column = Hashtable_get(p1->super.processList->dynamicColumns, key); - - if (!column) - return -1; - - size_t metric = column->id; - unsigned int type = PCPMetric_type(metric); - - pmAtomValue atom1 = {0}, atom2 = {0}; - if (!PCPMetric_instance(metric, p1->super.pid, p1->offset, &atom1, type) || - !PCPMetric_instance(metric, p2->super.pid, p2->offset, &atom2, type)) { - if (type == PM_TYPE_STRING) { - free(atom1.cp); - free(atom2.cp); - } - return -1; - } - - switch (type) { - case PM_TYPE_STRING: { - int cmp = SPACESHIP_NULLSTR(atom2.cp, atom1.cp); - free(atom2.cp); - free(atom1.cp); - return cmp; - } - case PM_TYPE_32: - return SPACESHIP_NUMBER(atom2.l, atom1.l); - case PM_TYPE_U32: - return SPACESHIP_NUMBER(atom2.ul, atom1.ul); - case PM_TYPE_64: - return SPACESHIP_NUMBER(atom2.ll, atom1.ll); - case PM_TYPE_U64: - return SPACESHIP_NUMBER(atom2.ull, atom1.ull); - case PM_TYPE_FLOAT: - return SPACESHIP_NUMBER(atom2.f, atom1.f); - case PM_TYPE_DOUBLE: - return SPACESHIP_NUMBER(atom2.d, atom1.d); - default: - break; - } - return -1; -} diff --git a/fedora/.local/bin/htop-vim/pcp/PCPDynamicColumn.h b/fedora/.local/bin/htop-vim/pcp/PCPDynamicColumn.h deleted file mode 100644 index d0ffe71..0000000 --- a/fedora/.local/bin/htop-vim/pcp/PCPDynamicColumn.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef HEADER_PCPDynamicColumn -#define HEADER_PCPDynamicColumn - -#include - -#include "DynamicColumn.h" -#include "Hashtable.h" -#include "Process.h" -#include "RichString.h" - -#include "pcp/PCPProcess.h" - - -typedef struct PCPDynamicColumn_ { - DynamicColumn super; - char* metricName; - size_t id; /* identifier for metric array lookups */ -} PCPDynamicColumn; - -typedef struct PCPDynamicColumns_ { - Hashtable* table; - size_t count; /* count of dynamic meters discovered by scan */ - size_t offset; /* start offset into the Platform metric array */ - size_t cursor; /* identifier allocator for each new metric used */ -} PCPDynamicColumns; - -void PCPDynamicColumns_init(PCPDynamicColumns* columns); - -void PCPDynamicColumns_done(Hashtable* table); - -void PCPDynamicColumn_writeField(PCPDynamicColumn* this, const Process* proc, RichString* str); - -int PCPDynamicColumn_compareByKey(const PCPProcess* p1, const PCPProcess* p2, ProcessField key); - -#endif diff --git a/fedora/.local/bin/htop-vim/pcp/PCPDynamicMeter.c b/fedora/.local/bin/htop-vim/pcp/PCPDynamicMeter.c deleted file mode 100644 index e899988..0000000 --- a/fedora/.local/bin/htop-vim/pcp/PCPDynamicMeter.c +++ /dev/null @@ -1,468 +0,0 @@ -/* -htop - PCPDynamicMeter.c -(C) 2021 htop dev team -(C) 2021 Red Hat, Inc. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ -#include "config.h" // IWYU pragma: keep - -#include "pcp/PCPDynamicMeter.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "Macros.h" -#include "Platform.h" -#include "RichString.h" -#include "XUtils.h" - -#include "pcp/PCPMetric.h" - - -static PCPDynamicMetric* PCPDynamicMeter_lookupMetric(PCPDynamicMeters* meters, PCPDynamicMeter* meter, const char* name) { - size_t bytes = 16 + strlen(meter->super.name) + strlen(name); - char* metricName = xMalloc(bytes); - xSnprintf(metricName, bytes, "htop.meter.%s.%s", meter->super.name, name); - - PCPDynamicMetric* metric; - for (size_t i = 0; i < meter->totalMetrics; i++) { - metric = &meter->metrics[i]; - if (String_eq(metric->name, metricName)) { - free(metricName); - return metric; - } - } - - /* not an existing metric in this meter - add it */ - size_t n = meter->totalMetrics + 1; - meter->metrics = xReallocArray(meter->metrics, n, sizeof(PCPDynamicMetric)); - meter->totalMetrics = n; - metric = &meter->metrics[n - 1]; - memset(metric, 0, sizeof(PCPDynamicMetric)); - metric->name = metricName; - metric->label = String_cat(name, ": "); - metric->id = meters->offset + meters->cursor; - meters->cursor++; - - Platform_addMetric(metric->id, metricName); - - return metric; -} - -static void PCPDynamicMeter_parseMetric(PCPDynamicMeters* meters, PCPDynamicMeter* meter, const char* path, unsigned int line, char* key, char* value) { - PCPDynamicMetric* metric; - char* p; - - if ((p = strchr(key, '.')) == NULL) - return; - *p++ = '\0'; /* end the name, p is now the attribute, e.g. 'label' */ - - if (String_eq(p, "metric")) { - /* lookup a dynamic metric with this name, else create */ - metric = PCPDynamicMeter_lookupMetric(meters, meter, key); - - /* use derived metrics in dynamic meters for simplicity */ - char* error; - if (pmRegisterDerivedMetric(metric->name, value, &error) < 0) { - char* note; - xAsprintf(¬e, - "%s: failed to parse expression in %s at line %u\n%s\n%s", - pmGetProgname(), path, line, error, pmGetProgname()); - free(error); - errno = EINVAL; - CRT_fatalError(note); - free(note); - } - } else { - /* this is a property of a dynamic metric - the metric expression */ - /* may not have been observed yet - i.e. we allow for any ordering */ - metric = PCPDynamicMeter_lookupMetric(meters, meter, key); - if (String_eq(p, "color")) { - if (String_eq(value, "gray")) - metric->color = DYNAMIC_GRAY; - else if (String_eq(value, "darkgray")) - metric->color = DYNAMIC_DARKGRAY; - else if (String_eq(value, "red")) - metric->color = DYNAMIC_RED; - else if (String_eq(value, "green")) - metric->color = DYNAMIC_GREEN; - else if (String_eq(value, "blue")) - metric->color = DYNAMIC_BLUE; - else if (String_eq(value, "cyan")) - metric->color = DYNAMIC_CYAN; - else if (String_eq(value, "magenta")) - metric->color = DYNAMIC_MAGENTA; - else if (String_eq(value, "yellow")) - metric->color = DYNAMIC_YELLOW; - else if (String_eq(value, "white")) - metric->color = DYNAMIC_WHITE; - } else if (String_eq(p, "label")) { - char* label = String_cat(value, ": "); - free_and_xStrdup(&metric->label, label); - free(label); - } else if (String_eq(p, "suffix")) { - free_and_xStrdup(&metric->suffix, value); - } - } -} - -// Ensure a valid name for use in a PCP metric name and in htoprc -static bool PCPDynamicMeter_validateMeterName(char* key, const char* path, unsigned int line) { - char* p = key; - char* end = strrchr(key, ']'); - - if (end) { - *end = '\0'; - } else { - fprintf(stderr, - "%s: no closing brace on meter name at %s line %u\n\"%s\"\n", - pmGetProgname(), path, line, key); - return false; - } - - while (*p) { - if (p == key) { - if (!isalpha(*p) && *p != '_') - break; - } else { - if (!isalnum(*p) && *p != '_') - break; - } - p++; - } - if (*p != '\0') { /* badness */ - fprintf(stderr, - "%s: invalid meter name at %s line %u\n\"%s\"\n", - pmGetProgname(), path, line, key); - return false; - } - return true; -} - -// Ensure a meter name has not been defined previously -static bool PCPDynamicMeter_uniqueName(char* key, PCPDynamicMeters* meters) { - return !DynamicMeter_search(meters->table, key, NULL); -} - -static PCPDynamicMeter* PCPDynamicMeter_new(PCPDynamicMeters* meters, const char* name) { - PCPDynamicMeter* meter = xCalloc(1, sizeof(*meter)); - String_safeStrncpy(meter->super.name, name, sizeof(meter->super.name)); - Hashtable_put(meters->table, ++meters->count, meter); - return meter; -} - -static void PCPDynamicMeter_parseFile(PCPDynamicMeters* meters, const char* path) { - FILE* file = fopen(path, "r"); - if (!file) - return; - - PCPDynamicMeter* meter = NULL; - unsigned int lineno = 0; - bool ok = true; - for (;;) { - char* line = String_readLine(file); - if (!line) - break; - lineno++; - - /* cleanup whitespace, skip comment lines */ - char* trimmed = String_trim(line); - free(line); - if (trimmed[0] == '#' || trimmed[0] == '\0') { - free(trimmed); - continue; - } - - size_t n; - char** config = String_split(trimmed, '=', &n); - free(trimmed); - if (config == NULL) - continue; - - char* key = String_trim(config[0]); - char* value = n > 1 ? String_trim(config[1]) : NULL; - if (key[0] == '[') { /* new section heading - i.e. new meter */ - ok = PCPDynamicMeter_validateMeterName(key + 1, path, lineno); - if (ok) - ok = PCPDynamicMeter_uniqueName(key + 1, meters); - if (ok) - meter = PCPDynamicMeter_new(meters, key + 1); - } else if (!ok) { - ; /* skip this one, we're looking for a new header */ - } else if (value && meter && String_eq(key, "caption")) { - char* caption = String_cat(value, ": "); - if (caption) { - free_and_xStrdup(&meter->super.caption, caption); - free(caption); - caption = NULL; - } - } else if (value && meter && String_eq(key, "description")) { - free_and_xStrdup(&meter->super.description, value); - } else if (value && meter && String_eq(key, "type")) { - if (String_eq(config[1], "bar")) - meter->super.type = BAR_METERMODE; - else if (String_eq(config[1], "text")) - meter->super.type = TEXT_METERMODE; - else if (String_eq(config[1], "graph")) - meter->super.type = GRAPH_METERMODE; - else if (String_eq(config[1], "led")) - meter->super.type = LED_METERMODE; - } else if (value && meter && String_eq(key, "maximum")) { - meter->super.maximum = strtod(value, NULL); - } else if (value && meter) { - PCPDynamicMeter_parseMetric(meters, meter, path, lineno, key, value); - } - String_freeArray(config); - free(value); - free(key); - } - fclose(file); -} - -static void PCPDynamicMeter_scanDir(PCPDynamicMeters* meters, char* path) { - DIR* dir = opendir(path); - if (!dir) - return; - - struct dirent* dirent; - while ((dirent = readdir(dir)) != NULL) { - if (dirent->d_name[0] == '.') - continue; - - char* file = String_cat(path, dirent->d_name); - PCPDynamicMeter_parseFile(meters, file); - free(file); - } - closedir(dir); -} - -void PCPDynamicMeters_init(PCPDynamicMeters* meters) { - const char* share = pmGetConfig("PCP_SHARE_DIR"); - const char* sysconf = pmGetConfig("PCP_SYSCONF_DIR"); - const char* xdgConfigHome = getenv("XDG_CONFIG_HOME"); - const char* override = getenv("PCP_HTOP_DIR"); - const char* home = getenv("HOME"); - char* path; - - if (!xdgConfigHome && !home) { - const struct passwd* pw = getpwuid(getuid()); - if (pw) - home = pw->pw_dir; - } - - meters->table = Hashtable_new(0, true); - - /* developer paths - PCP_HTOP_DIR=./pcp ./pcp-htop */ - if (override) { - path = String_cat(override, "/meters/"); - PCPDynamicMeter_scanDir(meters, path); - free(path); - } - - /* next, search in home directory alongside htoprc */ - if (xdgConfigHome) - path = String_cat(xdgConfigHome, "/htop/meters/"); - else if (home) - path = String_cat(home, "/.config/htop/meters/"); - else - path = NULL; - if (path) { - PCPDynamicMeter_scanDir(meters, path); - free(path); - } - - /* next, search in the system meters directory */ - path = String_cat(sysconf, "/htop/meters/"); - PCPDynamicMeter_scanDir(meters, path); - free(path); - - /* next, try the readonly system meters directory */ - path = String_cat(share, "/htop/meters/"); - PCPDynamicMeter_scanDir(meters, path); - free(path); -} - -static void PCPDynamicMeter_free(ATTR_UNUSED ht_key_t key, void* value, ATTR_UNUSED void* data) { - PCPDynamicMeter* meter = (PCPDynamicMeter*) value; - for (size_t i = 0; i < meter->totalMetrics; i++) { - free(meter->metrics[i].name); - free(meter->metrics[i].label); - free(meter->metrics[i].suffix); - } - free(meter->metrics); - free(meter->super.caption); - free(meter->super.description); -} - -void PCPDynamicMeters_done(Hashtable* table) { - Hashtable_foreach(table, PCPDynamicMeter_free, NULL); -} - -void PCPDynamicMeter_enable(PCPDynamicMeter* this) { - for (size_t i = 0; i < this->totalMetrics; i++) - PCPMetric_enable(this->metrics[i].id, true); -} - -void PCPDynamicMeter_updateValues(PCPDynamicMeter* this, Meter* meter) { - char* buffer = meter->txtBuffer; - size_t size = sizeof(meter->txtBuffer); - size_t bytes = 0; - - for (size_t i = 0; i < this->totalMetrics; i++) { - if (i > 0 && bytes < size - 1) - buffer[bytes++] = '/'; /* separator */ - - PCPDynamicMetric* metric = &this->metrics[i]; - const pmDesc* desc = PCPMetric_desc(metric->id); - pmAtomValue atom, raw; - - if (!PCPMetric_values(metric->id, &raw, 1, desc->type)) { - bytes--; /* clear the separator */ - continue; - } - - pmUnits conv = desc->units; /* convert to canonical units */ - if (conv.dimSpace) - conv.scaleSpace = PM_SPACE_KBYTE; - if (conv.dimTime) - conv.scaleTime = PM_TIME_SEC; - if (desc->type == PM_TYPE_STRING) - atom = raw; - else if (pmConvScale(desc->type, &raw, &desc->units, &atom, &conv) < 0) { - bytes--; /* clear the separator */ - continue; - } - - size_t saved = bytes; - switch (desc->type) { - case PM_TYPE_STRING: - bytes += xSnprintf(buffer + bytes, size - bytes, "%s", atom.cp); - free(atom.cp); - break; - case PM_TYPE_32: - bytes += conv.dimSpace ? - Meter_humanUnit(buffer + bytes, atom.l, size - bytes) : - xSnprintf(buffer + bytes, size - bytes, "%d", atom.l); - break; - case PM_TYPE_U32: - bytes += conv.dimSpace ? - Meter_humanUnit(buffer + bytes, atom.ul, size - bytes) : - xSnprintf(buffer + bytes, size - bytes, "%u", atom.ul); - break; - case PM_TYPE_64: - bytes += conv.dimSpace ? - Meter_humanUnit(buffer + bytes, atom.ll, size - bytes) : - xSnprintf(buffer + bytes, size - bytes, "%lld", (long long) atom.ll); - break; - case PM_TYPE_U64: - bytes += conv.dimSpace ? - Meter_humanUnit(buffer + bytes, atom.ull, size - bytes) : - xSnprintf(buffer + bytes, size - bytes, "%llu", (unsigned long long) atom.ull); - break; - case PM_TYPE_FLOAT: - bytes += conv.dimSpace ? - Meter_humanUnit(buffer + bytes, atom.f, size - bytes) : - xSnprintf(buffer + bytes, size - bytes, "%.2f", (double) atom.f); - break; - case PM_TYPE_DOUBLE: - bytes += conv.dimSpace ? - Meter_humanUnit(buffer + bytes, atom.d, size - bytes) : - xSnprintf(buffer + bytes, size - bytes, "%.2f", atom.d); - break; - default: - break; - } - if (saved != bytes && metric->suffix) - bytes += xSnprintf(buffer + bytes, size - bytes, "%s", metric->suffix); - } - if (!bytes) - xSnprintf(buffer, size, "no data"); -} - -void PCPDynamicMeter_display(PCPDynamicMeter* this, ATTR_UNUSED const Meter* meter, RichString* out) { - int nodata = 1; - - for (size_t i = 0; i < this->totalMetrics; i++) { - PCPDynamicMetric* metric = &this->metrics[i]; - const pmDesc* desc = PCPMetric_desc(metric->id); - pmAtomValue atom, raw; - char buffer[64]; - - if (!PCPMetric_values(metric->id, &raw, 1, desc->type)) - continue; - - pmUnits conv = desc->units; /* convert to canonical units */ - if (conv.dimSpace) - conv.scaleSpace = PM_SPACE_KBYTE; - if (conv.dimTime) - conv.scaleTime = PM_TIME_SEC; - if (desc->type == PM_TYPE_STRING) - atom = raw; - else if (pmConvScale(desc->type, &raw, &desc->units, &atom, &conv) < 0) - continue; - - nodata = 0; /* we will use this metric so *some* data will be added */ - - if (i > 0) - RichString_appendnAscii(out, CRT_colors[metric->color], " ", 1); - - if (metric->label) - RichString_appendAscii(out, CRT_colors[METER_TEXT], metric->label); - - int len = 0; - switch (desc->type) { - case PM_TYPE_STRING: - len = xSnprintf(buffer, sizeof(buffer), "%s", atom.cp); - free(atom.cp); - break; - case PM_TYPE_32: - len = conv.dimSpace ? - Meter_humanUnit(buffer, atom.l, sizeof(buffer)) : - xSnprintf(buffer, sizeof(buffer), "%d", atom.l); - break; - case PM_TYPE_U32: - len = conv.dimSpace ? - Meter_humanUnit(buffer, atom.ul, sizeof(buffer)) : - xSnprintf(buffer, sizeof(buffer), "%u", atom.ul); - break; - case PM_TYPE_64: - len = conv.dimSpace ? - Meter_humanUnit(buffer, atom.ll, sizeof(buffer)) : - xSnprintf(buffer, sizeof(buffer), "%lld", (long long) atom.ll); - break; - case PM_TYPE_U64: - len = conv.dimSpace ? - Meter_humanUnit(buffer, atom.ull, sizeof(buffer)) : - xSnprintf(buffer, sizeof(buffer), "%llu", (unsigned long long) atom.ull); - break; - case PM_TYPE_FLOAT: - len = conv.dimSpace ? - Meter_humanUnit(buffer, atom.f, sizeof(buffer)) : - xSnprintf(buffer, sizeof(buffer), "%.2f", (double) atom.f); - break; - case PM_TYPE_DOUBLE: - len = conv.dimSpace ? - Meter_humanUnit(buffer, atom.d, sizeof(buffer)) : - xSnprintf(buffer, sizeof(buffer), "%.2f", atom.d); - break; - default: - break; - } - if (len) { - RichString_appendnAscii(out, CRT_colors[metric->color], buffer, len); - if (metric->suffix) - RichString_appendAscii(out, CRT_colors[METER_TEXT], metric->suffix); - } - } - if (nodata) - RichString_writeAscii(out, CRT_colors[METER_VALUE_ERROR], "no data"); -} diff --git a/fedora/.local/bin/htop-vim/pcp/PCPDynamicMeter.h b/fedora/.local/bin/htop-vim/pcp/PCPDynamicMeter.h deleted file mode 100644 index 0e5ddd2..0000000 --- a/fedora/.local/bin/htop-vim/pcp/PCPDynamicMeter.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef HEADER_PCPDynamicMeter -#define HEADER_PCPDynamicMeter - -#include - -#include "CRT.h" -#include "DynamicMeter.h" -#include "Hashtable.h" -#include "Meter.h" -#include "RichString.h" - - -typedef struct PCPDynamicMetric_ { - size_t id; /* index into metric array */ - ColorElements color; - char* name; /* derived metric name */ - char* label; - char* suffix; -} PCPDynamicMetric; - -typedef struct PCPDynamicMeter_ { - DynamicMeter super; - PCPDynamicMetric* metrics; - size_t totalMetrics; -} PCPDynamicMeter; - -typedef struct PCPDynamicMeters_ { - Hashtable* table; - size_t count; /* count of dynamic meters discovered by scan */ - size_t offset; /* start offset into the Platform metric array */ - size_t cursor; /* identifier allocator for each new metric used */ -} PCPDynamicMeters; - -void PCPDynamicMeters_init(PCPDynamicMeters* meters); - -void PCPDynamicMeters_done(Hashtable* table); - -void PCPDynamicMeter_enable(PCPDynamicMeter* this); - -void PCPDynamicMeter_updateValues(PCPDynamicMeter* this, Meter* meter); - -void PCPDynamicMeter_display(PCPDynamicMeter* this, const Meter* meter, RichString* out); - -#endif diff --git a/fedora/.local/bin/htop-vim/pcp/PCPMetric.c b/fedora/.local/bin/htop-vim/pcp/PCPMetric.c deleted file mode 100644 index 606a5df..0000000 --- a/fedora/.local/bin/htop-vim/pcp/PCPMetric.c +++ /dev/null @@ -1,180 +0,0 @@ -/* -htop - PCPMetric.c -(C) 2020-2021 htop dev team -(C) 2020-2021 Red Hat, Inc. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "pcp/PCPMetric.h" - -#include -#include -#include - -#include "XUtils.h" - -#include "pcp/Platform.h" - - -extern Platform* pcp; - -const pmDesc* PCPMetric_desc(PCPMetric metric) { - return &pcp->descs[metric]; -} - -int PCPMetric_type(PCPMetric metric) { - return pcp->descs[metric].type; -} - -pmAtomValue* PCPMetric_values(PCPMetric metric, pmAtomValue* atom, int count, int type) { - if (pcp->result == NULL) - return NULL; - - pmValueSet* vset = pcp->result->vset[metric]; - if (!vset || vset->numval <= 0) - return NULL; - - /* extract requested number of values as requested type */ - const pmDesc* desc = &pcp->descs[metric]; - for (int i = 0; i < vset->numval; i++) { - if (i == count) - break; - const pmValue* value = &vset->vlist[i]; - int sts = pmExtractValue(vset->valfmt, value, desc->type, &atom[i], type); - if (sts < 0) { - if (pmDebugOptions.appl0) - fprintf(stderr, "Error: cannot extract metric value: %s\n", - pmErrStr(sts)); - memset(&atom[i], 0, sizeof(pmAtomValue)); - } - } - return atom; -} - -int PCPMetric_instanceCount(PCPMetric metric) { - pmValueSet* vset = pcp->result->vset[metric]; - if (vset) - return vset->numval; - return 0; -} - -int PCPMetric_instanceOffset(PCPMetric metric, int inst) { - pmValueSet* vset = pcp->result->vset[metric]; - if (!vset || vset->numval <= 0) - return 0; - - /* search for optimal offset for subsequent inst lookups to begin */ - for (int i = 0; i < vset->numval; i++) { - if (inst == vset->vlist[i].inst) - return i; - } - return 0; -} - -static pmAtomValue* PCPMetric_extract(PCPMetric metric, int inst, int offset, pmValueSet* vset, pmAtomValue* atom, int type) { - - /* extract value (using requested type) of given metric instance */ - const pmDesc* desc = &pcp->descs[metric]; - const pmValue* value = &vset->vlist[offset]; - int sts = pmExtractValue(vset->valfmt, value, desc->type, atom, type); - if (sts < 0) { - if (pmDebugOptions.appl0) - fprintf(stderr, "Error: cannot extract %s instance %d value: %s\n", - pcp->names[metric], inst, pmErrStr(sts)); - memset(atom, 0, sizeof(pmAtomValue)); - } - return atom; -} - -pmAtomValue* PCPMetric_instance(PCPMetric metric, int inst, int offset, pmAtomValue* atom, int type) { - - pmValueSet* vset = pcp->result->vset[metric]; - if (!vset || vset->numval <= 0) - return NULL; - - /* fast-path using heuristic offset based on expected location */ - if (offset >= 0 && offset < vset->numval && inst == vset->vlist[offset].inst) - return PCPMetric_extract(metric, inst, offset, vset, atom, type); - - /* slow-path using a linear search for the requested instance */ - for (int i = 0; i < vset->numval; i++) { - if (inst == vset->vlist[i].inst) - return PCPMetric_extract(metric, inst, i, vset, atom, type); - } - return NULL; -} - -/* - * Iterate over a set of instances (incl PM_IN_NULL) - * returning the next instance identifier and offset. - * - * Start it off by passing offset -1 into the routine. - */ -bool PCPMetric_iterate(PCPMetric metric, int* instp, int* offsetp) { - if (!pcp->result) - return false; - - pmValueSet* vset = pcp->result->vset[metric]; - if (!vset || vset->numval <= 0) - return false; - - int offset = *offsetp; - offset = (offset < 0) ? 0 : offset + 1; - if (offset > vset->numval - 1) - return false; - - *offsetp = offset; - *instp = vset->vlist[offset].inst; - return true; -} - -/* Switch on/off a metric for value fetching (sampling) */ -void PCPMetric_enable(PCPMetric metric, bool enable) { - pcp->fetch[metric] = enable ? pcp->pmids[metric] : PM_ID_NULL; -} - -bool PCPMetric_enabled(PCPMetric metric) { - return pcp->fetch[metric] != PM_ID_NULL; -} - -void PCPMetric_enableThreads(void) { - pmValueSet* vset = xCalloc(1, sizeof(pmValueSet)); - vset->vlist[0].inst = PM_IN_NULL; - vset->vlist[0].value.lval = 1; - vset->valfmt = PM_VAL_INSITU; - vset->numval = 1; - vset->pmid = pcp->pmids[PCP_CONTROL_THREADS]; - - pmResult* result = xCalloc(1, sizeof(pmResult)); - result->vset[0] = vset; - result->numpmid = 1; - - int sts = pmStore(result); - if (sts < 0 && pmDebugOptions.appl0) - fprintf(stderr, "Error: cannot enable threads: %s\n", pmErrStr(sts)); - - pmFreeResult(result); -} - -bool PCPMetric_fetch(struct timeval* timestamp) { - if (pcp->result) { - pmFreeResult(pcp->result); - pcp->result = NULL; - } - int sts, count = 0; - do { - sts = pmFetch(pcp->totalMetrics, pcp->fetch, &pcp->result); - } while (sts == PM_ERR_IPC && ++count < 3); - if (sts < 0) { - if (pmDebugOptions.appl0) - fprintf(stderr, "Error: cannot fetch metric values: %s\n", - pmErrStr(sts)); - return false; - } - if (timestamp) - *timestamp = pcp->result->timestamp; - return true; -} diff --git a/fedora/.local/bin/htop-vim/pcp/PCPMetric.h b/fedora/.local/bin/htop-vim/pcp/PCPMetric.h deleted file mode 100644 index c0966b3..0000000 --- a/fedora/.local/bin/htop-vim/pcp/PCPMetric.h +++ /dev/null @@ -1,181 +0,0 @@ -#ifndef HEADER_PCPMetric -#define HEADER_PCPMetric -/* -htop - PCPMetric.h -(C) 2020-2021 htop dev team -(C) 2020-2021 Red Hat, Inc. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include -#include -#include - -/* use htop config.h values for these macros, not pcp values */ -#undef PACKAGE_URL -#undef PACKAGE_NAME -#undef PACKAGE_STRING -#undef PACKAGE_TARNAME -#undef PACKAGE_VERSION -#undef PACKAGE_BUGREPORT - - -typedef enum PCPMetric_ { - PCP_CONTROL_THREADS, /* proc.control.perclient.threads */ - - PCP_HINV_NCPU, /* hinv.ncpu */ - PCP_HINV_CPUCLOCK, /* hinv.cpu.clock */ - PCP_UNAME_SYSNAME, /* kernel.uname.sysname */ - PCP_UNAME_RELEASE, /* kernel.uname.release */ - PCP_UNAME_MACHINE, /* kernel.uname.machine */ - PCP_UNAME_DISTRO, /* kernel.uname.distro */ - PCP_LOAD_AVERAGE, /* kernel.all.load */ - PCP_PID_MAX, /* kernel.all.pid_max */ - PCP_UPTIME, /* kernel.all.uptime */ - PCP_BOOTTIME, /* kernel.all.boottime */ - PCP_CPU_USER, /* kernel.all.cpu.user */ - PCP_CPU_NICE, /* kernel.all.cpu.nice */ - PCP_CPU_SYSTEM, /* kernel.all.cpu.sys */ - PCP_CPU_IDLE, /* kernel.all.cpu.idle */ - PCP_CPU_IOWAIT, /* kernel.all.cpu.wait.total */ - PCP_CPU_IRQ, /* kernel.all.cpu.intr */ - PCP_CPU_SOFTIRQ, /* kernel.all.cpu.irq.soft */ - PCP_CPU_STEAL, /* kernel.all.cpu.steal */ - PCP_CPU_GUEST, /* kernel.all.cpu.guest */ - PCP_CPU_GUESTNICE, /* kernel.all.cpu.guest_nice */ - PCP_PERCPU_USER, /* kernel.percpu.cpu.user */ - PCP_PERCPU_NICE, /* kernel.percpu.cpu.nice */ - PCP_PERCPU_SYSTEM, /* kernel.percpu.cpu.sys */ - PCP_PERCPU_IDLE, /* kernel.percpu.cpu.idle */ - PCP_PERCPU_IOWAIT, /* kernel.percpu.cpu.wait.total */ - PCP_PERCPU_IRQ, /* kernel.percpu.cpu.intr */ - PCP_PERCPU_SOFTIRQ, /* kernel.percpu.cpu.irq.soft */ - PCP_PERCPU_STEAL, /* kernel.percpu.cpu.steal */ - PCP_PERCPU_GUEST, /* kernel.percpu.cpu.guest */ - PCP_PERCPU_GUESTNICE, /* kernel.percpu.cpu.guest_nice */ - PCP_MEM_TOTAL, /* mem.physmem */ - PCP_MEM_FREE, /* mem.util.free */ - PCP_MEM_BUFFERS, /* mem.util.bufmem */ - PCP_MEM_CACHED, /* mem.util.cached */ - PCP_MEM_SHARED, /* mem.util.shared */ - PCP_MEM_AVAILABLE, /* mem.util.available */ - PCP_MEM_SRECLAIM, /* mem.util.slabReclaimable */ - PCP_MEM_SWAPCACHED, /* mem.util.swapCached */ - PCP_MEM_SWAPTOTAL, /* mem.util.swapTotal */ - PCP_MEM_SWAPFREE, /* mem.util.swapFree */ - PCP_DISK_READB, /* disk.all.read_bytes */ - PCP_DISK_WRITEB, /* disk.all.write_bytes */ - PCP_DISK_ACTIVE, /* disk.all.avactive */ - PCP_NET_RECVB, /* network.all.in.bytes */ - PCP_NET_SENDB, /* network.all.out.bytes */ - PCP_NET_RECVP, /* network.all.in.packets */ - PCP_NET_SENDP, /* network.all.out.packets */ - PCP_PSI_CPUSOME, /* kernel.all.pressure.cpu.some.avg */ - PCP_PSI_IOSOME, /* kernel.all.pressure.io.some.avg */ - PCP_PSI_IOFULL, /* kernel.all.pressure.io.full.avg */ - PCP_PSI_IRQFULL, /* kernel.all.pressure.irq.full.avg */ - PCP_PSI_MEMSOME, /* kernel.all.pressure.memory.some.avg */ - PCP_PSI_MEMFULL, /* kernel.all.pressure.memory.full.avg */ - PCP_ZFS_ARC_ANON_SIZE, /* zfs.arc.anon_size */ - PCP_ZFS_ARC_BONUS_SIZE, /* zfs.arc.bonus_size */ - PCP_ZFS_ARC_COMPRESSED_SIZE, /* zfs.arc.compressed_size */ - PCP_ZFS_ARC_UNCOMPRESSED_SIZE, /* zfs.arc.uncompressed_size */ - PCP_ZFS_ARC_C_MIN, /* zfs.arc.c_min */ - PCP_ZFS_ARC_C_MAX, /* zfs.arc.c_max */ - PCP_ZFS_ARC_DBUF_SIZE, /* zfs.arc.dbuf_size */ - PCP_ZFS_ARC_DNODE_SIZE, /* zfs.arc.dnode_size */ - PCP_ZFS_ARC_HDR_SIZE, /* zfs.arc.hdr_size */ - PCP_ZFS_ARC_MFU_SIZE, /* zfs.arc.mfu_size */ - PCP_ZFS_ARC_MRU_SIZE, /* zfs.arc.mru_size */ - PCP_ZFS_ARC_SIZE, /* zfs.arc.size */ - PCP_ZRAM_CAPACITY, /* zram.capacity */ - PCP_ZRAM_ORIGINAL, /* zram.mm_stat.data_size.original */ - PCP_ZRAM_COMPRESSED, /* zram.mm_stat.data_size.compressed */ - - PCP_PROC_PID, /* proc.psinfo.pid */ - PCP_PROC_PPID, /* proc.psinfo.ppid */ - PCP_PROC_TGID, /* proc.psinfo.tgid */ - PCP_PROC_PGRP, /* proc.psinfo.pgrp */ - PCP_PROC_SESSION, /* proc.psinfo.session */ - PCP_PROC_STATE, /* proc.psinfo.sname */ - PCP_PROC_TTY, /* proc.psinfo.tty */ - PCP_PROC_TTYPGRP, /* proc.psinfo.tty_pgrp */ - PCP_PROC_MINFLT, /* proc.psinfo.minflt */ - PCP_PROC_MAJFLT, /* proc.psinfo.maj_flt */ - PCP_PROC_CMINFLT, /* proc.psinfo.cmin_flt */ - PCP_PROC_CMAJFLT, /* proc.psinfo.cmaj_flt */ - PCP_PROC_UTIME, /* proc.psinfo.utime */ - PCP_PROC_STIME, /* proc.psinfo.stime */ - PCP_PROC_CUTIME, /* proc.psinfo.cutime */ - PCP_PROC_CSTIME, /* proc.psinfo.cstime */ - PCP_PROC_PRIORITY, /* proc.psinfo.priority */ - PCP_PROC_NICE, /* proc.psinfo.nice */ - PCP_PROC_THREADS, /* proc.psinfo.threads */ - PCP_PROC_STARTTIME, /* proc.psinfo.start_time */ - PCP_PROC_PROCESSOR, /* proc.psinfo.processor */ - PCP_PROC_CMD, /* proc.psinfo.cmd */ - PCP_PROC_PSARGS, /* proc.psinfo.psargs */ - PCP_PROC_CGROUPS, /* proc.psinfo.cgroups */ - PCP_PROC_OOMSCORE, /* proc.psinfo.oom_score */ - PCP_PROC_VCTXSW, /* proc.psinfo.vctxsw */ - PCP_PROC_NVCTXSW, /* proc.psinfo.nvctxsw */ - PCP_PROC_LABELS, /* proc.psinfo.labels */ - PCP_PROC_ENVIRON, /* proc.psinfo.environ */ - PCP_PROC_TTYNAME, /* proc.psinfo.ttyname */ - PCP_PROC_EXE, /* proc.psinfo.exe */ - PCP_PROC_CWD, /* proc.psinfo.cwd */ - - PCP_PROC_AUTOGROUP_ID, /* proc.autogroup.id */ - PCP_PROC_AUTOGROUP_NICE, /* proc.autogroup.nice */ - - PCP_PROC_ID_UID, /* proc.id.uid */ - PCP_PROC_ID_USER, /* proc.id.uid_nm */ - - PCP_PROC_IO_RCHAR, /* proc.io.rchar */ - PCP_PROC_IO_WCHAR, /* proc.io.wchar */ - PCP_PROC_IO_SYSCR, /* proc.io.syscr */ - PCP_PROC_IO_SYSCW, /* proc.io.syscw */ - PCP_PROC_IO_READB, /* proc.io.read_bytes */ - PCP_PROC_IO_WRITEB, /* proc.io.write_bytes */ - PCP_PROC_IO_CANCELLED, /* proc.io.cancelled_write_bytes */ - - PCP_PROC_MEM_SIZE, /* proc.memory.size */ - PCP_PROC_MEM_RSS, /* proc.memory.rss */ - PCP_PROC_MEM_SHARE, /* proc.memory.share */ - PCP_PROC_MEM_TEXTRS, /* proc.memory.textrss */ - PCP_PROC_MEM_LIBRS, /* proc.memory.librss */ - PCP_PROC_MEM_DATRS, /* proc.memory.datrss */ - PCP_PROC_MEM_DIRTY, /* proc.memory.dirty */ - - PCP_PROC_SMAPS_PSS, /* proc.smaps.pss */ - PCP_PROC_SMAPS_SWAP, /* proc.smaps.swap */ - PCP_PROC_SMAPS_SWAPPSS, /* proc.smaps.swappss */ - - PCP_METRIC_COUNT /* total metric count */ -} PCPMetric; - -void PCPMetric_enable(PCPMetric metric, bool enable); - -bool PCPMetric_enabled(PCPMetric metric); - -void PCPMetric_enableThreads(void); - -bool PCPMetric_fetch(struct timeval* timestamp); - -bool PCPMetric_iterate(PCPMetric metric, int* instp, int* offsetp); - -pmAtomValue* PCPMetric_values(PCPMetric metric, pmAtomValue* atom, int count, int type); - -const pmDesc* PCPMetric_desc(PCPMetric metric); - -int PCPMetric_type(PCPMetric metric); - -int PCPMetric_instanceCount(PCPMetric metric); - -int PCPMetric_instanceOffset(PCPMetric metric, int inst); - -pmAtomValue* PCPMetric_instance(PCPMetric metric, int inst, int offset, pmAtomValue* atom, int type); - -#endif diff --git a/fedora/.local/bin/htop-vim/pcp/PCPProcess.c b/fedora/.local/bin/htop-vim/pcp/PCPProcess.c deleted file mode 100644 index b8b87ca..0000000 --- a/fedora/.local/bin/htop-vim/pcp/PCPProcess.c +++ /dev/null @@ -1,291 +0,0 @@ -/* -htop - PCPProcess.c -(C) 2014 Hisham H. Muhammad -(C) 2020-2021 htop dev team -(C) 2020-2021 Red Hat, Inc. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "pcp/PCPProcess.h" - -#include -#include -#include - -#include "CRT.h" -#include "Macros.h" -#include "Process.h" -#include "ProvideCurses.h" -#include "RichString.h" -#include "XUtils.h" - -#include "pcp/PCPDynamicColumn.h" - - -const ProcessFieldData Process_fields[] = { - [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, - [PID] = { .name = "PID", .title = "PID", .description = "Process/thread ID", .flags = 0, .pidColumn = true, }, - [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, - [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging, I idle)", .flags = 0, }, - [PPID] = { .name = "PPID", .title = "PPID", .description = "Parent process ID", .flags = 0, }, - [PGRP] = { .name = "PGRP", .title = "PGRP", .description = "Process group ID", .flags = 0, }, - [SESSION] = { .name = "SESSION", .title = "SID", .description = "Process's session ID", .flags = 0, }, - [TTY] = { .name = "TTY", .title = "TTY ", .description = "Controlling terminal", .flags = 0, }, - [TPGID] = { .name = "TPGID", .title = "TPGID", .description = "Process ID of the fg process group of the controlling terminal", .flags = 0, }, - [MINFLT] = { .name = "MINFLT", .title = " MINFLT ", .description = "Number of minor faults which have not required loading a memory page from disk", .flags = 0, .defaultSortDesc = true, }, - [CMINFLT] = { .name = "CMINFLT", .title = " CMINFLT ", .description = "Children processes' minor faults", .flags = 0, .defaultSortDesc = true, }, - [MAJFLT] = { .name = "MAJFLT", .title = " MAJFLT ", .description = "Number of major faults which have required loading a memory page from disk", .flags = 0, .defaultSortDesc = true, }, - [CMAJFLT] = { .name = "CMAJFLT", .title = " CMAJFLT ", .description = "Children processes' major faults", .flags = 0, .defaultSortDesc = true, }, - [UTIME] = { .name = "UTIME", .title = " UTIME+ ", .description = "User CPU time - time the process spent executing in user mode", .flags = 0, .defaultSortDesc = true, }, - [STIME] = { .name = "STIME", .title = " STIME+ ", .description = "System CPU time - time the kernel spent running system calls for this process", .flags = 0, .defaultSortDesc = true, }, - [CUTIME] = { .name = "CUTIME", .title = " CUTIME+ ", .description = "Children processes' user CPU time", .flags = 0, .defaultSortDesc = true, }, - [CSTIME] = { .name = "CSTIME", .title = " CSTIME+ ", .description = "Children processes' system CPU time", .flags = 0, .defaultSortDesc = true, }, - [PRIORITY] = { .name = "PRIORITY", .title = "PRI ", .description = "Kernel's internal priority for the process", .flags = 0, }, - [NICE] = { .name = "NICE", .title = " NI ", .description = "Nice value (the higher the value, the more it lets other processes take priority)", .flags = 0, }, - [STARTTIME] = { .name = "STARTTIME", .title = "START ", .description = "Time the process was started", .flags = 0, }, - [ELAPSED] = { .name = "ELAPSED", .title = "ELAPSED ", .description = "Time since the process was started", .flags = 0, }, - [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "If of the CPU the process last executed on", .flags = 0, }, - [M_VIRT] = { .name = "M_VIRT", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, .defaultSortDesc = true, }, - [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, .defaultSortDesc = true, }, - [M_SHARE] = { .name = "M_SHARE", .title = " SHR ", .description = "Size of the process's shared pages", .flags = 0, .defaultSortDesc = true, }, - [M_TRS] = { .name = "M_TRS", .title = " CODE ", .description = "Size of the text segment of the process", .flags = 0, .defaultSortDesc = true, }, - [M_DRS] = { .name = "M_DRS", .title = " DATA ", .description = "Size of the data segment plus stack usage of the process", .flags = 0, .defaultSortDesc = true, }, - [M_LRS] = { .name = "M_LRS", .title = " LIB ", .description = "The library size of the process (unused since Linux 2.6; always 0)", .flags = 0, .defaultSortDesc = true, }, - [M_DT] = { .name = "M_DT", .title = " DIRTY ", .description = "Size of the dirty pages of the process (unused since Linux 2.6; always 0)", .flags = 0, .defaultSortDesc = true, }, - [ST_UID] = { .name = "ST_UID", .title = "UID", .description = "User ID of the process owner", .flags = 0, }, - [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = " CPU%", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, .defaultSortDesc = true, .autoWidth = true, }, - [PERCENT_NORM_CPU] = { .name = "PERCENT_NORM_CPU", .title = "NCPU%", .description = "Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)", .flags = 0, .defaultSortDesc = true, .autoWidth = true, }, - [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, .defaultSortDesc = true, }, - [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, - [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, .defaultSortDesc = true, }, - [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, .defaultSortDesc = true, }, - [TGID] = { .name = "TGID", .title = "TGID", .description = "Thread group ID (i.e. process ID)", .flags = 0, }, - [RCHAR] = { .name = "RCHAR", .title = "RCHAR ", .description = "Number of bytes the process has read", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [WCHAR] = { .name = "WCHAR", .title = "WCHAR ", .description = "Number of bytes the process has written", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [SYSCR] = { .name = "SYSCR", .title = " READ_SYSC ", .description = "Number of read(2) syscalls for the process", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [SYSCW] = { .name = "SYSCW", .title = " WRITE_SYSC ", .description = "Number of write(2) syscalls for the process", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [RBYTES] = { .name = "RBYTES", .title = " IO_R ", .description = "Bytes of read(2) I/O for the process", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [WBYTES] = { .name = "WBYTES", .title = " IO_W ", .description = "Bytes of write(2) I/O for the process", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [CNCLWB] = { .name = "CNCLWB", .title = " IO_C ", .description = "Bytes of cancelled write(2) I/O", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [IO_READ_RATE] = { .name = "IO_READ_RATE", .title = " DISK READ ", .description = "The I/O rate of read(2) in bytes per second for the process", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [IO_WRITE_RATE] = { .name = "IO_WRITE_RATE", .title = " DISK WRITE ", .description = "The I/O rate of write(2) in bytes per second for the process", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [IO_RATE] = { .name = "IO_RATE", .title = " DISK R/W ", .description = "Total I/O rate in bytes per second", .flags = PROCESS_FLAG_IO, .defaultSortDesc = true, }, - [CGROUP] = { .name = "CGROUP", .title = " CGROUP ", .description = "Which cgroup the process is in", .flags = PROCESS_FLAG_LINUX_CGROUP, }, - [OOM] = { .name = "OOM", .title = " OOM ", .description = "OOM (Out-of-Memory) killer score", .flags = PROCESS_FLAG_LINUX_OOM, .defaultSortDesc = true, }, - [PERCENT_CPU_DELAY] = { .name = "PERCENT_CPU_DELAY", .title = "CPUD% ", .description = "CPU delay %", .flags = 0, .defaultSortDesc = true, }, - [PERCENT_IO_DELAY] = { .name = "PERCENT_IO_DELAY", .title = " IOD% ", .description = "Block I/O delay %", .flags = 0, .defaultSortDesc = true, }, - [PERCENT_SWAP_DELAY] = { .name = "PERCENT_SWAP_DELAY", .title = "SWAPD% ", .description = "Swapin delay %", .flags = 0, .defaultSortDesc = true, }, - [M_PSS] = { .name = "M_PSS", .title = " PSS ", .description = "proportional set size, same as M_RESIDENT but each page is divided by the number of processes sharing it.", .flags = PROCESS_FLAG_LINUX_SMAPS, .defaultSortDesc = true, }, - [M_SWAP] = { .name = "M_SWAP", .title = " SWAP ", .description = "Size of the process's swapped pages", .flags = PROCESS_FLAG_LINUX_SMAPS, .defaultSortDesc = true, }, - [M_PSSWP] = { .name = "M_PSSWP", .title = " PSSWP ", .description = "shows proportional swap share of this mapping, Unlike \"Swap\", this does not take into account swapped out page of underlying shmem objects.", .flags = PROCESS_FLAG_LINUX_SMAPS, .defaultSortDesc = true, }, - [CTXT] = { .name = "CTXT", .title = " CTXT ", .description = "Context switches (incremental sum of voluntary_ctxt_switches and nonvoluntary_ctxt_switches)", .flags = PROCESS_FLAG_LINUX_CTXT, .defaultSortDesc = true, }, - [SECATTR] = { .name = "SECATTR", .title = " Security Attribute ", .description = "Security attribute of the process (e.g. SELinux or AppArmor)", .flags = PROCESS_FLAG_LINUX_SECATTR, }, - [PROC_COMM] = { .name = "COMM", .title = "COMM ", .description = "comm string of the process", .flags = 0, }, - [PROC_EXE] = { .name = "EXE", .title = "EXE ", .description = "Basename of exe of the process", .flags = 0, }, - [CWD] = { .name = "CWD", .title = "CWD ", .description = "The current working directory of the process", .flags = PROCESS_FLAG_CWD, }, - [AUTOGROUP_ID] = { .name = "AUTOGROUP_ID", .title = "AGRP", .description = "The autogroup identifier of the process", .flags = PROCESS_FLAG_LINUX_AUTOGROUP, }, - [AUTOGROUP_NICE] = { .name = "AUTOGROUP_NICE", .title = " ANI", .description = "Nice value (the higher the value, the more other processes take priority) associated with the process autogroup", .flags = PROCESS_FLAG_LINUX_AUTOGROUP, }, -}; - -Process* PCPProcess_new(const Settings* settings) { - PCPProcess* this = xCalloc(1, sizeof(PCPProcess)); - Object_setClass(this, Class(PCPProcess)); - Process_init(&this->super, settings); - return &this->super; -} - -void Process_delete(Object* cast) { - PCPProcess* this = (PCPProcess*) cast; - Process_done((Process*)cast); - free(this->cgroup); - free(this->secattr); - free(this); -} - -static void PCPProcess_printDelay(float delay_percent, char* buffer, int n) { - if (isnan(delay_percent)) { - xSnprintf(buffer, n, " N/A "); - } else { - xSnprintf(buffer, n, "%4.1f ", delay_percent); - } -} - -static void PCPProcess_writeField(const Process* this, RichString* str, ProcessField field) { - const PCPProcess* pp = (const PCPProcess*) this; - bool coloring = this->settings->highlightMegabytes; - char buffer[256]; buffer[255] = '\0'; - int attr = CRT_colors[DEFAULT_COLOR]; - int n = sizeof(buffer) - 1; - switch ((int)field) { - case CMINFLT: Process_printCount(str, pp->cminflt, coloring); return; - case CMAJFLT: Process_printCount(str, pp->cmajflt, coloring); return; - case M_DRS: Process_printBytes(str, pp->m_drs, coloring); return; - case M_DT: Process_printBytes(str, pp->m_dt, coloring); return; - case M_LRS: Process_printBytes(str, pp->m_lrs, coloring); return; - case M_TRS: Process_printBytes(str, pp->m_trs, coloring); return; - case M_SHARE: Process_printBytes(str, pp->m_share, coloring); return; - case M_PSS: Process_printKBytes(str, pp->m_pss, coloring); return; - case M_SWAP: Process_printKBytes(str, pp->m_swap, coloring); return; - case M_PSSWP: Process_printKBytes(str, pp->m_psswp, coloring); return; - case UTIME: Process_printTime(str, pp->utime, coloring); return; - case STIME: Process_printTime(str, pp->stime, coloring); return; - case CUTIME: Process_printTime(str, pp->cutime, coloring); return; - case CSTIME: Process_printTime(str, pp->cstime, coloring); return; - case RCHAR: Process_printBytes(str, pp->io_rchar, coloring); return; - case WCHAR: Process_printBytes(str, pp->io_wchar, coloring); return; - case SYSCR: Process_printCount(str, pp->io_syscr, coloring); return; - case SYSCW: Process_printCount(str, pp->io_syscw, coloring); return; - case RBYTES: Process_printBytes(str, pp->io_read_bytes, coloring); return; - case WBYTES: Process_printBytes(str, pp->io_write_bytes, coloring); return; - case CNCLWB: Process_printBytes(str, pp->io_cancelled_write_bytes, coloring); return; - case IO_READ_RATE: Process_printRate(str, pp->io_rate_read_bps, coloring); return; - case IO_WRITE_RATE: Process_printRate(str, pp->io_rate_write_bps, coloring); return; - case IO_RATE: { - double totalRate = NAN; - if (!isnan(pp->io_rate_read_bps) && !isnan(pp->io_rate_write_bps)) - totalRate = pp->io_rate_read_bps + pp->io_rate_write_bps; - else if (!isnan(pp->io_rate_read_bps)) - totalRate = pp->io_rate_read_bps; - else if (!isnan(pp->io_rate_write_bps)) - totalRate = pp->io_rate_write_bps; - else - totalRate = NAN; - Process_printRate(str, totalRate, coloring); - return; - } - case CGROUP: xSnprintf(buffer, n, "%-10s ", pp->cgroup ? pp->cgroup : ""); break; - case OOM: xSnprintf(buffer, n, "%4u ", pp->oom); break; - case PERCENT_CPU_DELAY: - PCPProcess_printDelay(pp->cpu_delay_percent, buffer, n); - break; - case PERCENT_IO_DELAY: - PCPProcess_printDelay(pp->blkio_delay_percent, buffer, n); - break; - case PERCENT_SWAP_DELAY: - PCPProcess_printDelay(pp->swapin_delay_percent, buffer, n); - break; - case CTXT: - if (pp->ctxt_diff > 1000) { - attr |= A_BOLD; - } - xSnprintf(buffer, n, "%5lu ", pp->ctxt_diff); - break; - case SECATTR: snprintf(buffer, n, "%-30s ", pp->secattr ? pp->secattr : "?"); break; - case AUTOGROUP_ID: - if (pp->autogroup_id != -1) { - xSnprintf(buffer, n, "%4ld ", pp->autogroup_id); - } else { - attr = CRT_colors[PROCESS_SHADOW]; - xSnprintf(buffer, n, " N/A "); - } - break; - case AUTOGROUP_NICE: - if (pp->autogroup_id != -1) { - xSnprintf(buffer, n, "%3d ", pp->autogroup_nice); - attr = pp->autogroup_nice < 0 ? CRT_colors[PROCESS_HIGH_PRIORITY] - : pp->autogroup_nice > 0 ? CRT_colors[PROCESS_LOW_PRIORITY] - : CRT_colors[PROCESS_SHADOW]; - } else { - attr = CRT_colors[PROCESS_SHADOW]; - xSnprintf(buffer, n, "N/A "); - } - break; - default: - Process_writeField(this, str, field); - return; - } - RichString_appendWide(str, attr, buffer); -} - -static double adjustNaN(double num) { - if (isnan(num)) - return -0.0005; - - return num; -} - -static int PCPProcess_compareByKey(const Process* v1, const Process* v2, ProcessField key) { - const PCPProcess* p1 = (const PCPProcess*)v1; - const PCPProcess* p2 = (const PCPProcess*)v2; - - switch (key) { - case M_DRS: - return SPACESHIP_NUMBER(p1->m_drs, p2->m_drs); - case M_DT: - return SPACESHIP_NUMBER(p1->m_dt, p2->m_dt); - case M_LRS: - return SPACESHIP_NUMBER(p1->m_lrs, p2->m_lrs); - case M_TRS: - return SPACESHIP_NUMBER(p1->m_trs, p2->m_trs); - case M_SHARE: - return SPACESHIP_NUMBER(p1->m_share, p2->m_share); - case M_PSS: - return SPACESHIP_NUMBER(p1->m_pss, p2->m_pss); - case M_SWAP: - return SPACESHIP_NUMBER(p1->m_swap, p2->m_swap); - case M_PSSWP: - return SPACESHIP_NUMBER(p1->m_psswp, p2->m_psswp); - case UTIME: - return SPACESHIP_NUMBER(p1->utime, p2->utime); - case CUTIME: - return SPACESHIP_NUMBER(p1->cutime, p2->cutime); - case STIME: - return SPACESHIP_NUMBER(p1->stime, p2->stime); - case CSTIME: - return SPACESHIP_NUMBER(p1->cstime, p2->cstime); - case RCHAR: - return SPACESHIP_NUMBER(p1->io_rchar, p2->io_rchar); - case WCHAR: - return SPACESHIP_NUMBER(p1->io_wchar, p2->io_wchar); - case SYSCR: - return SPACESHIP_NUMBER(p1->io_syscr, p2->io_syscr); - case SYSCW: - return SPACESHIP_NUMBER(p1->io_syscw, p2->io_syscw); - case RBYTES: - return SPACESHIP_NUMBER(p1->io_read_bytes, p2->io_read_bytes); - case WBYTES: - return SPACESHIP_NUMBER(p1->io_write_bytes, p2->io_write_bytes); - case CNCLWB: - return SPACESHIP_NUMBER(p1->io_cancelled_write_bytes, p2->io_cancelled_write_bytes); - case IO_READ_RATE: - return SPACESHIP_NUMBER(adjustNaN(p1->io_rate_read_bps), adjustNaN(p2->io_rate_read_bps)); - case IO_WRITE_RATE: - return SPACESHIP_NUMBER(adjustNaN(p1->io_rate_write_bps), adjustNaN(p2->io_rate_write_bps)); - case IO_RATE: - return SPACESHIP_NUMBER(adjustNaN(p1->io_rate_read_bps) + adjustNaN(p1->io_rate_write_bps), adjustNaN(p2->io_rate_read_bps) + adjustNaN(p2->io_rate_write_bps)); - case CGROUP: - return SPACESHIP_NULLSTR(p1->cgroup, p2->cgroup); - case OOM: - return SPACESHIP_NUMBER(p1->oom, p2->oom); - case PERCENT_CPU_DELAY: - return SPACESHIP_NUMBER(p1->cpu_delay_percent, p2->cpu_delay_percent); - case PERCENT_IO_DELAY: - return SPACESHIP_NUMBER(p1->blkio_delay_percent, p2->blkio_delay_percent); - case PERCENT_SWAP_DELAY: - return SPACESHIP_NUMBER(p1->swapin_delay_percent, p2->swapin_delay_percent); - case CTXT: - return SPACESHIP_NUMBER(p1->ctxt_diff, p2->ctxt_diff); - case SECATTR: - return SPACESHIP_NULLSTR(p1->secattr, p2->secattr); - case AUTOGROUP_ID: - return SPACESHIP_NUMBER(p1->autogroup_id, p2->autogroup_id); - case AUTOGROUP_NICE: - return SPACESHIP_NUMBER(p1->autogroup_nice, p2->autogroup_nice); - default: - if (key < LAST_PROCESSFIELD) - return Process_compareByKey_Base(v1, v2, key); - return PCPDynamicColumn_compareByKey(p1, p2, key); - } -} - -const ProcessClass PCPProcess_class = { - .super = { - .extends = Class(Process), - .display = Process_display, - .delete = Process_delete, - .compare = Process_compare - }, - .writeField = PCPProcess_writeField, - .compareByKey = PCPProcess_compareByKey -}; diff --git a/fedora/.local/bin/htop-vim/pcp/PCPProcess.h b/fedora/.local/bin/htop-vim/pcp/PCPProcess.h deleted file mode 100644 index 46ba07f..0000000 --- a/fedora/.local/bin/htop-vim/pcp/PCPProcess.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef HEADER_PCPProcess -#define HEADER_PCPProcess -/* -htop - PCPProcess.h -(C) 2014 Hisham H. Muhammad -(C) 2020 htop dev team -(C) 2020-2021 Red Hat, Inc. All Rights Reserved. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include - -#include "Object.h" -#include "Process.h" -#include "Settings.h" - - -#define PROCESS_FLAG_LINUX_CGROUP 0x00000800 -#define PROCESS_FLAG_LINUX_OOM 0x00001000 -#define PROCESS_FLAG_LINUX_SMAPS 0x00002000 -#define PROCESS_FLAG_LINUX_CTXT 0x00004000 -#define PROCESS_FLAG_LINUX_SECATTR 0x00008000 -#define PROCESS_FLAG_LINUX_AUTOGROUP 0x00080000 - -typedef struct PCPProcess_ { - Process super; - - /* default result offset to use for searching proc metrics */ - unsigned int offset; - - unsigned long int cminflt; - unsigned long int cmajflt; - unsigned long long int utime; - unsigned long long int stime; - unsigned long long int cutime; - unsigned long long int cstime; - long m_share; - long m_pss; - long m_swap; - long m_psswp; - long m_trs; - long m_drs; - long m_lrs; - long m_dt; - - /* Data read (in kilobytes) */ - unsigned long long io_rchar; - - /* Data written (in kilobytes) */ - unsigned long long io_wchar; - - /* Number of read(2) syscalls */ - unsigned long long io_syscr; - - /* Number of write(2) syscalls */ - unsigned long long io_syscw; - - /* Storage data read (in kilobytes) */ - unsigned long long io_read_bytes; - - /* Storage data written (in kilobytes) */ - unsigned long long io_write_bytes; - - /* Storage data cancelled (in kilobytes) */ - unsigned long long io_cancelled_write_bytes; - - /* Point in time of last io scan (in seconds elapsed since the Epoch) */ - unsigned long long io_last_scan_time; - - double io_rate_read_bps; - double io_rate_write_bps; - char* cgroup; - long int autogroup_id; - int autogroup_nice; - unsigned int oom; - unsigned long long int delay_read_time; - unsigned long long cpu_delay_total; - unsigned long long blkio_delay_total; - unsigned long long swapin_delay_total; - float cpu_delay_percent; - float blkio_delay_percent; - float swapin_delay_percent; - unsigned long ctxt_total; - unsigned long ctxt_diff; - char* secattr; - unsigned long long int last_mlrs_calctime; -} PCPProcess; - -extern const ProcessFieldData Process_fields[LAST_PROCESSFIELD]; - -extern const ProcessClass PCPProcess_class; - -Process* PCPProcess_new(const Settings* settings); - -void Process_delete(Object* cast); - -bool Process_isThread(const Process* this); - -#endif diff --git a/fedora/.local/bin/htop-vim/pcp/PCPProcessList.c b/fedora/.local/bin/htop-vim/pcp/PCPProcessList.c deleted file mode 100644 index f893689..0000000 --- a/fedora/.local/bin/htop-vim/pcp/PCPProcessList.c +++ /dev/null @@ -1,727 +0,0 @@ -/* -htop - PCPProcessList.c -(C) 2014 Hisham H. Muhammad -(C) 2020-2021 htop dev team -(C) 2020-2021 Red Hat, Inc. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "pcp/PCPProcessList.h" - -#include -#include -#include -#include -#include -#include - -#include "Macros.h" -#include "Object.h" -#include "Platform.h" -#include "Process.h" -#include "Settings.h" -#include "XUtils.h" - -#include "pcp/PCPMetric.h" -#include "pcp/PCPProcess.h" - - -static void PCPProcessList_updateCPUcount(PCPProcessList* this) { - ProcessList* pl = &(this->super); - pl->activeCPUs = PCPMetric_instanceCount(PCP_PERCPU_SYSTEM); - unsigned int cpus = Platform_getMaxCPU(); - if (cpus == pl->existingCPUs) - return; - if (cpus == 0) - cpus = pl->activeCPUs; - if (cpus <= 1) - cpus = pl->activeCPUs = 1; - pl->existingCPUs = cpus; - - free(this->percpu); - free(this->values); - - this->percpu = xCalloc(cpus, sizeof(pmAtomValue *)); - for (unsigned int i = 0; i < cpus; i++) - this->percpu[i] = xCalloc(CPU_METRIC_COUNT, sizeof(pmAtomValue)); - this->values = xCalloc(cpus, sizeof(pmAtomValue)); -} - -static char* setUser(UsersTable* this, unsigned int uid, int pid, int offset) { - char* name = Hashtable_get(this->users, uid); - if (name) - return name; - - pmAtomValue value; - if (PCPMetric_instance(PCP_PROC_ID_USER, pid, offset, &value, PM_TYPE_STRING)) { - Hashtable_put(this->users, uid, value.cp); - name = value.cp; - } - return name; -} - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId) { - PCPProcessList* this = xCalloc(1, sizeof(PCPProcessList)); - ProcessList* super = &(this->super); - - ProcessList_init(super, Class(PCPProcess), usersTable, dynamicMeters, dynamicColumns, pidMatchList, userId); - - struct timeval timestamp; - gettimeofday(×tamp, NULL); - this->timestamp = pmtimevalToReal(×tamp); - - this->cpu = xCalloc(CPU_METRIC_COUNT, sizeof(pmAtomValue)); - PCPProcessList_updateCPUcount(this); - - return super; -} - -void ProcessList_delete(ProcessList* pl) { - PCPProcessList* this = (PCPProcessList*) pl; - ProcessList_done(pl); - free(this->values); - for (unsigned int i = 0; i < pl->existingCPUs; i++) - free(this->percpu[i]); - free(this->percpu); - free(this->cpu); - free(this); -} - -static inline long Metric_instance_s32(int metric, int pid, int offset, long fallback) { - pmAtomValue value; - if (PCPMetric_instance(metric, pid, offset, &value, PM_TYPE_32)) - return value.l; - return fallback; -} - -static inline long long Metric_instance_s64(int metric, int pid, int offset, long long fallback) { - pmAtomValue value; - if (PCPMetric_instance(metric, pid, offset, &value, PM_TYPE_64)) - return value.l; - return fallback; -} - -static inline unsigned long Metric_instance_u32(int metric, int pid, int offset, unsigned long fallback) { - pmAtomValue value; - if (PCPMetric_instance(metric, pid, offset, &value, PM_TYPE_U32)) - return value.ul; - return fallback; -} - -static inline unsigned long long Metric_instance_u64(int metric, int pid, int offset, unsigned long long fallback) { - pmAtomValue value; - if (PCPMetric_instance(metric, pid, offset, &value, PM_TYPE_U64)) - return value.ull; - return fallback; -} - -static inline unsigned long long Metric_instance_time(int metric, int pid, int offset) { - pmAtomValue value; - if (PCPMetric_instance(metric, pid, offset, &value, PM_TYPE_U64)) - return value.ull / 10; - return 0; -} - -static inline unsigned long long Metric_instance_ONE_K(int metric, int pid, int offset) { - pmAtomValue value; - if (PCPMetric_instance(metric, pid, offset, &value, PM_TYPE_U64)) - return value.ull / ONE_K; - return ULLONG_MAX; -} - -static inline char Metric_instance_char(int metric, int pid, int offset, char fallback) { - pmAtomValue value; - if (PCPMetric_instance(metric, pid, offset, &value, PM_TYPE_STRING)) { - char uchar = value.cp[0]; - free(value.cp); - return uchar; - } - return fallback; -} - -static inline ProcessState PCPProcessList_getProcessState(char state) { - switch (state) { - case '?': return UNKNOWN; - case 'R': return RUNNING; - case 'W': return WAITING; - case 'D': return UNINTERRUPTIBLE_WAIT; - case 'P': return PAGING; - case 'T': return STOPPED; - case 't': return TRACED; - case 'Z': return ZOMBIE; - case 'X': return DEFUNCT; - case 'I': return IDLE; - case 'S': return SLEEPING; - default: return UNKNOWN; - } -} - -static void PCPProcessList_updateID(Process* process, int pid, int offset) { - process->tgid = Metric_instance_u32(PCP_PROC_TGID, pid, offset, 1); - process->ppid = Metric_instance_u32(PCP_PROC_PPID, pid, offset, 1); - process->state = PCPProcessList_getProcessState(Metric_instance_char(PCP_PROC_STATE, pid, offset, '?')); -} - -static void PCPProcessList_updateInfo(Process* process, int pid, int offset, char* command, size_t commLen) { - PCPProcess* pp = (PCPProcess*) process; - pmAtomValue value; - - if (!PCPMetric_instance(PCP_PROC_CMD, pid, offset, &value, PM_TYPE_STRING)) - value.cp = xStrdup(""); - String_safeStrncpy(command, value.cp, commLen); - free(value.cp); - - process->pgrp = Metric_instance_u32(PCP_PROC_PGRP, pid, offset, 0); - process->session = Metric_instance_u32(PCP_PROC_SESSION, pid, offset, 0); - process->tty_nr = Metric_instance_u32(PCP_PROC_TTY, pid, offset, 0); - process->tpgid = Metric_instance_u32(PCP_PROC_TTYPGRP, pid, offset, 0); - process->minflt = Metric_instance_u32(PCP_PROC_MINFLT, pid, offset, 0); - pp->cminflt = Metric_instance_u32(PCP_PROC_CMINFLT, pid, offset, 0); - process->majflt = Metric_instance_u32(PCP_PROC_MAJFLT, pid, offset, 0); - pp->cmajflt = Metric_instance_u32(PCP_PROC_CMAJFLT, pid, offset, 0); - pp->utime = Metric_instance_time(PCP_PROC_UTIME, pid, offset); - pp->stime = Metric_instance_time(PCP_PROC_STIME, pid, offset); - pp->cutime = Metric_instance_time(PCP_PROC_CUTIME, pid, offset); - pp->cstime = Metric_instance_time(PCP_PROC_CSTIME, pid, offset); - process->priority = Metric_instance_u32(PCP_PROC_PRIORITY, pid, offset, 0); - process->nice = Metric_instance_s32(PCP_PROC_NICE, pid, offset, 0); - process->nlwp = Metric_instance_u32(PCP_PROC_THREADS, pid, offset, 0); - process->starttime_ctime = Metric_instance_time(PCP_PROC_STARTTIME, pid, offset); - process->processor = Metric_instance_u32(PCP_PROC_PROCESSOR, pid, offset, 0); - - process->time = pp->utime + pp->stime; -} - -static void PCPProcessList_updateIO(PCPProcess* pp, int pid, int offset, unsigned long long now) { - pmAtomValue value; - - pp->io_rchar = Metric_instance_ONE_K(PCP_PROC_IO_RCHAR, pid, offset); - pp->io_wchar = Metric_instance_ONE_K(PCP_PROC_IO_WCHAR, pid, offset); - pp->io_syscr = Metric_instance_u64(PCP_PROC_IO_SYSCR, pid, offset, ULLONG_MAX); - pp->io_syscw = Metric_instance_u64(PCP_PROC_IO_SYSCW, pid, offset, ULLONG_MAX); - pp->io_cancelled_write_bytes = Metric_instance_ONE_K(PCP_PROC_IO_CANCELLED, pid, offset); - - if (PCPMetric_instance(PCP_PROC_IO_READB, pid, offset, &value, PM_TYPE_U64)) { - unsigned long long last_read = pp->io_read_bytes; - pp->io_read_bytes = value.ull / ONE_K; - pp->io_rate_read_bps = ONE_K * (pp->io_read_bytes - last_read) / - (now - pp->io_last_scan_time); - } else { - pp->io_read_bytes = ULLONG_MAX; - pp->io_rate_read_bps = NAN; - } - - if (PCPMetric_instance(PCP_PROC_IO_WRITEB, pid, offset, &value, PM_TYPE_U64)) { - unsigned long long last_write = pp->io_write_bytes; - pp->io_write_bytes = value.ull; - pp->io_rate_write_bps = ONE_K * (pp->io_write_bytes - last_write) / - (now - pp->io_last_scan_time); - } else { - pp->io_write_bytes = ULLONG_MAX; - pp->io_rate_write_bps = NAN; - } - - pp->io_last_scan_time = now; -} - -static void PCPProcessList_updateMemory(PCPProcess* pp, int pid, int offset) { - pp->super.m_virt = Metric_instance_u32(PCP_PROC_MEM_SIZE, pid, offset, 0); - pp->super.m_resident = Metric_instance_u32(PCP_PROC_MEM_RSS, pid, offset, 0); - pp->m_share = Metric_instance_u32(PCP_PROC_MEM_SHARE, pid, offset, 0); - pp->m_trs = Metric_instance_u32(PCP_PROC_MEM_TEXTRS, pid, offset, 0); - pp->m_lrs = Metric_instance_u32(PCP_PROC_MEM_LIBRS, pid, offset, 0); - pp->m_drs = Metric_instance_u32(PCP_PROC_MEM_DATRS, pid, offset, 0); - pp->m_dt = Metric_instance_u32(PCP_PROC_MEM_DIRTY, pid, offset, 0); -} - -static void PCPProcessList_updateSmaps(PCPProcess* pp, pid_t pid, int offset) { - pp->m_pss = Metric_instance_u64(PCP_PROC_SMAPS_PSS, pid, offset, 0); - pp->m_swap = Metric_instance_u64(PCP_PROC_SMAPS_SWAP, pid, offset, 0); - pp->m_psswp = Metric_instance_u64(PCP_PROC_SMAPS_SWAPPSS, pid, offset, 0); -} - -static void PCPProcessList_readOomData(PCPProcess* pp, int pid, int offset) { - pp->oom = Metric_instance_u32(PCP_PROC_OOMSCORE, pid, offset, 0); -} - -static void PCPProcessList_readAutogroup(PCPProcess* pp, int pid, int offset) { - pp->autogroup_id = Metric_instance_s64(PCP_PROC_AUTOGROUP_ID, pid, offset, -1); - pp->autogroup_nice = Metric_instance_s32(PCP_PROC_AUTOGROUP_NICE, pid, offset, 0); -} - -static void PCPProcessList_readCtxtData(PCPProcess* pp, int pid, int offset) { - pmAtomValue value; - unsigned long ctxt = 0; - - if (PCPMetric_instance(PCP_PROC_VCTXSW, pid, offset, &value, PM_TYPE_U32)) - ctxt += value.ul; - if (PCPMetric_instance(PCP_PROC_NVCTXSW, pid, offset, &value, PM_TYPE_U32)) - ctxt += value.ul; - - pp->ctxt_diff = ctxt > pp->ctxt_total ? ctxt - pp->ctxt_total : 0; - pp->ctxt_total = ctxt; -} - -static char* setString(PCPMetric metric, int pid, int offset, char* string) { - if (string) - free(string); - pmAtomValue value; - if (PCPMetric_instance(metric, pid, offset, &value, PM_TYPE_STRING)) - string = value.cp; - else - string = NULL; - return string; -} - -static void PCPProcessList_updateTTY(Process* process, int pid, int offset) { - process->tty_name = setString(PCP_PROC_TTYNAME, pid, offset, process->tty_name); -} - -static void PCPProcessList_readCGroups(PCPProcess* pp, int pid, int offset) { - pp->cgroup = setString(PCP_PROC_CGROUPS, pid, offset, pp->cgroup); -} - -static void PCPProcessList_readSecattrData(PCPProcess* pp, int pid, int offset) { - pp->secattr = setString(PCP_PROC_LABELS, pid, offset, pp->secattr); -} - -static void PCPProcessList_readCwd(PCPProcess* pp, int pid, int offset) { - pp->super.procCwd = setString(PCP_PROC_CWD, pid, offset, pp->super.procCwd); -} - -static void PCPProcessList_updateUsername(Process* process, int pid, int offset, UsersTable* users) { - process->st_uid = Metric_instance_u32(PCP_PROC_ID_UID, pid, offset, 0); - process->user = setUser(users, process->st_uid, pid, offset); -} - -static void PCPProcessList_updateCmdline(Process* process, int pid, int offset, const char* comm) { - pmAtomValue value; - if (!PCPMetric_instance(PCP_PROC_PSARGS, pid, offset, &value, PM_TYPE_STRING)) { - if (process->state != ZOMBIE) - process->isKernelThread = true; - Process_updateCmdline(process, NULL, 0, 0); - return; - } - - char* command = value.cp; - int length = strlen(command); - if (command[0] != '(') { - process->isKernelThread = false; - } else { - ++command; - --length; - if (command[length - 1] == ')') - command[--length] = '\0'; - process->isKernelThread = true; - } - - int tokenStart = 0; - for (int i = 0; i < length; i++) { - /* htop considers the next character after the last / that is before - * basenameOffset, as the start of the basename in cmdline - see - * Process_writeCommand */ - if (command[i] == '/') - tokenStart = i + 1; - } - int tokenEnd = length; - - Process_updateCmdline(process, command, tokenStart, tokenEnd); - free(value.cp); - - Process_updateComm(process, comm); - - if (PCPMetric_instance(PCP_PROC_EXE, pid, offset, &value, PM_TYPE_STRING)) { - Process_updateExe(process, value.cp[0] ? value.cp : NULL); - free(value.cp); - } -} - -static bool PCPProcessList_updateProcesses(PCPProcessList* this, double period, struct timeval* tv) { - ProcessList* pl = (ProcessList*) this; - const Settings* settings = pl->settings; - - bool hideKernelThreads = settings->hideKernelThreads; - bool hideUserlandThreads = settings->hideUserlandThreads; - - unsigned long long now = tv->tv_sec * 1000LL + tv->tv_usec / 1000LL; - int pid = -1, offset = -1; - - /* for every process ... */ - while (PCPMetric_iterate(PCP_PROC_PID, &pid, &offset)) { - - bool preExisting; - Process* proc = ProcessList_getProcess(pl, pid, &preExisting, PCPProcess_new); - PCPProcess* pp = (PCPProcess*) proc; - PCPProcessList_updateID(proc, pid, offset); - proc->isUserlandThread = proc->pid != proc->tgid; - pp->offset = offset >= 0 ? offset : 0; - - /* - * These conditions will not trigger on first occurrence, cause we need to - * add the process to the ProcessList and do all one time scans - * (e.g. parsing the cmdline to detect a kernel thread) - * But it will short-circuit subsequent scans. - */ - if (preExisting && hideKernelThreads && Process_isKernelThread(proc)) { - proc->updated = true; - proc->show = false; - if (proc->state == RUNNING) - pl->runningTasks++; - pl->kernelThreads++; - pl->totalTasks++; - continue; - } - if (preExisting && hideUserlandThreads && Process_isUserlandThread(proc)) { - proc->updated = true; - proc->show = false; - if (proc->state == RUNNING) - pl->runningTasks++; - pl->userlandThreads++; - pl->totalTasks++; - continue; - } - - if (settings->ss->flags & PROCESS_FLAG_IO) - PCPProcessList_updateIO(pp, pid, offset, now); - - PCPProcessList_updateMemory(pp, pid, offset); - - if ((settings->ss->flags & PROCESS_FLAG_LINUX_SMAPS) && - (Process_isKernelThread(proc) == false)) { - if (PCPMetric_enabled(PCP_PROC_SMAPS_PSS)) - PCPProcessList_updateSmaps(pp, pid, offset); - } - - char command[MAX_NAME + 1]; - unsigned int tty_nr = proc->tty_nr; - unsigned long long int lasttimes = pp->utime + pp->stime; - - PCPProcessList_updateInfo(proc, pid, offset, command, sizeof(command)); - proc->starttime_ctime += Platform_getBootTime(); - if (tty_nr != proc->tty_nr) - PCPProcessList_updateTTY(proc, pid, offset); - - float percent_cpu = (pp->utime + pp->stime - lasttimes) / period * 100.0; - proc->percent_cpu = isnan(percent_cpu) ? - 0.0 : CLAMP(percent_cpu, 0.0, pl->activeCPUs * 100.0); - proc->percent_mem = proc->m_resident / (double)pl->totalMem * 100.0; - Process_updateCPUFieldWidths(proc->percent_cpu); - - PCPProcessList_updateUsername(proc, pid, offset, pl->usersTable); - - if (!preExisting) { - PCPProcessList_updateCmdline(proc, pid, offset, command); - Process_fillStarttimeBuffer(proc); - ProcessList_add(pl, proc); - } else if (settings->updateProcessNames && proc->state != ZOMBIE) { - PCPProcessList_updateCmdline(proc, pid, offset, command); - } - - if (settings->ss->flags & PROCESS_FLAG_LINUX_CGROUP) - PCPProcessList_readCGroups(pp, pid, offset); - - if (settings->ss->flags & PROCESS_FLAG_LINUX_OOM) - PCPProcessList_readOomData(pp, pid, offset); - - if (settings->ss->flags & PROCESS_FLAG_LINUX_CTXT) - PCPProcessList_readCtxtData(pp, pid, offset); - - if (settings->ss->flags & PROCESS_FLAG_LINUX_SECATTR) - PCPProcessList_readSecattrData(pp, pid, offset); - - if (settings->ss->flags & PROCESS_FLAG_CWD) - PCPProcessList_readCwd(pp, pid, offset); - - if (settings->ss->flags & PROCESS_FLAG_LINUX_AUTOGROUP) - PCPProcessList_readAutogroup(pp, pid, offset); - - if (proc->state == ZOMBIE && !proc->cmdline && command[0]) { - Process_updateCmdline(proc, command, 0, strlen(command)); - } else if (Process_isThread(proc)) { - if ((settings->showThreadNames || Process_isKernelThread(proc)) && command[0]) { - Process_updateCmdline(proc, command, 0, strlen(command)); - } - - if (Process_isKernelThread(proc)) { - pl->kernelThreads++; - } else { - pl->userlandThreads++; - } - } - - /* Set at the end when we know if a new entry is a thread */ - proc->show = ! ((hideKernelThreads && Process_isKernelThread(proc)) || - (hideUserlandThreads && Process_isUserlandThread(proc))); - - pl->totalTasks++; - if (proc->state == RUNNING) - pl->runningTasks++; - proc->updated = true; - } - return true; -} - -static void PCPProcessList_updateMemoryInfo(ProcessList* super) { - unsigned long long int freeMem = 0; - unsigned long long int swapFreeMem = 0; - unsigned long long int sreclaimableMem = 0; - super->totalMem = super->usedMem = super->cachedMem = 0; - super->usedSwap = super->totalSwap = super->sharedMem = 0; - - pmAtomValue value; - if (PCPMetric_values(PCP_MEM_TOTAL, &value, 1, PM_TYPE_U64) != NULL) - super->totalMem = value.ull; - if (PCPMetric_values(PCP_MEM_FREE, &value, 1, PM_TYPE_U64) != NULL) - freeMem = value.ull; - if (PCPMetric_values(PCP_MEM_BUFFERS, &value, 1, PM_TYPE_U64) != NULL) - super->buffersMem = value.ull; - if (PCPMetric_values(PCP_MEM_SRECLAIM, &value, 1, PM_TYPE_U64) != NULL) - sreclaimableMem = value.ull; - if (PCPMetric_values(PCP_MEM_SHARED, &value, 1, PM_TYPE_U64) != NULL) - super->sharedMem = value.ull; - if (PCPMetric_values(PCP_MEM_CACHED, &value, 1, PM_TYPE_U64) != NULL) - super->cachedMem = value.ull + sreclaimableMem - super->sharedMem; - const memory_t usedDiff = freeMem + super->cachedMem + sreclaimableMem + super->buffersMem; - super->usedMem = (super->totalMem >= usedDiff) ? - super->totalMem - usedDiff : super->totalMem - freeMem; - if (PCPMetric_values(PCP_MEM_AVAILABLE, &value, 1, PM_TYPE_U64) != NULL) - super->availableMem = MINIMUM(value.ull, super->totalMem); - else - super->availableMem = freeMem; - if (PCPMetric_values(PCP_MEM_SWAPFREE, &value, 1, PM_TYPE_U64) != NULL) - swapFreeMem = value.ull; - if (PCPMetric_values(PCP_MEM_SWAPTOTAL, &value, 1, PM_TYPE_U64) != NULL) - super->totalSwap = value.ull; - if (PCPMetric_values(PCP_MEM_SWAPCACHED, &value, 1, PM_TYPE_U64) != NULL) - super->cachedSwap = value.ull; - super->usedSwap = super->totalSwap - swapFreeMem - super->cachedSwap; -} - -/* make copies of previously sampled values to avoid overwrite */ -static inline void PCPProcessList_backupCPUTime(pmAtomValue* values) { - /* the PERIOD fields (must) mirror the TIME fields */ - for (int metric = CPU_TOTAL_TIME; metric < CPU_TOTAL_PERIOD; metric++) { - values[metric + CPU_TOTAL_PERIOD] = values[metric]; - } -} - -static inline void PCPProcessList_saveCPUTimePeriod(pmAtomValue* values, CPUMetric previous, pmAtomValue* latest) { - pmAtomValue* value; - - /* new value for period */ - value = &values[previous]; - if (latest->ull > value->ull) - value->ull = latest->ull - value->ull; - else - value->ull = 0; - - /* new value for time */ - value = &values[previous - CPU_TOTAL_PERIOD]; - value->ull = latest->ull; -} - -/* using copied sampled values and new values, calculate derivations */ -static void PCPProcessList_deriveCPUTime(pmAtomValue* values) { - - pmAtomValue* usertime = &values[CPU_USER_TIME]; - pmAtomValue* guesttime = &values[CPU_GUEST_TIME]; - usertime->ull -= guesttime->ull; - - pmAtomValue* nicetime = &values[CPU_NICE_TIME]; - pmAtomValue* guestnicetime = &values[CPU_GUESTNICE_TIME]; - nicetime->ull -= guestnicetime->ull; - - pmAtomValue* idletime = &values[CPU_IDLE_TIME]; - pmAtomValue* iowaittime = &values[CPU_IOWAIT_TIME]; - pmAtomValue* idlealltime = &values[CPU_IDLE_ALL_TIME]; - idlealltime->ull = idletime->ull + iowaittime->ull; - - pmAtomValue* systemtime = &values[CPU_SYSTEM_TIME]; - pmAtomValue* irqtime = &values[CPU_IRQ_TIME]; - pmAtomValue* softirqtime = &values[CPU_SOFTIRQ_TIME]; - pmAtomValue* systalltime = &values[CPU_SYSTEM_ALL_TIME]; - systalltime->ull = systemtime->ull + irqtime->ull + softirqtime->ull; - - pmAtomValue* virtalltime = &values[CPU_GUEST_TIME]; - virtalltime->ull = guesttime->ull + guestnicetime->ull; - - pmAtomValue* stealtime = &values[CPU_STEAL_TIME]; - pmAtomValue* totaltime = &values[CPU_TOTAL_TIME]; - totaltime->ull = usertime->ull + nicetime->ull + systalltime->ull + - idlealltime->ull + stealtime->ull + virtalltime->ull; - - PCPProcessList_saveCPUTimePeriod(values, CPU_USER_PERIOD, usertime); - PCPProcessList_saveCPUTimePeriod(values, CPU_NICE_PERIOD, nicetime); - PCPProcessList_saveCPUTimePeriod(values, CPU_SYSTEM_PERIOD, systemtime); - PCPProcessList_saveCPUTimePeriod(values, CPU_SYSTEM_ALL_PERIOD, systalltime); - PCPProcessList_saveCPUTimePeriod(values, CPU_IDLE_ALL_PERIOD, idlealltime); - PCPProcessList_saveCPUTimePeriod(values, CPU_IDLE_PERIOD, idletime); - PCPProcessList_saveCPUTimePeriod(values, CPU_IOWAIT_PERIOD, iowaittime); - PCPProcessList_saveCPUTimePeriod(values, CPU_IRQ_PERIOD, irqtime); - PCPProcessList_saveCPUTimePeriod(values, CPU_SOFTIRQ_PERIOD, softirqtime); - PCPProcessList_saveCPUTimePeriod(values, CPU_STEAL_PERIOD, stealtime); - PCPProcessList_saveCPUTimePeriod(values, CPU_GUEST_PERIOD, virtalltime); - PCPProcessList_saveCPUTimePeriod(values, CPU_TOTAL_PERIOD, totaltime); -} - -static void PCPProcessList_updateAllCPUTime(PCPProcessList* this, PCPMetric metric, CPUMetric cpumetric) -{ - pmAtomValue* value = &this->cpu[cpumetric]; - if (PCPMetric_values(metric, value, 1, PM_TYPE_U64) == NULL) - memset(value, 0, sizeof(pmAtomValue)); -} - -static void PCPProcessList_updatePerCPUTime(PCPProcessList* this, PCPMetric metric, CPUMetric cpumetric) -{ - int cpus = this->super.existingCPUs; - if (PCPMetric_values(metric, this->values, cpus, PM_TYPE_U64) == NULL) - memset(this->values, 0, cpus * sizeof(pmAtomValue)); - for (int i = 0; i < cpus; i++) - this->percpu[i][cpumetric].ull = this->values[i].ull; -} - -static void PCPProcessList_updatePerCPUReal(PCPProcessList* this, PCPMetric metric, CPUMetric cpumetric) -{ - int cpus = this->super.existingCPUs; - if (PCPMetric_values(metric, this->values, cpus, PM_TYPE_DOUBLE) == NULL) - memset(this->values, 0, cpus * sizeof(pmAtomValue)); - for (int i = 0; i < cpus; i++) - this->percpu[i][cpumetric].d = this->values[i].d; -} - -static inline void PCPProcessList_scanZfsArcstats(PCPProcessList* this) { - unsigned long long int dbufSize = 0; - unsigned long long int dnodeSize = 0; - unsigned long long int bonusSize = 0; - pmAtomValue value; - - memset(&this->zfs, 0, sizeof(ZfsArcStats)); - if (PCPMetric_values(PCP_ZFS_ARC_ANON_SIZE, &value, 1, PM_TYPE_U64)) - this->zfs.anon = value.ull / ONE_K; - if (PCPMetric_values(PCP_ZFS_ARC_C_MIN, &value, 1, PM_TYPE_U64)) - this->zfs.min = value.ull / ONE_K; - if (PCPMetric_values(PCP_ZFS_ARC_C_MAX, &value, 1, PM_TYPE_U64)) - this->zfs.max = value.ull / ONE_K; - if (PCPMetric_values(PCP_ZFS_ARC_BONUS_SIZE, &value, 1, PM_TYPE_U64)) - bonusSize = value.ull / ONE_K; - if (PCPMetric_values(PCP_ZFS_ARC_DBUF_SIZE, &value, 1, PM_TYPE_U64)) - dbufSize = value.ull / ONE_K; - if (PCPMetric_values(PCP_ZFS_ARC_DNODE_SIZE, &value, 1, PM_TYPE_U64)) - dnodeSize = value.ull / ONE_K; - if (PCPMetric_values(PCP_ZFS_ARC_COMPRESSED_SIZE, &value, 1, PM_TYPE_U64)) - this->zfs.compressed = value.ull / ONE_K; - if (PCPMetric_values(PCP_ZFS_ARC_UNCOMPRESSED_SIZE, &value, 1, PM_TYPE_U64)) - this->zfs.uncompressed = value.ull / ONE_K; - if (PCPMetric_values(PCP_ZFS_ARC_HDR_SIZE, &value, 1, PM_TYPE_U64)) - this->zfs.header = value.ull / ONE_K; - if (PCPMetric_values(PCP_ZFS_ARC_MFU_SIZE, &value, 1, PM_TYPE_U64)) - this->zfs.MFU = value.ull / ONE_K; - if (PCPMetric_values(PCP_ZFS_ARC_MRU_SIZE, &value, 1, PM_TYPE_U64)) - this->zfs.MRU = value.ull / ONE_K; - if (PCPMetric_values(PCP_ZFS_ARC_SIZE, &value, 1, PM_TYPE_U64)) - this->zfs.size = value.ull / ONE_K; - - this->zfs.other = (dbufSize + dnodeSize + bonusSize) / ONE_K; - this->zfs.enabled = (this->zfs.size > 0); - this->zfs.isCompressed = (this->zfs.compressed > 0); -} - -static void PCPProcessList_updateHeader(ProcessList* super, const Settings* settings) { - PCPProcessList_updateMemoryInfo(super); - - PCPProcessList* this = (PCPProcessList*) super; - PCPProcessList_updateCPUcount(this); - - PCPProcessList_backupCPUTime(this->cpu); - PCPProcessList_updateAllCPUTime(this, PCP_CPU_USER, CPU_USER_TIME); - PCPProcessList_updateAllCPUTime(this, PCP_CPU_NICE, CPU_NICE_TIME); - PCPProcessList_updateAllCPUTime(this, PCP_CPU_SYSTEM, CPU_SYSTEM_TIME); - PCPProcessList_updateAllCPUTime(this, PCP_CPU_IDLE, CPU_IDLE_TIME); - PCPProcessList_updateAllCPUTime(this, PCP_CPU_IOWAIT, CPU_IOWAIT_TIME); - PCPProcessList_updateAllCPUTime(this, PCP_CPU_IRQ, CPU_IRQ_TIME); - PCPProcessList_updateAllCPUTime(this, PCP_CPU_SOFTIRQ, CPU_SOFTIRQ_TIME); - PCPProcessList_updateAllCPUTime(this, PCP_CPU_STEAL, CPU_STEAL_TIME); - PCPProcessList_updateAllCPUTime(this, PCP_CPU_GUEST, CPU_GUEST_TIME); - PCPProcessList_deriveCPUTime(this->cpu); - - for (unsigned int i = 0; i < super->existingCPUs; i++) - PCPProcessList_backupCPUTime(this->percpu[i]); - PCPProcessList_updatePerCPUTime(this, PCP_PERCPU_USER, CPU_USER_TIME); - PCPProcessList_updatePerCPUTime(this, PCP_PERCPU_NICE, CPU_NICE_TIME); - PCPProcessList_updatePerCPUTime(this, PCP_PERCPU_SYSTEM, CPU_SYSTEM_TIME); - PCPProcessList_updatePerCPUTime(this, PCP_PERCPU_IDLE, CPU_IDLE_TIME); - PCPProcessList_updatePerCPUTime(this, PCP_PERCPU_IOWAIT, CPU_IOWAIT_TIME); - PCPProcessList_updatePerCPUTime(this, PCP_PERCPU_IRQ, CPU_IRQ_TIME); - PCPProcessList_updatePerCPUTime(this, PCP_PERCPU_SOFTIRQ, CPU_SOFTIRQ_TIME); - PCPProcessList_updatePerCPUTime(this, PCP_PERCPU_STEAL, CPU_STEAL_TIME); - PCPProcessList_updatePerCPUTime(this, PCP_PERCPU_GUEST, CPU_GUEST_TIME); - for (unsigned int i = 0; i < super->existingCPUs; i++) - PCPProcessList_deriveCPUTime(this->percpu[i]); - - if (settings->showCPUFrequency) - PCPProcessList_updatePerCPUReal(this, PCP_HINV_CPUCLOCK, CPU_FREQUENCY); - - PCPProcessList_scanZfsArcstats(this); -} - -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { - PCPProcessList* this = (PCPProcessList*) super; - const Settings* settings = super->settings; - bool enabled = !pauseProcessUpdate; - - bool flagged = settings->showCPUFrequency; - PCPMetric_enable(PCP_HINV_CPUCLOCK, flagged); - - /* In pause mode do not sample per-process metric values at all */ - for (int metric = PCP_PROC_PID; metric < PCP_METRIC_COUNT; metric++) - PCPMetric_enable(metric, enabled); - - flagged = settings->ss->flags & PROCESS_FLAG_LINUX_CGROUP; - PCPMetric_enable(PCP_PROC_CGROUPS, flagged && enabled); - flagged = settings->ss->flags & PROCESS_FLAG_LINUX_OOM; - PCPMetric_enable(PCP_PROC_OOMSCORE, flagged && enabled); - flagged = settings->ss->flags & PROCESS_FLAG_LINUX_CTXT; - PCPMetric_enable(PCP_PROC_VCTXSW, flagged && enabled); - PCPMetric_enable(PCP_PROC_NVCTXSW, flagged && enabled); - flagged = settings->ss->flags & PROCESS_FLAG_LINUX_SECATTR; - PCPMetric_enable(PCP_PROC_LABELS, flagged && enabled); - flagged = settings->ss->flags & PROCESS_FLAG_LINUX_AUTOGROUP; - PCPMetric_enable(PCP_PROC_AUTOGROUP_ID, flagged && enabled); - PCPMetric_enable(PCP_PROC_AUTOGROUP_NICE, flagged && enabled); - - /* Sample smaps metrics on every second pass to improve performance */ - static int smaps_flag; - smaps_flag = !!smaps_flag; - PCPMetric_enable(PCP_PROC_SMAPS_PSS, smaps_flag && enabled); - PCPMetric_enable(PCP_PROC_SMAPS_SWAP, smaps_flag && enabled); - PCPMetric_enable(PCP_PROC_SMAPS_SWAPPSS, smaps_flag && enabled); - - struct timeval timestamp; - if (PCPMetric_fetch(×tamp) != true) - return; - - double sample = this->timestamp; - this->timestamp = pmtimevalToReal(×tamp); - - PCPProcessList_updateHeader(super, settings); - - /* In pause mode only update global data for meters (CPU, memory, etc) */ - if (pauseProcessUpdate) - return; - - double period = (this->timestamp - sample) * 100; - PCPProcessList_updateProcesses(this, period, ×tamp); -} - -bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id) { - assert(id < super->existingCPUs); - (void) super; - - pmAtomValue value; - if (PCPMetric_instance(PCP_PERCPU_SYSTEM, id, id, &value, PM_TYPE_U32)) - return true; - return false; -} diff --git a/fedora/.local/bin/htop-vim/pcp/PCPProcessList.h b/fedora/.local/bin/htop-vim/pcp/PCPProcessList.h deleted file mode 100644 index a3a7372..0000000 --- a/fedora/.local/bin/htop-vim/pcp/PCPProcessList.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef HEADER_PCPProcessList -#define HEADER_PCPProcessList -/* -htop - PCPProcessList.h -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include -#include - -#include "Hashtable.h" -#include "ProcessList.h" -#include "UsersTable.h" - -#include "pcp/Platform.h" -#include "zfs/ZfsArcStats.h" - - -typedef enum CPUMetric_ { - CPU_TOTAL_TIME, - CPU_USER_TIME, - CPU_SYSTEM_TIME, - CPU_SYSTEM_ALL_TIME, - CPU_IDLE_ALL_TIME, - CPU_IDLE_TIME, - CPU_NICE_TIME, - CPU_IOWAIT_TIME, - CPU_IRQ_TIME, - CPU_SOFTIRQ_TIME, - CPU_STEAL_TIME, - CPU_GUEST_TIME, - CPU_GUESTNICE_TIME, - - CPU_TOTAL_PERIOD, - CPU_USER_PERIOD, - CPU_SYSTEM_PERIOD, - CPU_SYSTEM_ALL_PERIOD, - CPU_IDLE_ALL_PERIOD, - CPU_IDLE_PERIOD, - CPU_NICE_PERIOD, - CPU_IOWAIT_PERIOD, - CPU_IRQ_PERIOD, - CPU_SOFTIRQ_PERIOD, - CPU_STEAL_PERIOD, - CPU_GUEST_PERIOD, - CPU_GUESTNICE_PERIOD, - - CPU_FREQUENCY, - - CPU_METRIC_COUNT -} CPUMetric; - -typedef struct PCPProcessList_ { - ProcessList super; - double timestamp; /* previous sample timestamp */ - pmAtomValue* cpu; /* aggregate values for each metric */ - pmAtomValue** percpu; /* per-processor values for each metric */ - pmAtomValue* values; /* per-processor buffer for just one metric */ - ZfsArcStats zfs; -} PCPProcessList; - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId); - -void ProcessList_delete(ProcessList* pl); - -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate); - -bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id); - -#endif diff --git a/fedora/.local/bin/htop-vim/pcp/Platform.c b/fedora/.local/bin/htop-vim/pcp/Platform.c deleted file mode 100644 index d9f75eb..0000000 --- a/fedora/.local/bin/htop-vim/pcp/Platform.c +++ /dev/null @@ -1,846 +0,0 @@ -/* -htop - linux/Platform.c -(C) 2014 Hisham H. Muhammad -(C) 2020-2022 htop dev team -(C) 2020-2022 Red Hat, Inc. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "pcp/Platform.h" - -#include -#include -#include -#include -#include - -#include "BatteryMeter.h" -#include "CPUMeter.h" -#include "ClockMeter.h" -#include "DateMeter.h" -#include "DateTimeMeter.h" -#include "DiskIOMeter.h" -#include "DynamicColumn.h" -#include "DynamicMeter.h" -#include "HostnameMeter.h" -#include "LoadAverageMeter.h" -#include "Macros.h" -#include "MemoryMeter.h" -#include "MemorySwapMeter.h" -#include "Meter.h" -#include "NetworkIOMeter.h" -#include "ProcessList.h" -#include "Settings.h" -#include "SwapMeter.h" -#include "SysArchMeter.h" -#include "TasksMeter.h" -#include "UptimeMeter.h" -#include "XUtils.h" - -#include "linux/PressureStallMeter.h" -#include "linux/ZramMeter.h" -#include "linux/ZramStats.h" -#include "pcp/PCPDynamicColumn.h" -#include "pcp/PCPDynamicMeter.h" -#include "pcp/PCPMetric.h" -#include "pcp/PCPProcessList.h" -#include "zfs/ZfsArcMeter.h" -#include "zfs/ZfsArcStats.h" -#include "zfs/ZfsCompressedArcMeter.h" - - -Platform* pcp; - -const ScreenDefaults Platform_defaultScreens[] = { - { - .name = "Main", - .columns = "PID USER PRIORITY NICE M_VIRT M_RESIDENT M_SHARE STATE PERCENT_CPU PERCENT_MEM TIME Command", - .sortKey = "PERCENT_CPU", - }, - { - .name = "I/O", - .columns = "PID USER IO_PRIORITY IO_RATE IO_READ_RATE IO_WRITE_RATE PERCENT_SWAP_DELAY PERCENT_IO_DELAY Command", - .sortKey = "IO_RATE", - }, -}; - -const unsigned int Platform_numberOfDefaultScreens = ARRAYSIZE(Platform_defaultScreens); - -const SignalItem Platform_signals[] = { - { .name = " 0 Cancel", .number = 0 }, -}; - -const unsigned int Platform_numberOfSignals = ARRAYSIZE(Platform_signals); - -const MeterClass* const Platform_meterTypes[] = { - &CPUMeter_class, - &DynamicMeter_class, - &ClockMeter_class, - &DateMeter_class, - &DateTimeMeter_class, - &LoadAverageMeter_class, - &LoadMeter_class, - &MemoryMeter_class, - &SwapMeter_class, - &MemorySwapMeter_class, - &TasksMeter_class, - &UptimeMeter_class, - &BatteryMeter_class, - &HostnameMeter_class, - &AllCPUsMeter_class, - &AllCPUs2Meter_class, - &AllCPUs4Meter_class, - &AllCPUs8Meter_class, - &LeftCPUsMeter_class, - &RightCPUsMeter_class, - &LeftCPUs2Meter_class, - &RightCPUs2Meter_class, - &LeftCPUs4Meter_class, - &RightCPUs4Meter_class, - &LeftCPUs8Meter_class, - &RightCPUs8Meter_class, - &BlankMeter_class, - &PressureStallCPUSomeMeter_class, - &PressureStallIOSomeMeter_class, - &PressureStallIOFullMeter_class, - &PressureStallIRQFullMeter_class, - &PressureStallMemorySomeMeter_class, - &PressureStallMemoryFullMeter_class, - &ZfsArcMeter_class, - &ZfsCompressedArcMeter_class, - &ZramMeter_class, - &DiskIOMeter_class, - &NetworkIOMeter_class, - &SysArchMeter_class, - NULL -}; - -static const char* Platform_metricNames[] = { - [PCP_CONTROL_THREADS] = "proc.control.perclient.threads", - - [PCP_HINV_NCPU] = "hinv.ncpu", - [PCP_HINV_CPUCLOCK] = "hinv.cpu.clock", - [PCP_UNAME_SYSNAME] = "kernel.uname.sysname", - [PCP_UNAME_RELEASE] = "kernel.uname.release", - [PCP_UNAME_MACHINE] = "kernel.uname.machine", - [PCP_UNAME_DISTRO] = "kernel.uname.distro", - [PCP_LOAD_AVERAGE] = "kernel.all.load", - [PCP_PID_MAX] = "kernel.all.pid_max", - [PCP_UPTIME] = "kernel.all.uptime", - [PCP_BOOTTIME] = "kernel.all.boottime", - [PCP_CPU_USER] = "kernel.all.cpu.user", - [PCP_CPU_NICE] = "kernel.all.cpu.nice", - [PCP_CPU_SYSTEM] = "kernel.all.cpu.sys", - [PCP_CPU_IDLE] = "kernel.all.cpu.idle", - [PCP_CPU_IOWAIT] = "kernel.all.cpu.wait.total", - [PCP_CPU_IRQ] = "kernel.all.cpu.intr", - [PCP_CPU_SOFTIRQ] = "kernel.all.cpu.irq.soft", - [PCP_CPU_STEAL] = "kernel.all.cpu.steal", - [PCP_CPU_GUEST] = "kernel.all.cpu.guest", - [PCP_CPU_GUESTNICE] = "kernel.all.cpu.guest_nice", - [PCP_PERCPU_USER] = "kernel.percpu.cpu.user", - [PCP_PERCPU_NICE] = "kernel.percpu.cpu.nice", - [PCP_PERCPU_SYSTEM] = "kernel.percpu.cpu.sys", - [PCP_PERCPU_IDLE] = "kernel.percpu.cpu.idle", - [PCP_PERCPU_IOWAIT] = "kernel.percpu.cpu.wait.total", - [PCP_PERCPU_IRQ] = "kernel.percpu.cpu.intr", - [PCP_PERCPU_SOFTIRQ] = "kernel.percpu.cpu.irq.soft", - [PCP_PERCPU_STEAL] = "kernel.percpu.cpu.steal", - [PCP_PERCPU_GUEST] = "kernel.percpu.cpu.guest", - [PCP_PERCPU_GUESTNICE] = "kernel.percpu.cpu.guest_nice", - [PCP_MEM_TOTAL] = "mem.physmem", - [PCP_MEM_FREE] = "mem.util.free", - [PCP_MEM_AVAILABLE] = "mem.util.available", - [PCP_MEM_BUFFERS] = "mem.util.bufmem", - [PCP_MEM_CACHED] = "mem.util.cached", - [PCP_MEM_SHARED] = "mem.util.shmem", - [PCP_MEM_SRECLAIM] = "mem.util.slabReclaimable", - [PCP_MEM_SWAPCACHED] = "mem.util.swapCached", - [PCP_MEM_SWAPTOTAL] = "mem.util.swapTotal", - [PCP_MEM_SWAPFREE] = "mem.util.swapFree", - [PCP_DISK_READB] = "disk.all.read_bytes", - [PCP_DISK_WRITEB] = "disk.all.write_bytes", - [PCP_DISK_ACTIVE] = "disk.all.avactive", - [PCP_NET_RECVB] = "network.all.in.bytes", - [PCP_NET_SENDB] = "network.all.out.bytes", - [PCP_NET_RECVP] = "network.all.in.packets", - [PCP_NET_SENDP] = "network.all.out.packets", - - [PCP_PSI_CPUSOME] = "kernel.all.pressure.cpu.some.avg", - [PCP_PSI_IOSOME] = "kernel.all.pressure.io.some.avg", - [PCP_PSI_IOFULL] = "kernel.all.pressure.io.full.avg", - [PCP_PSI_IRQFULL] = "kernel.all.pressure.irq.full.avg", - [PCP_PSI_MEMSOME] = "kernel.all.pressure.memory.some.avg", - [PCP_PSI_MEMFULL] = "kernel.all.pressure.memory.full.avg", - - [PCP_ZFS_ARC_ANON_SIZE] = "zfs.arc.anon_size", - [PCP_ZFS_ARC_BONUS_SIZE] = "zfs.arc.bonus_size", - [PCP_ZFS_ARC_COMPRESSED_SIZE] = "zfs.arc.compressed_size", - [PCP_ZFS_ARC_UNCOMPRESSED_SIZE] = "zfs.arc.uncompressed_size", - [PCP_ZFS_ARC_C_MIN] = "zfs.arc.c_min", - [PCP_ZFS_ARC_C_MAX] = "zfs.arc.c_max", - [PCP_ZFS_ARC_DBUF_SIZE] = "zfs.arc.dbuf_size", - [PCP_ZFS_ARC_DNODE_SIZE] = "zfs.arc.dnode_size", - [PCP_ZFS_ARC_HDR_SIZE] = "zfs.arc.hdr_size", - [PCP_ZFS_ARC_MFU_SIZE] = "zfs.arc.mfu.size", - [PCP_ZFS_ARC_MRU_SIZE] = "zfs.arc.mru.size", - [PCP_ZFS_ARC_SIZE] = "zfs.arc.size", - - [PCP_ZRAM_CAPACITY] = "zram.capacity", - [PCP_ZRAM_ORIGINAL] = "zram.mm_stat.data_size.original", - [PCP_ZRAM_COMPRESSED] = "zram.mm_stat.data_size.compressed", - - [PCP_PROC_PID] = "proc.psinfo.pid", - [PCP_PROC_PPID] = "proc.psinfo.ppid", - [PCP_PROC_TGID] = "proc.psinfo.tgid", - [PCP_PROC_PGRP] = "proc.psinfo.pgrp", - [PCP_PROC_SESSION] = "proc.psinfo.session", - [PCP_PROC_STATE] = "proc.psinfo.sname", - [PCP_PROC_TTY] = "proc.psinfo.tty", - [PCP_PROC_TTYPGRP] = "proc.psinfo.tty_pgrp", - [PCP_PROC_MINFLT] = "proc.psinfo.minflt", - [PCP_PROC_MAJFLT] = "proc.psinfo.maj_flt", - [PCP_PROC_CMINFLT] = "proc.psinfo.cmin_flt", - [PCP_PROC_CMAJFLT] = "proc.psinfo.cmaj_flt", - [PCP_PROC_UTIME] = "proc.psinfo.utime", - [PCP_PROC_STIME] = "proc.psinfo.stime", - [PCP_PROC_CUTIME] = "proc.psinfo.cutime", - [PCP_PROC_CSTIME] = "proc.psinfo.cstime", - [PCP_PROC_PRIORITY] = "proc.psinfo.priority", - [PCP_PROC_NICE] = "proc.psinfo.nice", - [PCP_PROC_THREADS] = "proc.psinfo.threads", - [PCP_PROC_STARTTIME] = "proc.psinfo.start_time", - [PCP_PROC_PROCESSOR] = "proc.psinfo.processor", - [PCP_PROC_CMD] = "proc.psinfo.cmd", - [PCP_PROC_PSARGS] = "proc.psinfo.psargs", - [PCP_PROC_CGROUPS] = "proc.psinfo.cgroups", - [PCP_PROC_OOMSCORE] = "proc.psinfo.oom_score", - [PCP_PROC_VCTXSW] = "proc.psinfo.vctxsw", - [PCP_PROC_NVCTXSW] = "proc.psinfo.nvctxsw", - [PCP_PROC_LABELS] = "proc.psinfo.labels", - [PCP_PROC_ENVIRON] = "proc.psinfo.environ", - [PCP_PROC_TTYNAME] = "proc.psinfo.ttyname", - [PCP_PROC_EXE] = "proc.psinfo.exe", - [PCP_PROC_CWD] = "proc.psinfo.cwd", - [PCP_PROC_AUTOGROUP_ID] = "proc.autogroup.id", - [PCP_PROC_AUTOGROUP_NICE] = "proc.autogroup.nice", - [PCP_PROC_ID_UID] = "proc.id.uid", - [PCP_PROC_ID_USER] = "proc.id.uid_nm", - [PCP_PROC_IO_RCHAR] = "proc.io.rchar", - [PCP_PROC_IO_WCHAR] = "proc.io.wchar", - [PCP_PROC_IO_SYSCR] = "proc.io.syscr", - [PCP_PROC_IO_SYSCW] = "proc.io.syscw", - [PCP_PROC_IO_READB] = "proc.io.read_bytes", - [PCP_PROC_IO_WRITEB] = "proc.io.write_bytes", - [PCP_PROC_IO_CANCELLED] = "proc.io.cancelled_write_bytes", - [PCP_PROC_MEM_SIZE] = "proc.memory.size", - [PCP_PROC_MEM_RSS] = "proc.memory.rss", - [PCP_PROC_MEM_SHARE] = "proc.memory.share", - [PCP_PROC_MEM_TEXTRS] = "proc.memory.textrss", - [PCP_PROC_MEM_LIBRS] = "proc.memory.librss", - [PCP_PROC_MEM_DATRS] = "proc.memory.datrss", - [PCP_PROC_MEM_DIRTY] = "proc.memory.dirty", - [PCP_PROC_SMAPS_PSS] = "proc.smaps.pss", - [PCP_PROC_SMAPS_SWAP] = "proc.smaps.swap", - [PCP_PROC_SMAPS_SWAPPSS] = "proc.smaps.swappss", - - [PCP_METRIC_COUNT] = NULL -}; - -#ifndef HAVE_PMLOOKUPDESCS -/* - * pmLookupDescs(3) exists in latest versions of libpcp (5.3.6+), - * but for older versions we provide an implementation here. This - * involves multiple round trips to pmcd though, which the latest - * libpcp version avoids by using a protocol extension. In time, - * perhaps in a few years, we could remove this back-compat code. - */ -int pmLookupDescs(int numpmid, pmID* pmids, pmDesc* descs) { - int count = 0; - - for (int i = 0; i < numpmid; i++) { - /* expect some metrics to be missing - e.g. PMDA not available */ - if (pmids[i] == PM_ID_NULL) - continue; - - int sts = pmLookupDesc(pmids[i], &descs[i]); - if (sts < 0) { - if (pmDebugOptions.appl0) - fprintf(stderr, "Error: cannot lookup metric %s(%s): %s\n", - pcp->names[i], pmIDStr(pcp->pmids[i]), pmErrStr(sts)); - pmids[i] = PM_ID_NULL; - continue; - } - - count++; - } - return count; -} -#endif - -size_t Platform_addMetric(PCPMetric id, const char* name) { - unsigned int i = (unsigned int)id; - - if (i >= PCP_METRIC_COUNT && i >= pcp->totalMetrics) { - /* added via configuration files */ - size_t j = pcp->totalMetrics + 1; - pcp->fetch = xRealloc(pcp->fetch, j * sizeof(pmID)); - pcp->pmids = xRealloc(pcp->pmids, j * sizeof(pmID)); - pcp->names = xRealloc(pcp->names, j * sizeof(char*)); - pcp->descs = xRealloc(pcp->descs, j * sizeof(pmDesc)); - memset(&pcp->descs[i], 0, sizeof(pmDesc)); - } - - pcp->pmids[i] = pcp->fetch[i] = PM_ID_NULL; - pcp->names[i] = name; - return ++pcp->totalMetrics; -} - -/* global state from the environment and command line arguments */ -pmOptions opts; - -bool Platform_init(void) { - const char* source; - if (opts.context == PM_CONTEXT_ARCHIVE) { - source = opts.archives[0]; - } else if (opts.context == PM_CONTEXT_HOST) { - source = opts.nhosts > 0 ? opts.hosts[0] : "local:"; - } else { - opts.context = PM_CONTEXT_HOST; - source = "local:"; - } - - int sts; - sts = pmNewContext(opts.context, source); - /* with no host requested, fallback to PM_CONTEXT_LOCAL shared libraries */ - if (sts < 0 && opts.context == PM_CONTEXT_HOST && opts.nhosts == 0) { - opts.context = PM_CONTEXT_LOCAL; - sts = pmNewContext(opts.context, NULL); - } - if (sts < 0) { - fprintf(stderr, "Cannot setup PCP metric source: %s\n", pmErrStr(sts)); - return false; - } - /* setup timezones and other general startup preparation completion */ - if (pmGetContextOptions(sts, &opts) < 0 || opts.errors) { - pmflush(); - return false; - } - - pcp = xCalloc(1, sizeof(Platform)); - pcp->context = sts; - pcp->fetch = xCalloc(PCP_METRIC_COUNT, sizeof(pmID)); - pcp->pmids = xCalloc(PCP_METRIC_COUNT, sizeof(pmID)); - pcp->names = xCalloc(PCP_METRIC_COUNT, sizeof(char*)); - pcp->descs = xCalloc(PCP_METRIC_COUNT, sizeof(pmDesc)); - - if (opts.context == PM_CONTEXT_ARCHIVE) { - gettimeofday(&pcp->offset, NULL); - pmtimevalDec(&pcp->offset, &opts.start); - } - - for (unsigned int i = 0; i < PCP_METRIC_COUNT; i++) - Platform_addMetric(i, Platform_metricNames[i]); - pcp->meters.offset = PCP_METRIC_COUNT; - - PCPDynamicMeters_init(&pcp->meters); - - pcp->columns.offset = PCP_METRIC_COUNT + pcp->meters.cursor; - PCPDynamicColumns_init(&pcp->columns); - - sts = pmLookupName(pcp->totalMetrics, pcp->names, pcp->pmids); - if (sts < 0) { - fprintf(stderr, "Error: cannot lookup metric names: %s\n", pmErrStr(sts)); - Platform_done(); - return false; - } - - sts = pmLookupDescs(pcp->totalMetrics, pcp->pmids, pcp->descs); - if (sts < 1) { - if (sts < 0) - fprintf(stderr, "Error: cannot lookup descriptors: %s\n", pmErrStr(sts)); - else /* ensure we have at least one valid metric to work with */ - fprintf(stderr, "Error: cannot find a single valid metric, exiting\n"); - Platform_done(); - return false; - } - - /* set proc.control.perclient.threads to 1 for live contexts */ - PCPMetric_enableThreads(); - - /* extract values needed for setup - e.g. cpu count, pid_max */ - PCPMetric_enable(PCP_PID_MAX, true); - PCPMetric_enable(PCP_BOOTTIME, true); - PCPMetric_enable(PCP_HINV_NCPU, true); - PCPMetric_enable(PCP_PERCPU_SYSTEM, true); - PCPMetric_enable(PCP_UNAME_SYSNAME, true); - PCPMetric_enable(PCP_UNAME_RELEASE, true); - PCPMetric_enable(PCP_UNAME_MACHINE, true); - PCPMetric_enable(PCP_UNAME_DISTRO, true); - - for (size_t i = pcp->columns.offset; i < pcp->columns.offset + pcp->columns.count; i++) - PCPMetric_enable(i, true); - - PCPMetric_fetch(NULL); - - for (PCPMetric metric = 0; metric < PCP_PROC_PID; metric++) - PCPMetric_enable(metric, true); - PCPMetric_enable(PCP_PID_MAX, false); /* needed one time only */ - PCPMetric_enable(PCP_BOOTTIME, false); - PCPMetric_enable(PCP_UNAME_SYSNAME, false); - PCPMetric_enable(PCP_UNAME_RELEASE, false); - PCPMetric_enable(PCP_UNAME_MACHINE, false); - PCPMetric_enable(PCP_UNAME_DISTRO, false); - - /* first sample (fetch) performed above, save constants */ - Platform_getBootTime(); - Platform_getRelease(0); - Platform_getMaxCPU(); - Platform_getMaxPid(); - - return true; -} - -void Platform_dynamicColumnsDone(Hashtable* columns) { - PCPDynamicColumns_done(columns); -} - -void Platform_dynamicMetersDone(Hashtable* meters) { - PCPDynamicMeters_done(meters); -} - -void Platform_done(void) { - pmDestroyContext(pcp->context); - if (pcp->result) - pmFreeResult(pcp->result); - free(pcp->release); - free(pcp->fetch); - free(pcp->pmids); - free(pcp->names); - free(pcp->descs); - free(pcp); -} - -void Platform_setBindings(Htop_Action* keys) { - /* no platform-specific key bindings */ - (void)keys; -} - -int Platform_getUptime(void) { - pmAtomValue value; - if (PCPMetric_values(PCP_UPTIME, &value, 1, PM_TYPE_32) == NULL) - return 0; - return value.l; -} - -void Platform_getLoadAverage(double* one, double* five, double* fifteen) { - *one = *five = *fifteen = 0.0; - - pmAtomValue values[3] = {0}; - if (PCPMetric_values(PCP_LOAD_AVERAGE, values, 3, PM_TYPE_DOUBLE) != NULL) { - *one = values[0].d; - *five = values[1].d; - *fifteen = values[2].d; - } -} - -unsigned int Platform_getMaxCPU(void) { - if (pcp->ncpu) - return pcp->ncpu; - - pmAtomValue value; - if (PCPMetric_values(PCP_HINV_NCPU, &value, 1, PM_TYPE_U32) != NULL) - pcp->ncpu = value.ul; - else - pcp->ncpu = 1; - return pcp->ncpu; -} - -int Platform_getMaxPid(void) { - if (pcp->pidmax) - return pcp->pidmax; - - pmAtomValue value; - if (PCPMetric_values(PCP_PID_MAX, &value, 1, PM_TYPE_32) == NULL) - return -1; - pcp->pidmax = value.l; - return pcp->pidmax; -} - -long long Platform_getBootTime(void) { - if (pcp->btime) - return pcp->btime; - - pmAtomValue value; - if (PCPMetric_values(PCP_BOOTTIME, &value, 1, PM_TYPE_64) != NULL) - pcp->btime = value.ll; - return pcp->btime; -} - -static double Platform_setOneCPUValues(Meter* this, pmAtomValue* values) { - - unsigned long long value = values[CPU_TOTAL_PERIOD].ull; - double total = (double) (value == 0 ? 1 : value); - double percent; - - double* v = this->values; - v[CPU_METER_NICE] = values[CPU_NICE_PERIOD].ull / total * 100.0; - v[CPU_METER_NORMAL] = values[CPU_USER_PERIOD].ull / total * 100.0; - if (this->pl->settings->detailedCPUTime) { - v[CPU_METER_KERNEL] = values[CPU_SYSTEM_PERIOD].ull / total * 100.0; - v[CPU_METER_IRQ] = values[CPU_IRQ_PERIOD].ull / total * 100.0; - v[CPU_METER_SOFTIRQ] = values[CPU_SOFTIRQ_PERIOD].ull / total * 100.0; - v[CPU_METER_STEAL] = values[CPU_STEAL_PERIOD].ull / total * 100.0; - v[CPU_METER_GUEST] = values[CPU_GUEST_PERIOD].ull / total * 100.0; - v[CPU_METER_IOWAIT] = values[CPU_IOWAIT_PERIOD].ull / total * 100.0; - this->curItems = 8; - if (this->pl->settings->accountGuestInCPUMeter) - percent = v[0] + v[1] + v[2] + v[3] + v[4] + v[5] + v[6]; - else - percent = v[0] + v[1] + v[2] + v[3] + v[4]; - } else { - v[2] = values[CPU_SYSTEM_ALL_PERIOD].ull / total * 100.0; - value = values[CPU_STEAL_PERIOD].ull + values[CPU_GUEST_PERIOD].ull; - v[3] = value / total * 100.0; - this->curItems = 4; - percent = v[0] + v[1] + v[2] + v[3]; - } - percent = CLAMP(percent, 0.0, 100.0); - if (isnan(percent)) - percent = 0.0; - - v[CPU_METER_FREQUENCY] = values[CPU_FREQUENCY].d; - v[CPU_METER_TEMPERATURE] = NAN; - - return percent; -} - -double Platform_setCPUValues(Meter* this, int cpu) { - const PCPProcessList* pl = (const PCPProcessList*) this->pl; - if (cpu <= 0) /* use aggregate values */ - return Platform_setOneCPUValues(this, pl->cpu); - return Platform_setOneCPUValues(this, pl->percpu[cpu - 1]); -} - -void Platform_setMemoryValues(Meter* this) { - const ProcessList* pl = this->pl; - const PCPProcessList* ppl = (const PCPProcessList*) pl; - - this->total = pl->totalMem; - this->values[MEMORY_METER_USED] = pl->usedMem; - this->values[MEMORY_METER_BUFFERS] = pl->buffersMem; - this->values[MEMORY_METER_SHARED] = pl->sharedMem; - this->values[MEMORY_METER_CACHE] = pl->cachedMem; - this->values[MEMORY_METER_AVAILABLE] = pl->availableMem; - - if (ppl->zfs.enabled != 0) { - // ZFS does not shrink below the value of zfs_arc_min. - unsigned long long int shrinkableSize = 0; - if (ppl->zfs.size > ppl->zfs.min) - shrinkableSize = ppl->zfs.size - ppl->zfs.min; - this->values[MEMORY_METER_USED] -= shrinkableSize; - this->values[MEMORY_METER_CACHE] += shrinkableSize; - this->values[MEMORY_METER_AVAILABLE] += shrinkableSize; - } -} - -void Platform_setSwapValues(Meter* this) { - const ProcessList* pl = this->pl; - this->total = pl->totalSwap; - this->values[SWAP_METER_USED] = pl->usedSwap; - this->values[SWAP_METER_CACHE] = pl->cachedSwap; -} - -void Platform_setZramValues(Meter* this) { - int i, count = PCPMetric_instanceCount(PCP_ZRAM_CAPACITY); - if (!count) { - this->total = 0; - this->values[0] = 0; - this->values[1] = 0; - return; - } - - pmAtomValue* values = xCalloc(count, sizeof(pmAtomValue)); - ZramStats stats = {0}; - - if (PCPMetric_values(PCP_ZRAM_CAPACITY, values, count, PM_TYPE_U64)) { - for (i = 0; i < count; i++) - stats.totalZram += values[i].ull; - } - if (PCPMetric_values(PCP_ZRAM_ORIGINAL, values, count, PM_TYPE_U64)) { - for (i = 0; i < count; i++) - stats.usedZramOrig += values[i].ull; - } - if (PCPMetric_values(PCP_ZRAM_COMPRESSED, values, count, PM_TYPE_U64)) { - for (i = 0; i < count; i++) - stats.usedZramComp += values[i].ull; - } - - free(values); - - this->total = stats.totalZram; - this->values[0] = stats.usedZramComp; - this->values[1] = stats.usedZramOrig; -} - -void Platform_setZfsArcValues(Meter* this) { - const PCPProcessList* ppl = (const PCPProcessList*) this->pl; - - ZfsArcMeter_readStats(this, &(ppl->zfs)); -} - -void Platform_setZfsCompressedArcValues(Meter* this) { - const PCPProcessList* ppl = (const PCPProcessList*) this->pl; - - ZfsCompressedArcMeter_readStats(this, &(ppl->zfs)); -} - -void Platform_getHostname(char* buffer, size_t size) { - const char* hostname = pmGetContextHostName(pcp->context); - String_safeStrncpy(buffer, hostname, size); -} - -void Platform_getRelease(char** string) { - /* fast-path - previously-formatted string */ - if (string) { - *string = pcp->release; - return; - } - - /* first call, extract just-sampled values */ - pmAtomValue sysname, release, machine, distro; - if (!PCPMetric_values(PCP_UNAME_SYSNAME, &sysname, 1, PM_TYPE_STRING)) - sysname.cp = NULL; - if (!PCPMetric_values(PCP_UNAME_RELEASE, &release, 1, PM_TYPE_STRING)) - release.cp = NULL; - if (!PCPMetric_values(PCP_UNAME_MACHINE, &machine, 1, PM_TYPE_STRING)) - machine.cp = NULL; - if (!PCPMetric_values(PCP_UNAME_DISTRO, &distro, 1, PM_TYPE_STRING)) - distro.cp = NULL; - - size_t length = 16; /* padded for formatting characters */ - if (sysname.cp) - length += strlen(sysname.cp); - if (release.cp) - length += strlen(release.cp); - if (machine.cp) - length += strlen(machine.cp); - if (distro.cp) - length += strlen(distro.cp); - pcp->release = xCalloc(1, length); - - if (sysname.cp) { - strcat(pcp->release, sysname.cp); - strcat(pcp->release, " "); - } - if (release.cp) { - strcat(pcp->release, release.cp); - strcat(pcp->release, " "); - } - if (machine.cp) { - strcat(pcp->release, "["); - strcat(pcp->release, machine.cp); - strcat(pcp->release, "] "); - } - if (distro.cp) { - if (pcp->release[0] != '\0') { - strcat(pcp->release, "@ "); - strcat(pcp->release, distro.cp); - } else { - strcat(pcp->release, distro.cp); - } - strcat(pcp->release, " "); - } - - if (pcp->release) /* cull trailing space */ - pcp->release[strlen(pcp->release)] = '\0'; - - free(distro.cp); - free(machine.cp); - free(release.cp); - free(sysname.cp); -} - -char* Platform_getProcessEnv(pid_t pid) { - pmAtomValue value; - if (!PCPMetric_instance(PCP_PROC_ENVIRON, pid, 0, &value, PM_TYPE_STRING)) - return NULL; - return value.cp; -} - -FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) { - (void)pid; - return NULL; -} - -void Platform_getPressureStall(const char* file, bool some, double* ten, double* sixty, double* threehundred) { - *ten = *sixty = *threehundred = 0; - - PCPMetric metric; - if (String_eq(file, "cpu")) - metric = PCP_PSI_CPUSOME; - else if (String_eq(file, "io")) - metric = some ? PCP_PSI_IOSOME : PCP_PSI_IOFULL; - else if (String_eq(file, "irq")) - metric = PCP_PSI_IRQFULL; - else if (String_eq(file, "mem")) - metric = some ? PCP_PSI_MEMSOME : PCP_PSI_MEMFULL; - else - return; - - pmAtomValue values[3] = {0}; - if (PCPMetric_values(metric, values, 3, PM_TYPE_DOUBLE) != NULL) { - *ten = values[0].d; - *sixty = values[1].d; - *threehundred = values[2].d; - } -} - -bool Platform_getDiskIO(DiskIOData* data) { - memset(data, 0, sizeof(*data)); - - pmAtomValue value; - if (PCPMetric_values(PCP_DISK_READB, &value, 1, PM_TYPE_U64) != NULL) - data->totalBytesRead = value.ull; - if (PCPMetric_values(PCP_DISK_WRITEB, &value, 1, PM_TYPE_U64) != NULL) - data->totalBytesWritten = value.ull; - if (PCPMetric_values(PCP_DISK_ACTIVE, &value, 1, PM_TYPE_U64) != NULL) - data->totalMsTimeSpend = value.ull; - return true; -} - -bool Platform_getNetworkIO(NetworkIOData* data) { - memset(data, 0, sizeof(*data)); - - pmAtomValue value; - if (PCPMetric_values(PCP_NET_RECVB, &value, 1, PM_TYPE_U64) != NULL) - data->bytesReceived = value.ull; - if (PCPMetric_values(PCP_NET_SENDB, &value, 1, PM_TYPE_U64) != NULL) - data->bytesTransmitted = value.ull; - if (PCPMetric_values(PCP_NET_RECVP, &value, 1, PM_TYPE_U64) != NULL) - data->packetsReceived = value.ull; - if (PCPMetric_values(PCP_NET_SENDP, &value, 1, PM_TYPE_U64) != NULL) - data->packetsTransmitted = value.ull; - return true; -} - -void Platform_getBattery(double* level, ACPresence* isOnAC) { - *level = NAN; - *isOnAC = AC_ERROR; -} - -void Platform_longOptionsUsage(ATTR_UNUSED const char* name) { - printf( -" --host=HOSTSPEC metrics source is PMCD at HOSTSPEC [see PCPIntro(1)]\n" -" --hostzone set reporting timezone to local time of metrics source\n" -" --timezone=TZ set reporting timezone\n"); -} - -CommandLineStatus Platform_getLongOption(int opt, ATTR_UNUSED int argc, char** argv) { - /* libpcp export without a header definition */ - extern void __pmAddOptHost(pmOptions*, char*); - - switch (opt) { - case PLATFORM_LONGOPT_HOST: /* --host=HOSTSPEC */ - if (argv[optind][0] == '\0') - return STATUS_ERROR_EXIT; - __pmAddOptHost(&opts, optarg); - return STATUS_OK; - - case PLATFORM_LONGOPT_HOSTZONE: /* --hostzone */ - if (opts.timezone) { - pmprintf("%s: at most one of -Z and -z allowed\n", pmGetProgname()); - opts.errors++; - } else { - opts.tzflag = 1; - } - return STATUS_OK; - - case PLATFORM_LONGOPT_TIMEZONE: /* --timezone=TZ */ - if (argv[optind][0] == '\0') - return STATUS_ERROR_EXIT; - if (opts.tzflag) { - pmprintf("%s: at most one of -Z and -z allowed\n", pmGetProgname()); - opts.errors++; - } else { - opts.timezone = optarg; - } - return STATUS_OK; - - default: - break; - } - return STATUS_ERROR_EXIT; -} - -void Platform_gettime_realtime(struct timeval* tv, uint64_t* msec) { - if (gettimeofday(tv, NULL) == 0) { - /* shift by start offset to stay in lock-step with realtime (archives) */ - if (pcp->offset.tv_sec || pcp->offset.tv_usec) - pmtimevalDec(tv, &pcp->offset); - *msec = ((uint64_t)tv->tv_sec * 1000) + ((uint64_t)tv->tv_usec / 1000); - } else { - memset(tv, 0, sizeof(struct timeval)); - *msec = 0; - } -} - -void Platform_gettime_monotonic(uint64_t* msec) { - if (pcp->result) { - struct timeval* tv = &pcp->result->timestamp; - *msec = ((uint64_t)tv->tv_sec * 1000) + ((uint64_t)tv->tv_usec / 1000); - } else { - *msec = 0; - } -} - -Hashtable* Platform_dynamicMeters(void) { - return pcp->meters.table; -} - -void Platform_dynamicMeterInit(Meter* meter) { - PCPDynamicMeter* this = Hashtable_get(pcp->meters.table, meter->param); - if (this) - PCPDynamicMeter_enable(this); -} - -void Platform_dynamicMeterUpdateValues(Meter* meter) { - PCPDynamicMeter* this = Hashtable_get(pcp->meters.table, meter->param); - if (this) - PCPDynamicMeter_updateValues(this, meter); -} - -void Platform_dynamicMeterDisplay(const Meter* meter, RichString* out) { - PCPDynamicMeter* this = Hashtable_get(pcp->meters.table, meter->param); - if (this) - PCPDynamicMeter_display(this, meter, out); -} - -Hashtable* Platform_dynamicColumns(void) { - return pcp->columns.table; -} - -const char* Platform_dynamicColumnInit(unsigned int key) { - PCPDynamicColumn* this = Hashtable_get(pcp->columns.table, key); - if (this) { - PCPMetric_enable(this->id, true); - if (this->super.caption) - return this->super.caption; - if (this->super.heading) - return this->super.heading; - return this->super.name; - } - return NULL; -} - -bool Platform_dynamicColumnWriteField(const Process* proc, RichString* str, unsigned int key) { - PCPDynamicColumn* this = Hashtable_get(pcp->columns.table, key); - if (this) { - PCPDynamicColumn_writeField(this, proc, str); - return true; - } - return false; -} diff --git a/fedora/.local/bin/htop-vim/pcp/Platform.h b/fedora/.local/bin/htop-vim/pcp/Platform.h deleted file mode 100644 index f06f226..0000000 --- a/fedora/.local/bin/htop-vim/pcp/Platform.h +++ /dev/null @@ -1,156 +0,0 @@ -#ifndef HEADER_Platform -#define HEADER_Platform -/* -htop - pcp/Platform.h -(C) 2014 Hisham H. Muhammad -(C) 2020-2021 htop dev team -(C) 2020-2021 Red Hat, Inc. All Rights Reserved. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include -#include -#include -#include -#include -#include - -/* use htop config.h values for these macros, not pcp values */ -#undef PACKAGE_URL -#undef PACKAGE_NAME -#undef PACKAGE_STRING -#undef PACKAGE_TARNAME -#undef PACKAGE_VERSION -#undef PACKAGE_BUGREPORT - -#include "Action.h" -#include "BatteryMeter.h" -#include "DiskIOMeter.h" -#include "Hashtable.h" -#include "Meter.h" -#include "NetworkIOMeter.h" -#include "Process.h" -#include "ProcessLocksScreen.h" -#include "RichString.h" -#include "SignalsPanel.h" -#include "CommandLine.h" - -#include "pcp/PCPDynamicColumn.h" -#include "pcp/PCPDynamicMeter.h" -#include "pcp/PCPMetric.h" - - -typedef struct Platform_ { - int context; /* PMAPI(3) context identifier */ - size_t totalMetrics; /* total number of all metrics */ - const char** names; /* name array indexed by Metric */ - pmID* pmids; /* all known metric identifiers */ - pmID* fetch; /* enabled identifiers for sampling */ - pmDesc* descs; /* metric desc array indexed by Metric */ - pmResult* result; /* sample values result indexed by Metric */ - PCPDynamicMeters meters; /* dynamic meters via configuration files */ - PCPDynamicColumns columns; /* dynamic columns via configuration files */ - struct timeval offset; /* time offset used in archive mode only */ - long long btime; /* boottime in seconds since the epoch */ - char* release; /* uname and distro from this context */ - int pidmax; /* maximum platform process identifier */ - unsigned int ncpu; /* maximum processor count configured */ -} Platform; - -extern const ScreenDefaults Platform_defaultScreens[]; - -extern const unsigned int Platform_numberOfDefaultScreens; - -extern const SignalItem Platform_signals[]; - -extern const unsigned int Platform_numberOfSignals; - -extern const MeterClass* const Platform_meterTypes[]; - -bool Platform_init(void); - -void Platform_done(void); - -void Platform_setBindings(Htop_Action* keys); - -int Platform_getUptime(void); - -void Platform_getLoadAverage(double* one, double* five, double* fifteen); - -long long Platform_getBootTime(void); - -unsigned int Platform_getMaxCPU(void); - -int Platform_getMaxPid(void); - -double Platform_setCPUValues(Meter* this, int cpu); - -void Platform_setMemoryValues(Meter* this); - -void Platform_setSwapValues(Meter* this); - -void Platform_setZramValues(Meter* this); - -void Platform_setZfsArcValues(Meter* this); - -void Platform_setZfsCompressedArcValues(Meter* this); - -char* Platform_getProcessEnv(pid_t pid); - -FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid); - -void Platform_getPressureStall(const char* file, bool some, double* ten, double* sixty, double* threehundred); - -bool Platform_getDiskIO(DiskIOData* data); - -bool Platform_getNetworkIO(NetworkIOData* data); - -void Platform_getBattery(double* percent, ACPresence* isOnAC); - -void Platform_getHostname(char* buffer, size_t size); - -void Platform_getRelease(char** string); - -enum { - PLATFORM_LONGOPT_HOST = 128, - PLATFORM_LONGOPT_TIMEZONE, - PLATFORM_LONGOPT_HOSTZONE, -}; - -#define PLATFORM_LONG_OPTIONS \ - {PMLONGOPT_HOST, optional_argument, 0, PLATFORM_LONGOPT_HOST}, \ - {PMLONGOPT_TIMEZONE, optional_argument, 0, PLATFORM_LONGOPT_TIMEZONE}, \ - {PMLONGOPT_HOSTZONE, optional_argument, 0, PLATFORM_LONGOPT_HOSTZONE}, \ - -void Platform_longOptionsUsage(const char* name); - -CommandLineStatus Platform_getLongOption(int opt, int argc, char** argv); - -extern pmOptions opts; - -size_t Platform_addMetric(PCPMetric id, const char* name); - -void Platform_gettime_realtime(struct timeval* tv, uint64_t* msec); - -void Platform_gettime_monotonic(uint64_t* msec); - -Hashtable* Platform_dynamicMeters(void); - -void Platform_dynamicMetersDone(Hashtable* meters); - -void Platform_dynamicMeterInit(Meter* meter); - -void Platform_dynamicMeterUpdateValues(Meter* meter); - -void Platform_dynamicMeterDisplay(const Meter* meter, RichString* out); - -Hashtable* Platform_dynamicColumns(void); - -void Platform_dynamicColumnsDone(Hashtable* columns); - -const char* Platform_dynamicColumnInit(unsigned int key); - -bool Platform_dynamicColumnWriteField(const Process* proc, RichString* str, unsigned int key); - -#endif diff --git a/fedora/.local/bin/htop-vim/pcp/ProcessField.h b/fedora/.local/bin/htop-vim/pcp/ProcessField.h deleted file mode 100644 index b3ba265..0000000 --- a/fedora/.local/bin/htop-vim/pcp/ProcessField.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef HEADER_PCPProcessField -#define HEADER_PCPProcessField -/* -htop - pcp/ProcessField.h -(C) 2014 Hisham H. Muhammad -(C) 2021 htop dev team -(C) 2020-2021 Red Hat, Inc. All Rights Reserved. -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - - -#define PLATFORM_PROCESS_FIELDS \ - CMINFLT = 11, \ - CMAJFLT = 13, \ - UTIME = 14, \ - STIME = 15, \ - CUTIME = 16, \ - CSTIME = 17, \ - M_SHARE = 41, \ - M_TRS = 42, \ - M_DRS = 43, \ - M_LRS = 44, \ - M_DT = 45, \ - CTID = 100, \ - RCHAR = 103, \ - WCHAR = 104, \ - SYSCR = 105, \ - SYSCW = 106, \ - RBYTES = 107, \ - WBYTES = 108, \ - CNCLWB = 109, \ - IO_READ_RATE = 110, \ - IO_WRITE_RATE = 111, \ - IO_RATE = 112, \ - CGROUP = 113, \ - OOM = 114, \ - PERCENT_CPU_DELAY = 116, \ - PERCENT_IO_DELAY = 117, \ - PERCENT_SWAP_DELAY = 118, \ - M_PSS = 119, \ - M_SWAP = 120, \ - M_PSSWP = 121, \ - CTXT = 122, \ - SECATTR = 123, \ - AUTOGROUP_ID = 127, \ - AUTOGROUP_NICE = 128, \ - // End of list - - -#endif /* HEADER_PCPProcessField */ diff --git a/fedora/.local/bin/htop-vim/pcp/columns/container b/fedora/.local/bin/htop-vim/pcp/columns/container deleted file mode 100644 index 519288f..0000000 --- a/fedora/.local/bin/htop-vim/pcp/columns/container +++ /dev/null @@ -1,10 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[container] -heading = Container -caption = CONTAINER -width = -12 -metric = proc.id.container -description = Name of processes container via cgroup heuristics diff --git a/fedora/.local/bin/htop-vim/pcp/columns/delayacct b/fedora/.local/bin/htop-vim/pcp/columns/delayacct deleted file mode 100644 index 016904c..0000000 --- a/fedora/.local/bin/htop-vim/pcp/columns/delayacct +++ /dev/null @@ -1,10 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[blkio] -heading = BLKIOD -caption = BLKIO_TIME -width = 6 -metric = proc.psinfo.delayacct_blkio_time -description = Aggregated block I/O delays diff --git a/fedora/.local/bin/htop-vim/pcp/columns/fdcount b/fedora/.local/bin/htop-vim/pcp/columns/fdcount deleted file mode 100644 index e679480..0000000 --- a/fedora/.local/bin/htop-vim/pcp/columns/fdcount +++ /dev/null @@ -1,10 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[fds] -heading = FDS -caption = FDCOUNT -width = 4 -metric = proc.fd.count -description = Open file descriptors diff --git a/fedora/.local/bin/htop-vim/pcp/columns/guest b/fedora/.local/bin/htop-vim/pcp/columns/guest deleted file mode 100644 index 89bb926..0000000 --- a/fedora/.local/bin/htop-vim/pcp/columns/guest +++ /dev/null @@ -1,17 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[guest] -heading = GUEST -caption = GUEST_TIME -width = 6 -metric = proc.psinfo.guest_time -description = Guest time for the process - -[cguest] -heading = CGUEST -caption = CGUEST_TIME -width = 6 -metric = proc.psinfo.guest_time + proc.psinfo.cguest_time -description = Cumulative guest time for the process and its children diff --git a/fedora/.local/bin/htop-vim/pcp/columns/memory b/fedora/.local/bin/htop-vim/pcp/columns/memory deleted file mode 100644 index 305a654..0000000 --- a/fedora/.local/bin/htop-vim/pcp/columns/memory +++ /dev/null @@ -1,39 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[vmdata] -heading = VDATA -width = 6 -metric = proc.memory.vmdata -description = Virtual memory used for data - -[vmstack] -heading = VSTACK -width = -6 -metric = proc.memory.vmstack -description = Virtual memory used for stack - -[vmexe] -heading = VEXEC -width = 6 -metric = proc.memory.vmexe -description = Virtual memory used for non-library executable code - -[vmlib] -heading = VLIBS -width = 6 -metric = proc.memory.vmlib -description = Virtual memory used for libraries - -[vmswap] -heading = VSWAP -width = 6 -metric = proc.memory.vmswap -description = Virtual memory size currently swapped out - -[vmlock] -heading = VLOCK -width = 6 -metric = proc.memory.vmlock -description = Locked virtual memory diff --git a/fedora/.local/bin/htop-vim/pcp/columns/sched b/fedora/.local/bin/htop-vim/pcp/columns/sched deleted file mode 100644 index 36b8b55..0000000 --- a/fedora/.local/bin/htop-vim/pcp/columns/sched +++ /dev/null @@ -1,10 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[rundelay] -heading = RUNQ -caption = RUN_DELAY -width = 4 -metric = proc.schedstat.run_delay -description = Run queue time diff --git a/fedora/.local/bin/htop-vim/pcp/columns/swap b/fedora/.local/bin/htop-vim/pcp/columns/swap deleted file mode 100644 index 234b3db..0000000 --- a/fedora/.local/bin/htop-vim/pcp/columns/swap +++ /dev/null @@ -1,15 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[swap] -heading = SWAP -width = 5 -metric = proc.psinfo.nswap -description = Count of swap operations for the process - -[cswap] -heading = CSWAP -width = 5 -metric = proc.psinfo.nswap + proc.psinfo.cnswap -description = Cumulative swap operations for the process and its children diff --git a/fedora/.local/bin/htop-vim/pcp/columns/tcp b/fedora/.local/bin/htop-vim/pcp/columns/tcp deleted file mode 100644 index f9a1819..0000000 --- a/fedora/.local/bin/htop-vim/pcp/columns/tcp +++ /dev/null @@ -1,31 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[tcp_send_calls] -heading = TCPS -caption = TCP_SEND -width = 6 -metric = bcc.proc.net.tcp.send.calls -description = Count of TCP send calls - -[tcp_send_bytes] -heading = TCPSB -caption = TCP_SEND_BYTES -width = 6 -metric = bcc.proc.net.tcp.send.bytes -description = Cumulative bytes sent via TCP - -[tcp_recv_calls] -heading = TCPR -caption = TCP_RECV -width = 6 -metric = bcc.proc.net.tcp.recv.calls -description = Count of TCP recv calls - -[tcp_recv_bytes] -heading = TCPRB -caption = TCP_RECV_BYTES -width = 6 -metric = bcc.proc.net.tcp.recv.bytes -description = Cumulative bytes received via TCP diff --git a/fedora/.local/bin/htop-vim/pcp/columns/udp b/fedora/.local/bin/htop-vim/pcp/columns/udp deleted file mode 100644 index 060f048..0000000 --- a/fedora/.local/bin/htop-vim/pcp/columns/udp +++ /dev/null @@ -1,31 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[udp_send_calls] -heading = UDPS -caption = UDP_SEND -width = 6 -metric = bcc.proc.net.udp.send.calls -description = Count of UDP send calls - -[udp_send_bytes] -heading = UDPSB -caption = UDP_SEND_BYTES -width = 6 -metric = bcc.proc.net.udp.send.bytes -description = Cumulative bytes sent via UDP - -[udp_recv_calls] -heading = UDPR -caption = UDP_RECV -width = 6 -metric = bcc.proc.net.udp.recv.calls -description = Count of UDP recv calls - -[udp_recv_bytes] -heading = UDPRB -caption = UDP_RECV_BYTES -width = 6 -metric = bcc.proc.net.udp.recv.bytes -description = Cumulative bytes received via UDP diff --git a/fedora/.local/bin/htop-vim/pcp/columns/wchan b/fedora/.local/bin/htop-vim/pcp/columns/wchan deleted file mode 100644 index 893de58..0000000 --- a/fedora/.local/bin/htop-vim/pcp/columns/wchan +++ /dev/null @@ -1,17 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[wchan] -heading = WCHAN -caption = WCHAN_ADDRESS -width = 8 -metric = proc.psinfo.wchan -description = Wait channel, kernel address process is blocked or sleeping on - -[wchans] -heading = WCHANS -caption = WCHAN_SYMBOL -width = -12 -metric = proc.psinfo.wchan_s -description = Wait channel, kernel symbol process is blocked or sleeping on diff --git a/fedora/.local/bin/htop-vim/pcp/meters/entropy b/fedora/.local/bin/htop-vim/pcp/meters/entropy deleted file mode 100644 index 0bef0cf..0000000 --- a/fedora/.local/bin/htop-vim/pcp/meters/entropy +++ /dev/null @@ -1,9 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[entropy] -caption = Entropy -avail.metric = kernel.all.entropy.avail / kernel.all.entropy.poolsize * 100 -avail.label = avail -avail.suffix = % diff --git a/fedora/.local/bin/htop-vim/pcp/meters/freespace b/fedora/.local/bin/htop-vim/pcp/meters/freespace deleted file mode 100644 index 074af6d..0000000 --- a/fedora/.local/bin/htop-vim/pcp/meters/freespace +++ /dev/null @@ -1,11 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[freespace] -caption = Freespace -description = Filesystem space -used.metric = sum(filesys.used) -used.color = blue -free.metric = sum(filesys.free) -free.color = green diff --git a/fedora/.local/bin/htop-vim/pcp/meters/ipc b/fedora/.local/bin/htop-vim/pcp/meters/ipc deleted file mode 100644 index 4162f39..0000000 --- a/fedora/.local/bin/htop-vim/pcp/meters/ipc +++ /dev/null @@ -1,13 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[ipc] -caption = SysV IPC -description = SysV IPC counts -msg.metric = ipc.msg.used_queues -msg.color = blue -sem.metric = ipc.sem.used_sem -sem.color = green -shm.metric = ipc.shm.used_ids -shm.color = cyan diff --git a/fedora/.local/bin/htop-vim/pcp/meters/locks b/fedora/.local/bin/htop-vim/pcp/meters/locks deleted file mode 100644 index 5d09510..0000000 --- a/fedora/.local/bin/htop-vim/pcp/meters/locks +++ /dev/null @@ -1,15 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[locks] -caption = File locks -description = VFS file locks -posix.metric = vfs.locks.posix.count -posix.color = blue -flock.metric = vfs.locks.flock.count -flock.color = green -readlock.metric = vfs.locks.posix.read + vfs.locks.flock.read -readlock.color = red -writelock.metric = vfs.locks.posix.write + vfs.locks.flock.write -writelock.color = yellow diff --git a/fedora/.local/bin/htop-vim/pcp/meters/memcache b/fedora/.local/bin/htop-vim/pcp/meters/memcache deleted file mode 100644 index 0f2fac2..0000000 --- a/fedora/.local/bin/htop-vim/pcp/meters/memcache +++ /dev/null @@ -1,11 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[memcache] -caption = Memcache -description = Memcache Hits -hit.metric = sum(memcache.hits) -hit.color = green -miss.metric = sum(memcache.misses) -miss.color = blue diff --git a/fedora/.local/bin/htop-vim/pcp/meters/mysql b/fedora/.local/bin/htop-vim/pcp/meters/mysql deleted file mode 100644 index a9e75e4..0000000 --- a/fedora/.local/bin/htop-vim/pcp/meters/mysql +++ /dev/null @@ -1,71 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[mysql_io] -caption = MySQL I/O -recv.metric = mysql.status.bytes_received -recv.color = green -sent.metric = mysql.status.bytes_sent -sent.color = blue - -[mysql_keys] -caption = MySQL keys -description = MySQL key status -key_blocks_used.metric = mysql.status.key_blocks_used -key_blocks_used.label = color -key_blocks_used.label = used -key_reads.metric = mysql.status.key_reads -key_reads.label = read -key_reads.color = green -key_writes.metric = mysql.status.key_writes -key_writes.label = writ -key_writes.color = blue -key_read_requests.metric = mysql.status.key_read_requests -key_read_requests.label = rreq -key_read_requests.color = green -key_write_requests.metric = mysql.status.key_write_requests -key_write_requests.label = wreq -key_write_requests.color = blue - -[innodb_buffer] -caption = InnoDB pool -description = InnoDB buffer pool -created.metric = mysql.status.innodb_pages_created -created.label = cr -created.color = yellow -read.metric = mysql.status.innodb_pages_read -read.label = rd -read.color = greed -written.metric = mysql.status.innodb_pages_written -written.label = wr -written.color = red - -[innodb_io] -caption = InnoDB I/O -description = InnoDB I/O operations -read.metric = mysql.status.innodb_data_read -read.label = rd -read.color = green -written.metric = mysql.status.innodb_data.writes -written.label = wr -written.color = blue -sync.metric = mysql.status.innodb_data_fsyncs -sync.label = sync -sync.color = cyan - -[innodb_ops] -caption = InnoDB ops -description = InnoDB operations -inserted.metric = mysql.status.innodb_rows_inserted -inserted.label = ins -inserted.color = blue -updated.metric = mysql.status.innodb_rows_updated -updated.label = upd -updated.color = cyan -deleted.metric = mysql.status.innodb_rows_deleted -deleted.label = del -deleted.color = red -read.metric = mysql.status.innodb_rows_read -read.label = rd -read.color = green diff --git a/fedora/.local/bin/htop-vim/pcp/meters/postfix b/fedora/.local/bin/htop-vim/pcp/meters/postfix deleted file mode 100644 index cda6837..0000000 --- a/fedora/.local/bin/htop-vim/pcp/meters/postfix +++ /dev/null @@ -1,20 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[postfix] -caption = Postfix -incoming.metric = sum(postfix.queues.incoming) -incoming.color = green -incoming.label = in -active.metric = sum(postfix.queues.active) -active.color = blue -active.label = act -deferred.metric = sum(postfix.queues.deferred) -deferred.color = cyan -deferred.label = dfr -bounce.metric = sum(postfix.queues.maildrop) -bounce.color = red -bounce.label = bnc -hold.metric = sum(postfix.queues.hold) -hold.color = yellow diff --git a/fedora/.local/bin/htop-vim/pcp/meters/redis b/fedora/.local/bin/htop-vim/pcp/meters/redis deleted file mode 100644 index a72f727..0000000 --- a/fedora/.local/bin/htop-vim/pcp/meters/redis +++ /dev/null @@ -1,39 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[redisxact] -caption = Redis xact -description = Redis transactions -tps.metric = redis.instantaneous_ops_per_sec -tps.color = green - -[redismem] -caption = Redis mem -description = Redis memory -lua.metric = redis.used_memory_lua -lua.color = magenta -used.metric = redis.used_memory -used.color = blue - -[redisclient] -caption = Redis clients -description = Redis clients -type = bar -blocked.metric = redis.blocked_clients -blocked.color = blue -blocked.label = blk -clients.metric = redis.connected_clients -clients.color = green -clients.label = conn - -[redisconn] -caption = Redis conn -description = Redis connections -type = bar -reject.metric = redis.rejected_connections -reject.color = magenta -reject.label = fail/s -total.metric = redis.total_connections_received -total.color = blue -total.label = conn/s diff --git a/fedora/.local/bin/htop-vim/pcp/meters/tcp b/fedora/.local/bin/htop-vim/pcp/meters/tcp deleted file mode 100644 index c95736f..0000000 --- a/fedora/.local/bin/htop-vim/pcp/meters/tcp +++ /dev/null @@ -1,21 +0,0 @@ -# -# pcp-htop(1) configuration file - see pcp-htop(5) -# - -[tcp] -caption = TCP -description = TCP sockets -listen.metric = network.tcpconn.listen -listen.color = green -listen.label = lis -active.metric = network.tcpconn.established -active.color = blue -active.label = act -syn.metric = network.tcpconn.syn_sent + network.tcpconn.syn_recv + network.tcpconn.last_ack -syn.color = cyan -wait.metric = network.tcpconn.time_wait -wait.color = red -wait.label = tim -close.metric = network.tcpconn.fin_wait1 + network.tcpconn.fin_wait2 + network.tcpconn.close + network.tcpconn.close_wait + network.tcpconn.closing -close.color = yellow -close.label = clo diff --git a/fedora/.local/bin/htop-vim/scripts/htop_suppressions.valgrind b/fedora/.local/bin/htop-vim/scripts/htop_suppressions.valgrind deleted file mode 100644 index 0ba4539..0000000 --- a/fedora/.local/bin/htop-vim/scripts/htop_suppressions.valgrind +++ /dev/null @@ -1,57 +0,0 @@ -{ - - Memcheck:Leak - match-leak-kinds: possible,reachable - ... - fun:doupdate_sp - fun:wrefresh -} - -{ - - Memcheck:Leak - match-leak-kinds: possible,reachable - ... - fun:newterm_sp - fun:newterm - fun:initscr - fun:CRT_init -} - -{ - - Memcheck:Leak - match-leak-kinds: reachable - ... - obj:*/libtinfo* - fun:CRT_init -} - -{ - - Memcheck:Leak - match-leak-kinds: reachable - ... - obj:*/libncurses* - fun:CRT_init -} - -{ - - Memcheck:Leak - match-leak-kinds: possible,reachable - ... - obj:*/libncurses* - fun:CRT_setColors - fun:CRT_init -} - -{ - - Memcheck:Leak - match-leak-kinds: possible,reachable - ... - obj:*/libdevstat* - ... - fun:Platform_getDiskIO -} diff --git a/fedora/.local/bin/htop-vim/scripts/run_valgrind.sh b/fedora/.local/bin/htop-vim/scripts/run_valgrind.sh deleted file mode 100755 index a03468c..0000000 --- a/fedora/.local/bin/htop-vim/scripts/run_valgrind.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -SCRIPT=$(readlink -f "$0") -SCRIPTDIR=$(dirname "$SCRIPT") - -valgrind --leak-check=full --show-reachable=yes --show-leak-kinds=all --track-fds=yes --errors-for-leak-kinds=all --track-origins=yes --suppressions="${SCRIPTDIR}/htop_suppressions.valgrind" "${SCRIPTDIR}/../htop" diff --git a/fedora/.local/bin/htop-vim/solaris/Platform.c b/fedora/.local/bin/htop-vim/solaris/Platform.c deleted file mode 100644 index 96f3526..0000000 --- a/fedora/.local/bin/htop-vim/solaris/Platform.c +++ /dev/null @@ -1,331 +0,0 @@ -/* -htop - solaris/Platform.c -(C) 2014 Hisham H. Muhammad -(C) 2015 David C. Hunt -(C) 2017,2018 Guy M. Broome -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "solaris/Platform.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Macros.h" -#include "Meter.h" -#include "CPUMeter.h" -#include "MemoryMeter.h" -#include "MemorySwapMeter.h" -#include "SwapMeter.h" -#include "TasksMeter.h" -#include "LoadAverageMeter.h" -#include "ClockMeter.h" -#include "DateMeter.h" -#include "DateTimeMeter.h" -#include "HostnameMeter.h" -#include "SysArchMeter.h" -#include "UptimeMeter.h" -#include "zfs/ZfsArcMeter.h" -#include "zfs/ZfsCompressedArcMeter.h" -#include "SolarisProcess.h" -#include "SolarisProcessList.h" - - -const ScreenDefaults Platform_defaultScreens[] = { - { - .name = "Default", - .columns = "PID LWPID USER PRIORITY NICE M_VIRT M_RESIDENT STATE PERCENT_CPU PERCENT_MEM TIME Command", - .sortKey = "PERCENT_CPU", - }, -}; - -const unsigned int Platform_numberOfDefaultScreens = ARRAYSIZE(Platform_defaultScreens); - -const SignalItem Platform_signals[] = { - { .name = " 0 Cancel", .number = 0 }, - { .name = " 1 SIGHUP", .number = 1 }, - { .name = " 2 SIGINT", .number = 2 }, - { .name = " 3 SIGQUIT", .number = 3 }, - { .name = " 4 SIGILL", .number = 4 }, - { .name = " 5 SIGTRAP", .number = 5 }, - { .name = " 6 SIGABRT/IOT", .number = 6 }, - { .name = " 7 SIGEMT", .number = 7 }, - { .name = " 8 SIGFPE", .number = 8 }, - { .name = " 9 SIGKILL", .number = 9 }, - { .name = "10 SIGBUS", .number = 10 }, - { .name = "11 SIGSEGV", .number = 11 }, - { .name = "12 SIGSYS", .number = 12 }, - { .name = "13 SIGPIPE", .number = 13 }, - { .name = "14 SIGALRM", .number = 14 }, - { .name = "15 SIGTERM", .number = 15 }, - { .name = "16 SIGUSR1", .number = 16 }, - { .name = "17 SIGUSR2", .number = 17 }, - { .name = "18 SIGCHLD/CLD", .number = 18 }, - { .name = "19 SIGPWR", .number = 19 }, - { .name = "20 SIGWINCH", .number = 20 }, - { .name = "21 SIGURG", .number = 21 }, - { .name = "22 SIGPOLL/IO", .number = 22 }, - { .name = "23 SIGSTOP", .number = 23 }, - { .name = "24 SIGTSTP", .number = 24 }, - { .name = "25 SIGCONT", .number = 25 }, - { .name = "26 SIGTTIN", .number = 26 }, - { .name = "27 SIGTTOU", .number = 27 }, - { .name = "28 SIGVTALRM", .number = 28 }, - { .name = "29 SIGPROF", .number = 29 }, - { .name = "30 SIGXCPU", .number = 30 }, - { .name = "31 SIGXFSZ", .number = 31 }, - { .name = "32 SIGWAITING", .number = 32 }, - { .name = "33 SIGLWP", .number = 33 }, - { .name = "34 SIGFREEZE", .number = 34 }, - { .name = "35 SIGTHAW", .number = 35 }, - { .name = "36 SIGCANCEL", .number = 36 }, - { .name = "37 SIGLOST", .number = 37 }, - { .name = "38 SIGXRES", .number = 38 }, - { .name = "39 SIGJVM1", .number = 39 }, - { .name = "40 SIGJVM2", .number = 40 }, - { .name = "41 SIGINFO", .number = 41 }, -}; - -const unsigned int Platform_numberOfSignals = ARRAYSIZE(Platform_signals); - -const MeterClass* const Platform_meterTypes[] = { - &CPUMeter_class, - &ClockMeter_class, - &DateMeter_class, - &DateTimeMeter_class, - &LoadAverageMeter_class, - &LoadMeter_class, - &MemoryMeter_class, - &SwapMeter_class, - &MemorySwapMeter_class, - &TasksMeter_class, - &BatteryMeter_class, - &HostnameMeter_class, - &SysArchMeter_class, - &UptimeMeter_class, - &AllCPUsMeter_class, - &AllCPUs2Meter_class, - &AllCPUs4Meter_class, - &AllCPUs8Meter_class, - &LeftCPUsMeter_class, - &RightCPUsMeter_class, - &LeftCPUs2Meter_class, - &RightCPUs2Meter_class, - &LeftCPUs4Meter_class, - &RightCPUs4Meter_class, - &LeftCPUs8Meter_class, - &RightCPUs8Meter_class, - &ZfsArcMeter_class, - &ZfsCompressedArcMeter_class, - &BlankMeter_class, - NULL -}; - -bool Platform_init(void) { - /* no platform-specific setup needed */ - return true; -} - -void Platform_done(void) { - /* no platform-specific cleanup needed */ -} - -void Platform_setBindings(Htop_Action* keys) { - /* no platform-specific key bindings */ - (void) keys; -} - -int Platform_getUptime(void) { - int boot_time = 0; - int curr_time = time(NULL); - struct utmpx* ent; - - while (( ent = getutxent() )) { - if ( String_eq("system boot", ent->ut_line )) { - boot_time = ent->ut_tv.tv_sec; - } - } - - endutxent(); - - return (curr_time - boot_time); -} - -void Platform_getLoadAverage(double* one, double* five, double* fifteen) { - double plat_loadavg[3]; - if (getloadavg( plat_loadavg, 3 ) < 0) { - *one = NAN; - *five = NAN; - *fifteen = NAN; - return; - } - *one = plat_loadavg[LOADAVG_1MIN]; - *five = plat_loadavg[LOADAVG_5MIN]; - *fifteen = plat_loadavg[LOADAVG_15MIN]; -} - -int Platform_getMaxPid(void) { - int vproc = 32778; // Reasonable Solaris default - - kstat_ctl_t* kc = kstat_open(); - if (kc != NULL) { - kstat_t* kshandle = kstat_lookup_wrapper(kc, "unix", 0, "var"); - if (kshandle != NULL) { - kstat_read(kc, kshandle, NULL); - - kvar_t* ksvar = kshandle->ks_data; - if (ksvar && ksvar->v_proc > 0) { - vproc = ksvar->v_proc; - } - } - kstat_close(kc); - } - - return vproc; -} - -double Platform_setCPUValues(Meter* this, unsigned int cpu) { - const SolarisProcessList* spl = (const SolarisProcessList*) this->pl; - unsigned int cpus = this->pl->existingCPUs; - const CPUData* cpuData = NULL; - - if (cpus == 1) { - // single CPU box has everything in spl->cpus[0] - cpuData = &(spl->cpus[0]); - } else { - cpuData = &(spl->cpus[cpu]); - } - - if (!cpuData->online) { - this->curItems = 0; - return NAN; - } - - double percent; - double* v = this->values; - - v[CPU_METER_NICE] = cpuData->nicePercent; - v[CPU_METER_NORMAL] = cpuData->userPercent; - if (this->pl->settings->detailedCPUTime) { - v[CPU_METER_KERNEL] = cpuData->systemPercent; - v[CPU_METER_IRQ] = cpuData->irqPercent; - this->curItems = 4; - percent = v[0] + v[1] + v[2] + v[3]; - } else { - v[2] = cpuData->systemAllPercent; - this->curItems = 3; - percent = v[0] + v[1] + v[2]; - } - - percent = isnan(percent) ? 0.0 : CLAMP(percent, 0.0, 100.0); - - v[CPU_METER_FREQUENCY] = cpuData->frequency; - v[CPU_METER_TEMPERATURE] = NAN; - - return percent; -} - -void Platform_setMemoryValues(Meter* this) { - const ProcessList* pl = this->pl; - this->total = pl->totalMem; - this->values[MEMORY_METER_USED] = pl->usedMem; - this->values[MEMORY_METER_BUFFERS] = pl->buffersMem; - // this->values[MEMORY_METER_SHARED] = "shared memory, like tmpfs and shm" - this->values[MEMORY_METER_CACHE] = pl->cachedMem; - // this->values[MEMORY_METER_AVAILABLE] = "available memory" -} - -void Platform_setSwapValues(Meter* this) { - const ProcessList* pl = this->pl; - this->total = pl->totalSwap; - this->values[SWAP_METER_USED] = pl->usedSwap; - this->values[SWAP_METER_CACHE] = NAN; -} - -void Platform_setZfsArcValues(Meter* this) { - const SolarisProcessList* spl = (const SolarisProcessList*) this->pl; - - ZfsArcMeter_readStats(this, &(spl->zfs)); -} - -void Platform_setZfsCompressedArcValues(Meter* this) { - const SolarisProcessList* spl = (const SolarisProcessList*) this->pl; - - ZfsCompressedArcMeter_readStats(this, &(spl->zfs)); -} - -static int Platform_buildenv(void* accum, struct ps_prochandle* Phandle, uintptr_t addr, const char* str) { - envAccum* accump = accum; - (void) Phandle; - (void) addr; - - size_t thissz = strlen(str); - - while ((thissz + 2) > (accump->capacity - accump->size)) { - if (accump->capacity > (SIZE_MAX / 2)) - return 1; - - accump->capacity *= 2; - accump->env = xRealloc(accump->env, accump->capacity); - } - - strlcpy( accump->env + accump->size, str, accump->capacity - accump->size); - strncpy( accump->env + accump->size + thissz + 1, "\n", 2); - - accump->size += thissz + 1; - return 0; -} - -char* Platform_getProcessEnv(pid_t pid) { - envAccum envBuilder; - pid_t realpid = pid / 1024; - int graberr; - struct ps_prochandle* Phandle; - - if ((Phandle = Pgrab(realpid, PGRAB_RDONLY, &graberr)) == NULL) { - return NULL; - } - - envBuilder.capacity = 4096; - envBuilder.size = 0; - envBuilder.env = xMalloc(envBuilder.capacity); - - (void) Penv_iter(Phandle, Platform_buildenv, &envBuilder); - - Prelease(Phandle, 0); - - strncpy( envBuilder.env + envBuilder.size, "\0", 1); - - return xRealloc(envBuilder.env, envBuilder.size + 1); -} - -FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) { - (void)pid; - return NULL; -} - -bool Platform_getDiskIO(DiskIOData* data) { - // TODO - (void)data; - return false; -} - -bool Platform_getNetworkIO(NetworkIOData* data) { - // TODO - (void)data; - return false; -} - -void Platform_getBattery(double* percent, ACPresence* isOnAC) { - *percent = NAN; - *isOnAC = AC_ERROR; -} diff --git a/fedora/.local/bin/htop-vim/solaris/Platform.h b/fedora/.local/bin/htop-vim/solaris/Platform.h deleted file mode 100644 index 14431e3..0000000 --- a/fedora/.local/bin/htop-vim/solaris/Platform.h +++ /dev/null @@ -1,159 +0,0 @@ -#ifndef HEADER_Platform -#define HEADER_Platform -/* -htop - solaris/Platform.h -(C) 2014 Hisham H. Muhammad -(C) 2015 David C. Hunt -(C) 2017,2018 Guy M. Broome -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include - -/* On OmniOS /usr/include/sys/regset.h redefines ERR to 13 - \r, breaking the Enter key. - * Since ncruses macros use the ERR macro, we can not use another name. - */ -#undef ERR -#include -#undef ERR -#define ERR (-1) - -#include -#include - -#include -#include -#include - -#include "Action.h" -#include "BatteryMeter.h" -#include "DiskIOMeter.h" -#include "Hashtable.h" -#include "NetworkIOMeter.h" -#include "ProcessLocksScreen.h" -#include "SignalsPanel.h" -#include "CommandLine.h" -#include "generic/gettime.h" -#include "generic/hostname.h" -#include "generic/uname.h" - - -#define kill(pid, signal) kill(pid / 1024, signal) - -typedef struct var kvar_t; - -typedef struct envAccum_ { - size_t capacity; - size_t size; - size_t bytes; - char* env; -} envAccum; - -extern const ScreenDefaults Platform_defaultScreens[]; - -extern const unsigned int Platform_numberOfDefaultScreens; - -extern const SignalItem Platform_signals[]; - -extern const unsigned int Platform_numberOfSignals; - -extern const MeterClass* const Platform_meterTypes[]; - -bool Platform_init(void); - -void Platform_done(void); - -void Platform_setBindings(Htop_Action* keys); - -int Platform_getUptime(void); - -void Platform_getLoadAverage(double* one, double* five, double* fifteen); - -int Platform_getMaxPid(void); - -double Platform_setCPUValues(Meter* this, unsigned int cpu); - -void Platform_setMemoryValues(Meter* this); - -void Platform_setSwapValues(Meter* this); - -void Platform_setZfsArcValues(Meter* this); - -void Platform_setZfsCompressedArcValues(Meter* this); - -char* Platform_getProcessEnv(pid_t pid); - -FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid); - -bool Platform_getDiskIO(DiskIOData* data); - -bool Platform_getNetworkIO(NetworkIOData* data); - -void Platform_getBattery(double* percent, ACPresence* isOnAC); - -static inline void Platform_getHostname(char* buffer, size_t size) { - Generic_hostname(buffer, size); -} - -static inline void Platform_getRelease(char** string) { - *string = Generic_uname(); -} - -#define PLATFORM_LONG_OPTIONS - -static inline void Platform_longOptionsUsage(ATTR_UNUSED const char* name) { } - -static inline CommandLineStatus Platform_getLongOption(ATTR_UNUSED int opt, ATTR_UNUSED int argc, ATTR_UNUSED char** argv) { - return STATUS_ERROR_EXIT; -} - -static inline void Platform_gettime_realtime(struct timeval* tv, uint64_t* msec) { - Generic_gettime_realtime(tv, msec); -} - -static inline void Platform_gettime_monotonic(uint64_t* msec) { - Generic_gettime_monotonic(msec); -} - -static inline void* kstat_data_lookup_wrapper(kstat_t* ksp, const char* name) { -IGNORE_WCASTQUAL_BEGIN - return kstat_data_lookup(ksp, (char*)name); -IGNORE_WCASTQUAL_END -} - -static inline kstat_t* kstat_lookup_wrapper(kstat_ctl_t* kc, const char* ks_module, int ks_instance, const char* ks_name) { -IGNORE_WCASTQUAL_BEGIN - return kstat_lookup(kc, (char*)ks_module, ks_instance, (char*)ks_name); -IGNORE_WCASTQUAL_END -} - -static inline Hashtable* Platform_dynamicMeters(void) { - return NULL; -} - -static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* table) { } - -static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { } - -static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* meter) { } - -static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter* meter, ATTR_UNUSED RichString* out) { } - -static inline Hashtable* Platform_dynamicColumns(void) { - return NULL; -} - -static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* table) { } - -static inline const char* Platform_dynamicColumnInit(ATTR_UNUSED unsigned int key) { - return NULL; -} - -static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Process* proc, ATTR_UNUSED RichString* str, ATTR_UNUSED unsigned int key) { - return false; -} - -#endif diff --git a/fedora/.local/bin/htop-vim/solaris/ProcessField.h b/fedora/.local/bin/htop-vim/solaris/ProcessField.h deleted file mode 100644 index 65dbcdc..0000000 --- a/fedora/.local/bin/htop-vim/solaris/ProcessField.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef HEADER_SolarisProcessField -#define HEADER_SolarisProcessField -/* -htop - solaris/ProcessField.h -(C) 2020 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - - -#define PLATFORM_PROCESS_FIELDS \ - ZONEID = 100, \ - ZONE = 101, \ - PROJID = 102, \ - TASKID = 103, \ - POOLID = 104, \ - CONTID = 105, \ - LWPID = 106, \ - \ - DUMMY_BUMP_FIELD = CWD, \ - // End of list - - -#endif /* HEADER_SolarisProcessField */ diff --git a/fedora/.local/bin/htop-vim/solaris/SolarisProcess.c b/fedora/.local/bin/htop-vim/solaris/SolarisProcess.c deleted file mode 100644 index 840757e..0000000 --- a/fedora/.local/bin/htop-vim/solaris/SolarisProcess.c +++ /dev/null @@ -1,137 +0,0 @@ -/* -htop - SolarisProcess.c -(C) 2015 Hisham H. Muhammad -(C) 2017,2018 Guy M. Broome -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "solaris/SolarisProcess.h" - -#include -#include -#include -#include - -#include "Process.h" -#include "ProcessList.h" -#include "CRT.h" - -#include "solaris/Platform.h" - - -const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { - [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, - [PID] = { .name = "PID", .title = "PID", .description = "Process/thread ID", .flags = 0, .pidColumn = true, }, - [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, - [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, O onproc, Z zombie, T stopped, W waiting)", .flags = 0, }, - [PPID] = { .name = "PPID", .title = "PPID", .description = "Parent process ID", .flags = 0, .pidColumn = true, }, - [PGRP] = { .name = "PGRP", .title = "PGRP", .description = "Process group ID", .flags = 0, .pidColumn = true, }, - [SESSION] = { .name = "SESSION", .title = "SID", .description = "Process's session ID", .flags = 0, .pidColumn = true, }, - [TTY] = { .name = "TTY", .title = "TTY ", .description = "Controlling terminal", .flags = 0, }, - //[TPGID] = { .name = "TPGID", .title = "TPGID", .description = "Process ID of the fg process group of the controlling terminal", .flags = 0, .pidColumn = true, }, - //[MINFLT] = { .name = "MINFLT", .title = " MINFLT ", .description = "Number of minor faults which have not required loading a memory page from disk", .flags = 0, .defaultSortDesc = true, }, - //[MAJFLT] = { .name = "MAJFLT", .title = " MAJFLT ", .description = "Number of major faults which have required loading a memory page from disk", .flags = 0, .defaultSortDesc = true, }, - [PRIORITY] = { .name = "PRIORITY", .title = "PRI ", .description = "Kernel's internal priority for the process", .flags = 0, }, - [NICE] = { .name = "NICE", .title = " NI ", .description = "Nice value (the higher the value, the more it lets other processes take priority)", .flags = 0, }, - [STARTTIME] = { .name = "STARTTIME", .title = "START ", .description = "Time the process was started", .flags = 0, }, - [ELAPSED] = { .name = "ELAPSED", .title = "ELAPSED ", .description = "Time since the process was started", .flags = 0, }, - [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, }, - [M_VIRT] = { .name = "M_VIRT", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, .defaultSortDesc = true, }, - [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, .defaultSortDesc = true, }, - [ST_UID] = { .name = "ST_UID", .title = "UID", .description = "User ID of the process owner", .flags = 0, }, - [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = " CPU%", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, .defaultSortDesc = true, .autoWidth = true, }, - [PERCENT_NORM_CPU] = { .name = "PERCENT_NORM_CPU", .title = "NCPU%", .description = "Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)", .flags = 0, .defaultSortDesc = true, .autoWidth = true, }, - [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, .defaultSortDesc = true, }, - [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, - [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, .defaultSortDesc = true, }, - [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, }, - [TGID] = { .name = "TGID", .title = "TGID", .description = "Thread group ID (i.e. process ID)", .flags = 0, .pidColumn = true, }, - [PROC_COMM] = { .name = "COMM", .title = "COMM ", .description = "comm string of the process", .flags = 0, }, - [PROC_EXE] = { .name = "EXE", .title = "EXE ", .description = "Basename of exe of the process", .flags = 0, }, - [CWD] = { .name = "CWD", .title = "CWD ", .description = "The current working directory of the process", .flags = PROCESS_FLAG_CWD, }, - [ZONEID] = { .name = "ZONEID", .title = "ZONEID", .description = "Zone ID", .flags = 0, .pidColumn = true, }, - [ZONE] = { .name = "ZONE", .title = "ZONE ", .description = "Zone name", .flags = 0, }, - [PROJID] = { .name = "PROJID", .title = "PRJID", .description = "Project ID", .flags = 0, .pidColumn = true, }, - [TASKID] = { .name = "TASKID", .title = "TSKID", .description = "Task ID", .flags = 0, .pidColumn = true, }, - [POOLID] = { .name = "POOLID", .title = "POLID", .description = "Pool ID", .flags = 0, .pidColumn = true, }, - [CONTID] = { .name = "CONTID", .title = "CNTID", .description = "Contract ID", .flags = 0, .pidColumn = true, }, - [LWPID] = { .name = "LWPID", .title = "LWPID", .description = "LWP ID", .flags = 0, .pidColumn = true, }, -}; - -Process* SolarisProcess_new(const Settings* settings) { - SolarisProcess* this = xCalloc(1, sizeof(SolarisProcess)); - Object_setClass(this, Class(SolarisProcess)); - Process_init(&this->super, settings); - return &this->super; -} - -void Process_delete(Object* cast) { - SolarisProcess* sp = (SolarisProcess*) cast; - Process_done((Process*)cast); - free(sp->zname); - free(sp); -} - -static void SolarisProcess_writeField(const Process* this, RichString* str, ProcessField field) { - const SolarisProcess* sp = (const SolarisProcess*) this; - char buffer[256]; buffer[255] = '\0'; - int attr = CRT_colors[DEFAULT_COLOR]; - int n = sizeof(buffer) - 1; - switch (field) { - // add Solaris-specific fields here - case ZONEID: xSnprintf(buffer, n, "%*d ", Process_pidDigits, sp->zoneid); break; - case PROJID: xSnprintf(buffer, n, "%*d ", Process_pidDigits, sp->projid); break; - case TASKID: xSnprintf(buffer, n, "%*d ", Process_pidDigits, sp->taskid); break; - case POOLID: xSnprintf(buffer, n, "%*d ", Process_pidDigits, sp->poolid); break; - case CONTID: xSnprintf(buffer, n, "%*d ", Process_pidDigits, sp->contid); break; - case ZONE: Process_printLeftAlignedField(str, attr, sp->zname ? sp->zname : "global", ZONENAME_MAX/4); return; - case PID: xSnprintf(buffer, n, "%*d ", Process_pidDigits, sp->realpid); break; - case PPID: xSnprintf(buffer, n, "%*d ", Process_pidDigits, sp->realppid); break; - case TGID: xSnprintf(buffer, n, "%*d ", Process_pidDigits, sp->realtgid); break; - case LWPID: xSnprintf(buffer, n, "%*d ", Process_pidDigits, sp->lwpid); break; - default: - Process_writeField(this, str, field); - return; - } - RichString_appendWide(str, attr, buffer); -} - -static int SolarisProcess_compareByKey(const Process* v1, const Process* v2, ProcessField key) { - const SolarisProcess* p1 = (const SolarisProcess*)v1; - const SolarisProcess* p2 = (const SolarisProcess*)v2; - - switch (key) { - case ZONEID: - return SPACESHIP_NUMBER(p1->zoneid, p2->zoneid); - case PROJID: - return SPACESHIP_NUMBER(p1->projid, p2->projid); - case TASKID: - return SPACESHIP_NUMBER(p1->taskid, p2->taskid); - case POOLID: - return SPACESHIP_NUMBER(p1->poolid, p2->poolid); - case CONTID: - return SPACESHIP_NUMBER(p1->contid, p2->contid); - case ZONE: - return strcmp(p1->zname ? p1->zname : "global", p2->zname ? p2->zname : "global"); - case PID: - return SPACESHIP_NUMBER(p1->realpid, p2->realpid); - case PPID: - return SPACESHIP_NUMBER(p1->realppid, p2->realppid); - case LWPID: - return SPACESHIP_NUMBER(p1->lwpid, p2->lwpid); - default: - return Process_compareByKey_Base(v1, v2, key); - } -} - -const ProcessClass SolarisProcess_class = { - .super = { - .extends = Class(Process), - .display = Process_display, - .delete = Process_delete, - .compare = Process_compare - }, - .writeField = SolarisProcess_writeField, - .compareByKey = SolarisProcess_compareByKey -}; diff --git a/fedora/.local/bin/htop-vim/solaris/SolarisProcess.h b/fedora/.local/bin/htop-vim/solaris/SolarisProcess.h deleted file mode 100644 index 13a2bc1..0000000 --- a/fedora/.local/bin/htop-vim/solaris/SolarisProcess.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef HEADER_SolarisProcess -#define HEADER_SolarisProcess -/* -htop - SolarisProcess.h -(C) 2015 Hisham H. Muhammad -(C) 2017,2018 Guy M. Broome -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include -#include - -/* On OmniOS /usr/include/sys/regset.h redefines ERR to 13 - \r, breaking the Enter key. - * Since ncruses macros use the ERR macro, we can not use another name. - */ -#undef ERR -#include -#undef ERR -#define ERR (-1) - -#include "Settings.h" - - -typedef struct SolarisProcess_ { - Process super; - zoneid_t zoneid; - char* zname; - taskid_t taskid; - projid_t projid; - poolid_t poolid; - ctid_t contid; - pid_t realpid; - pid_t realppid; - pid_t realtgid; - pid_t lwpid; -} SolarisProcess; - -extern const ProcessClass SolarisProcess_class; - -extern const ProcessFieldData Process_fields[LAST_PROCESSFIELD]; - -Process* SolarisProcess_new(const Settings* settings); - -void Process_delete(Object* cast); - -#endif diff --git a/fedora/.local/bin/htop-vim/solaris/SolarisProcessList.c b/fedora/.local/bin/htop-vim/solaris/SolarisProcessList.c deleted file mode 100644 index 905cfbd..0000000 --- a/fedora/.local/bin/htop-vim/solaris/SolarisProcessList.c +++ /dev/null @@ -1,560 +0,0 @@ -/* -htop - SolarisProcessList.c -(C) 2014 Hisham H. Muhammad -(C) 2017,2018 Guy M. Broome -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - - -#include "solaris/SolarisProcessList.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "CRT.h" -#include "solaris/Platform.h" -#include "solaris/SolarisProcess.h" - - -#define GZONE "global " -#define UZONE "unknown " - -static int pageSize; -static int pageSizeKB; - -static char* SolarisProcessList_readZoneName(kstat_ctl_t* kd, SolarisProcess* sproc) { - char* zname; - - if ( sproc->zoneid == 0 ) { - zname = xStrdup(GZONE); - } else if ( kd == NULL ) { - zname = xStrdup(UZONE); - } else { - kstat_t* ks = kstat_lookup_wrapper( kd, "zones", sproc->zoneid, NULL ); - zname = xStrdup(ks == NULL ? UZONE : ks->ks_name); - } - - return zname; -} - -static void SolarisProcessList_updateCPUcount(ProcessList* super) { - SolarisProcessList* spl = (SolarisProcessList*) super; - long int s; - bool change = false; - - s = sysconf(_SC_NPROCESSORS_CONF); - if (s < 1) - CRT_fatalError("Cannot get existing CPU count by sysconf(_SC_NPROCESSORS_CONF)"); - - if (s != super->existingCPUs) { - if (s == 1) { - spl->cpus = xRealloc(spl->cpus, sizeof(CPUData)); - spl->cpus[0].online = true; - } else { - spl->cpus = xReallocArray(spl->cpus, s + 1, sizeof(CPUData)); - spl->cpus[0].online = true; /* average is always "online" */ - for (int i = 1; i < s + 1; i++) { - spl->cpus[i].online = false; - } - } - - change = true; - super->existingCPUs = s; - } - - s = sysconf(_SC_NPROCESSORS_ONLN); - if (s < 1) - CRT_fatalError("Cannot get active CPU count by sysconf(_SC_NPROCESSORS_ONLN)"); - - if (s != super->activeCPUs) { - change = true; - super->activeCPUs = s; - } - - if (change) { - kstat_close(spl->kd); - spl->kd = kstat_open(); - if (!spl->kd) - CRT_fatalError("Cannot open kstat handle"); - } -} - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId) { - SolarisProcessList* spl = xCalloc(1, sizeof(SolarisProcessList)); - ProcessList* pl = (ProcessList*) spl; - ProcessList_init(pl, Class(SolarisProcess), usersTable, dynamicMeters, dynamicColumns, pidMatchList, userId); - - spl->kd = kstat_open(); - if (!spl->kd) - CRT_fatalError("Cannot open kstat handle"); - - pageSize = sysconf(_SC_PAGESIZE); - if (pageSize == -1) - CRT_fatalError("Cannot get pagesize by sysconf(_SC_PAGESIZE)"); - pageSizeKB = pageSize / 1024; - - SolarisProcessList_updateCPUcount(pl); - - return pl; -} - -static inline void SolarisProcessList_scanCPUTime(ProcessList* pl) { - const SolarisProcessList* spl = (SolarisProcessList*) pl; - unsigned int activeCPUs = pl->activeCPUs; - unsigned int existingCPUs = pl->existingCPUs; - kstat_t* cpuinfo = NULL; - kstat_named_t* idletime = NULL; - kstat_named_t* intrtime = NULL; - kstat_named_t* krnltime = NULL; - kstat_named_t* usertime = NULL; - kstat_named_t* cpu_freq = NULL; - double idlebuf = 0; - double intrbuf = 0; - double krnlbuf = 0; - double userbuf = 0; - int arrskip = 0; - - assert(existingCPUs > 0); - assert(spl->kd); - - if (existingCPUs > 1) { - // Store values for the stats loop one extra element up in the array - // to leave room for the average to be calculated afterwards - arrskip++; - } - - // Calculate per-CPU statistics first - for (unsigned int i = 0; i < existingCPUs; i++) { - CPUData* cpuData = &(spl->cpus[i + arrskip]); - - if ((cpuinfo = kstat_lookup_wrapper(spl->kd, "cpu", i, "sys")) != NULL) { - cpuData->online = true; - if (kstat_read(spl->kd, cpuinfo, NULL) != -1) { - idletime = kstat_data_lookup_wrapper(cpuinfo, "cpu_nsec_idle"); - intrtime = kstat_data_lookup_wrapper(cpuinfo, "cpu_nsec_intr"); - krnltime = kstat_data_lookup_wrapper(cpuinfo, "cpu_nsec_kernel"); - usertime = kstat_data_lookup_wrapper(cpuinfo, "cpu_nsec_user"); - } - } else { - cpuData->online = false; - continue; - } - - assert( (idletime != NULL) && (intrtime != NULL) - && (krnltime != NULL) && (usertime != NULL) ); - - if (pl->settings->showCPUFrequency) { - if ((cpuinfo = kstat_lookup_wrapper(spl->kd, "cpu_info", i, NULL)) != NULL) { - if (kstat_read(spl->kd, cpuinfo, NULL) != -1) { - cpu_freq = kstat_data_lookup_wrapper(cpuinfo, "current_clock_Hz"); - } - } - - assert( cpu_freq != NULL ); - } - - uint64_t totaltime = (idletime->value.ui64 - cpuData->lidle) - + (intrtime->value.ui64 - cpuData->lintr) - + (krnltime->value.ui64 - cpuData->lkrnl) - + (usertime->value.ui64 - cpuData->luser); - - // Calculate percentages of deltas since last reading - cpuData->userPercent = ((usertime->value.ui64 - cpuData->luser) / (double)totaltime) * 100.0; - cpuData->nicePercent = (double)0.0; // Not implemented on Solaris - cpuData->systemPercent = ((krnltime->value.ui64 - cpuData->lkrnl) / (double)totaltime) * 100.0; - cpuData->irqPercent = ((intrtime->value.ui64 - cpuData->lintr) / (double)totaltime) * 100.0; - cpuData->systemAllPercent = cpuData->systemPercent + cpuData->irqPercent; - cpuData->idlePercent = ((idletime->value.ui64 - cpuData->lidle) / (double)totaltime) * 100.0; - // Store current values to use for the next round of deltas - cpuData->luser = usertime->value.ui64; - cpuData->lkrnl = krnltime->value.ui64; - cpuData->lintr = intrtime->value.ui64; - cpuData->lidle = idletime->value.ui64; - // Add frequency in MHz - cpuData->frequency = pl->settings->showCPUFrequency ? (double)cpu_freq->value.ui64 / 1E6 : NAN; - // Accumulate the current percentages into buffers for later average calculation - if (existingCPUs > 1) { - userbuf += cpuData->userPercent; - krnlbuf += cpuData->systemPercent; - intrbuf += cpuData->irqPercent; - idlebuf += cpuData->idlePercent; - } - } - - if (existingCPUs > 1) { - CPUData* cpuData = &(spl->cpus[0]); - cpuData->userPercent = userbuf / activeCPUs; - cpuData->nicePercent = (double)0.0; // Not implemented on Solaris - cpuData->systemPercent = krnlbuf / activeCPUs; - cpuData->irqPercent = intrbuf / activeCPUs; - cpuData->systemAllPercent = cpuData->systemPercent + cpuData->irqPercent; - cpuData->idlePercent = idlebuf / activeCPUs; - } -} - -static inline void SolarisProcessList_scanMemoryInfo(ProcessList* pl) { - SolarisProcessList* spl = (SolarisProcessList*) pl; - static kstat_t *meminfo = NULL; - int ksrphyserr = -1; - kstat_named_t *totalmem_pgs = NULL; - kstat_named_t *freemem_pgs = NULL; - kstat_named_t *pages = NULL; - struct swaptable *sl = NULL; - struct swapent *swapdev = NULL; - uint64_t totalswap = 0; - uint64_t totalfree = 0; - int nswap = 0; - char *spath = NULL; - char *spathbase = NULL; - - // Part 1 - physical memory - if (spl->kd != NULL && meminfo == NULL) { - // Look up the kstat chain just once, it never changes - meminfo = kstat_lookup_wrapper(spl->kd, "unix", 0, "system_pages"); - } - if (meminfo != NULL) { - ksrphyserr = kstat_read(spl->kd, meminfo, NULL); - } - if (ksrphyserr != -1) { - totalmem_pgs = kstat_data_lookup_wrapper(meminfo, "physmem"); - freemem_pgs = kstat_data_lookup_wrapper(meminfo, "freemem"); - pages = kstat_data_lookup_wrapper(meminfo, "pagestotal"); - - pl->totalMem = totalmem_pgs->value.ui64 * pageSizeKB; - if (pl->totalMem > freemem_pgs->value.ui64 * pageSizeKB) { - pl->usedMem = pl->totalMem - freemem_pgs->value.ui64 * pageSizeKB; - } else { - pl->usedMem = 0; // This can happen in non-global zone (in theory) - } - // Not sure how to implement this on Solaris - suggestions welcome! - pl->cachedMem = 0; - // Not really "buffers" but the best Solaris analogue that I can find to - // "memory in use but not by programs or the kernel itself" - pl->buffersMem = (totalmem_pgs->value.ui64 - pages->value.ui64) * pageSizeKB; - } else { - // Fall back to basic sysconf if kstat isn't working - pl->totalMem = sysconf(_SC_PHYS_PAGES) * pageSize; - pl->buffersMem = 0; - pl->cachedMem = 0; - pl->usedMem = pl->totalMem - (sysconf(_SC_AVPHYS_PAGES) * pageSize); - } - - // Part 2 - swap - nswap = swapctl(SC_GETNSWP, NULL); - if (nswap > 0) { - sl = xMalloc((nswap * sizeof(swapent_t)) + sizeof(int)); - } - if (sl != NULL) { - spathbase = xMalloc( nswap * MAXPATHLEN ); - } - if (spathbase != NULL) { - spath = spathbase; - swapdev = sl->swt_ent; - for (int i = 0; i < nswap; i++, swapdev++) { - swapdev->ste_path = spath; - spath += MAXPATHLEN; - } - sl->swt_n = nswap; - } - nswap = swapctl(SC_LIST, sl); - if (nswap > 0) { - swapdev = sl->swt_ent; - for (int i = 0; i < nswap; i++, swapdev++) { - totalswap += swapdev->ste_pages; - totalfree += swapdev->ste_free; - } - } - free(spathbase); - free(sl); - pl->totalSwap = totalswap * pageSizeKB; - pl->usedSwap = pl->totalSwap - (totalfree * pageSizeKB); -} - -static inline void SolarisProcessList_scanZfsArcstats(ProcessList* pl) { - SolarisProcessList* spl = (SolarisProcessList*) pl; - kstat_t *arcstats = NULL; - int ksrphyserr = -1; - kstat_named_t *cur_kstat = NULL; - - if (spl->kd != NULL) { - arcstats = kstat_lookup_wrapper(spl->kd, "zfs", 0, "arcstats"); - } - if (arcstats != NULL) { - ksrphyserr = kstat_read(spl->kd, arcstats, NULL); - } - if (ksrphyserr != -1) { - cur_kstat = kstat_data_lookup_wrapper( arcstats, "size" ); - spl->zfs.size = cur_kstat->value.ui64 / 1024; - spl->zfs.enabled = spl->zfs.size > 0 ? 1 : 0; - - cur_kstat = kstat_data_lookup_wrapper( arcstats, "c_max" ); - spl->zfs.max = cur_kstat->value.ui64 / 1024; - - cur_kstat = kstat_data_lookup_wrapper( arcstats, "mfu_size" ); - spl->zfs.MFU = cur_kstat != NULL ? cur_kstat->value.ui64 / 1024 : 0; - - cur_kstat = kstat_data_lookup_wrapper( arcstats, "mru_size" ); - spl->zfs.MRU = cur_kstat != NULL ? cur_kstat->value.ui64 / 1024 : 0; - - cur_kstat = kstat_data_lookup_wrapper( arcstats, "anon_size" ); - spl->zfs.anon = cur_kstat != NULL ? cur_kstat->value.ui64 / 1024 : 0; - - cur_kstat = kstat_data_lookup_wrapper( arcstats, "hdr_size" ); - spl->zfs.header = cur_kstat != NULL ? cur_kstat->value.ui64 / 1024 : 0; - - cur_kstat = kstat_data_lookup_wrapper( arcstats, "other_size" ); - spl->zfs.other = cur_kstat != NULL ? cur_kstat->value.ui64 / 1024 : 0; - - if ((cur_kstat = kstat_data_lookup_wrapper( arcstats, "compressed_size" )) != NULL) { - spl->zfs.compressed = cur_kstat->value.ui64 / 1024; - spl->zfs.isCompressed = 1; - - cur_kstat = kstat_data_lookup_wrapper( arcstats, "uncompressed_size" ); - spl->zfs.uncompressed = cur_kstat->value.ui64 / 1024; - } else { - spl->zfs.isCompressed = 0; - } - } -} - -void ProcessList_delete(ProcessList* pl) { - SolarisProcessList* spl = (SolarisProcessList*) pl; - ProcessList_done(pl); - free(spl->cpus); - if (spl->kd) { - kstat_close(spl->kd); - } - free(spl); -} - -static void SolarisProcessList_updateExe(pid_t pid, Process* proc) { - char path[32]; - xSnprintf(path, sizeof(path), "/proc/%d/path/a.out", pid); - - char target[PATH_MAX]; - ssize_t ret = readlink(path, target, sizeof(target) - 1); - if (ret <= 0) - return; - - target[ret] = '\0'; - Process_updateExe(proc, target); -} - -static void SolarisProcessList_updateCwd(pid_t pid, Process* proc) { - char path[32]; - xSnprintf(path, sizeof(path), "/proc/%d/cwd", pid); - - char target[PATH_MAX]; - ssize_t ret = readlink(path, target, sizeof(target) - 1); - if (ret <= 0) - return; - - target[ret] = '\0'; - free_and_xStrdup(&proc->procCwd, target); -} - -/* Taken from: https://docs.oracle.com/cd/E19253-01/817-6223/6mlkidlom/index.html#tbl-sched-state */ -static inline ProcessState SolarisProcessList_getProcessState(char state) { - switch (state) { - case 'S': return SLEEPING; - case 'R': return RUNNABLE; - case 'O': return RUNNING; - case 'Z': return ZOMBIE; - case 'T': return STOPPED; - case 'I': return IDLE; - default: return UNKNOWN; - } -} - -/* NOTE: the following is a callback function of type proc_walk_f - * and MUST conform to the appropriate definition in order - * to work. See libproc(3LIB) on a Solaris or Illumos - * system for more info. - */ - -static int SolarisProcessList_walkproc(psinfo_t* _psinfo, lwpsinfo_t* _lwpsinfo, void* listptr) { - bool preExisting; - pid_t getpid; - - // Setup process list - ProcessList* pl = (ProcessList*) listptr; - SolarisProcessList* spl = (SolarisProcessList*) listptr; - - id_t lwpid_real = _lwpsinfo->pr_lwpid; - if (lwpid_real > 1023) { - return 0; - } - - pid_t lwpid = (_psinfo->pr_pid * 1024) + lwpid_real; - bool onMasterLWP = (_lwpsinfo->pr_lwpid == _psinfo->pr_lwp.pr_lwpid); - if (onMasterLWP) { - getpid = _psinfo->pr_pid * 1024; - } else { - getpid = lwpid; - } - - Process* proc = ProcessList_getProcess(pl, getpid, &preExisting, SolarisProcess_new); - SolarisProcess* sproc = (SolarisProcess*) proc; - - // Common code pass 1 - proc->show = false; - sproc->taskid = _psinfo->pr_taskid; - sproc->projid = _psinfo->pr_projid; - sproc->poolid = _psinfo->pr_poolid; - sproc->contid = _psinfo->pr_contract; - proc->priority = _lwpsinfo->pr_pri; - proc->nice = _lwpsinfo->pr_nice - NZERO; - proc->processor = _lwpsinfo->pr_onpro; - proc->state = SolarisProcessList_getProcessState(_lwpsinfo->pr_sname); - // NOTE: This 'percentage' is a 16-bit BINARY FRACTIONS where 1.0 = 0x8000 - // Source: https://docs.oracle.com/cd/E19253-01/816-5174/proc-4/index.html - // (accessed on 18 November 2017) - proc->percent_mem = ((uint16_t)_psinfo->pr_pctmem / (double)32768) * (double)100.0; - proc->pgrp = _psinfo->pr_pgid; - proc->nlwp = _psinfo->pr_nlwp; - proc->session = _psinfo->pr_sid; - - proc->tty_nr = _psinfo->pr_ttydev; - const char* name = (_psinfo->pr_ttydev != PRNODEV) ? ttyname(_psinfo->pr_ttydev) : NULL; - if (!name) { - free(proc->tty_name); - proc->tty_name = NULL; - } else { - free_and_xStrdup(&proc->tty_name, name); - } - - proc->m_resident = _psinfo->pr_rssize; // KB - proc->m_virt = _psinfo->pr_size; // KB - - if (proc->st_uid != _psinfo->pr_euid) { - proc->st_uid = _psinfo->pr_euid; - proc->user = UsersTable_getRef(pl->usersTable, proc->st_uid); - } - - if (!preExisting) { - sproc->realpid = _psinfo->pr_pid; - sproc->lwpid = lwpid_real; - sproc->zoneid = _psinfo->pr_zoneid; - sproc->zname = SolarisProcessList_readZoneName(spl->kd, sproc); - SolarisProcessList_updateExe(_psinfo->pr_pid, proc); - - Process_updateComm(proc, _psinfo->pr_fname); - Process_updateCmdline(proc, _psinfo->pr_psargs, 0, 0); - - if (proc->settings->ss->flags & PROCESS_FLAG_CWD) { - SolarisProcessList_updateCwd(_psinfo->pr_pid, proc); - } - } - - // End common code pass 1 - - if (onMasterLWP) { // Are we on the representative LWP? - proc->ppid = (_psinfo->pr_ppid * 1024); - proc->tgid = (_psinfo->pr_ppid * 1024); - sproc->realppid = _psinfo->pr_ppid; - sproc->realtgid = _psinfo->pr_ppid; - - // See note above (in common section) about this BINARY FRACTION - proc->percent_cpu = ((uint16_t)_psinfo->pr_pctcpu / (double)32768) * (double)100.0; - Process_updateCPUFieldWidths(proc->percent_cpu); - - proc->time = _psinfo->pr_time.tv_sec * 100 + _psinfo->pr_time.tv_nsec / 10000000; - if (!preExisting) { // Tasks done only for NEW processes - proc->isUserlandThread = false; - proc->starttime_ctime = _psinfo->pr_start.tv_sec; - } - - // Update proc and thread counts based on settings - if (proc->isKernelThread && !pl->settings->hideKernelThreads) { - pl->kernelThreads += proc->nlwp; - pl->totalTasks += proc->nlwp + 1; - if (proc->state == RUNNING) { - pl->runningTasks++; - } - } else if (!proc->isKernelThread) { - if (proc->state == RUNNING) { - pl->runningTasks++; - } - if (pl->settings->hideUserlandThreads) { - pl->totalTasks++; - } else { - pl->userlandThreads += proc->nlwp; - pl->totalTasks += proc->nlwp + 1; - } - } - proc->show = !(pl->settings->hideKernelThreads && proc->isKernelThread); - } else { // We are not in the master LWP, so jump to the LWP handling code - proc->percent_cpu = ((uint16_t)_lwpsinfo->pr_pctcpu / (double)32768) * (double)100.0; - Process_updateCPUFieldWidths(proc->percent_cpu); - - proc->time = _lwpsinfo->pr_time.tv_sec * 100 + _lwpsinfo->pr_time.tv_nsec / 10000000; - if (!preExisting) { // Tasks done only for NEW LWPs - proc->isUserlandThread = true; - proc->ppid = _psinfo->pr_pid * 1024; - proc->tgid = _psinfo->pr_pid * 1024; - sproc->realppid = _psinfo->pr_pid; - sproc->realtgid = _psinfo->pr_pid; - proc->starttime_ctime = _lwpsinfo->pr_start.tv_sec; - } - - // Top-level process only gets this for the representative LWP - if (proc->isKernelThread && !pl->settings->hideKernelThreads) { - proc->show = true; - } - if (!proc->isKernelThread && !pl->settings->hideUserlandThreads) { - proc->show = true; - } - } // Top-level LWP or subordinate LWP - - // Common code pass 2 - - if (!preExisting) { - if ((sproc->realppid <= 0) && !(sproc->realpid <= 1)) { - proc->isKernelThread = true; - } else { - proc->isKernelThread = false; - } - - Process_fillStarttimeBuffer(proc); - ProcessList_add(pl, proc); - } - - proc->updated = true; - - // End common code pass 2 - - return 0; -} - -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { - SolarisProcessList_updateCPUcount(super); - SolarisProcessList_scanCPUTime(super); - SolarisProcessList_scanMemoryInfo(super); - SolarisProcessList_scanZfsArcstats(super); - - // in pause mode only gather global data for meters (CPU/memory/...) - if (pauseProcessUpdate) { - return; - } - - super->kernelThreads = 1; - proc_walk(&SolarisProcessList_walkproc, super, PR_WALK_LWP); -} - -bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id) { - assert(id < super->existingCPUs); - - const SolarisProcessList* spl = (const SolarisProcessList*) super; - - return (super->existingCPUs == 1) ? true : spl->cpus[id + 1].online; -} diff --git a/fedora/.local/bin/htop-vim/solaris/SolarisProcessList.h b/fedora/.local/bin/htop-vim/solaris/SolarisProcessList.h deleted file mode 100644 index 91fd4f4..0000000 --- a/fedora/.local/bin/htop-vim/solaris/SolarisProcessList.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef HEADER_SolarisProcessList -#define HEADER_SolarisProcessList -/* -htop - SolarisProcessList.h -(C) 2014 Hisham H. Muhammad -(C) 2017,2018 Guy M. Broome -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Hashtable.h" -#include "ProcessList.h" -#include "UsersTable.h" - -#include "solaris/SolarisProcess.h" - -#include "zfs/ZfsArcStats.h" - - -#define ZONE_ERRMSGLEN 1024 -extern char zone_errmsg[ZONE_ERRMSGLEN]; - -typedef struct CPUData_ { - double userPercent; - double nicePercent; - double systemPercent; - double irqPercent; - double idlePercent; - double systemAllPercent; - double frequency; - uint64_t luser; - uint64_t lkrnl; - uint64_t lintr; - uint64_t lidle; - bool online; -} CPUData; - -typedef struct SolarisProcessList_ { - ProcessList super; - kstat_ctl_t* kd; - CPUData* cpus; - ZfsArcStats zfs; -} SolarisProcessList; - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId); - -void ProcessList_delete(ProcessList* pl); - -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate); - -bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id); - -#endif diff --git a/fedora/.local/bin/htop-vim/test_spec.lua b/fedora/.local/bin/htop-vim/test_spec.lua deleted file mode 100755 index 2ae8015..0000000 --- a/fedora/.local/bin/htop-vim/test_spec.lua +++ /dev/null @@ -1,687 +0,0 @@ -#!/usr/bin/env lua - -local VISUALDELAY = os.getenv("VISUALDELAY") - -local visual = VISUALDELAY or false -local visual_delay = VISUALDELAY and (tonumber(VISUALDELAY)) or 0.1 -local short_delay = 0.3 -local long_delay = 1 - -local unistd = require("posix.unistd") -local time = require("posix.time") -local curses = require("posix.curses") -local rote = require("rote") - -local rt = rote.RoteTerm(24, 80) - ---[[ -local function os_execread(cmd) - local fd = io.popen(cmd, "r") - local out = fd:read("*a") - fd:close() - return (out:gsub("\n$", "")) -end -]] ---local branch = os_execread("git branch | grep '*'"):sub(3) ---print("Running in branch "..branch) - -os.execute("make coverage") -os.execute("rm -f *.gcda */*.gcda") -os.execute("rm -f coverage.info test.htoprc") -os.execute("rm -rf lcov") -os.execute("killall htop") -os.execute("ps aux | grep '[s]leep 12345' | awk '{print $2}' | xargs kill 2> /dev/null") - -os.execute("cp ./default.htoprc ./test.htoprc") -rt:forkPty("LC_ALL=C HTOPRC=./test.htoprc ./htop 2> htop-valgrind.txt") - -local stdscr, term_win --- Curses initialization needed even when not in visual mode --- because luaposix only initializes KEY_* constants after initscr(). -stdscr = curses.initscr() -if visual then - curses.echo(false) - curses.start_color() - curses.raw(true) - curses.halfdelay(1) - stdscr:keypad(true) - term_win = curses.newwin(24, 80, 0, 0) - local function makePair(foreground, background) - return background * 8 + 7 - foreground - end - -- initialize the color pairs the way rt:draw() expects it - for foreground = 0, 7 do - for background = 0, 7 do - if foreground ~= 7 or background ~= 0 then - local pair = makePair(foreground, background) - curses.init_pair(pair, foreground, background) - end - end - end -else - curses.endwin() -end - -local function show(key) - rt:update() - if visual then - rt:draw(term_win, 0, 0) - if key then - term_win:mvaddstr(0, 0, tostring(key)) - end - term_win:refresh() - - delay(visual_delay) - end -end - -local function send(key, times, quick) - if times == 0 then return end - for _ = 1, times or 1 do - delay(0.003) -- 30ms delay to avoid clobbering Esc sequences - if type(key) == "string" then - for c in key:gmatch('.') do - rt:keyPress(string.byte(c)) - end - else - rt:keyPress(key) - end - if not quick then - show(key) - end - end - if quick then - show(key) - end -end - -local function string_at(x, y, len) - rt:update() - local out = {} - for i = 1, len do - out[#out+1] = rt:cellChar(y-1, x+i-2) - end - return table.concat(out) -end - -local function is_string_at(x, y, str) - return string_at(x, y, #str) == str -end - -local function check_string_at(x, y, str) - return { str, string_at(x, y, #str) } -end - -local ESC = "\27\27" - -function delay(t) - time.nanosleep({ tv_sec = math.floor(t), tv_nsec = (t - math.floor(t)) * 1000000000 }) -end - -delay(2) -- give some time for htop to initialize. -rt:update() - -local y_panelhdr = (function() - for y = 1, 24 do - if is_string_at(3, y, "PID") then - return y - end - end -end)() or 1 - -assert.not_equal(y_panelhdr, 1) - -local x_metercol2 = 41 - -show() - -os.execute("sleep 12345 &") - -local function terminated() - return not os.execute("ps aux | grep -q '\\./[h]top'") -end - -local function running_it(desc, fn) - it(desc, function() - assert(not terminated()) - show() - fn() - assert(not terminated()) - end) -end - -local function check(t) - return t[1], t[2] -end - -local attrs = { - black_on_cyan = 6, - red_on_cyan = 22, - white_on_black = 176, - yellow_on_black = 112, -} - -local function find_selected_y(from) - rt:update() - for y = from or (y_panelhdr + 1), rt:rows() - 1 do - local attr = rt:cellAttr(y-1, 1) - if attr == attrs.black_on_cyan then - return y - end - end - return y_panelhdr + 1 -end - -local function find_command_x() - for x = 1, 80 do - if is_string_at(x, y_panelhdr, "Command") then - return x - end - end - return 64 -end - -local function set_display_option(n) - send("S") - send(curses.KEY_DOWN) - send(curses.KEY_RIGHT) - send(curses.KEY_DOWN, n, "quick") - send("\n") - send(curses.KEY_F10) -end - -describe("htop test suite", function() - - running_it("performs incremental filter", function() - send("\\") - send("x\127bux\127sted") -- test backspace - send("\n") - delay(short_delay) - rt:update() - local pid = (" "..tostring(unistd.getpid())):sub(-5) - local ourpid = check_string_at(1, y_panelhdr + 1, pid) - send("\\") - send(ESC) - send(curses.KEY_F5) - send(curses.KEY_HOME) - delay(short_delay) - rt:update() - local initpid = check_string_at(1, y_panelhdr + 1, " 1") - delay(short_delay) - rt:update() - send(curses.KEY_F5) - assert.equal(check(ourpid)) - assert.equal(check(initpid)) - end) - - running_it("performs incremental search", function() - send(curses.KEY_HOME) - send("/") - send("busted") - local attr = rt:cellAttr(rt:rows() - 1, 30) - delay(short_delay) - local line = find_selected_y() - local pid = (" "..tostring(unistd.getpid())):sub(-5) - assert.equal(attr, attrs.black_on_cyan) - local ourpid = check_string_at(1, line, pid) - send("\n") - send(curses.KEY_HOME) - assert.equal(check(ourpid)) - end) - - running_it("performs pid search", function() - send(curses.KEY_F5) - send(curses.KEY_END) - send("1") - delay(short_delay) - local line = find_selected_y() - local initpid = check_string_at(1, line, " 1") - send(curses.KEY_F5) - assert.equal(check(initpid)) - end) - - - running_it("horizontal scroll", function() - local h_scroll = 20 - send(curses.KEY_F5) - delay(short_delay) - local str1 = string_at(1+h_scroll, y_panelhdr+1, 5) - send(curses.KEY_RIGHT) - delay(short_delay) - local str2 = string_at(1, y_panelhdr+1, 5) - send(curses.KEY_LEFT) - delay(short_delay) - local str3 = string_at(1+h_scroll, y_panelhdr+1, 5) - send(curses.KEY_LEFT) - delay(short_delay) - local str4 = string_at(1+h_scroll, y_panelhdr+1, 5) - send(curses.KEY_F5) - assert.equal(str1, str2) - assert.equal(str2, str3) - assert.equal(str3, str4) - end) - - running_it("kills a process", function() - send(curses.KEY_HOME) - send("\\") - send("sleep 12345") - local attr = rt:cellAttr(rt:rows() - 1, 30) - assert.equal(attr, attrs.black_on_cyan) - send("\n") - delay(short_delay) - rt:update() - local col = find_command_x() - local procname = check_string_at(col, y_panelhdr + 1, "sleep 12345") - send("k") - send("\n") - send("\\") - send(ESC) - delay(short_delay) - assert.equal(check(procname)) - assert.not_equal((os.execute("ps aux | grep -q '[s]leep 12345'")), true) - end) - - running_it("runs strace", function() - send(curses.KEY_HOME) - send("/") - send("busted") - send("\n") - send("s") - delay(long_delay) - send(ESC) - end) - - running_it("runs lsof", function() - send(curses.KEY_HOME) - send("/") - send("busted") - send("\n") - send("l") - delay(long_delay) - send(ESC) - end) - - running_it("performs filtering in lsof", function() - send(curses.KEY_HOME) - send("/") - send("htop") - send("\n") - send("l") - send(curses.KEY_F4) - send("pipe") - delay(long_delay) - local pipefd = check_string_at(1, 3, " 3") - send(ESC) - assert.equal(check(pipefd)) - end) - - running_it("performs search in lsof", function() - send(curses.KEY_HOME) - send("/") - send("htop") - send("\n") - send("l") - send(curses.KEY_F3) - send("pipe") - delay(long_delay) - local line = find_selected_y(3) - local pipefd = check_string_at(1, line, " 3") - send(ESC) - assert.equal(check(pipefd)) - end) - - - running_it("cycles through meter modes in the default meters", function() - send("S") - for _ = 1, 2 do - send(curses.KEY_RIGHT) - for _ = 1, 3 do - send("\n", 4) - send(curses.KEY_DOWN) - end - end - send(ESC) - end) - - running_it("show process of a user", function() - send(curses.KEY_F5) - send("u") - send(curses.KEY_DOWN) - delay(short_delay) - rt:update() - local chosen = string_at(1, y_panelhdr + 2, 9) - send("\n") - send(curses.KEY_HOME) - delay(short_delay) - rt:update() - local shown = string_at(7, y_panelhdr + 1, 9) - send("u") - send("\n") - send(curses.KEY_HOME) - delay(short_delay) - rt:update() - local inituser = string_at(7, y_panelhdr + 1, 9) - send(curses.KEY_F5) - assert.equal(shown, chosen) - assert.equal(inituser, "root ") - end) - - running_it("performs failing search", function() - send(curses.KEY_HOME) - send("/") - send("xxxxxxxxxx") - delay(short_delay) - rt:update() - local attr = rt:cellAttr(rt:rows() - 1, 30) - assert.equal(attr, attrs.red_on_cyan) - send("\n") - end) - - running_it("cycles through search", function() - send(curses.KEY_HOME) - send("/") - send("sh") - local lastpid - local pidpairs = {} - for _ = 1, 3 do - send(curses.KEY_F3) - local line = find_selected_y() - local pid = string_at(1, line, 5) - if lastpid then - pidpairs[#pidpairs + 1] = { lastpid, pid } - lastpid = pid - end - end - send(curses.KEY_HOME) - for _, pair in pairs(pidpairs) do - assert.not_equal(pair[1], pair[2]) - end - end) - - running_it("visits each setup screen", function() - send("S") - send(curses.KEY_DOWN, 3) - send(curses.KEY_F10) - end) - - running_it("adds and removes PPID column", function() - send("S") - send(curses.KEY_DOWN, 3) - send(curses.KEY_RIGHT, 2) - send(curses.KEY_DOWN, 2) - send("\n") - send(curses.KEY_F10) - delay(short_delay) - local ppid = check_string_at(2, y_panelhdr, "PPID") - send("S") - send(curses.KEY_DOWN, 3) - send(curses.KEY_RIGHT, 1) - send(curses.KEY_DC) - send(curses.KEY_F10) - delay(short_delay) - local not_ppid = check_string_at(2, y_panelhdr, "PPID") - assert.equal(check(ppid)) - assert.not_equal(check(not_ppid)) - end) - - running_it("changes CPU affinity for a process", function() - send("a") - send(" \n") - send(ESC) - end) - - running_it("renices for a process", function() - send("/") - send("busted") - send("\n") - local line = find_selected_y() - local before = check_string_at(22, line, " 0") - send(curses.KEY_F8) - delay(short_delay) - local after = check_string_at(22, line, " 1") - assert.equal(check(before)) - assert.equal(check(after)) - end) - - running_it("tries to lower nice for a process", function() - send("/") - send("busted") - send("\n") - local line = find_selected_y() - local before = string_at(22, line, 2) - send(curses.KEY_F7) - delay(short_delay) - local after = string_at(22, line, 2) - assert.equal(before, after) -- no permissions - end) - - running_it("invert sort order", function() - local cpu_col = 45 - send("P") - send("I") - send(curses.KEY_HOME) - delay(short_delay) - local zerocpu = check_string_at(cpu_col, y_panelhdr + 1, " 0.0") - send("I") - delay(short_delay) - local nonzerocpu = check_string_at(cpu_col, y_panelhdr + 1, " 0.0") - assert.equal(check(zerocpu)) - assert.not_equal(check(nonzerocpu)) - end) - - running_it("changes IO priority for a process", function() - send("/") - send("htop") - send("\n") - send("i") - send(curses.KEY_END) - send("\n") - send(ESC) - end) - - running_it("shows help", function() - send(curses.KEY_F1) - send("\n") - set_display_option(9) - send(curses.KEY_F1) - send("\n") - set_display_option(9) - end) - - running_it("moves meters around", function() - send("S") - send(curses.KEY_RIGHT) - send(curses.KEY_UP) - send("\n") - send(curses.KEY_DOWN) - send(curses.KEY_UP) - send(curses.KEY_RIGHT) - send(curses.KEY_RIGHT) - send(curses.KEY_LEFT) - send(curses.KEY_LEFT) - send("\n") - send(curses.KEY_F10) - end) - - local meters = { - { name = "clock", down = 0, string = "Time" }, - { name = "load", down = 2, string = "Load" }, - { name = "battery", down = 7, string = "Battery" }, - { name = "hostname", down = 8, string = "Hostname" }, - { name = "memory", down = 3, string = "Mem" }, - { name = "CPU average", down = 16, string = "Avg" }, - } - - running_it("checks various CPU meters", function() - send("S") - send(curses.KEY_RIGHT, 3) - send(curses.KEY_DOWN, 9, "quick") - for _ = 9, 14 do - send("\n") - send("\n") - send(curses.KEY_DC) - send(curses.KEY_RIGHT) - send(curses.KEY_DOWN) - end - end) - - for _, item in ipairs(meters) do - running_it("adds and removes a "..item.name.." widget", function() - send("S") - send(curses.KEY_RIGHT, 3) - send(curses.KEY_DOWN, item.down) - send("\n") - send(curses.KEY_UP, 4) - send("\n") - send(curses.KEY_F4, 4) -- cycle through meter modes - delay(short_delay) - rt:update() - local with = check_string_at(x_metercol2, 2, item.string) - send(curses.KEY_DC) - delay(short_delay) - local without = check_string_at(x_metercol2, 2, item.string) - send(curses.KEY_F10) - assert.equal(check(with)) - assert.not_equal(check(without)) - end) - end - - running_it("goes through themes", function() - send(curses.KEY_F2) - send(curses.KEY_DOWN, 2) - send(curses.KEY_RIGHT) - for _ = 1, 6 do - send("\n") - send(curses.KEY_DOWN) - end - send(curses.KEY_UP, 6) - send("\n") - send(curses.KEY_F10) - end) - - local display_options = { - { name = "tree view", down = 0 }, - { name = "shadow other user's process", down = 1 }, - { name = "hide kernel threads", down = 2 }, - { name = "hide userland threads", down = 3 }, - { name = "display threads in different color", down = 4 }, - { name = "show custom thread names", down = 5 }, - { name = "highlight basename", down = 6 }, - { name = "highlight large numbers", down = 7 }, - { name = "leave margin around header", down = 8 }, - { name = "use detailed CPU time", down = 9 }, - { name = "count from zero", down = 10 }, - { name = "update process names", down = 11 }, - { name = "guest time in CPU%", down = 12 }, - } - - for _, item in ipairs(display_options) do - running_it("checks display option to "..item.name, function() - for _ = 1, 2 do - set_display_option(item.down) - delay(short_delay) - end - end) - end - - running_it("shows detailed CPU with guest time", function() - for _ = 1, 2 do - send("S") - send(curses.KEY_DOWN) - send(curses.KEY_RIGHT) - send(curses.KEY_DOWN, 9) - send("\n") - send(curses.KEY_DOWN, 3) - send("\n") - send(curses.KEY_LEFT) - send(curses.KEY_UP) - send(curses.KEY_RIGHT) - send(curses.KEY_F4, 4) -- cycle through CPU meter modes - send(curses.KEY_F10) - delay(short_delay) - end - end) - - running_it("expands and collapses tree", function() - send(curses.KEY_F5) -- tree view - send(curses.KEY_HOME) - send(curses.KEY_DOWN) -- second process in the tree - send("-") - send("+") - send(curses.KEY_F5) - end) - - running_it("sets sort key", function() - send(".") - send("\n") - end) - - running_it("tags all children", function() - send(curses.KEY_F5) -- tree view - send(curses.KEY_HOME) -- ensure we're at init - send("c") - local taggedattrs = {} - rt:update() - for y = y_panelhdr + 2, 23 do - table.insert(taggedattrs, rt:cellAttr(y-1, 4)) - end - delay(short_delay) - send("U") - local untaggedattrs = {} - rt:update() - for y = y_panelhdr + 2, 23 do - table.insert(untaggedattrs, rt:cellAttr(y-1, 4)) - end - send(curses.KEY_F5) - - for _, taggedattr in ipairs(taggedattrs) do - assert.equal(attrs.yellow_on_black, taggedattr) - end - for _, untaggedattr in ipairs(untaggedattrs) do - assert.equal(attrs.white_on_black, untaggedattr) - end - end) - - for i = 1, 62 do - running_it("show column "..i, function() - send("S") - send(curses.KEY_END) - send(curses.KEY_RIGHT, 1) - if i > 1 then - send(curses.KEY_DC) - end - send(curses.KEY_RIGHT, 1) - local down = i - while down > 13 do - send(curses.KEY_NPAGE) - down = down - 13 - end - send(curses.KEY_DOWN, down, "quick") - send("\n") - send(curses.KEY_F10) - if i == 62 then - send("S") - send(curses.KEY_END) - send(curses.KEY_RIGHT, 1) - if i > 1 then - send(curses.KEY_DC) - end - send(curses.KEY_F10) - end - end) - end - - it("finally quits", function() - assert(not terminated()) - send("q") - while not terminated() do - unistd.sleep(1) - send("q") - end - assert(terminated()) - if visual then - curses.endwin() - end - os.execute("make lcov && xdg-open lcov/index.html") - end) -end) diff --git a/fedora/.local/bin/htop-vim/unsupported/Platform.c b/fedora/.local/bin/htop-vim/unsupported/Platform.c deleted file mode 100644 index 27bc560..0000000 --- a/fedora/.local/bin/htop-vim/unsupported/Platform.c +++ /dev/null @@ -1,158 +0,0 @@ -/* -htop - unsupported/Platform.c -(C) 2014 Hisham H. Muhammad -(C) 2015 David C. Hunt -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "unsupported/Platform.h" - -#include - -#include "CPUMeter.h" -#include "ClockMeter.h" -#include "DateMeter.h" -#include "DateTimeMeter.h" -#include "HostnameMeter.h" -#include "LoadAverageMeter.h" -#include "Macros.h" -#include "MemoryMeter.h" -#include "MemorySwapMeter.h" -#include "SwapMeter.h" -#include "SysArchMeter.h" -#include "TasksMeter.h" -#include "UptimeMeter.h" - - -const ScreenDefaults Platform_defaultScreens[] = { - { - .name = "Main", - .columns = "PID USER PRIORITY NICE M_VIRT M_RESIDENT STATE PERCENT_CPU PERCENT_MEM TIME Command", - .sortKey = "PERCENT_CPU", - }, -}; - -const unsigned int Platform_numberOfDefaultScreens = ARRAYSIZE(Platform_defaultScreens); - -const SignalItem Platform_signals[] = { - { .name = " 0 Cancel", .number = 0 }, -}; - -const unsigned int Platform_numberOfSignals = ARRAYSIZE(Platform_signals); - -const MeterClass* const Platform_meterTypes[] = { - &CPUMeter_class, - &ClockMeter_class, - &DateMeter_class, - &DateTimeMeter_class, - &LoadAverageMeter_class, - &LoadMeter_class, - &MemoryMeter_class, - &SwapMeter_class, - &MemorySwapMeter_class, - &TasksMeter_class, - &BatteryMeter_class, - &HostnameMeter_class, - &SysArchMeter_class, - &UptimeMeter_class, - &AllCPUsMeter_class, - &AllCPUs2Meter_class, - &AllCPUs4Meter_class, - &AllCPUs8Meter_class, - &LeftCPUsMeter_class, - &RightCPUsMeter_class, - &LeftCPUs2Meter_class, - &RightCPUs2Meter_class, - &LeftCPUs4Meter_class, - &RightCPUs4Meter_class, - &LeftCPUs8Meter_class, - &RightCPUs8Meter_class, - &BlankMeter_class, - NULL -}; - -static const char Platform_unsupported[] = "unsupported"; - -bool Platform_init(void) { - /* no platform-specific setup needed */ - return true; -} - -void Platform_done(void) { - /* no platform-specific cleanup needed */ -} - -void Platform_setBindings(Htop_Action* keys) { - /* no platform-specific key bindings */ - (void) keys; -} - -int Platform_getUptime(void) { - return 0; -} - -void Platform_getLoadAverage(double* one, double* five, double* fifteen) { - *one = 0; - *five = 0; - *fifteen = 0; -} - -int Platform_getMaxPid(void) { - return 1; -} - -double Platform_setCPUValues(Meter* this, unsigned int cpu) { - (void) cpu; - - double* v = this->values; - v[CPU_METER_FREQUENCY] = NAN; - v[CPU_METER_TEMPERATURE] = NAN; - - this->curItems = 1; - - return 0.0; -} - -void Platform_setMemoryValues(Meter* this) { - (void) this; -} - -void Platform_setSwapValues(Meter* this) { - (void) this; -} - -char* Platform_getProcessEnv(pid_t pid) { - (void) pid; - return NULL; -} - -FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) { - (void)pid; - return NULL; -} - -bool Platform_getDiskIO(DiskIOData* data) { - (void)data; - return false; -} - -bool Platform_getNetworkIO(NetworkIOData* data) { - (void)data; - return false; -} - -void Platform_getBattery(double* percent, ACPresence* isOnAC) { - *percent = NAN; - *isOnAC = AC_ERROR; -} - -void Platform_getHostname(char* buffer, size_t size) { - String_safeStrncpy(buffer, Platform_unsupported, size); -} - -void Platform_getRelease(char** string) { - *string = xStrdup(Platform_unsupported); -} diff --git a/fedora/.local/bin/htop-vim/unsupported/Platform.h b/fedora/.local/bin/htop-vim/unsupported/Platform.h deleted file mode 100644 index f475dda..0000000 --- a/fedora/.local/bin/htop-vim/unsupported/Platform.h +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef HEADER_Platform -#define HEADER_Platform -/* -htop - unsupported/Platform.h -(C) 2014 Hisham H. Muhammad -(C) 2015 David C. Hunt -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Action.h" -#include "BatteryMeter.h" -#include "DiskIOMeter.h" -#include "Hashtable.h" -#include "NetworkIOMeter.h" -#include "ProcessLocksScreen.h" -#include "SignalsPanel.h" -#include "CommandLine.h" -#include "generic/gettime.h" -#include "unsupported/UnsupportedProcess.h" - - -extern const ScreenDefaults Platform_defaultScreens[]; - -extern const unsigned int Platform_numberOfDefaultScreens; - -extern const SignalItem Platform_signals[]; - -extern const unsigned int Platform_numberOfSignals; - -extern const MeterClass* const Platform_meterTypes[]; - -bool Platform_init(void); - -void Platform_done(void); - -void Platform_setBindings(Htop_Action* keys); - -int Platform_getUptime(void); - -void Platform_getLoadAverage(double* one, double* five, double* fifteen); - -int Platform_getMaxPid(void); - -double Platform_setCPUValues(Meter* this, unsigned int cpu); - -void Platform_setMemoryValues(Meter* this); - -void Platform_setSwapValues(Meter* this); - -char* Platform_getProcessEnv(pid_t pid); - -FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid); - -bool Platform_getDiskIO(DiskIOData* data); - -bool Platform_getNetworkIO(NetworkIOData* data); - -void Platform_getBattery(double* percent, ACPresence* isOnAC); - -void Platform_getHostname(char* buffer, size_t size); - -void Platform_getRelease(char** string); - -#define PLATFORM_LONG_OPTIONS - -static inline void Platform_longOptionsUsage(ATTR_UNUSED const char* name) { } - -static inline CommandLineStatus Platform_getLongOption(ATTR_UNUSED int opt, ATTR_UNUSED int argc, ATTR_UNUSED char** argv) { - return STATUS_ERROR_EXIT; -} - -static inline void Platform_gettime_realtime(struct timeval* tv, uint64_t* msec) { - Generic_gettime_realtime(tv, msec); -} - -static inline void Platform_gettime_monotonic(uint64_t* msec) { - Generic_gettime_monotonic(msec); -} - -static inline Hashtable* Platform_dynamicMeters(void) { - return NULL; -} - -static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* table) { } - -static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { } - -static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* meter) { } - -static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter* meter, ATTR_UNUSED RichString* out) { } - -static inline Hashtable* Platform_dynamicColumns(void) { - return NULL; -} - -static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* table) { } - -static inline const char* Platform_dynamicColumnInit(ATTR_UNUSED unsigned int key) { - return NULL; -} - -static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Process* proc, ATTR_UNUSED RichString* str, ATTR_UNUSED unsigned int key) { - return false; -} - -#endif diff --git a/fedora/.local/bin/htop-vim/unsupported/ProcessField.h b/fedora/.local/bin/htop-vim/unsupported/ProcessField.h deleted file mode 100644 index 0c908ea..0000000 --- a/fedora/.local/bin/htop-vim/unsupported/ProcessField.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef HEADER_UnsupportedProcessField -#define HEADER_UnsupportedProcessField -/* -htop - unsupported/ProcessField.h -(C) 2020 htop dev team -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - - -#define PLATFORM_PROCESS_FIELDS \ - // End of list - - -#endif /* HEADER_UnsupportedProcessField */ diff --git a/fedora/.local/bin/htop-vim/unsupported/UnsupportedProcess.c b/fedora/.local/bin/htop-vim/unsupported/UnsupportedProcess.c deleted file mode 100644 index 2aca048..0000000 --- a/fedora/.local/bin/htop-vim/unsupported/UnsupportedProcess.c +++ /dev/null @@ -1,104 +0,0 @@ -/* -htop - UnsupportedProcess.c -(C) 2015 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include "unsupported/UnsupportedProcess.h" - -#include - -#include "CRT.h" -#include "Process.h" - - -const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { - [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, - [PID] = { .name = "PID", .title = "PID", .description = "Process/thread ID", .flags = 0, .pidColumn = true, }, - [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, - [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging)", .flags = 0, }, - [PPID] = { .name = "PPID", .title = "PPID", .description = "Parent process ID", .flags = 0, .pidColumn = true, }, - [PGRP] = { .name = "PGRP", .title = "PGRP", .description = "Process group ID", .flags = 0, .pidColumn = true, }, - [SESSION] = { .name = "SESSION", .title = "SID", .description = "Process's session ID", .flags = 0, .pidColumn = true, }, - [TTY] = { .name = "TTY", .title = "TTY ", .description = "Controlling terminal", .flags = 0, }, - [TPGID] = { .name = "TPGID", .title = "TPGID", .description = "Process ID of the fg process group of the controlling terminal", .flags = 0, .pidColumn = true, }, - [MINFLT] = { .name = "MINFLT", .title = " MINFLT ", .description = "Number of minor faults which have not required loading a memory page from disk", .flags = 0, .defaultSortDesc = true,}, - [MAJFLT] = { .name = "MAJFLT", .title = " MAJFLT ", .description = "Number of major faults which have required loading a memory page from disk", .flags = 0, .defaultSortDesc = true, }, - [PRIORITY] = { .name = "PRIORITY", .title = "PRI ", .description = "Kernel's internal priority for the process", .flags = 0, }, - [NICE] = { .name = "NICE", .title = " NI ", .description = "Nice value (the higher the value, the more it lets other processes take priority)", .flags = 0, }, - [STARTTIME] = { .name = "STARTTIME", .title = "START ", .description = "Time the process was started", .flags = 0, }, - [ELAPSED] = { .name = "ELAPSED", .title = "ELAPSED ", .description = "Time since the process was started", .flags = 0, }, - [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, }, - [M_VIRT] = { .name = "M_VIRT", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, .defaultSortDesc = true, }, - [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, .defaultSortDesc = true, }, - [ST_UID] = { .name = "ST_UID", .title = "UID", .description = "User ID of the process owner", .flags = 0, }, - [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = " CPU%", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, .defaultSortDesc = true, .autoWidth = true, }, - [PERCENT_NORM_CPU] = { .name = "PERCENT_NORM_CPU", .title = "NCPU%", .description = "Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)", .flags = 0, .defaultSortDesc = true, .autoWidth = true, }, - [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, .defaultSortDesc = true, }, - [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, - [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, .defaultSortDesc = true, }, - [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, }, - [TGID] = { .name = "TGID", .title = "TGID", .description = "Thread group ID (i.e. process ID)", .flags = 0, .pidColumn = true, }, -}; - -Process* UnsupportedProcess_new(const Settings* settings) { - Process* this = xCalloc(1, sizeof(UnsupportedProcess)); - Object_setClass(this, Class(UnsupportedProcess)); - Process_init(this, settings); - return this; -} - -void Process_delete(Object* cast) { - Process* super = (Process*) cast; - Process_done(super); - // free platform-specific fields here - free(cast); -} - -static void UnsupportedProcess_writeField(const Process* this, RichString* str, ProcessField field) { - const UnsupportedProcess* up = (const UnsupportedProcess*) this; - bool coloring = this->settings->highlightMegabytes; - char buffer[256]; buffer[255] = '\0'; - int attr = CRT_colors[DEFAULT_COLOR]; - size_t n = sizeof(buffer) - 1; - - (void) up; - (void) coloring; - (void) n; - - switch (field) { - /* Add platform specific fields */ - default: - Process_writeField(this, str, field); - return; - } - RichString_appendWide(str, attr, buffer); -} - -static int UnsupportedProcess_compareByKey(const Process* v1, const Process* v2, ProcessField key) { - const UnsupportedProcess* p1 = (const UnsupportedProcess*)v1; - const UnsupportedProcess* p2 = (const UnsupportedProcess*)v2; - - (void) p1; - (void) p2; - - switch (key) { - /* Add platform specific fields */ - default: - return Process_compareByKey_Base(v1, v2, key); - } -} - -const ProcessClass UnsupportedProcess_class = { - .super = { - .extends = Class(Process), - .display = Process_display, - .delete = Process_delete, - .compare = Process_compare - }, - .writeField = UnsupportedProcess_writeField, - .compareByKey = UnsupportedProcess_compareByKey -}; diff --git a/fedora/.local/bin/htop-vim/unsupported/UnsupportedProcess.h b/fedora/.local/bin/htop-vim/unsupported/UnsupportedProcess.h deleted file mode 100644 index e30169c..0000000 --- a/fedora/.local/bin/htop-vim/unsupported/UnsupportedProcess.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef HEADER_UnsupportedProcess -#define HEADER_UnsupportedProcess -/* -htop - UnsupportedProcess.h -(C) 2015 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "Settings.h" - - -typedef struct UnsupportedProcess_ { - Process super; - - /* Add platform specific fields */ -} UnsupportedProcess; - - -extern const ProcessFieldData Process_fields[LAST_PROCESSFIELD]; - -Process* UnsupportedProcess_new(const Settings* settings); - -void Process_delete(Object* cast); - -extern const ProcessClass UnsupportedProcess_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/unsupported/UnsupportedProcessList.c b/fedora/.local/bin/htop-vim/unsupported/UnsupportedProcessList.c deleted file mode 100644 index 5291797..0000000 --- a/fedora/.local/bin/htop-vim/unsupported/UnsupportedProcessList.c +++ /dev/null @@ -1,100 +0,0 @@ -/* -htop - UnsupportedProcessList.c -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "UnsupportedProcessList.h" - -#include -#include - -#include "ProcessList.h" -#include "UnsupportedProcess.h" - - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId) { - ProcessList* this = xCalloc(1, sizeof(ProcessList)); - ProcessList_init(this, Class(Process), usersTable, dynamicMeters, dynamicColumns, pidMatchList, userId); - - this->existingCPUs = 1; - this->activeCPUs = 1; - - return this; -} - -void ProcessList_delete(ProcessList* this) { - ProcessList_done(this); - free(this); -} - -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { - - // in pause mode only gather global data for meters (CPU/memory/...) - if (pauseProcessUpdate) { - return; - } - - bool preExisting = true; - Process* proc; - - proc = ProcessList_getProcess(super, 1, &preExisting, UnsupportedProcess_new); - - /* Empty values */ - proc->time = proc->time + 10; - proc->pid = 1; - proc->ppid = 1; - proc->tgid = 0; - - Process_updateComm(proc, "commof16char"); - Process_updateCmdline(proc, "", 0, 0); - Process_updateExe(proc, "/path/to/executable"); - - if (proc->settings->ss->flags & PROCESS_FLAG_CWD) { - free_and_xStrdup(&proc->procCwd, "/current/working/directory"); - } - - proc->updated = true; - - proc->state = RUNNING; - proc->isKernelThread = false; - proc->isUserlandThread = false; - proc->show = true; /* Reflected in proc->settings-> "hideXXX" really */ - proc->pgrp = 0; - proc->session = 0; - proc->tty_nr = 0; - proc->tty_name = NULL; - proc->tpgid = 0; - proc->processor = 0; - - proc->percent_cpu = 2.5; - proc->percent_mem = 2.5; - Process_updateCPUFieldWidths(proc->percent_cpu); - - proc->st_uid = 0; - proc->user = "nobody"; /* Update whenever proc->st_uid is changed */ - - proc->priority = 0; - proc->nice = 0; - proc->nlwp = 1; - proc->starttime_ctime = 1433116800; // Jun 01, 2015 - Process_fillStarttimeBuffer(proc); - - proc->m_virt = 100; - proc->m_resident = 100; - - proc->minflt = 20; - proc->majflt = 20; - - if (!preExisting) - ProcessList_add(super, proc); -} - -bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id) { - assert(id < super->existingCPUs); - - (void) super; (void) id; - - return true; -} diff --git a/fedora/.local/bin/htop-vim/unsupported/UnsupportedProcessList.h b/fedora/.local/bin/htop-vim/unsupported/UnsupportedProcessList.h deleted file mode 100644 index cbf25af..0000000 --- a/fedora/.local/bin/htop-vim/unsupported/UnsupportedProcessList.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef HEADER_UnsupportedProcessList -#define HEADER_UnsupportedProcessList -/* -htop - UnsupportedProcessList.h -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "ProcessList.h" - - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId); - -void ProcessList_delete(ProcessList* this); - -void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate); - -bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id); - -#endif diff --git a/fedora/.local/bin/htop-vim/zfs/ZfsArcMeter.c b/fedora/.local/bin/htop-vim/zfs/ZfsArcMeter.c deleted file mode 100644 index f124272..0000000 --- a/fedora/.local/bin/htop-vim/zfs/ZfsArcMeter.c +++ /dev/null @@ -1,98 +0,0 @@ -/* -htop - ZfsArcMeter.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "zfs/ZfsArcMeter.h" - -#include - -#include "CRT.h" -#include "Object.h" -#include "Platform.h" -#include "RichString.h" - -#include "zfs/ZfsArcStats.h" - - -static const int ZfsArcMeter_attributes[] = { - ZFS_MFU, ZFS_MRU, ZFS_ANON, ZFS_HEADER, ZFS_OTHER -}; - -void ZfsArcMeter_readStats(Meter* this, const ZfsArcStats* stats) { - this->total = stats->max; - this->values[0] = stats->MFU; - this->values[1] = stats->MRU; - this->values[2] = stats->anon; - this->values[3] = stats->header; - this->values[4] = stats->other; - - // "Hide" the last value so it can - // only be accessed by index and is not - // displayed by the Bar or Graph style - this->curItems = 5; - this->values[5] = stats->size; -} - -static void ZfsArcMeter_updateValues(Meter* this) { - char* buffer = this->txtBuffer; - size_t size = sizeof(this->txtBuffer); - int written; - Platform_setZfsArcValues(this); - - written = Meter_humanUnit(buffer, this->values[5], size); - METER_BUFFER_CHECK(buffer, size, written); - - METER_BUFFER_APPEND_CHR(buffer, size, '/'); - - Meter_humanUnit(buffer, this->total, size); -} - -static void ZfsArcMeter_display(const Object* cast, RichString* out) { - const Meter* this = (const Meter*)cast; - - if (this->values[5] > 0) { - char buffer[50]; - Meter_humanUnit(buffer, this->total, sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_VALUE], buffer); - Meter_humanUnit(buffer, this->values[5], sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " Used:"); - RichString_appendAscii(out, CRT_colors[METER_VALUE], buffer); - Meter_humanUnit(buffer, this->values[0], sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " MFU:"); - RichString_appendAscii(out, CRT_colors[ZFS_MFU], buffer); - Meter_humanUnit(buffer, this->values[1], sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " MRU:"); - RichString_appendAscii(out, CRT_colors[ZFS_MRU], buffer); - Meter_humanUnit(buffer, this->values[2], sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " Anon:"); - RichString_appendAscii(out, CRT_colors[ZFS_ANON], buffer); - Meter_humanUnit(buffer, this->values[3], sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " Hdr:"); - RichString_appendAscii(out, CRT_colors[ZFS_HEADER], buffer); - Meter_humanUnit(buffer, this->values[4], sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " Oth:"); - RichString_appendAscii(out, CRT_colors[ZFS_OTHER], buffer); - } else { - RichString_writeAscii(out, CRT_colors[METER_TEXT], " "); - RichString_appendAscii(out, CRT_colors[FAILED_READ], "Unavailable"); - } -} - -const MeterClass ZfsArcMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = ZfsArcMeter_display, - }, - .updateValues = ZfsArcMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 6, - .total = 100.0, - .attributes = ZfsArcMeter_attributes, - .name = "ZFSARC", - .uiName = "ZFS ARC", - .caption = "ARC: " -}; diff --git a/fedora/.local/bin/htop-vim/zfs/ZfsArcMeter.h b/fedora/.local/bin/htop-vim/zfs/ZfsArcMeter.h deleted file mode 100644 index 3f6ea5a..0000000 --- a/fedora/.local/bin/htop-vim/zfs/ZfsArcMeter.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef HEADER_ZfsArcMeter -#define HEADER_ZfsArcMeter -/* -htop - ZfsArcMeter.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "zfs/ZfsArcStats.h" - -#include "Meter.h" - - -void ZfsArcMeter_readStats(Meter* this, const ZfsArcStats* stats); - -extern const MeterClass ZfsArcMeter_class; - -#endif diff --git a/fedora/.local/bin/htop-vim/zfs/ZfsArcStats.h b/fedora/.local/bin/htop-vim/zfs/ZfsArcStats.h deleted file mode 100644 index 1fe7236..0000000 --- a/fedora/.local/bin/htop-vim/zfs/ZfsArcStats.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef HEADER_ZfsArcStats -#define HEADER_ZfsArcStats -/* -htop - ZfsArcStats.h -(C) 2014 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -typedef struct ZfsArcStats_ { - int enabled; - int isCompressed; - unsigned long long int min; - unsigned long long int max; - unsigned long long int size; - unsigned long long int MFU; - unsigned long long int MRU; - unsigned long long int anon; - unsigned long long int header; - unsigned long long int other; - unsigned long long int compressed; - unsigned long long int uncompressed; -} ZfsArcStats; - -#endif diff --git a/fedora/.local/bin/htop-vim/zfs/ZfsCompressedArcMeter.c b/fedora/.local/bin/htop-vim/zfs/ZfsCompressedArcMeter.c deleted file mode 100644 index 2e49473..0000000 --- a/fedora/.local/bin/htop-vim/zfs/ZfsCompressedArcMeter.c +++ /dev/null @@ -1,87 +0,0 @@ -/* -htop - ZfsCompressedArcMeter.c -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "zfs/ZfsCompressedArcMeter.h" - -#include - -#include "CRT.h" -#include "Meter.h" -#include "Object.h" -#include "Platform.h" -#include "RichString.h" -#include "XUtils.h" -#include "zfs/ZfsArcStats.h" - - -static const int ZfsCompressedArcMeter_attributes[] = { - ZFS_COMPRESSED -}; - -void ZfsCompressedArcMeter_readStats(Meter* this, const ZfsArcStats* stats) { - if ( stats->isCompressed ) { - this->total = stats->uncompressed; - this->values[0] = stats->compressed; - } else { - // For uncompressed ARC, report 1:1 ratio - this->total = stats->size; - this->values[0] = stats->size; - } -} - -static int ZfsCompressedArcMeter_printRatioString(const Meter* this, char* buffer, size_t size) { - if (this->values[0] > 0) { - return xSnprintf(buffer, size, "%.2f:1", this->total / this->values[0]); - } - - return xSnprintf(buffer, size, "N/A"); -} - -static void ZfsCompressedArcMeter_updateValues(Meter* this) { - Platform_setZfsCompressedArcValues(this); - - ZfsCompressedArcMeter_printRatioString(this, this->txtBuffer, sizeof(this->txtBuffer)); -} - -static void ZfsCompressedArcMeter_display(const Object* cast, RichString* out) { - const Meter* this = (const Meter*)cast; - - if (this->values[0] > 0) { - char buffer[50]; - int len; - - Meter_humanUnit(buffer, this->total, sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_VALUE], buffer); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " Uncompressed, "); - Meter_humanUnit(buffer, this->values[0], sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_VALUE], buffer); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " Compressed, "); - len = ZfsCompressedArcMeter_printRatioString(this, buffer, sizeof(buffer)); - RichString_appendnAscii(out, CRT_colors[ZFS_RATIO], buffer, len); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " Ratio"); - } else { - RichString_writeAscii(out, CRT_colors[METER_TEXT], " "); - RichString_appendAscii(out, CRT_colors[FAILED_READ], "Compression Unavailable"); - } -} - -const MeterClass ZfsCompressedArcMeter_class = { - .super = { - .extends = Class(Meter), - .delete = Meter_delete, - .display = ZfsCompressedArcMeter_display, - }, - .updateValues = ZfsCompressedArcMeter_updateValues, - .defaultMode = TEXT_METERMODE, - .maxItems = 1, - .total = 100.0, - .attributes = ZfsCompressedArcMeter_attributes, - .name = "ZFSCARC", - .uiName = "ZFS CARC", - .description = "ZFS CARC: Compressed ARC statistics", - .caption = "ARC: " -}; diff --git a/fedora/.local/bin/htop-vim/zfs/ZfsCompressedArcMeter.h b/fedora/.local/bin/htop-vim/zfs/ZfsCompressedArcMeter.h deleted file mode 100644 index 6e2f45f..0000000 --- a/fedora/.local/bin/htop-vim/zfs/ZfsCompressedArcMeter.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef HEADER_ZfsCompressedArcMeter -#define HEADER_ZfsCompressedArcMeter -/* -htop - ZfsCompressedArcMeter.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "zfs/ZfsArcStats.h" - -#include "Meter.h" - - -void ZfsCompressedArcMeter_readStats(Meter* this, const ZfsArcStats* stats); - -extern const MeterClass ZfsCompressedArcMeter_class; - -#endif diff --git a/fedora/.local/bin/imgcat b/fedora/.local/bin/imgcat deleted file mode 100755 index af50702..0000000 --- a/fedora/.local/bin/imgcat +++ /dev/null @@ -1,274 +0,0 @@ -#!/usr/bin/env bash - -set -o pipefail - -# tmux requires unrecognized OSC sequences to be wrapped with DCS tmux; -# ST, and for all ESCs in to be replaced with ESC ESC. It -# only accepts ESC backslash for ST. We use TERM instead of TMUX because TERM -# gets passed through ssh. -function print_osc() { - if [[ $TERM == screen* || $TERM == tmux* ]]; then - printf "\033Ptmux;\033\033]" - else - printf "\033]" - fi -} - -# More of the tmux workaround described above. -function print_st() { - if [[ $TERM == screen* || $TERM == tmux* ]]; then - printf "\a\033\\" - else - printf "\a" - fi -} - -function load_version() { - if [ -z ${IMGCAT_BASE64_VERSION+x} ]; then - IMGCAT_BASE64_VERSION=$(base64 --version 2>&1) - export IMGCAT_BASE64_VERSION - fi -} - -function b64_encode() { - load_version - if [[ $IMGCAT_BASE64_VERSION =~ GNU ]]; then - # Disable line wrap - base64 -w0 - else - base64 - fi -} - -function b64_decode() { - load_version - if [[ $IMGCAT_BASE64_VERSION =~ fourmilab ]]; then - BASE64ARG=-d - elif [[ $IMGCAT_BASE64_VERSION =~ GNU ]]; then - BASE64ARG=-di - else - BASE64ARG=-D - fi - base64 $BASE64ARG -} - -# print_image filename inline base64contents print_filename width height preserve_aspect_ratio -# filename: Filename to convey to client -# inline: 0 or 1, if set to 1, the file will be displayed inline, otherwise, it will be downloaded -# base64contents: Base64-encoded contents -# print_filename: 0 or 1, if set to 1, print the filename after outputting the image -# width: set output width of the image in character cells, pixels or percent -# height: set output height of the image in character cells, pixels or percent -# preserve_aspect_ratio: 0 or 1, if set to 1, fill the specified width and height as much as possible without stretching the image -# file: Empty string or file type like "application/json" or ".js". -# legacy: 1 to send one giant control sequence, 0 to send many small control sequences. -function print_image() { - # Send metadata to begin transfer. - print_osc - printf "1337;" - if [[ "$9" -eq 1 ]]; then - printf "File" - else - printf "MultipartFile" - fi - printf "=inline=%s" "$2" - printf ";size=%d" $(printf "%s" "$3" | b64_decode | wc -c) - [ -n "$1" ] && printf ";name=%s" "$(printf "%s" "$1" | b64_encode)" - [ -n "$5" ] && printf ";width=%s" "$5" - [ -n "$6" ] && printf ";height=%s" "$6" - [ -n "$7" ] && printf ";preserveAspectRatio=%s" "$7" - [ -n "$8" ] && printf ";type=%s" "$8" - if [[ "$9" -eq 1 ]]; then - printf ":%s" "$3" - print_st - else - print_st - - # Split into 200-byte chunks. This helps it get through tmux. - parts=$(printf "%s" "$3" | fold -w 200) - - # Send each part. - for part in $parts; do - print_osc - printf '1337;FilePart=%s' "$part" - print_st - done - - # Indicate completion - print_osc - printf '1337;FileEnd' - print_st - fi - - printf '\n' - [ "$4" == "1" ] && echo "$1" - has_image_displayed=t -} - -function error() { - errcho "ERROR: $*" -} - -function errcho() { - echo "$@" >&2 -} - -function show_help() { - errcho - errcho "Usage: imgcat [-p] [-n] [-W width] [-H height] [-r] [-s] [-u] [-t file-type] [-f] filename ..." - errcho " cat filename | imgcat [-W width] [-H height] [-r] [-s]" - errcho - errcho "Display images inline in the iTerm2 using Inline Images Protocol" - errcho - errcho "Options:" - errcho - errcho " -h, --help Display help message" - errcho " -p, --print Enable printing of filename or URL after each image" - errcho " -n, --no-print Disable printing of filename or URL after each image" - errcho " -u, --url Interpret following filename arguments as remote URLs" - errcho " -f, --file Interpret following filename arguments as regular Files" - errcho " -t, --type file-type Provides a type hint" - errcho " -r, --preserve-aspect-ratio When scaling image preserve its original aspect ratio" - errcho " -s, --stretch Stretch image to specified width and height (this option is opposite to -r)" - errcho " -W, --width N Set image width to N character cells, pixels or percent (see below)" - errcho " -H, --height N Set image height to N character cells, pixels or percent (see below)" - errcho " -l, --legacy Use legacy protocol that sends the whole image in a single control sequence" - errcho - errcho " If you don't specify width or height an appropriate value will be chosen automatically." - errcho " The width and height are given as word 'auto' or number N followed by a unit:" - errcho " N character cells" - errcho " Npx pixels" - errcho " N% percent of the session's width or height" - errcho " auto the image's inherent size will be used to determine an appropriate dimension" - errcho - errcho " If a type is provided, it is used as a hint to disambiguate." - errcho " The file type can be a mime type like text/markdown, a language name like Java, or a file extension like .c" - errcho " The file type can usually be inferred from the extension or its contents. -t is most useful when" - errcho " a filename is not available, such as whe input comes from a pipe." - errcho - errcho "Examples:" - errcho - errcho " $ imgcat -W 250px -H 250px -s avatar.png" - errcho " $ cat graph.png | imgcat -W 100%" - errcho " $ imgcat -p -W 500px -u http://host.tld/path/to/image.jpg -W 80 -f image.png" - errcho " $ cat url_list.txt | xargs imgcat -p -W 40 -u" - errcho " $ imgcat -t application/json config.json" - errcho -} - -function check_dependency() { - if ! (builtin command -V "$1" >/dev/null 2>&1); then - error "missing dependency: can't find $1" - exit 1 - fi -} - -# verify that value is in the image sizing unit format: N / Npx / N% / auto -function validate_size_unit() { - if [[ ! "$1" =~ ^(:?[0-9]+(:?px|%)?|auto)$ ]]; then - error "Invalid image sizing unit - '$1'" - show_help - exit 1 - fi -} - -## Main - -if [ -t 0 ]; then - has_stdin=f -else - has_stdin=t -fi - -# Show help if no arguments and no stdin. -if [ $has_stdin = f ] && [ $# -eq 0 ]; then - show_help - exit -fi - -check_dependency base64 -check_dependency wc -file_type="" -legacy=0 - -# Look for command line flags. -while [ $# -gt 0 ]; do - case "$1" in - -h | --h | --help) - show_help - exit - ;; - -p | --p | --print) - print_filename=1 - ;; - -n | --n | --no-print) - print_filename=0 - ;; - -W | --W | --width) - validate_size_unit "$2" - width="$2" - shift - ;; - -H | --H | --height) - validate_size_unit "$2" - height="$2" - shift - ;; - -r | --r | --preserve-aspect-ratio) - preserve_aspect_ratio=1 - ;; - -s | --s | --stretch) - preserve_aspect_ratio=0 - ;; - -l | --l | --legacy) - legacy=1 - ;; - -f | --f | --file) - has_stdin=f - is_url=f - ;; - -u | --u | --url) - check_dependency curl - has_stdin=f - is_url=t - ;; - -t | --t | --type) - file_type="$2" - shift - ;; - -*) - error "Unknown option flag: $1" - show_help - exit 1 - ;; - *) - if [ "$is_url" == "t" ]; then - encoded_image=$(curl -fs "$1" | b64_encode) || { - error "Could not retrieve image from URL $1, error_code: $?" - exit 2 - } - elif [ -r "$1" ]; then - encoded_image=$(cat "$1" | b64_encode) - else - error "imgcat: $1: No such file or directory" - exit 2 - fi - has_stdin=f - print_image "$1" 1 "$encoded_image" "$print_filename" "$width" "$height" "$preserve_aspect_ratio" "$file_type" "$legacy" - ;; - esac - shift -done - -# Read and print stdin -if [ $has_stdin = t ]; then - print_image "" 1 "$(cat | b64_encode)" 0 "$width" "$height" "$preserve_aspect_ratio" "$file_type" "$legacy" -fi - -if [ "$has_image_displayed" != "t" ]; then - error "No image provided. Check command line options." - show_help - exit 1 -fi - -exit 0 diff --git a/fedora/.local/bin/lastfiles b/fedora/.local/bin/lastfiles index 082b004..ba8c11a 100755 --- a/fedora/.local/bin/lastfiles +++ b/fedora/.local/bin/lastfiles @@ -2,7 +2,7 @@ # Display help message usage() { - echo "Open the most recent file or the list of old files in fzf edited by Vim." + echo "Open the most recent file or the list of old files in fzf edited by vim." echo "" echo "Usage: ${0##*/} [OPTION]" echo "" @@ -17,16 +17,16 @@ usage() { exit 0 } -# Fetch oldfiles from Vim -get_oldfiles() { - vim -u NONE -es +'silent oldfiles' +qa 2>/dev/null | - sed 's/^[0-9]\+\s\+//' | - grep -v "^$" -} - # List and handle oldfiles list_oldfiles() { - oldfiles=$(get_oldfiles) + # Fetch the oldfiles list from Vim's viminfo (file-mark entries start with '> ') + viminfo="${VIMINFO:-${HOME}/.viminfo}" + if [ ! -f "$viminfo" ]; then + echo "No viminfo found at $viminfo" >&2 + exit 1 + fi + + oldfiles=$(awk '/^> / {sub(/^> /,""); print}' "$viminfo" | sed "s|^~|$HOME|") # Exit if no oldfiles are found [ -z "$oldfiles" ] && { @@ -39,28 +39,33 @@ list_oldfiles() { usage ;; -l | --list) + # Filter valid files valid_files=$(echo "$oldfiles" | while IFS= read -r file; do [ -f "$file" ] && printf "%s\n" "$file" done) + # Exit if no valid files exist [ -z "$valid_files" ] && { echo "No valid files found." >&2 exit 1 } + # Use fzf to select files selected_files=$(echo "$valid_files" | - fzf-tmux \ + fzf \ --multi \ --preview 'bat -n --color=always --line-range=:500 {} 2>/dev/null || echo "Error previewing file"' \ --height=70% \ --reverse) + # Exit if no files were selected [ -z "$selected_files" ] && exit 1 - openfiles $selected_files + # Open selected files in Vim + openfiles "$selected_files" ;; *) - # Open the most recent valid file + # Open the most recent file for file in $oldfiles; do if [ -f "$file" ]; then openfiles "$file" diff --git a/fedora/.local/bin/opensessions b/fedora/.local/bin/opensessions deleted file mode 100755 index 6f9f236..0000000 --- a/fedora/.local/bin/opensessions +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -# split the selected directories into an array -dirs="$*" - -# filter out any empty selections -dirs=$(echo "$dirs" | tr -s ' ' '\n' | sed '/^$/d') -[ -z "$dirs" ] && exit 0 - -# function to clean and create a valid session name -get_session_name() { - basename "$1" | sed 's/[^a-zA-Z0-9]/_/g' -} - -set -- $dirs - -# handle session creation for multiple selected directories -for dir in $dirs; do - if [ -d "$dir" ]; then - session_name=$(get_session_name "$dir") - if ! tmux has-session -t "$session_name" 2>/dev/null; then - tmux new-session -d -s "$session_name" -c "$dir" - if git -C "$dir" rev-parse --is-inside-work-tree >/dev/null 2>&1 && [ -n "$(git -C "$dir" status --porcelain)" ]; then - tmux send-keys -t "$session_name" "git status --porcelain" C-m - fi - fi - fi -done - -if [ "$#" -gt 0 ]; then - first_session=$(get_session_name "$1") - if [ -n "$TMUX" ]; then - tmux switch-client -t "$first_session" - else - tmux attach-session -t "$first_session" - fi -fi diff --git a/fedora/.local/bin/remaps b/fedora/.local/bin/remaps deleted file mode 100755 index 93832ea..0000000 --- a/fedora/.local/bin/remaps +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -# This script is called on startup to remap keys. -xset s off -dpms -# Decrease key repeat delay to 200ms and increase key repeat rate to 50 per second. -xset r rate 200 50 -# Map the caps lock key to control, and map the menu key to right super. -xinput list | grep 'id=' | while read -r line; do - keyboard=$(echo "$line" | grep -i 'keyboard.*id.*keyboard' | sed 's/.*id=\([0-9]\+\).*/\1/') - mouse=$(echo "$line" | grep -i '.*id.*pointer' | sed 's/.*id=\([0-9]\+\).*/\1/') - [ -z "$keyboard" ] || { - case "$(echo "$line" | grep -oE '.*id=' | sed 's/ id=.*//')" in - *"Lite-On Tech Lenovo USB Travel Keyboard with Ultra Nav"*) - setxkbmap -device "$keyboard" -option - setxkbmap -device "$keyboard" -option caps:ctrl_modifier,ctrl:swap_lwin_lctl - ;; - *"Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint"* | *"AT Translated Set 2 keyboard"*) - setxkbmap -device "$keyboard" -option - setxkbmap -device "$keyboard" -option caps:ctrl_modifier,altwin:menu_win,altwin:swap_lalt_lwin - ;; - *"Magic keyboard"*) - setxkbmap -device "$keyboard" -option - setxkbmap -device "$keyboard" -option caps:ctrl_modifier - ;; - *"HHKB"*) - setxkbmap -device "$keyboard" -option - setxkbmap -device "$keyboard" -option altwin:menu_win - ;; - *"Glove80"*) - setxkbmap -device "$keyboard" -option - ;; - *) - setxkbmap -device "$keyboard" -option - setxkbmap -device "$keyboard" -option caps:ctrl_modifier,altwin:menu_win - ;; - esac - } - [ -z "$mouse" ] || { - case "$(echo "$line" | grep -oE '.*id=' | sed 's/ id=.*//')" in - *"Apple Inc. Magic Trackpad"*) - xinput set-prop "$mouse" "libinput Tapping Enabled" 0 - ;; - *"SynPS/2 Synaptics TouchPad"*) - xinput set-prop "$mouse" "libinput Tapping Enabled" 0 - ;; - *"Lite-On Tech Lenovo USB Travel Keyboard with Ultra Nav Mouse"*) - [ -z "$1" ] && xinput set-prop "$mouse" "Coordinate Transformation Matrix" 5, 0, 0, 0, 5, 0, 0, 0, 1 || xinput set-prop "$mouse" "Coordinate Transformation Matrix" $1, 0, 0, 0, $1, 0, 0, 0, 1 - xinput set-prop "$mouse" "libinput Scroll Method Enabled" 0, 0, 1 - ;; - *"Logitech USB Receiver"*) - [ -z "$1" ] && xinput set-prop "$mouse" "Coordinate Transformation Matrix" 3, 0, 0, 0, 3, 0, 0, 0, 1 || xinput set-prop "$mouse" "Coordinate Transformation Matrix" $1, 0, 0, 0, $1, 0, 0, 0, 1 - ;; - *"TPPS/2 IBM TrackPoint"*) - [ -z "$1" ] && xinput set-prop "$mouse" "Coordinate Transformation Matrix" 1, 0, 0, 0, 1, 0, 0, 0, 1 || xinput set-prop "$mouse" "Coordinate Transformation Matrix" $1, 0, 0, 0, $1, 0, 0, 0, 1 - ;; - *"Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint"*) - [ -z "$1" ] && xinput set-prop "$mouse" "Coordinate Transformation Matrix" 3, 0, 0, 0, 3, 0, 0, 0, 1 || xinput set-prop "$mouse" "Coordinate Transformation Matrix" $1, 0, 0, 0, $1, 0, 0, 0, 1 - ;; - *"Glove80 Mouse"*) - [ -z "$1" ] && xinput set-prop "$mouse" "Coordinate Transformation Matrix" 2, 0, 0, 0, 2, 0, 0, 0, 1 || xinput set-prop "$mouse" "Coordinate Transformation Matrix" $1, 0, 0, 0, $1, 0, 0, 0, 1 - ;; - esac - } -done -# When left control, caps lock, or Super_L is pressed only once, treat it as escape. -killall xcape 2>/dev/null -xcape -e 'Caps_Lock=Escape;Control_L=Escape' #;Super_L=Escape' -# Turn off caps lock if on since there is no longer a key for it. -xset -q | grep -q "Caps Lock:\s*on" && xdotool key Caps_Lock diff --git a/fedora/.local/bin/restartvim b/fedora/.local/bin/restartvim deleted file mode 100755 index 3c63f8b..0000000 --- a/fedora/.local/bin/restartvim +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -set -e - -# Set new line and tab for word splitting -IFS=" - " - -# Check if the script is running inside a tmux session -if [ -z "$TMUX" ]; then - echo "This script must be run from inside a tmux session." - exit 1 -fi - -# Get the current tmux pane ID -tmux_pane=$(tmux display-message -p '#D') - -# Send Escape, :wq, and Enter to Vim in the tmux pane -tmux send-keys -t "$tmux_pane" Escape C-m ':wq' C-m - -# Wait to ensure Vim exits -sleep 0.5 - -# Detach the script from Vim and wait a bit to ensure Vim exits -(nohup sh -c "sleep 0.5; tmux send-keys -t \"$tmux_pane\" 'vim -c \"execute \\\"edit \\\" . v:oldfiles[0] | normal '\''0\"' C-m" >/dev/null 2>&1 &) diff --git a/fedora/.local/bin/rg b/fedora/.local/bin/rg deleted file mode 100755 index 477c475..0000000 Binary files a/fedora/.local/bin/rg and /dev/null differ diff --git a/fedora/.local/bin/rga b/fedora/.local/bin/rga deleted file mode 100755 index 545efba..0000000 Binary files a/fedora/.local/bin/rga and /dev/null differ diff --git a/fedora/.local/bin/rga-fzf b/fedora/.local/bin/rga-fzf deleted file mode 100755 index 7b86d75..0000000 Binary files a/fedora/.local/bin/rga-fzf and /dev/null differ diff --git a/fedora/.local/bin/rga-fzf-open b/fedora/.local/bin/rga-fzf-open deleted file mode 100755 index 71257cd..0000000 Binary files a/fedora/.local/bin/rga-fzf-open and /dev/null differ diff --git a/fedora/.local/bin/rga-preproc b/fedora/.local/bin/rga-preproc deleted file mode 100755 index c1ce02f..0000000 Binary files a/fedora/.local/bin/rga-preproc and /dev/null differ diff --git a/fedora/.local/bin/rgafiles b/fedora/.local/bin/rgafiles index e8b5e72..2fc8488 100755 --- a/fedora/.local/bin/rgafiles +++ b/fedora/.local/bin/rgafiles @@ -2,7 +2,7 @@ # Usage function to display script options usage() { - echo "Find files using ripgrep and open them in Neovim." + echo "Find files using ripgrep and open them in Vim." echo "" echo "Usage: ${0##*/} [-s] [-i] [-l] [-p] [] " echo "" @@ -17,7 +17,7 @@ usage() { echo "Examples:" echo " ${0##*/} -p TODO 'KEYWORD' # Search for 'KEYWORD' in files tagged with 'TODO' in the project directories" echo " ${0##*/} -l -p 'KEYWORD' # List files associated with the default 'PROJECT' tag and 'KEYWORD'" - echo " ${0##*/} 'KEYWORD' # Open files containing 'KEYWORD' in nvim" + echo " ${0##*/} 'KEYWORD' # Open files containing 'KEYWORD' in vim" exit 0 } @@ -36,10 +36,24 @@ search_term() { # Construct the preview command preview_cmd=$(printf "rga %s --pretty --context 10 '%s' {}" "$case_flag" "$*") - rga_output=$(rga --follow --no-ignore --hidden --text --max-count=1 ${case_flag:+$case_flag} --files-with-matches --no-messages --glob '!**/.git/*' "$*") + query="$*" + rga_output=$(rga --follow --no-ignore --hidden --text --max-count=1 ${case_flag:+$case_flag} --files-with-matches --no-messages \ + --glob '!**/.cache/*' \ + --glob '!**/.git/*' \ + --glob '!**/.github/*' \ + --glob '!**/.next/*' \ + --glob '!**/.venv/*' \ + --glob '!**/build/*' \ + --glob '!**/coverage/*' \ + --glob '!**/dist/*' \ + --glob '!**/node_modules/*' \ + --glob '!**/target/*' \ + --glob '!**/vendor/*' \ + --glob '!**/venv/*' \ + "$query") # Use fzf to select files - files=$(echo "$rga_output" | fzf-tmux +m --preview="$preview_cmd" --reverse --multi --select-1 --exit-0) || return 1 + files=$(echo "$rga_output" | fzf +m --preview="$preview_cmd" --reverse --multi --select-1 --exit-0) || return 1 # Check if files are selected if [ -z "$files" ]; then @@ -48,9 +62,42 @@ search_term() { fi # copy target to the clipboard - echo "$@" | xclip -selection clipboard 2>/dev/null - - openfiles "$files" + echo "$query" | xclip -selection clipboard 2>/dev/null + + # Open files at matching lines + count=$(echo "$files" | wc -l) + if [ "$count" -eq 1 ]; then + # Find the first matching line number in the selected file + line=$(rga --max-count=1 --line-number --no-filename ${case_flag:+$case_flag} --no-messages "$query" "$files" 2>/dev/null | head -1 | cut -d: -f1) + if [ -n "$line" ]; then + ${EDITOR:-vim} "+${line}" "$(realpath "$files")" + else + openfiles "$files" + fi + else + # Multiple files: open at matching lines via quickfix + tmpfile=$(mktemp) + echo "$files" | while IFS= read -r file; do + match=$(rga --max-count=1 --line-number --no-filename ${case_flag:+$case_flag} --no-messages "$query" "$file" 2>/dev/null | head -1) + if [ -n "$match" ]; then + printf '%s:%s\n' "$(realpath "$file")" "$match" >> "$tmpfile" + else + printf '%s:1:\n' "$(realpath "$file")" >> "$tmpfile" + fi + done + if [ "$count" -lt 5 ]; then + ${EDITOR:-vim} -q "$tmpfile" \ + -c 'for i in range(2,len(getqflist())) | vsplit | execute "cc ".i | endfor | wincmd t' + else + first_line=$(head -1 "$tmpfile" | cut -d: -f2) + file_args="" + while IFS=: read -r fpath _; do + file_args="$file_args \"$fpath\"" + done < "$tmpfile" + eval "${EDITOR:-vim}" "+${first_line}" "$file_args" + fi + rm -f "$tmpfile" + fi # print the file names echo "$rga_output" @@ -68,7 +115,20 @@ list_or_open_project_files() { rga_output="" for path in $project_paths; do if [ -d "$path" ]; then - rga_result=$(rga --follow --no-ignore --hidden --text --max-count=1 --files-with-matches --no-messages --glob '!**/.git/*' "$project_tag" "$path") + rga_result=$(rga --follow --no-ignore --hidden --text --max-count=1 --files-with-matches --no-messages \ + --glob '!**/.cache/*' \ + --glob '!**/.git/*' \ + --glob '!**/.github/*' \ + --glob '!**/.next/*' \ + --glob '!**/.venv/*' \ + --glob '!**/build/*' \ + --glob '!**/coverage/*' \ + --glob '!**/dist/*' \ + --glob '!**/node_modules/*' \ + --glob '!**/target/*' \ + --glob '!**/vendor/*' \ + --glob '!**/venv/*' \ + "$project_tag" "$path") rga_output="$rga_output $rga_result" fi done @@ -86,9 +146,35 @@ list_or_open_project_files() { if [ "$list_mode" -eq 1 ]; then echo "$rga_output" else - # Otherwise, open the files with nvim - set -- "$(printf "%s\n" "$rga_output")" - openfiles "$@" + # Open files at matching lines + file_count=$(echo "$rga_output" | wc -w) + if [ "$file_count" -eq 1 ]; then + line=$(rga --max-count=1 --line-number --no-filename --no-messages "$project_tag" "$rga_output" 2>/dev/null | head -1 | cut -d: -f1) + if [ -n "$line" ]; then + ${EDITOR:-vim} "+${line}" "$(realpath "$rga_output")" + else + openfiles "$rga_output" + fi + else + # Multiple files: open at matching lines via quickfix + tmpfile=$(mktemp) + for file in $rga_output; do + match=$(rga --max-count=1 --line-number --no-filename --no-messages "$project_tag" "$file" 2>/dev/null | head -1) + if [ -n "$match" ]; then + printf '%s:%s\n' "$(realpath "$file")" "$match" >> "$tmpfile" + else + printf '%s:1:\n' "$(realpath "$file")" >> "$tmpfile" + fi + done + if [ "$file_count" -lt 5 ]; then + ${EDITOR:-vim} -q "$tmpfile" \ + -c 'for i in range(2,len(getqflist())) | vsplit | execute "cc ".i | endfor | wincmd t' + else + ${EDITOR:-vim} -q "$tmpfile" \ + -c 'silent! for i in range(2,len(getqflist())+1) | execute "silent! cc ".i | endfor | silent! cfirst' + fi + rm -f "$tmpfile" + fi fi } diff --git a/fedora/.local/bin/sesh b/fedora/.local/bin/sesh deleted file mode 100755 index 0355f00..0000000 Binary files a/fedora/.local/bin/sesh and /dev/null differ diff --git a/fedora/.local/bin/sessionizer b/fedora/.local/bin/sessionizer deleted file mode 100755 index 93f32b1..0000000 --- a/fedora/.local/bin/sessionizer +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -sessionizer() { - path="$( - sesh list -d --icons | fzf-tmux \ - -p 80%,70% --no-sort --cycle --ignore-case --ansi --border=sharp --multi --reverse \ - --border-label "โ•ข TheSiahxyz โ•Ÿ" \ - --header "^a all ^e sesh ^f zoxide ^g git ^t tmux ^u staged files ^x tmux kill M-cr open in editor ^/ help" \ - --prompt "๐Ÿ’ก " \ - --bind "ctrl-a:change-prompt(๐Ÿ’ก )+reload(sesh list -d -H --icons)" \ - --bind "ctrl-e:change-prompt(๐Ÿ“‘ )+reload(sesh list -d -c -H --icons)" \ - --bind "ctrl-f:change-prompt(๐Ÿ”Ž )+reload(sesh list -d -z -H --icons)" \ - --bind "ctrl-g:change-prompt(๏‚› )+reload(fd -H -d 1 -d -t d -E .Trash -E .git -E .cache . $HOME/Private/repos $HOME/Public/repos | sed 's|$HOME|~|g')" \ - --bind "ctrl-t:change-prompt(๐ŸชŸ )+reload(sesh list -d -t --icons)" \ - --bind "ctrl-v:execute($EDITOR ${0})+abort" \ - --bind 'ctrl-x:execute(tmux kill-session -t "$(echo {} | cut -d" " -f2-)")+reload(sesh list -d --icons)' \ - --bind "alt-enter:execute($EDITOR {})+abort" \ - --bind 'ctrl-/:change-prompt(โ“ )+reload(echo "^a all -^e sesh config -^f zoxide -^g git -^t tmux -^x tmux kill -M-cr open in editor -^/ help")' \ - --preview-window 'right:45%' \ - --preview 'sesh preview {}' - )" 2>/dev/null - - case "$path" in - ^*) sessionizer ;; - *) sesh connect "$path" >/dev/null 2>&1 && exit ;; - esac -} - -sessionizer diff --git a/fedora/.local/bin/tmuxcreate b/fedora/.local/bin/tmuxcreate deleted file mode 100755 index 5fb5ef3..0000000 --- a/fedora/.local/bin/tmuxcreate +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -create_new_session() { - session_name=$1 - session_path=${2:-"$PWD"} # Default to current directory if no path is provided - [ -z "$session_name" ] && { printf "New session name: " && read -r session_name; } - if tmux has-session -t "$session_name" 2>/dev/null; then - tmux switch-client -t "$session_name" - else - if [ -n "$TMUX" ]; then - tmux new-session -d -s "$session_name" -c "$session_path" - tmux switch-client -t "$session_name" - else - tmux new -s "$session_name" -c "$session_path" - fi - fi -} - -if [ $# -gt 0 ]; then - if [ -d "$1" ]; then - create_new_session "$(basename "$1")" "$1" - else - create_new_session "$1" - fi -else - # Capture the output of tmux ls - sessions=$(tmux ls 2>/dev/null) - if [ -z "$sessions" ]; then - create_new_session - else - session=$( ( - echo "$sessions" - echo "[new session]" - ) | fzf-tmux --reverse | cut -d: -f1) - [ -z "$session" ] && exit - if [ "$session" = "[new session]" ]; then - create_new_session - else - tmux attach -t "$session" - fi - fi -fi diff --git a/fedora/.local/bin/tmuxcycleborder b/fedora/.local/bin/tmuxcycleborder deleted file mode 100755 index ad2a430..0000000 --- a/fedora/.local/bin/tmuxcycleborder +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -case "$(tmux show-option -gqv pane-border-status)" in -"off") tmux set-option -g pane-border-status top ;; -"top") tmux set-option -g pane-border-status bottom ;; -"bottom") tmux set-option -g pane-border-status off ;; -esac diff --git a/fedora/.local/bin/tmuxopen b/fedora/.local/bin/tmuxopen deleted file mode 100755 index 87e4f36..0000000 --- a/fedora/.local/bin/tmuxopen +++ /dev/null @@ -1,208 +0,0 @@ -#!/bin/sh - -wrapper() { - usage() { - echo "Search for files and open them in Neovim within tmux panes." - echo "" - echo "Usage: tmuxopen [OPTIONS]" - echo "" - echo "Options:" - echo " -h, --help : Show this help message" - echo "" - echo "Controls:" - echo " Tab Select files" - echo " Ctrl+f Search filenames" - echo " Ctrl+g Search file contents" - echo " Ctrl+d Search directories" - echo "" - echo "Environment Variables:" - echo " VIM_SEARCH_REGISTRY Set to the search query, allowing Neovim to highlight matches" - echo "" - echo "Example:" - echo " tmuxopen # Run the normal search and open" - } - - get_fzf_output() { - # Create temporary files to store search state - tmp_files="/tmp/search-files-$$" - tmp_content_query="/tmp/search-content-query-$$" - - # Cleanup on exit - trap "rm -f $tmp_files $tmp_content_query" EXIT - - rg_fixed_bind="ctrl-g:transform-query( - echo {q} > $tmp_content_query; - echo {q} - )+reload( - rm -f $tmp_files; - rg --line-number --follow --fixed-strings --hidden --no-heading --color=always --smart-case --glob '!**/.git/**' --glob '!node_modules/**' {q} 2>/dev/null || true - )" - file_bind="ctrl-f:transform-query( - current_query={q}; - if [ ! -s $tmp_content_query ]; then - echo \$current_query > $tmp_content_query; - fi; - rg --hidden --follow --files-with-matches --no-messages --glob '!**/.git/**' --glob '!node_modules/**' -- \$current_query > $tmp_files; - )+reload( - if [ -s $tmp_files ]; then - if [ -n {q} ]; then - grep -i -- {q} $tmp_files || true; - else - cat $tmp_files; - fi | while IFS= read -r file; do - if [ -f \"\$file\" ]; then - echo \"\$file:1\"; - fi; - done; - else - echo 'No matching files found'; - fi - )" - if command -v fd >/dev/null 2>&1; then - dir_bind="ctrl-d:change-prompt(๐Ÿ“ )+reload(fd --follow --type d --hidden --absolute-path --color never --exclude .git --exclude node_modules --search-path \"\$PWD\")" - else - dir_bind="ctrl-d:change-prompt(๐Ÿ“ )+reload(find \"\$PWD\" -L -type d -name node_modules -prune -o -name .git -prune -o -type d -print)" - fi - - rg --line-number --follow --no-heading --color=always --smart-case --glob '!**/.git/**' --glob '!LICENSE' '' 2>/dev/null | - fzf-tmux \ - --ansi --multi --delimiter : \ - --reverse \ - --print-query \ - --preview 'bat --style=numbers --color=always --highlight-line {2} {1} 2>/dev/null || bat --color=always {} 2>/dev/null || ls -la {} 2>/dev/null || echo "Preview is not available."' \ - --preview-window 'right,55%,border-bottom,+{2}+3/3,~3' \ - --bind "$file_bind" \ - --bind "$rg_fixed_bind" \ - --bind "$dir_bind" \ - --bind 'ctrl-c:abort' \ - --header "^f filenames | ^g contents | ^d directories" \ - --prompt "๐Ÿ”Ž " - } - - set_vim_search_variable() { - raw_output="$1" - tmp_content_query="/tmp/search-content-query-$$" - if [ -f "$tmp_content_query" ]; then - saved_query=$(cat "$tmp_content_query" 2>/dev/null) - if [ -n "$saved_query" ]; then - export VIM_SEARCH_REGISTRY="$saved_query" - return - fi - fi - query=$(echo "$raw_output" | head -n1) - export VIM_SEARCH_REGISTRY="$query" - } - - open_files_in_vim() { - pane="$1" - shift - file_indices="$*" - vim_cmd="vim" - for index in $file_indices; do - file=$(echo "$files" | awk -v idx="$index" '{print $idx}') - line=$(echo "$lines" | awk -v idx="$index" '{print $idx}') - vim_cmd="$vim_cmd +$line $file" - done - vim_cmd="$vim_cmd -c 'let @/=\"$VIM_SEARCH_REGISTRY\"'" - tmux send-keys -t "$pane" "$vim_cmd" C-m - } - - # Parse command line arguments - while [ "$#" -gt 0 ]; do - case "$1" in - -h | --help) - usage - exit 0 - ;; - *) - echo "Unknown option: $1" >&2 - usage - exit 1 - ;; - esac - done - - raw_output=$(get_fzf_output) - set_vim_search_variable "$raw_output" - - # Split the newline-delimited output into an array, skipping the first line (query) - selections=$(echo "$raw_output" | sed 1d) - - if [ -z "$selections" ]; then - echo "No selections made" - exit 0 - fi - - files="" - lines="" - count=0 - - # Use a here document to avoid subshell issues - while IFS= read -r selection; do - file=$(echo "$selection" | awk -F: '{print $1}') - line=$(echo "$selection" | awk -F: '{print $2}') - if [ -f "$file" ]; then - files="$files $file" - lines="$lines $line" - count=$((count + 1)) - else - echo "File not found: $file" - fi - done </dev/null 2>&1; then - echo "Error: $cmd not found" >&2 - exit 1 - fi -done - -if [ -z "$TMUX" ]; then - echo "Error: Not in a tmux session" >&2 - exit 1 -fi - -wrapper "$@" diff --git a/fedora/.local/bin/tmuxtogglebar b/fedora/.local/bin/tmuxtogglebar deleted file mode 100755 index 2ae045e..0000000 --- a/fedora/.local/bin/tmuxtogglebar +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -case "$(tmux show-option -gqv status)" in -on) tmux set-option -g status off ;; -off) tmux set-option -g status on ;; -esac diff --git a/fedora/.local/bin/tmuxtoggleterm b/fedora/.local/bin/tmuxtoggleterm deleted file mode 100755 index f21f833..0000000 --- a/fedora/.local/bin/tmuxtoggleterm +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -export TMUX_PANE_DIRECTION="bottom" - -if [ "$TMUX_PANE_DIRECTION" = "bottom" ]; then - tmux select-pane -U -elif [ "$TMUX_PANE_DIRECTION" = "right" ]; then - tmux select-pane -L -fi - -tmux resize-pane -Z diff --git a/fedora/.local/bin/ya b/fedora/.local/bin/ya deleted file mode 100755 index 2701e30..0000000 Binary files a/fedora/.local/bin/ya and /dev/null differ diff --git a/fedora/.local/bin/yazi b/fedora/.local/bin/yazi deleted file mode 100755 index 0c01561..0000000 Binary files a/fedora/.local/bin/yazi and /dev/null differ diff --git a/fedora/.local/bin/zoxide b/fedora/.local/bin/zoxide deleted file mode 100755 index e7ba833..0000000 Binary files a/fedora/.local/bin/zoxide and /dev/null differ diff --git a/fedora/.vimrc b/fedora/.vimrc new file mode 100644 index 0000000..1220960 --- /dev/null +++ b/fedora/.vimrc @@ -0,0 +1,102 @@ +" ============================================================ +" Basic vimrc for Fedora +" ============================================================ + +set nocompatible +filetype plugin indent on +syntax on + +" --- Line numbers +set number +set relativenumber + +" --- Encoding +set encoding=utf-8 +set fileencoding=utf-8 +set fileencodings=utf-8,cp949,euc-kr,latin1 + +" --- Indentation +set autoindent +set smartindent +set expandtab +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +set smarttab + +" --- Search +set hlsearch +set incsearch +set ignorecase +set smartcase + +" --- Display +set cursorline +set showmatch +set showcmd +set ruler +set laststatus=2 +set wildmenu +set wildmode=longest:full,full +set scrolloff=5 +set sidescrolloff=8 +set signcolumn=yes +set display=lastline +set lazyredraw +set ttyfast + +" --- Editing +set backspace=indent,eol,start +set hidden +set clipboard=unnamedplus +set mouse=a +set splitright +set splitbelow + +" --- Files / history +set history=1000 +set undolevels=1000 +set undofile +set undodir=~/.vim/undo// +set backupdir=~/.vim/backup// +set directory=~/.vim/swap// +set viminfo='100,<50,s10,h + +" Auto-create undo/backup/swap directories +silent! call mkdir(expand('~/.vim/undo'), 'p') +silent! call mkdir(expand('~/.vim/backup'), 'p') +silent! call mkdir(expand('~/.vim/swap'), 'p') + +" --- Misc +set timeoutlen=500 +set updatetime=300 +set noerrorbells +set novisualbell +set nowrap +set list +set listchars=tab:โ–ธ\ ,trail:ยท,nbsp:โฃ + +" --- Colors +set background=dark +silent! colorscheme desert + +" --- Leader key +let mapleader = " " + +" --- Keymaps +nnoremap w :w +nnoremap q :q +nnoremap h :nohlsearch +nnoremap h +nnoremap j +nnoremap k +nnoremap l + +" --- Restore last cursor position +augroup remember_last_pos + autocmd! + autocmd BufReadPost * + \ if line("'\"") > 0 && line("'\"") <= line("$") | + \ exe "normal! g`\"" | + \ endif +augroup END -- cgit v1.2.3

- hide/show program path. - - , - quit program. - - - do nothing. - - - enter STrace screen. - - , - toggle between Tree and Sorted view, update F5 in FunctionBar, follow process - - - enter User screen. - - , , , , - do nothing. - - , - do nothing. - - , , - enter Setup screen. - - , - do nothing. - - - follow process. - - - do nothing. - - - toggle show/hide userland threads. - - - invert sort order. - - - do nothing. - - - toggle show/hide kernel threads. - - - do nothing. - - - enter Sorted view, update function bar, sort by MEM%. - - , - do nothing. - -