Skip to content

Commit

Permalink
misc minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Sep 21, 2024
1 parent 060d1ec commit 2c3db85
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 30 deletions.
25 changes: 12 additions & 13 deletions home/.config/i3blocks/config
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ separator=false
[memory]
label=🐏
percent=false
interval=5
interval=1

# Idle time
[custom_idle]
command=~/.config/i3blocks/custom_scripts/idle.sh
interval=5
interval=1

[separator]
full_text=‖
Expand Down Expand Up @@ -101,7 +101,7 @@ color=#666666
# CPU Temperature
[cpu_temp]
command=~/.config/i3blocks/custom_scripts/cpu_temp.sh
interval=10
interval=1

[separator]
full_text=‖
Expand All @@ -110,7 +110,7 @@ color=#666666
# CPU Usage
[cpu_usage]
command=~/.config/i3blocks/custom_scripts/cpu_usage.sh
interval=5
interval=1

[separator]
full_text=‖
Expand All @@ -119,7 +119,7 @@ color=#666666
# Load Average
[custom_load]
command=~/.config/i3blocks/custom_scripts/load_average.sh
interval=10
interval=1

[separator]
full_text=‖
Expand All @@ -128,7 +128,7 @@ color=#666666
# RAM Usage
[memory]
command=~/.config/i3blocks/custom_scripts/memory.sh
interval=5
interval=1

#[memory]
#label=SWAP
Expand Down Expand Up @@ -162,16 +162,11 @@ interval=5
full_text=‖
color=#666666

# GPU Load
[gpu_load]
# GPU
[gpu]
command=~/.config/i3blocks/custom_scripts/gpu_load.sh
interval=10

[separator]
full_text=‖
color=#666666

# GPU VRAM
[gpu_vram]
command=~/.config/i3blocks/custom_scripts/gpu_vram.sh
interval=10
Expand Down Expand Up @@ -219,6 +214,10 @@ color=#666666
command=date '+%Y-%m-%d %H:%M:%S'
interval=1

[separator]
full_text=‖
color=#666666

# Generic media player support
#
# This displays "ARTIST - SONG" if a music is playing.
Expand Down
12 changes: 6 additions & 6 deletions home/.config/i3blocks/custom_scripts/power_draw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ battery_path=$(find /sys/class/power_supply/BAT* -type d -print -quit 2>/dev/nul
# Check for AC adapter presence
ac_adapter=$(find /sys/class/power_supply/*/ -name "online" -print -quit 2>/dev/null)

if [ -z "$battery_path" ] || [ -n "$ac_adapter" ] && [ "$(cat "$ac_adapter" 2>/dev/null)" == "1" ]; then
echo "🔌"
# Check if the battery is charging
if [ -n "$battery_path" ] && [ -n "$ac_adapter" ] && [ "$(cat "$ac_adapter" 2>/dev/null)" == "1" ]; then
echo "🔌"
echo "#FFFFFF"
# Check if the battery is discharging
elif [ -n "$battery_path" ]; then
power_now_file="$battery_path/power_now"
if [ -f "$power_now_file" ]; then
power_draw=$(awk '{printf "%.1f", $1 / 1000000}' "$power_now_file")
echo "${power_draw}W"
echo "${power_draw}W"
echo "#FFFF00"
else
echo "⚡ N/A"
echo "⚡ N/A"
echo "#FFFFFF"
fi
# No battery or AC adapter found
else
echo "🔌"
echo "🔌"
# echo "🔌"
echo ""
echo "#FFFFFF"
fi
22 changes: 11 additions & 11 deletions home/.vim/config/plugins.vim
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ call plug#begin('~/.vim/plugged')
Plug 'preservim/vim-wordy'

" Keys
Plug 'tpope/vim-unimpaired'
Plug 'folke/which-key.nvim'
Plug 'tpope/vim-unimpaired'

" Copilot/LLMs
Plug 'github/copilot.vim', {'branch': 'release'}
Expand Down Expand Up @@ -134,25 +134,25 @@ let g:ale_linters = {
\ 'typescript': ['eslint', 'tslint'],
\}

let g:ale_python_flake8_options='--ignore=E203,E225,E265,E402,E501,W503 --builtins=Analysis,PYZ,EXE,BUNDLE,MERGE,COLLECT'
let g:ale_python_mypy_options='--ignore-missing-imports --check-untyped-defs --disable-error-code name-defined'
let g:ale_python_autoflake_options='--remove-unused-variables --ignore-init-module-imports --ignore-pass-after-docstring --in-place'
let g:ale_python_autoimport_options=''
let g:ale_python_reorderpythonimports_options='--py38-plus'
let g:ale_python_isort_options='--profile black --force-grid-wrap 4'
let g:ale_python_bandit_options='--skip B101'

let g:ale_fixers = {
\ 'python': ['autoflake', 'autoimport', 'reorder-python-imports', 'isort', 'autopep8', 'black', 'ruff'],
\ 'python': ['autoflake', 'autoimport', 'reorder-python-imports', 'isort', 'autopep8', 'black', 'ruff', 'ruff_format'],
\ 'javascript': ['prettier'],
\ 'javascriptreact': ['prettier'],
\ 'typescript': ['prettier'],
\ 'typescriptreact': ['prettier'],
\ 'vue': ['prettier'],
\ 'rust': ['rustfmt'],
\}
let g:ale_rust_cargo_use_clippy = executable('cargo-clippy')

let g:ale_fix_on_save=1
let g:ale_rust_cargo_use_clippy = executable('cargo-clippy')
let g:ale_python_flake8_options='--ignore=E203,E225,E265,E402,E501,W503 --builtins=Analysis,PYZ,EXE,BUNDLE,MERGE,COLLECT'
let g:ale_python_mypy_options='--ignore-missing-imports --check-untyped-defs --disable-error-code name-defined'
let g:ale_python_autoflake_options='--remove-unused-variables --ignore-init-module-imports --ignore-pass-after-docstring --in-place'
let g:ale_python_autoimport_options=''
let g:ale_python_reorderpythonimports_options='--py38-plus'
let g:ale_python_isort_options='--profile black --force-grid-wrap 4'
let g:ale_python_bandit_options='--skip B101'

" UltiSnips
let g:UltiSnipsExpandTrigger="<c-s>"
Expand Down

0 comments on commit 2c3db85

Please sign in to comment.