Initial commit (extract fro private repo)
commit
61a0ab4308
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,125 @@
|
|||
#
|
||||
# ~/.bashrc
|
||||
#
|
||||
|
||||
[[ $- != *i* ]] && return
|
||||
|
||||
prompt_git() {
|
||||
local s='';
|
||||
local branchName='';
|
||||
|
||||
# Check if the current directory is in a Git repository.
|
||||
if [ $(git rev-parse --is-inside-work-tree &>/dev/null; echo "${?}") == '0' ]; then
|
||||
|
||||
# check if the current directory is in .git before running git checks
|
||||
if [ "$(git rev-parse --is-inside-git-dir 2> /dev/null)" == 'false' ]; then
|
||||
|
||||
# Ensure the index is up to date.
|
||||
git update-index --really-refresh -q &>/dev/null;
|
||||
|
||||
# Check for uncommitted changes in the index.
|
||||
if ! $(git diff --quiet --ignore-submodules --cached); then
|
||||
s+='+';
|
||||
fi;
|
||||
|
||||
# Check for unstaged changes.
|
||||
if ! $(git diff-files --quiet --ignore-submodules --); then
|
||||
s+='!';
|
||||
fi;
|
||||
|
||||
# Check for untracked files.
|
||||
if [ -n "$(git ls-files --others --exclude-standard)" ]; then
|
||||
s+='?';
|
||||
fi;
|
||||
|
||||
# Check for stashed files.
|
||||
if $(git rev-parse --verify refs/stash &>/dev/null); then
|
||||
s+='$';
|
||||
fi;
|
||||
|
||||
fi;
|
||||
|
||||
# Get the short symbolic ref.
|
||||
# If HEAD isn’t a symbolic ref, get the short SHA for the latest commit
|
||||
# Otherwise, just give up.
|
||||
branchName="$(git symbolic-ref --quiet --short HEAD 2> /dev/null || \
|
||||
git rev-parse --short HEAD 2> /dev/null || \
|
||||
echo '(unknown)')";
|
||||
|
||||
[ -n "${s}" ] && s=" [${s}]";
|
||||
|
||||
echo -e " ${1}${branchName}${2}${s}";
|
||||
else
|
||||
return;
|
||||
fi;
|
||||
}
|
||||
|
||||
hostname_color() {
|
||||
case $(hostname) in
|
||||
blue*)
|
||||
echo "34"
|
||||
;;
|
||||
green*)
|
||||
echo "32"
|
||||
;;
|
||||
pink*)
|
||||
echo "35"
|
||||
;;
|
||||
red*)
|
||||
echo "31"
|
||||
;;
|
||||
*)
|
||||
echo "37"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
status_color() {
|
||||
if [[ ${EUID} == 0 ]] ; then
|
||||
echo "31"
|
||||
else
|
||||
if [[ $(whoami) == "sheychen" ]] ; then
|
||||
if [[ $(sudo -n uptime 2>&1|grep "load"|wc -l) -gt 0 ]] ; then
|
||||
echo "33"
|
||||
else
|
||||
echo "32"
|
||||
fi
|
||||
else
|
||||
echo "35"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
parse_user() {
|
||||
if [[ ${EUID} != 0 ]] ; then
|
||||
if [[ $(whoami) != "sheychen" ]] ; then
|
||||
echo "$(whoami)@"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function spwd {
|
||||
echo $PWD | sed "s:${HOME}:~:" | sed "s:/\(.\)[^/]*:/\1:g" | sed "s:/[^/]*$:/$(basename "$PWD"):"
|
||||
}
|
||||
|
||||
PS1='\[\033[01;$(status_color)m\][\[\033[01;37m\]$(parse_user)\[\033[01;$(hostname_color)m\]\H\[\033[01;37m\] $(spwd)$(prompt_git)\[\033[01;$(status_color)m\]]\[\033[00m\] '
|
||||
|
||||
type shopt &> /dev/null && shopt -s histappend;
|
||||
shopt -s cmdhist
|
||||
shopt -s checkwinsize
|
||||
shopt -s autocd
|
||||
bind Space:magic-space
|
||||
bind '"\eh": "\C-a\eb\ed\C-y\e#man \C-y\C-m\C-p\C-p\C-a\C-d\C-e"'
|
||||
unset HISTFILE
|
||||
|
||||
cl() {
|
||||
local dir="$1"
|
||||
local dir="${dir:=$HOME}"
|
||||
if [[ -d "$dir" ]]; then
|
||||
cd "$dir" >/dev/null; ls
|
||||
else
|
||||
echo "bash: cl: $dir: Directory not found"
|
||||
fi
|
||||
}
|
||||
|
||||
[[ -f ~/.shrc ]] && . ~/.shrc
|
|
@ -0,0 +1,2 @@
|
|||
// Placez vos combinaisons de touches dans ce fichier pour remplacer les valeurs par défaut
|
||||
[]
|
|
@ -0,0 +1,193 @@
|
|||
{
|
||||
"editor.scrollBeyondLastLine": false,
|
||||
"editor.minimap.enabled": true,
|
||||
"editor.formatOnType": true,
|
||||
"editor.formatOnPaste": true,
|
||||
"editor.emptySelectionClipboard": false,
|
||||
"workbench.iconTheme": "vs-nomo-dark",
|
||||
"telemetry.enableTelemetry": false,
|
||||
"telemetry.enableCrashReporter": false,
|
||||
"editor.dragAndDrop": true,
|
||||
"explorer.enableDragAndDrop": true,
|
||||
"window.zoomLevel": 0,
|
||||
"guides.active.color.dark": "rgba(60, 60, 60, 0.75)",
|
||||
"composer.executablePath": "/usr/bin/composer",
|
||||
"editor.wordWrap": "off",
|
||||
"git.autorefresh": false,
|
||||
"git.autofetch": false,
|
||||
"editor.renderIndentGuides": false,
|
||||
"code-runner.runInTerminal": true,
|
||||
"workbench.startupEditor": "newUntitledFile",
|
||||
"python.formatting.provider": "yapf",
|
||||
"explorer.confirmDragAndDrop": false,
|
||||
"workbench.statusBar.visible": true,
|
||||
"code-runner.executorMap": {
|
||||
"javascript": "node",
|
||||
"php": "php",
|
||||
"python": "python",
|
||||
"csharp": "dotnet run",
|
||||
"typescript": "ts-node",
|
||||
},
|
||||
"git.confirmSync": false,
|
||||
"omnisharp.loggingLevel": "warning",
|
||||
"terminal.integrated.cursorStyle": "line",
|
||||
"editor.fontFamily": "'DejaVuSansMono Nerd Font Mono', monospace",
|
||||
"csharp.referencesCodeLens.enabled": false,
|
||||
"editor.renderWhitespace": "all",
|
||||
"todohighlight.include": [
|
||||
"**/*.py",
|
||||
"**/*.cs",
|
||||
"**/*.js",
|
||||
"**/*.jsx",
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
"**/*.html",
|
||||
"**/*.php",
|
||||
"**/*.css",
|
||||
"**/*.scss"
|
||||
],
|
||||
"todohighlight.exclude": [
|
||||
"**/node_modules/**",
|
||||
"**/bower_components/**",
|
||||
"**/dist/**",
|
||||
"**/build/**",
|
||||
"**/.vscode/**",
|
||||
"**/.github/**",
|
||||
"**/_output/**",
|
||||
"**/*.min.*",
|
||||
"**/*.map",
|
||||
"**/.next/**",
|
||||
"**/vendor/**"
|
||||
],
|
||||
"todohighlight.keywords": [
|
||||
{
|
||||
"text": "FIXME:",
|
||||
"color": "white",
|
||||
"backgroundColor": "orangeRed"
|
||||
},
|
||||
{
|
||||
"text": "TODO:",
|
||||
"color": "white",
|
||||
"backgroundColor": "darkorange"
|
||||
},
|
||||
{
|
||||
"text": "MAYBE:",
|
||||
"color": "white",
|
||||
"backgroundColor": "lightgreen"
|
||||
},
|
||||
{
|
||||
"text": "DANGER:",
|
||||
"color": "orangeRed",
|
||||
"backgroundColor": "none"
|
||||
},
|
||||
{
|
||||
"text": "NOTE:",
|
||||
"color": "darkorange",
|
||||
"backgroundColor": "none"
|
||||
},
|
||||
{
|
||||
"text": "REMARK:",
|
||||
"color": "lightgreen",
|
||||
"backgroundColor": "none"
|
||||
},
|
||||
],
|
||||
"todohighlight.toggleURI": true,
|
||||
"fileutils.delete.useTrash": false,
|
||||
"workbench.activityBar.visible": false,
|
||||
"code-runner.enableAppInsights": false,
|
||||
"breadcrumbs.enabled": true,
|
||||
"diffEditor.ignoreTrimWhitespace": true,
|
||||
"editor.renderControlCharacters": false,
|
||||
"spellright.addToSystemDictionary": true,
|
||||
"spellright.configurationScope": "user",
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"vue"
|
||||
],
|
||||
"window.menuBarVisibility": "default",
|
||||
"search.location": "sidebar",
|
||||
"window.titleBarStyle": "native",
|
||||
"liveServer.settings.donotVerifyTags": true,
|
||||
"liveServer.settings.donotShowInfoMsg": true,
|
||||
"editor.suggestSelection": "first",
|
||||
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
|
||||
"python.jediEnabled": false,
|
||||
"workbench.sideBar.location": "left",
|
||||
"activitusbar.views": [
|
||||
{
|
||||
"name": "explorer",
|
||||
"octicon": "file-text"
|
||||
},
|
||||
{
|
||||
"name": "search",
|
||||
"octicon": "search"
|
||||
},
|
||||
{
|
||||
"name": "scm",
|
||||
"octicon": "repo-forked"
|
||||
},
|
||||
{
|
||||
"name": "debug",
|
||||
"octicon": "bug"
|
||||
},
|
||||
{
|
||||
"name": "extensions",
|
||||
"octicon": "package"
|
||||
}
|
||||
],
|
||||
"activitusbar.activeColour": "white",
|
||||
"activitusbar.inactiveColour": "lightgrey",
|
||||
"[vue]": {
|
||||
"editor.tabSize": 2
|
||||
},
|
||||
"cSpell.language": "en,fr",
|
||||
"cSpell.userWords": [
|
||||
"Archlinux",
|
||||
"Catgirl",
|
||||
"Maelys",
|
||||
"Pleroma",
|
||||
"Subpersonalities",
|
||||
"aujourd'hui",
|
||||
"comtodon",
|
||||
"fediverse",
|
||||
"misgendered"
|
||||
],
|
||||
"cSpell.enabledLanguageIds": [
|
||||
"asciidoc",
|
||||
"c",
|
||||
"cpp",
|
||||
"csharp",
|
||||
"css",
|
||||
"git-commit",
|
||||
"go",
|
||||
"handlebars",
|
||||
"html",
|
||||
"jade",
|
||||
"java",
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"json",
|
||||
"jsonc",
|
||||
"latex",
|
||||
"less",
|
||||
"markdown",
|
||||
"php",
|
||||
"plaintext",
|
||||
"pug",
|
||||
"python",
|
||||
"restructuredtext",
|
||||
"rust",
|
||||
"scala",
|
||||
"scss",
|
||||
"text",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"yaml",
|
||||
"yml"
|
||||
],
|
||||
"workbench.enableExperiments": false,
|
||||
"workbench.settings.enableNaturalLanguageSearch": false,
|
||||
"update.mode": "none",
|
||||
"update.showReleaseNotes": false,
|
||||
}
|
|
@ -0,0 +1,286 @@
|
|||
{
|
||||
"for": {
|
||||
"prefix": "for",
|
||||
"body": [
|
||||
"for (${size_t} ${i} = ${1:0}; ${i} < ${2:length}; ${i}++)",
|
||||
"{",
|
||||
" $3",
|
||||
"}"
|
||||
],
|
||||
"description": "Code snippet for 'for' loop"
|
||||
},
|
||||
"forr": {
|
||||
"prefix": "forr",
|
||||
"body": [
|
||||
"for (int ${i} = ${1:length} - 1; ${i} >= ${2:0}; ${i}--)",
|
||||
"{",
|
||||
" $3",
|
||||
"}"
|
||||
],
|
||||
"description": "Code snippet for reverse 'for' loop"
|
||||
},
|
||||
"do": {
|
||||
"prefix": "do",
|
||||
"body": [
|
||||
"do",
|
||||
"{",
|
||||
" $1",
|
||||
"} while($2);"
|
||||
],
|
||||
"description": "Code snippet for do...while loop"
|
||||
},
|
||||
"while": {
|
||||
"prefix": "while",
|
||||
"body": [
|
||||
"while ($1)",
|
||||
"{",
|
||||
" $2",
|
||||
"}"
|
||||
],
|
||||
"description": ""
|
||||
},
|
||||
"foreach": {
|
||||
"prefix": "foreach",
|
||||
"body": [
|
||||
"for(auto ${var} : ${collection_to_loop})",
|
||||
"{",
|
||||
" $1",
|
||||
"}"
|
||||
],
|
||||
"description": "Code snippet for range-based for loop (c++11) statement"
|
||||
},
|
||||
"if": {
|
||||
"prefix": "if",
|
||||
"body": [
|
||||
"if ($1)",
|
||||
"{",
|
||||
" $2",
|
||||
"}"
|
||||
],
|
||||
"description": "Code snippet for if statement"
|
||||
},
|
||||
"else": {
|
||||
"prefix": "else",
|
||||
"body": [
|
||||
"else",
|
||||
"{",
|
||||
" $1",
|
||||
"}"
|
||||
],
|
||||
"description": "Code snippet for else statement"
|
||||
},
|
||||
"else if": {
|
||||
"prefix": "else if",
|
||||
"body": [
|
||||
"else if ($1)",
|
||||
"{",
|
||||
" $2",
|
||||
"}"
|
||||
],
|
||||
"description": "Code snippet for else-if statement"
|
||||
},
|
||||
"enum": {
|
||||
"prefix": "enum",
|
||||
"body": [
|
||||
"enum ${MyEnum}",
|
||||
"{",
|
||||
" $1",
|
||||
"};"
|
||||
],
|
||||
"description": "Code snippet for enum"
|
||||
},
|
||||
"enum class": {
|
||||
"prefix": "enum class",
|
||||
"body": [
|
||||
"enum class ${MyClass} { };"
|
||||
],
|
||||
"description": "Code snippet for enum class (c++11)"
|
||||
},
|
||||
"class": {
|
||||
"prefix": "class",
|
||||
"body": [
|
||||
"class ${MyClass}",
|
||||
"{",
|
||||
"public:",
|
||||
" ${MyClass}();",
|
||||
" ${MyClass}(${MyClass} &&) = default;",
|
||||
" ${MyClass}(const ${MyClass} &) = default;",
|
||||
" ${MyClass} &operator=(${MyClass} &&) = default;",
|
||||
" ${MyClass} &operator=(const ${MyClass} &) = default;",
|
||||
" ~${MyClass}();",
|
||||
"",
|
||||
"private:",
|
||||
" $1",
|
||||
"};",
|
||||
"",
|
||||
"${MyClass}::${MyClass}()",
|
||||
"{",
|
||||
"}",
|
||||
"",
|
||||
"${MyClass}::~${MyClass}()",
|
||||
"{",
|
||||
"}"
|
||||
],
|
||||
"description": "Code snippet for class"
|
||||
},
|
||||
"classi": {
|
||||
"prefix": "classi",
|
||||
"body": [
|
||||
"class ${MyClass}",
|
||||
"{",
|
||||
"public:",
|
||||
" ${MyClass}() = default;",
|
||||
" ${MyClass}(${MyClass} &&) = default;",
|
||||
" ${MyClass}(const ${MyClass} &) = default;",
|
||||
" ${MyClass} &operator=(${MyClass} &&) = default;",
|
||||
" ${MyClass} &operator=(const ${MyClass} &) = default;",
|
||||
" ~${MyClass}() = default;",
|
||||
"",
|
||||
"private:",
|
||||
" $1",
|
||||
"};"
|
||||
],
|
||||
"description": "Code snippet for class with inline constructor/destructor"
|
||||
},
|
||||
"interface": {
|
||||
"prefix": "interface",
|
||||
"body": [
|
||||
"__interface I${Interface}",
|
||||
"{",
|
||||
" $1",
|
||||
"};"
|
||||
],
|
||||
"description": "Code snippet for interface (Visual C++)"
|
||||
},
|
||||
"namespace": {
|
||||
"prefix": "namespace",
|
||||
"body": [
|
||||
"namespace ${MyNamespace}",
|
||||
"{",
|
||||
" $1",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
"#ifdef": {
|
||||
"prefix": "#ifdef",
|
||||
"body": [
|
||||
"#ifdef ${DEBUG}",
|
||||
"$1",
|
||||
"#endif // ${DEBUG}"
|
||||
],
|
||||
"description": "Code snippet for #ifdef"
|
||||
},
|
||||
"#ifndef": {
|
||||
"prefix": "#ifndef",
|
||||
"body": [
|
||||
"#ifndef ${1:1}",
|
||||
"$2",
|
||||
"#endif // !$1"
|
||||
],
|
||||
"description": "Code snippet for #ifndef"
|
||||
},
|
||||
"#if": {
|
||||
"prefix": "#if",
|
||||
"body": [
|
||||
"#ifdef ${1:0}",
|
||||
"$2",
|
||||
"#endif // $1"
|
||||
],
|
||||
"description": "Code snippet for #if"
|
||||
},
|
||||
"struct": {
|
||||
"prefix": "struct",
|
||||
"body": [
|
||||
"struct ${MyStruct}",
|
||||
"{",
|
||||
" $1",
|
||||
"};"
|
||||
],
|
||||
"description": "Code snippet for struct"
|
||||
},
|
||||
"switch": {
|
||||
"prefix": "switch",
|
||||
"body": [
|
||||
"switch (${switch_on})",
|
||||
"{",
|
||||
"default:",
|
||||
" break;$1",
|
||||
"}"
|
||||
],
|
||||
"description": "Code snippet for switch statement"
|
||||
},
|
||||
"try": {
|
||||
"prefix": "try",
|
||||
"body": [
|
||||
"try",
|
||||
"{",
|
||||
" ",
|
||||
"}",
|
||||
"catch (const std::exception&)",
|
||||
"{",
|
||||
" $1",
|
||||
"}"
|
||||
],
|
||||
"description": "Code snippet for try catch"
|
||||
},
|
||||
"union": {
|
||||
"prefix": "union",
|
||||
"body": [
|
||||
"union ${MyUnion}",
|
||||
"{",
|
||||
" $1",
|
||||
"};"
|
||||
],
|
||||
"description": "Code snippet for union"
|
||||
},
|
||||
"cout": {
|
||||
"prefix": "cout",
|
||||
"body": [
|
||||
"std::cout << \"${1:/* message */}\" << std::endl;"
|
||||
],
|
||||
"description": "Code snippet for printing to std::cout, provided the header is set"
|
||||
},
|
||||
"#inc": {
|
||||
"prefix": "#inc",
|
||||
"body": [
|
||||
"#include \"$1\""
|
||||
],
|
||||
"description": "Code snippet for #include \" \""
|
||||
},
|
||||
"#inc<": {
|
||||
"prefix": "#inc<",
|
||||
"body": [
|
||||
"#include <$1>"
|
||||
],
|
||||
"description": "Code snippet for #include \" \""
|
||||
},
|
||||
"#def": {
|
||||
"prefix": "#def",
|
||||
"body": [
|
||||
"#define \"$1\" \"$2\" "
|
||||
],
|
||||
"description": "Code snippet for #define \" \""
|
||||
},
|
||||
"main": {
|
||||
"prefix": "main",
|
||||
"body": [
|
||||
"int main(int argc, const char** argv) {",
|
||||
" return 0;",
|
||||
"}"
|
||||
],
|
||||
"description": "Code snippet for 'for' loop"
|
||||
},
|
||||
"hpp": {
|
||||
"prefix": "hpp",
|
||||
"body": [
|
||||
"#ifndef ${1:${TM_FILENAME/(.*)/${1:/upcase}/}}",
|
||||
"#define $1",
|
||||
"",
|
||||
"$2",
|
||||
"",
|
||||
"#endif",
|
||||
""
|
||||
],
|
||||
"description": "Headr file ifndef"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"Namespace": {
|
||||
"prefix": "namespace",
|
||||
"body": [
|
||||
"namespace ${1:Name} {",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Create namespace"
|
||||
},
|
||||
"Class": {
|
||||
"prefix": "class",
|
||||
"body": [
|
||||
"class ${1:${TM_FILENAME_BASE:Name}} {",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Create class"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,345 @@
|
|||
# Configuration for Alacritty, the GPU enhanced terminal emulator
|
||||
|
||||
|
||||
# Any items in the `env` entry below will be added as
|
||||
# environment variables. Some entries may override variables
|
||||
# set by alacritty it self.
|
||||
env:
|
||||
# TERM env customization.
|
||||
#
|
||||
# If this property is not set, alacritty will set it to xterm-256color.
|
||||
#
|
||||
# Note that some xterm terminfo databases don't declare support for italics.
|
||||
# You can verify this by checking for the presence of `smso` and `sitm` in
|
||||
# `infocmp xterm-256color`.
|
||||
TERM: xterm-256color
|
||||
window:
|
||||
# Window dimensions in character columns and lines
|
||||
# (changes require restart)
|
||||
dimensions:
|
||||
columns: 80
|
||||
lines: 24
|
||||
|
||||
# Adds this many blank pixels of padding around the window
|
||||
# Units are physical pixels; this is not DPI aware.
|
||||
# (change requires restart)
|
||||
padding:
|
||||
x: 2
|
||||
y: 2
|
||||
|
||||
# Window decorations
|
||||
# Setting this to false will result in window without borders and title bar.
|
||||
|
||||
# Display tabs using this many cells (changes require restart)
|
||||
tabspaces: 4
|
||||
|
||||
# Cursor blinking
|
||||
cursor_blink_interval: 300
|
||||
cursor_blink: true
|
||||
|
||||
# When true, bold text is drawn using the bright variant of colors.
|
||||
draw_bold_text_with_bright_colors: true
|
||||
|
||||
# Font configuration (changes require restart)
|
||||
font:
|
||||
# The normal (roman) font face to use.
|
||||
normal:
|
||||
family: "DejaVuSansMono Nerd Font Mono" # should be "Menlo" or something on macOS.
|
||||
# Style can be specified to pick a specific face.
|
||||
style: Roman
|
||||
|
||||
# The bold font face
|
||||
bold:
|
||||
family: "DejaVuSansMono Nerd Font Mono" # should be "Menlo" or something on macOS.
|
||||
# Style can be specified to pick a specific face.
|
||||
style: Bold
|
||||
|
||||
# The italic font face
|
||||
italic:
|
||||
family: "DejaVuSansMono Nerd Font Mono" # should be "Menlo" or something on macOS.
|
||||
# Style can be specified to pick a specific face.
|
||||
style: Italic
|
||||
|
||||
# Point size of the font
|
||||
size: 8.0
|
||||
|
||||
# Offset is the extra space around each character. offset.y can be thought of
|
||||
# as modifying the linespacing, and offset.x as modifying the letter spacing.
|
||||
offset:
|
||||
x: 0
|
||||
y: 0
|
||||
|
||||
# Glyph offset determines the locations of the glyphs within their cells with
|
||||
# the default being at the bottom. Increase the x offset to move the glyph to
|
||||
# the right, increase the y offset to move the glyph upward.
|
||||
glyph_offset:
|
||||
x: 0
|
||||
y: 0
|
||||
|
||||
# OS X only: use thin stroke font rendering. Thin strokes are suitable
|
||||
# for retina displays, but for non-retina you probably want this set to
|
||||
# false.
|
||||
use_thin_strokes: true
|
||||
|
||||
# Should display the render timer
|
||||
render_timer: false
|
||||
|
||||
# Use custom cursor colors. If true, display the cursor in the cursor.foreground
|
||||
# and cursor.background colors, otherwise invert the colors of the cursor.
|
||||
|
||||
# Colors (Tomorrow Night Bright)
|
||||
colors:
|
||||
# Default colors
|
||||
primary:
|
||||
background: '0x333333'
|
||||
foreground: '0xdddddd'
|
||||
|
||||
# Colors the cursor will use if `custom_cursor_colors` is true
|
||||
cursor:
|
||||
text: '0x000000'
|
||||
cursor: '0xdddddd'
|
||||
|
||||
# Normal colors
|
||||
normal:
|
||||
black: '0x000000'
|
||||
red: '0xd54e53'
|
||||
green: '0xb9ca4a'
|
||||
yellow: '0xe6c547'
|
||||
blue: '0x7aa6da'
|
||||
magenta: '0xc397d8'
|
||||
cyan: '0x70c0ba'
|
||||
white: '0xffffff'
|
||||
|
||||
# Bright colors
|
||||
bright:
|
||||
black: '0x666666'
|
||||
red: '0xff3334'
|
||||
green: '0x9ec400'
|
||||
yellow: '0xe7c547'
|
||||
blue: '0x7aa6da'
|
||||
magenta: '0xb77ee0'
|
||||
cyan: '0x54ced6'
|
||||
white: '0xffffff'
|
||||
|
||||
# Dim colors (Optional)
|
||||
dim:
|
||||
 black: '0x333333'
|
||||
 red: '0xf2777a'
|
||||
 green: '0x99cc99'
|
||||
 yellow: '0xffcc66'
|
||||
 blue: '0x6699cc'
|
||||
 magenta: '0xcc99cc'
|
||||
 cyan: '0x66cccc'
|
||||
 white: '0xdddddd'
|
||||
|
||||
# Visual Bell
|
||||
#
|
||||
# Any time the BEL code is received, Alacritty "rings" the visual bell. Once
|
||||
# rung, the terminal background will be set to white and transition back to the
|
||||
# default background color. You can control the rate of this transition by
|
||||
# setting the `duration` property (represented in milliseconds). You can also
|
||||
# configure the transition function by setting the `animation` property.
|
||||
#
|
||||
# Possible values for `animation`
|
||||
# `Ease`
|
||||
# `EaseOut`
|
||||
# `EaseOutSine`
|
||||
# `EaseOutQuad`
|
||||
# `EaseOutCubic`
|
||||
# `EaseOutQuart`
|
||||
# `EaseOutQuint`
|
||||
# `EaseOutExpo`
|
||||
# `EaseOutCirc`
|
||||
# `Linear`
|
||||
#
|
||||
# To completely disable the visual bell, set its duration to 0.
|
||||
#
|
||||
visual_bell:
|
||||
animation: EaseOutExpo
|
||||
duration: 0
|
||||
|
||||
# Background opacity
|
||||
background_opacity: 0.9
|
||||
# Key bindings
|
||||
#
|
||||
# Each binding is defined as an object with some properties. Most of the
|
||||
# properties are optional. All of the alphabetical keys should have a letter for
|
||||
# the `key` value such as `V`. Function keys are probably what you would expect
|
||||
# as well (F1, F2, ..). The number keys above the main keyboard are encoded as
|
||||
# `Key1`, `Key2`, etc. Keys on the number pad are encoded `Number1`, `Number2`,
|
||||
# etc. These all match the glutin::VirtualKeyCode variants.
|
||||
#
|
||||
# Possible values for `mods`
|
||||
# `Command`, `Super` refer to the super/command/windows key
|
||||
# `Control` for the control key
|
||||
# `Shift` for the Shift key
|
||||
# `Alt` and `Option` refer to alt/option
|
||||
#
|
||||
# mods may be combined with a `|`. For example, requiring control and shift
|
||||
# looks like:
|
||||
#
|
||||
# mods: Control|Shift
|
||||
#
|
||||
# The parser is currently quite sensitive to whitespace and capitalization -
|
||||
# capitalization must match exactly, and piped items must not have whitespace
|
||||
# around them.
|
||||
#
|
||||
# Either an `action`, `chars`, or `command` field must be present.
|
||||
# `action` must be one of `Paste`, `PasteSelection`, `Copy`, or `Quit`.
|
||||
# `chars` writes the specified string every time that binding is activated.
|
||||
# These should generally be escape sequences, but they can be configured to
|
||||
# send arbitrary strings of bytes.
|
||||
# `command` must be a map containing a `program` string, and `args` array of
|
||||
# strings. For example:
|
||||
# - { ... , command: { program: "alacritty", args: ["-e", "vttest"] } }
|
||||
#
|
||||
# Want to add a binding (e.g. "PageUp") but are unsure what the X sequence
|
||||
# (e.g. "\x1b[5~") is? Open another terminal (like xterm) without tmux,
|
||||
# then run `showkey -a` to get the sequence associated to a key combination.
|
||||
key_bindings:
|
||||
- { key: V, mods: Control|Shift, action: Paste }
|
||||
- { key: C, mods: Control|Shift, action: Copy }
|
||||
- { key: Q, mods: Command, action: Quit }
|
||||
- { key: W, mods: Command, action: Quit }
|
||||
- { key: Insert, mods: Shift, action: PasteSelection }
|
||||
- { key: Numpad0, mods: Control, action: ResetFontSize }
|
||||
- { key: Equals, mods: Control, action: IncreaseFontSize }
|
||||
- { key: Subtract, mods: Control, action: DecreaseFontSize }
|
||||
- { key: Home, chars: "\x1bOH", mode: AppCursor }
|
||||
- { key: Home, chars: "\x1b[H", mode: ~AppCursor }
|
||||
- { key: End, chars: "\x1bOF", mode: AppCursor }
|
||||
- { key: End, chars: "\x1b[F", mode: ~AppCursor }
|
||||
- { key: PageUp, mods: Shift, chars: "\x1b[5;2~" }
|
||||
- { key: PageUp, mods: Control, chars: "\x1b[5;5~" }
|
||||
- { key: PageUp, chars: "\x1b[5~" }
|
||||
- { key: PageDown, mods: Shift, chars: "\x1b[6;2~" }
|
||||
- { key: PageDown, mods: Control, chars: "\x1b[6;5~" }
|
||||
- { key: PageDown, chars: "\x1b[6~" }
|
||||
- { key: Tab, mods: Shift, chars: "\x1b[Z" }
|
||||
- { key: Back, chars: "\x7f" }
|
||||
- { key: Back, mods: Alt, chars: "\x1b\x7f" }
|
||||
- { key: Insert, chars: "\x1b[2~" }
|
||||
- { key: Delete, chars: "\x1b[3~" }
|
||||
- { key: Left, mods: Shift, chars: "\x1b[1;2D" }
|
||||
- { key: Left, mods: Control, chars: "\x1b[1;5D" }
|
||||
- { key: Left, mods: Alt, chars: "\x1b[1;3D" }
|
||||
- { key: Left, chars: "\x1b[D", mode: ~AppCursor }
|
||||
- { key: Left, chars: "\x1bOD", mode: AppCursor }
|
||||
- { key: Right, mods: Shift, chars: "\x1b[1;2C" }
|
||||
- { key: Right, mods: Control, chars: "\x1b[1;5C" }
|
||||
- { key: Right, mods: Alt, chars: "\x1b[1;3C" }
|
||||
- { key: Right, chars: "\x1b[C", mode: ~AppCursor }
|
||||
- { key: Right, chars: "\x1bOC", mode: AppCursor }
|
||||
- { key: Up, mods: Shift, chars: "\x1b[1;2A" }
|
||||
- { key: Up, mods: Control, chars: "\x1b[1;5A" }
|
||||
- { key: Up, mods: Alt, chars: "\x1b[1;3A" }
|
||||
- { key: Up, chars: "\x1b[A", mode: ~AppCursor }
|
||||
- { key: Up, chars: "\x1bOA", mode: AppCursor }
|
||||
- { key: Down, mods: Shift, chars: "\x1b[1;2B" }
|
||||
- { key: Down, mods: Control, chars: "\x1b[1;5B" }
|
||||
- { key: Down, mods: Alt, chars: "\x1b[1;3B" }
|
||||
- { key: Down, chars: "\x1b[B", mode: ~AppCursor }
|
||||
- { key: Down, chars: "\x1bOB", mode: AppCursor }
|
||||
- { key: Tab, mods: Shift, chars: "\x1b[Z" }
|
||||
- { key: F1, chars: "\x1bOP" }
|
||||
- { key: F2, chars: "\x1bOQ" }
|
||||
- { key: F3, chars: "\x1bOR" }
|
||||
- { key: F4, chars: "\x1bOS" }
|
||||
- { key: F5, chars: "\x1b[15~" }
|
||||
- { key: F6, chars: "\x1b[17~" }
|
||||
- { key: F7, chars: "\x1b[18~" }
|
||||
- { key: F8, chars: "\x1b[19~" }
|
||||
- { key: F9, chars: "\x1b[20~" }
|
||||
- { key: F10, chars: "\x1b[21~" }
|
||||
- { key: F11, chars: "\x1b[23~" }
|
||||
- { key: F12, chars: "\x1b[24~" }
|
||||
# - { key: Back, chars: "\x7f" }
|
||||
- { key: Back, mods: Alt, chars: "\x1b\x7f" }
|
||||
- { key: Insert, chars: "\x1b[2~" }
|
||||
- { key: F1, mods: Shift, chars: "\x1b[1;2P" }
|
||||
- { key: F2, mods: Shift, chars: "\x1b[1;2Q" }
|
||||
- { key: F3, mods: Shift, chars: "\x1b[1;2R" }
|
||||
- { key: F4, mods: Shift, chars: "\x1b[1;2S" }
|
||||
- { key: F5, mods: Shift, chars: "\x1b[15;2~" }
|
||||
- { key: F6, mods: Shift, chars: "\x1b[17;2~" }
|
||||
- { key: F7, mods: Shift, chars: "\x1b[18;2~" }
|
||||
- { key: F8, mods: Shift, chars: "\x1b[19;2~" }
|
||||
- { key: F9, mods: Shift, chars: "\x1b[20;2~" }
|
||||
- { key: F10, mods: Shift, chars: "\x1b[21;2~" }
|
||||
- { key: F11, mods: Shift, chars: "\x1b[23;2~" }
|
||||
- { key: F12, mods: Shift, chars: "\x1b[24;2~" }
|
||||
- { key: F1, mods: Control, chars: "\x1b[1;5P" }
|
||||
- { key: F2, mods: Control, chars: "\x1b[1;5Q" }
|
||||
- { key: F3, mods: Control, chars: "\x1b[1;5R" }
|
||||
- { key: F4, mods: Control, chars: "\x1b[1;5S" }
|
||||
- { key: F5, mods: Control, chars: "\x1b[15;5~" }
|
||||
- { key: F6, mods: Control, chars: "\x1b[17;5~" }
|
||||
- { key: F7, mods: Control, chars: "\x1b[18;5~" }
|
||||
- { key: F8, mods: Control, chars: "\x1b[19;5~" }
|
||||
- { key: F9, mods: Control, chars: "\x1b[20;5~" }
|
||||
- { key: F10, mods: Control, chars: "\x1b[21;5~" }
|
||||
- { key: F11, mods: Control, chars: "\x1b[23;5~" }
|
||||
- { key: F12, mods: Control, chars: "\x1b[24;5~" }
|
||||
- { key: F1, mods: Alt, chars: "\x1b[1;6P" }
|
||||
- { key: F2, mods: Alt, chars: "\x1b[1;6Q" }
|
||||
- { key: F3, mods: Alt, chars: "\x1b[1;6R" }
|
||||
- { key: F4, mods: Alt, chars: "\x1b[1;6S" }
|
||||
- { key: F5, mods: Alt, chars: "\x1b[15;6~" }
|
||||
- { key: F6, mods: Alt, chars: "\x1b[17;6~" }
|
||||
- { key: F7, mods: Alt, chars: "\x1b[18;6~" }
|
||||
- { key: F8, mods: Alt, chars: "\x1b[19;6~" }
|
||||
- { key: F9, mods: Alt, chars: "\x1b[20;6~" }
|
||||
- { key: F10, mods: Alt, chars: "\x1b[21;6~" }
|
||||
- { key: F11, mods: Alt, chars: "\x1b[23;6~" }
|
||||
- { key: F12, mods: Alt, chars: "\x1b[24;6~" }
|
||||
- { key: F1, mods: Super, chars: "\x1b[1;3P" }
|
||||
- { key: F2, mods: Super, chars: "\x1b[1;3Q" }
|
||||
- { key: F3, mods: Super, chars: "\x1b[1;3R" }
|
||||
- { key: F4, mods: Super, chars: "\x1b[1;3S" }
|
||||
- { key: F5, mods: Super, chars: "\x1b[15;3~" }
|
||||
- { key: F6, mods: Super, chars: "\x1b[17;3~" }
|
||||
- { key: F7, mods: Super, chars: "\x1b[18;3~" }
|
||||
- { key: F8, mods: Super, chars: "\x1b[19;3~" }
|
||||
- { key: F9, mods: Super, chars: "\x1b[20;3~" }
|
||||
- { key: F10, mods: Super, chars: "\x1b[21;3~" }
|
||||
- { key: F11, mods: Super, chars: "\x1b[23;3~" }
|
||||
- { key: F12, mods: Super, chars: "\x1b[24;3~" }
|
||||
|
||||
# Mouse bindings
|
||||
#
|
||||
# Currently doesn't support modifiers. Both the `mouse` and `action` fields must
|
||||
# be specified.
|
||||
#
|
||||
# Values for `mouse`:
|
||||
# - Middle
|
||||
# - Left
|
||||
# - Right
|
||||
# - Numeric identifier such as `5`
|
||||
#
|
||||
# Values for `action`:
|
||||
# - Paste
|
||||
# - PasteSelection
|
||||
# - Copy (TODO)
|
||||
mouse_bindings:
|
||||
- { mouse: Middle, action: PasteSelection }
|
||||
|
||||
mouse:
|
||||
double_click: { threshold: 300 }
|
||||
triple_click: { threshold: 300 }
|
||||
|
||||
selection:
|
||||
semantic_escape_chars: ",│`|:\"' ()[]{}<>"
|
||||
|
||||
# hide_cursor_when_typing: false
|
||||
|
||||
cursor:
|
||||
style: Beam
|
||||
# Shell
|
||||
#
|
||||
# You can set shell.program to the path of your favorite shell, e.g. /bin/fish.
|
||||
# Entries in shell.args are passed unmodified as arguments to the shell.
|
||||
#shell:
|
||||
# program: /bin/bash
|
||||
# args:
|
||||
# - --login
|
||||
# - -e "echo -e -n '\e[6 q'"
|
|
@ -0,0 +1,137 @@
|
|||
## Configuration file for CAVA. Default values are commented out. Use either ';' or '#' for commenting.
|
||||
|
||||
|
||||
[general]
|
||||
|
||||
# Smoothing mode. Can be 'normal', 'scientific' or 'waves'.
|
||||
; mode = normal
|
||||
|
||||
# Accepts only non-negative values.
|
||||
framerate = 60
|
||||
|
||||
# 'autosens' will attempt to decrease sensitivity if the bars peak. 1 = on, 0 = off
|
||||
# 'overshoot' allows bars to overshoot (in % of terminal height) without initiating autosens.
|
||||
; autosens = 1
|
||||
; overshoot = 20
|
||||
|
||||
# Manual sensitivity in %. Autosens must be turned off for this to take effect.
|
||||
# 200 means double height. Accepts only non-negative values.
|
||||
; sensitivity = 100
|
||||
|
||||
# The number of bars (0-200). 0 sets it to auto (fill up console).
|
||||
# Bars' width and space between bars in number of characters.
|
||||
bars = 0
|
||||
bar_width = 1
|
||||
bar_spacing = 0
|
||||
|
||||
|
||||
# Lower and higher cutoff frequencies for lowest and highest bars
|
||||
# the bandwidth of the visualizer.
|
||||
# Note: there is a minimum total bandwidth of 43Mhz x number of bars.
|
||||
# Cava will automatically increase the higher cutoff if a too low band is specified.
|
||||
; lower_cutoff_freq = 50
|
||||
; higher_cutoff_freq = 10000
|
||||
|
||||
|
||||
|
||||
[input]
|
||||
|
||||
# Audio capturing method. Possible methods are: 'pulse', 'alsa' or 'fifo'.
|
||||
# Defaults to 'pulse', 'alsa' or 'fifo', in that order, dependent on what support cava was built with.
|
||||
#
|
||||
# All input methods uses the same config variable 'source'
|
||||
# to define where it should get the audio.
|
||||
#
|
||||
# For pulseaudio 'source' will be the source. Default: 'auto', which uses the monitor source of the default sink
|
||||
# (all pulseaudio sinks(outputs) have 'monitor' sources(inputs) associated with them).
|
||||
#
|
||||
# For alsa 'source' will be the capture device.
|
||||
# For fifo 'source' will be the path to fifo-file.
|
||||
; method = pulse
|
||||
; source = auto
|
||||
|
||||
; method = alsa
|
||||
; source = hw:Loopback,1
|
||||
|
||||
; method = fifo
|
||||
; source = /tmp/mpd.fifo
|
||||
|
||||
|
||||
|
||||
[output]
|
||||
|
||||
# Ouput method. Can be 'ncurses', 'noncurses' or 'raw'.
|
||||
# 'noncurses' is for systems that does not suport ncurses.
|
||||
# 'raw' is a 16 bit data stream of the bar heights that can be used to send to other applications.
|
||||
# 'raw' defaults to 200 bars, which can be adjusted in the 'bars' option above.
|
||||
; method = raw
|
||||
|
||||
# Visual styles. Can be 'stereo' or 'mono'.
|
||||
# 'stereo' mirrors both channels with low frequencies in center.
|
||||
# 'mono' averages both channels and outputs left to right lowest to highest frequencies.
|
||||
style = mono
|
||||
|
||||
# Raw output target. A fifo will be created if target does not exist.
|
||||
; raw_target = /dev/stdout
|
||||
|
||||
# Raw data format. Can be 'binary' or 'ascii'.
|
||||
; data_format = binary
|
||||
|
||||
# Binary bit format, can be '8bit' (0-255) or '16bit' (0-65530).
|
||||
; bit_format = 16bit
|
||||
|
||||
# Ascii max value. In 'ascii' mode range will run from 0 to value specified here
|
||||
; ascii_max_range = 1000
|
||||
|
||||
# Ascii delimiters. In ascii format each bar and frame is separated by a delimiters.
|
||||
# Use decimal value in ascii table (i.e. 59 = ';' and 10 = '\n' (line feed)).
|
||||
; bar_delimiter = 59
|
||||
; frame_delimiter = 10
|
||||
|
||||
|
||||
|
||||
[color]
|
||||
|
||||
# Colors can be one of seven predefined: black, blue, cyan, green, magenta, red, white, yellow.
|
||||
# Or defined by hex code '#xxxxxx' (hex code must be within ''). User defined colors requires a
|
||||
# terminal that can change color definitions such as Gnome-terminal or rxvt.
|
||||
; background = black
|
||||
foreground = white
|
||||
|
||||
# Gradient mode, only hex defined colors are supported, background must also be defined in hex
|
||||
# or remain commented out. 1 = on, 0 = off. Warning: for certain terminal emulators cava will
|
||||
# not able to restore color definitions on exit, simply restart your terminal to restore colors.
|
||||
gradient = 1
|
||||
gradient_color_1 = '#ea4230'
|
||||
gradient_color_2 = '#820bc6'
|
||||
|
||||
|
||||
|
||||
[smoothing]
|
||||
|
||||
# Multiplier for the integral smoothing calculations. Takes values from 0-0.99.
|
||||
# Higher values means smoother, but less precise. Set to 0 to disable.
|
||||
; integral = 0.7
|
||||
|
||||
# Disables or enables the so-called "Monstercat smoothing". Set to 0 to disable.
|
||||
; monstercat = 0
|
||||
|
||||
# Set gravity multiplier for "drop off". Higher values means bars will drop faster.
|
||||
# Accepts only non-negative values. 0.5 means half gravity, 2 means double. Set to 0 to disable "drop off".
|
||||
; gravity = 1
|
||||
|
||||
|
||||
# In bar height, bars that would have been lower that this will not be drawn.
|
||||
; ignore = 0
|
||||
|
||||
|
||||
[eq]
|
||||
|
||||
# This one is tricky. You can have as much keys as you want.
|
||||
# Remember to uncomment more then one key! More keys = more precision.
|
||||
# Look at readme.md on github for further explanations and examples.
|
||||
; 1 = 1 # bass
|
||||
; 2 = 1
|
||||
; 3 = 1 # midtone
|
||||
; 4 = 1
|
||||
; 5 = 1 # treble
|
|
@ -0,0 +1,26 @@
|
|||
# Beware! This file is rewritten by htop when settings are changed in the interface.
|
||||
# The parser is also very primitive, and not human-friendly.
|
||||
fields=0 48 2 46 47 38 49 111 1
|
||||
sort_key=46
|
||||
sort_direction=1
|
||||
hide_threads=1
|
||||
hide_kernel_threads=1
|
||||
hide_userland_threads=1
|
||||
shadow_other_users=0
|
||||
show_thread_names=0
|
||||
show_program_path=1
|
||||
highlight_base_name=1
|
||||
highlight_megabytes=1
|
||||
highlight_threads=1
|
||||
tree_view=0
|
||||
header_margin=1
|
||||
detailed_cpu_time=0
|
||||
cpu_count_from_zero=0
|
||||
update_process_names=0
|
||||
account_guest_in_cpu_meter=0
|
||||
color_scheme=0
|
||||
delay=15
|
||||
left_meters=Hostname LoadAverage Tasks Uptime Clock
|
||||
left_meter_modes=2 2 2 2 2
|
||||
right_meters=AllCPUs2 Memory Swap Battery
|
||||
right_meter_modes=1 1 1 1
|
|
@ -0,0 +1,9 @@
|
|||
MOUSE_BTN3 add volume 5
|
||||
MOUSE_BTN4 add volume -5
|
||||
+ add speed 0.05
|
||||
- add speed -0.05
|
||||
h add volume -5
|
||||
l add volume 5
|
||||
j seek 15
|
||||
k seek -15
|
||||
m cycle pause
|
|
@ -0,0 +1 @@
|
|||
layout=slimbox
|
|
@ -0,0 +1,7 @@
|
|||
volume=100
|
||||
volume-max=200
|
||||
|
||||
force-window
|
||||
quiet
|
||||
|
||||
ytdl-format=bestvideo[height<=?1080]+bestaudio/best
|
|
@ -0,0 +1,731 @@
|
|||
-- Display some stats.
|
||||
--
|
||||
-- Please consult the readme for information about usage and configuration:
|
||||
-- https://github.com/Argon-/mpv-stats
|
||||
--
|
||||
-- Please note: not every property is always available and therefore not always
|
||||
-- visible.
|
||||
|
||||
local mp = require 'mp'
|
||||
local options = require 'mp.options'
|
||||
|
||||
-- Options
|
||||
local o = {
|
||||
-- Default key bindings
|
||||
key_oneshot = "i",
|
||||
key_toggle = "I",
|
||||
key_page_1 = "1",
|
||||
key_page_2 = "2",
|
||||
key_page_3 = "3",
|
||||
|
||||
duration = 4,
|
||||
redraw_delay = 1, -- acts as duration in the toggling case
|
||||
ass_formatting = true,
|
||||
print_perfdata_passes = false, -- when true, print the full information about all passes
|
||||
filter_params_max_length = 100, -- a filter list longer than this many characters will be shown one filter per line instead
|
||||
debug = false,
|
||||
|
||||
-- Graph options and style
|
||||
plot_perfdata = true,
|
||||
plot_vsync_ratio = true,
|
||||
plot_vsync_jitter = true,
|
||||
skip_frames = 5,
|
||||
global_max = true,
|
||||
flush_graph_data = true, -- clear data buffers when toggling
|
||||
plot_bg_border_color = "0000FF",
|
||||
plot_bg_color = "262626",
|
||||
plot_color = "FFFFFF",
|
||||
|
||||
-- Text style
|
||||
font = "Source Sans Pro",
|
||||
font_mono = "Source Sans Pro", -- monospaced digits are sufficient
|
||||
font_size = 8,
|
||||
font_color = "FFFFFF",
|
||||
border_size = 0.8,
|
||||
border_color = "262626",
|
||||
shadow_x_offset = 0.0,
|
||||
shadow_y_offset = 0.0,
|
||||
shadow_color = "000000",
|
||||
alpha = "11",
|
||||
|
||||
-- Custom header for ASS tags to style the text output.
|
||||
-- Specifying this will ignore the text style values above and just
|
||||
-- use this string instead.
|
||||
custom_header = "",
|
||||
|
||||
-- Text formatting
|
||||
-- With ASS
|
||||
ass_nl = "\\N",
|
||||
ass_indent = "\\h\\h\\h\\h\\h",
|
||||
ass_prefix_sep = "\\h\\h",
|
||||
ass_b1 = "{\\b1}",
|
||||
ass_b0 = "{\\b0}",
|
||||
ass_it1 = "{\\i1}",
|
||||
ass_it0 = "{\\i0}",
|
||||
-- Without ASS
|
||||
no_ass_nl = "\n",
|
||||
no_ass_indent = "\t",
|
||||
no_ass_prefix_sep = " ",
|
||||
no_ass_b1 = "\027[1m",
|
||||
no_ass_b0 = "\027[0m",
|
||||
no_ass_it1 = "\027[3m",
|
||||
no_ass_it0 = "\027[0m",
|
||||
}
|
||||
options.read_options(o)
|
||||
|
||||
local format = string.format
|
||||
local max = math.max
|
||||
local min = math.min
|
||||
|
||||
-- Function used to record performance data
|
||||
local recorder = nil
|
||||
-- Timer used for toggling
|
||||
local toggle_timer = nil
|
||||
-- Timer used to remove forced keybindings
|
||||
local binding_timer = nil
|
||||
-- Current page and <page key>:<page function> mappings
|
||||
local curr_page = o.key_page_1
|
||||
local pages = {}
|
||||
|
||||
-- Save these sequences locally as we'll need them a lot
|
||||
local ass_start = mp.get_property_osd("osd-ass-cc/0")
|
||||
local ass_stop = mp.get_property_osd("osd-ass-cc/1")
|
||||
|
||||
-- Ring buffers for the values used to construct a graph.
|
||||
-- .pos denotes the current position, .len the buffer length
|
||||
-- .max is the max value in the corresponding buffer
|
||||
local vsratio_buf, vsjitter_buf
|
||||
local function init_buffers()
|
||||
vsratio_buf = {0, pos = 1, len = 50, max = 0}
|
||||
vsjitter_buf = {0, pos = 1, len = 50, max = 0}
|
||||
end
|
||||
|
||||
-- Save all properties known to this version of mpv
|
||||
local property_list = {}
|
||||
for p in string.gmatch(mp.get_property("property-list"), "([^,]+)") do property_list[p] = true end
|
||||
-- Mapping of properties to their deprecated names
|
||||
local property_aliases = {
|
||||
["decoder-frame-drop-count"] = "drop-frame-count",
|
||||
["frame-drop-count"] = "vo-drop-frame-count",
|
||||
["container-fps"] = "fps",
|
||||
}
|
||||
|
||||
|
||||
-- Return deprecated name for the given property
|
||||
local function compat(p)
|
||||
while not property_list[p] and property_aliases[p] do
|
||||
p = property_aliases[p]
|
||||
end
|
||||
return p
|
||||
end
|
||||
|
||||
|
||||
local function set_ASS(b)
|
||||
if not o.use_ass then
|
||||
return ""
|
||||
end
|
||||
return b and ass_start or ass_stop
|
||||
end
|
||||
|
||||
|
||||
local function no_ASS(t)
|
||||
return set_ASS(false) .. t .. set_ASS(true)
|
||||
end
|
||||
|
||||
|
||||
local function b(t)
|
||||
return o.b1 .. t .. o.b0
|
||||
end
|
||||
|
||||
|
||||
local function it(t)
|
||||
return o.it1 .. t .. o.it0
|
||||
end
|
||||
|
||||
|
||||
local function text_style()
|
||||
if not o.use_ass then
|
||||
return ""
|
||||
end
|
||||
if o.custom_header and o.custom_header ~= "" then
|
||||
return set_ASS(true) .. o.custom_header
|
||||
else
|
||||
return format("%s{\\r}{\\an7}{\\fs%d}{\\fn%s}{\\bord%f}{\\3c&H%s&}{\\1c&H%s&}{\\alpha&H%s&}{\\xshad%f}{\\yshad%f}{\\4c&H%s&}",
|
||||
set_ASS(true), o.font_size, o.font, o.border_size,
|
||||
o.border_color, o.font_color, o.alpha, o.shadow_x_offset,
|
||||
o.shadow_y_offset, o.shadow_color)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local function has_vo_window()
|
||||
return mp.get_property("vo-configured") == "yes"
|
||||
end
|
||||
|
||||
|
||||
local function has_video()
|
||||
local r = mp.get_property("video")
|
||||
return r and r ~= "no" and r ~= ""
|
||||
end
|
||||
|
||||
|
||||
local function has_audio()
|
||||
local r = mp.get_property("audio")
|
||||
return r and r ~= "no" and r ~= ""
|
||||
end
|
||||
|
||||
|
||||
local function has_ansi()
|
||||
local is_windows = type(package) == 'table' and type(package.config) == 'string' and package.config:sub(1,1) == '\\'
|
||||
if is_windows then
|
||||
return os.getenv("ANSICON")
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
-- Generate a graph from the given values.
|
||||
-- Returns an ASS formatted vector drawing as string.
|
||||
--
|
||||
-- values: Array/table of numbers representing the data. Used like a ring buffer
|
||||
-- it will get iterated backwards `len` times starting at position `i`.
|
||||
-- i : Index of the latest data value in `values`.
|
||||
-- len : The length/amount of numbers in `values`.
|
||||
-- v_max : The maximum number in `values`. It is used to scale all data
|
||||
-- values to a range of 0 to `v_max`.
|
||||
-- v_avg : The average number in `values`. It is used to try and center graphs
|
||||
-- if possible. May be left as nil
|
||||
-- scale : A value that will be multiplied with all data values.
|
||||
-- x_tics: Horizontal width multiplier for the steps
|
||||
local function generate_graph(values, i, len, v_max, v_avg, scale, x_tics)
|
||||
-- Check if at least one value exists
|
||||
if not values[i] then
|
||||
return ""
|
||||
end
|
||||
|
||||
local x_max = (len - 1) * x_tics
|
||||
local y_offset = o.border_size
|
||||
local y_max = o.font_size * 0.66
|
||||
local x = 0
|
||||
|
||||
-- try and center the graph if possible, but avoid going above `scale`
|
||||
if v_avg then
|
||||
scale = min(scale, v_max / (2 * v_avg))
|
||||
end
|
||||
|
||||
local s = {format("m 0 0 n %f %f l ", x, y_max - (y_max * values[i] / v_max * scale))}
|
||||
i = ((i - 2) % len) + 1
|
||||
|
||||
for p = 1, len - 1 do
|
||||
if values[i] then
|
||||
x = x - x_tics
|
||||
s[#s+1] = format("%f %f ", x, y_max - (y_max * values[i] / v_max * scale))
|
||||
end
|
||||
i = ((i - 2) % len) + 1
|
||||
end
|
||||
|
||||
s[#s+1] = format("%f %f %f %f", x, y_max, 0, y_max)
|
||||
|
||||
local bg_box = format("{\\bord0.5}{\\3c&H%s&}{\\1c&H%s&}m 0 %f l %f %f %f 0 0 0",
|
||||
o.plot_bg_border_color, o.plot_bg_color, y_max, x_max, y_max, x_max)
|
||||
return format("%s{\\r}{\\pbo%f}{\\shad0}{\\alpha&H00}{\\p1}%s{\\p0}{\\bord0}{\\1c&H%s}{\\p1}%s{\\p0}%s",
|
||||
o.prefix_sep, y_offset, bg_box, o.plot_color, table.concat(s), text_style())
|
||||
end
|
||||
|
||||
|
||||
-- Format and append a property.
|
||||
-- A property whose value is either `nil` or empty (hereafter called "invalid")
|
||||
-- is skipped and not appended.
|
||||
-- Returns `false` in case nothing was appended, otherwise `true`.
|
||||
--
|
||||
-- s : Table containing strings.
|
||||
-- prop : The property to query and format (based on its OSD representation).
|
||||
-- attr : Optional table to overwrite certain (formatting) attributes for
|
||||
-- this property.
|
||||
-- exclude: Optional table containing keys which are considered invalid values
|
||||
-- for this property. Specifying this will replace empty string as
|
||||
-- default invalid value (nil is always invalid).
|
||||
local function append_property(s, prop, attr, excluded)
|
||||
excluded = excluded or {[""] = true}
|
||||
local ret = mp.get_property_osd(prop)
|
||||
if not ret or excluded[ret] then
|
||||
if o.debug then
|
||||
print("No value for property: " .. prop)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
attr.prefix_sep = attr.prefix_sep or o.prefix_sep
|
||||
attr.indent = attr.indent or o.indent
|
||||
attr.nl = attr.nl or o.nl
|
||||
attr.suffix = attr.suffix or ""
|
||||
attr.prefix = attr.prefix or ""
|
||||
attr.no_prefix_markup = attr.no_prefix_markup or false
|
||||
attr.prefix = attr.no_prefix_markup and attr.prefix or b(attr.prefix)
|
||||
ret = attr.no_value and "" or ret
|
||||
|
||||
s[#s+1] = format("%s%s%s%s%s%s", attr.nl, attr.indent,
|
||||
attr.prefix, attr.prefix_sep, no_ASS(ret), attr.suffix)
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
local function append_perfdata(s, dedicated_page)
|
||||
local vo_p = mp.get_property_native("vo-passes")
|
||||
if not vo_p then
|
||||
return
|
||||
end
|
||||
|
||||
local ds = mp.get_property_bool("display-sync-active", false)
|
||||
local target_fps = ds and mp.get_property_number("display-fps", 0)
|
||||
or mp.get_property_number(compat("container-fps"), 0)
|
||||
if target_fps > 0 then target_fps = 1 / target_fps * 1e9 end
|
||||
|
||||
-- Sums of all last/avg/peak values
|
||||
local last_s, avg_s, peak_s = {}, {}, {}
|
||||
for frame, data in pairs(vo_p) do
|
||||
last_s[frame], avg_s[frame], peak_s[frame] = 0, 0, 0
|
||||
for _, pass in ipairs(data) do
|
||||
last_s[frame] = last_s[frame] + pass["last"]
|
||||
avg_s[frame] = avg_s[frame] + pass["avg"]
|
||||
peak_s[frame] = peak_s[frame] + pass["peak"]
|
||||
end
|
||||
end
|
||||
|
||||
-- Pretty print measured time
|
||||
local function pp(i)
|
||||
-- rescale to microseconds for a saner display
|
||||
return format("%05d", i / 1000)
|
||||
end
|
||||
|
||||
-- Format n/m with a font weight based on the ratio
|
||||
local function p(n, m)
|
||||
local i = 0
|
||||
if m > 0 then
|
||||
i = tonumber(n) / m
|
||||
end
|
||||
-- Calculate font weight. 100 is minimum, 400 is normal, 700 bold, 900 is max
|
||||
local w = (700 * math.sqrt(i)) + 200
|
||||
return format("{\\b%d}%02d%%{\\b0}", w, i * 100)
|
||||
end
|
||||
|
||||
s[#s+1] = format("%s%s%s%s{\\fs%s}%s{\\fs%s}", dedicated_page and "" or o.nl, dedicated_page and "" or o.indent,
|
||||
b("Frame Timings:"), o.prefix_sep, o.font_size * 0.66,
|
||||
"(last/average/peak μs)", o.font_size)
|
||||
|
||||
for frame, data in pairs(vo_p) do
|
||||
local f = "%s%s%s{\\fn%s}%s / %s / %s %s%s{\\fn%s}%s%s%s"
|
||||
|
||||
if dedicated_page then
|
||||
s[#s+1] = format("%s%s%s:", o.nl, o.indent,
|
||||
b(frame:gsub("^%l", string.upper)))
|
||||
|
||||
for _, pass in ipairs(data) do
|
||||
s[#s+1] = format(f, o.nl, o.indent, o.indent,
|
||||
o.font_mono, pp(pass["last"]),
|
||||
pp(pass["avg"]), pp(pass["peak"]),
|
||||
o.prefix_sep .. o.prefix_sep, p(pass["last"], last_s[frame]),
|
||||
o.font, o.prefix_sep, o.prefix_sep, pass["desc"])
|
||||
|
||||
if o.plot_perfdata and o.use_ass then
|
||||
s[#s+1] = generate_graph(pass["samples"], pass["count"],
|
||||
pass["count"], pass["peak"],
|
||||
pass["avg"], 0.9, 0.25)
|
||||
end
|
||||
end
|
||||
|
||||
-- Print sum of timing values as "Total"
|
||||
s[#s+1] = format(f, o.nl, o.indent, o.indent,
|
||||
o.font_mono, pp(last_s[frame]),
|
||||
pp(avg_s[frame]), pp(peak_s[frame]), "", "", o.font,
|
||||
o.prefix_sep, o.prefix_sep, b("Total"))
|
||||
else
|
||||
-- for the simplified view, we just print the sum of each pass
|
||||
s[#s+1] = format(f, o.nl, o.indent, o.indent, o.font_mono,
|
||||
pp(last_s[frame]), pp(avg_s[frame]), pp(peak_s[frame]),
|
||||
"", "", o.font, o.prefix_sep, o.prefix_sep,
|
||||
frame:gsub("^%l", string.upper))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local function append_display_sync(s)
|
||||
if not mp.get_property_bool("display-sync-active", false) then
|
||||
return
|
||||
end
|
||||
|
||||
local vspeed = append_property(s, "video-speed-correction", {prefix="DS:"})
|
||||
if vspeed then
|
||||
append_property(s, "audio-speed-correction",
|
||||
{prefix="/", nl="", indent=" ", prefix_sep=" ", no_prefix_markup=true})
|
||||
else
|
||||
append_property(s, "audio-speed-correction",
|
||||
{prefix="DS:" .. o.prefix_sep .. " - / ", prefix_sep=""})
|
||||
end
|
||||
|
||||
append_property(s, "mistimed-frame-count", {prefix="Mistimed:", nl=""})
|
||||
append_property(s, "vo-delayed-frame-count", {prefix="Delayed:", nl=""})
|
||||
|
||||
-- As we need to plot some graphs we print jitter and ratio on their own lines
|
||||
if toggle_timer:is_enabled() and (o.plot_vsync_ratio or o.plot_vsync_jitter) and o.use_ass then
|
||||
local ratio_graph = ""
|
||||
local jitter_graph = ""
|
||||
if o.plot_vsync_ratio then
|
||||
ratio_graph = generate_graph(vsratio_buf, vsratio_buf.pos, vsratio_buf.len, vsratio_buf.max, nil, 0.8, 1)
|
||||
end
|
||||
if o.plot_vsync_jitter then
|
||||
jitter_graph = generate_graph(vsjitter_buf, vsjitter_buf.pos, vsjitter_buf.len, vsjitter_buf.max, nil, 0.8, 1)
|
||||
end
|
||||
append_property(s, "vsync-ratio", {prefix="VSync Ratio:", suffix=o.prefix_sep .. ratio_graph})
|
||||
append_property(s, "vsync-jitter", {prefix="VSync Jitter:", suffix=o.prefix_sep .. jitter_graph})
|
||||
else
|
||||
-- Since no graph is needed we can print ratio/jitter on the same line and save some space
|
||||
local vratio = append_property(s, "vsync-ratio", {prefix="VSync Ratio:"})
|
||||
append_property(s, "vsync-jitter", {prefix="VSync Jitter:", nl="" or o.nl})
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local function append_filters(s, prop, prefix)
|
||||
local length = 0
|
||||
local filters = {}
|
||||
|
||||
for _,f in ipairs(mp.get_property_native(prop, {})) do
|
||||
local n = f.name
|
||||
if f.enabled ~= nil and not f.enabled then
|
||||
n = n .. " (disabled)"
|
||||
end
|
||||
|
||||
local p = {}
|
||||
for key,value in pairs(f.params) do
|
||||
p[#p+1] = key .. "=" .. value
|
||||
end
|
||||
if #p > 0 then
|
||||
p = " [" .. table.concat(p, " ") .. "]"
|
||||
else
|
||||
p = ""
|
||||
end
|
||||
|
||||
length = length + n:len() + p:len()
|
||||
filters[#filters+1] = no_ASS(n) .. it(no_ASS(p))
|
||||
end
|
||||
|
||||
if #filters > 0 then
|
||||
local ret
|
||||
if length < o.filter_params_max_length then
|
||||
ret = table.concat(filters, ", ")
|
||||