From cfe0a3aae9feb7f66cb352b5e7f9ff9cdf784854 Mon Sep 17 00:00:00 2001 From: AngeD Date: Fri, 9 Sep 2022 14:46:10 +0200 Subject: [PATCH 1/5] feat: dkpurge default answer and -h --- bin/dkpurge | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/bin/dkpurge b/bin/dkpurge index b088631..ab70fe6 100755 --- a/bin/dkpurge +++ b/bin/dkpurge @@ -1,5 +1,35 @@ #!/bin/bash +if [ "$1" == '-h' ] || [ "$1" == '--help' ]; then + cat << EOF +Usage: $0 [Default-answer] +Clean all Docker ressources. +root permission not necessary so the binary can be placed in +$HOME/[.local/]bin. + +| Ressource | Answer | Description | +| ---------- | ------ | -------------------------- | +| Containers | [Y]es | Remove stopped containers | +| | [A]ll | Remove all containers | +| | [N]o | Skip | +| | | | +| Volumes | [Y]es | Remove unused volumes | +| | [A]ll | Remove unused volumes | +| | [N]o | Skip | +| | | | +| Images | [Y]es | Remove unused local images | +| | [A]ll | Remove all unused images | +| | [N]o | Skip | +| | | | +| Networks | [Y]es | Remove unused networks | +| | [A]ll | Remove unused networks | +| | [N]o | Skip | +EOF + exit +fi + + + PS="$(docker container ls -aq 2> /dev/null)" if [ "$?" != 0 ] && [ "$EUID" != 0 ]; then @@ -13,12 +43,14 @@ NET="$(docker network ls -q 2> /dev/null)" DEFAULT_NET="$(docker network ls -q -f name=bridge -f name=host -f name=none)" +ANS="$1" +[ -z "$1" ] && READ="read -r ANS" if [ -n "$PS" ]; then docker container ls -a echo -n "Prune Containers? [Y/n/a] " - read -r ANS + $READ case "${ANS,,}" in 'y'|'yes'|'') echo "$PS" | xargs docker rm 2> /dev/null @@ -34,7 +66,7 @@ if [ -n "$VOL" ]; then docker volume ls echo -n "Prune Volumes? [Ya/n] " - read -r ANS + $READ case "${ANS,,}" in 'y'|'yes'|'a'|'all'|'') echo "$VOL" | xargs docker volume rm -f 2> /dev/null @@ -47,10 +79,15 @@ if [ -n "$IMG" ]; then docker image ls echo -n "Prune Images? [Y/n/a] " - read -r ANS + $READ case "${ANS,,}" in 'y'|'yes'|'') - docker image prune -f + for img in $IMG; do + if docker image inspect "$img" | grep '"RepoTags": \[]' &> /dev/null; then + TO_CLEAN="$TO_CLEAN $img" + fi + done + echo "$TO_CLEAN" | xargs docker image rm -f 2> /dev/null ;; 'a'|'all') echo "$IMG" | xargs docker image rm -f 2> /dev/null @@ -63,7 +100,7 @@ if [ -n "$NET" ] && [ "$NET" != "$DEFAULT_NET" ]; then docker network ls echo -n "Prune Networks? [Ya/n] " - read -r ANS + $READ case "${ANS,,}" in 'y'|'yes'|'a'|'all'|'') docker network prune -f From a8495390a6b7cfa7082a2035f20b0da9abe203c9 Mon Sep 17 00:00:00 2001 From: AngeD Date: Thu, 15 Sep 2022 11:30:04 +0200 Subject: [PATCH 2/5] fix: indentation, better naming, alacritty opacity --- .config/alacritty.yml | 2 +- .config/awesome/rc.lua | 2 +- .config/nvim/ftplugin/python.lua | 2 +- .config/nvim/lua/lspbinds.lua | 1 - .config/nvim/pack/plugins/opt/black | 2 +- .config/nvim/pack/plugins/opt/nvim-lspconfig | 2 +- .config/nvim/pack/plugins/opt/nvim-treesitter | 2 +- .config/zsh/.p10k.zsh | 4 ++-- .config/zsh/ohmyzsh | 2 +- .pyenv | 2 +- bin/dkpurge | 2 +- 11 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.config/alacritty.yml b/.config/alacritty.yml index b9cc848..8949efc 100644 --- a/.config/alacritty.yml +++ b/.config/alacritty.yml @@ -67,7 +67,7 @@ window: # # Window opacity as a floating point number from `0.0` to `1.0`. # The value `0.0` is completely transparent and `1.0` is opaque. - opacity: 0.8 + opacity: 0.9 # Startup Mode (changes require restart) diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 336fb8e..bdc53aa 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -118,7 +118,7 @@ local function set_wallpaper(s) if type(wallpaper) == "function" then wallpaper = wallpaper(s) end - gears.wallpaper.maximized(wallpaper, s, true) + gears.wallpaper.maximized(wallpaper, s, true) end end diff --git a/.config/nvim/ftplugin/python.lua b/.config/nvim/ftplugin/python.lua index dfc577a..90e69fb 100644 --- a/.config/nvim/ftplugin/python.lua +++ b/.config/nvim/ftplugin/python.lua @@ -7,4 +7,4 @@ require'lspconfig'.pyright.setup { vim.cmd("let g:black_linelength=79") -- keybindings -vim.keymap.set("n", "", ":Black") +vim.keymap.set("n", "f", "Black") diff --git a/.config/nvim/lua/lspbinds.lua b/.config/nvim/lua/lspbinds.lua index 56dfad6..4b64ad4 100644 --- a/.config/nvim/lua/lspbinds.lua +++ b/.config/nvim/lua/lspbinds.lua @@ -27,5 +27,4 @@ return function(client, bufnr) vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) - vim.keymap.set('n', 'f', vim.lsp.buf.formatting, bufopts) end diff --git a/.config/nvim/pack/plugins/opt/black b/.config/nvim/pack/plugins/opt/black index 383b228..e2adcd7 160000 --- a/.config/nvim/pack/plugins/opt/black +++ b/.config/nvim/pack/plugins/opt/black @@ -1 +1 @@ -Subproject commit 383b228a1690d9c15ce97bd2e01874596fbf1288 +Subproject commit e2adcd7de10eb570987bb894d95f2ff8c8693b9f diff --git a/.config/nvim/pack/plugins/opt/nvim-lspconfig b/.config/nvim/pack/plugins/opt/nvim-lspconfig index 79d4cb9..51775b1 160000 --- a/.config/nvim/pack/plugins/opt/nvim-lspconfig +++ b/.config/nvim/pack/plugins/opt/nvim-lspconfig @@ -1 +1 @@ -Subproject commit 79d4cb9c45ecf185d2200dd2af1e12829c8a9232 +Subproject commit 51775b12cfbf1b6462c7b13cd020cc09e6767aea diff --git a/.config/nvim/pack/plugins/opt/nvim-treesitter b/.config/nvim/pack/plugins/opt/nvim-treesitter index 2a63ea5..cd9dfc1 160000 --- a/.config/nvim/pack/plugins/opt/nvim-treesitter +++ b/.config/nvim/pack/plugins/opt/nvim-treesitter @@ -1 +1 @@ -Subproject commit 2a63ea5665a6de96acd31a045d9d4d73272ff5a9 +Subproject commit cd9dfc1e48e8ad27b75cf883ba036e83b7079b9a diff --git a/.config/zsh/.p10k.zsh b/.config/zsh/.p10k.zsh index c49c54f..663f041 100644 --- a/.config/zsh/.p10k.zsh +++ b/.config/zsh/.p10k.zsh @@ -541,9 +541,9 @@ typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=0 typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=3 # Show duration of the last command if takes at least this many seconds. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=0 # Show this many fractional digits. Zero means round to seconds. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=2 # Duration format: 1d 2h 3m 4s. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' # Custom icon. diff --git a/.config/zsh/ohmyzsh b/.config/zsh/ohmyzsh index 6d48309..7dcabbe 160000 --- a/.config/zsh/ohmyzsh +++ b/.config/zsh/ohmyzsh @@ -1 +1 @@ -Subproject commit 6d48309cd7da1b91038cf08be7865fb5bb9bc5ea +Subproject commit 7dcabbe6826073ef6069c8a4b6f9a943f00d2df0 diff --git a/.pyenv b/.pyenv index 6a104f6..1d28067 160000 --- a/.pyenv +++ b/.pyenv @@ -1 +1 @@ -Subproject commit 6a104f68d014813fc8a8e270933ac564e094a931 +Subproject commit 1d28067353920f8cd8a9ef72d3675b07adefbe7c diff --git a/bin/dkpurge b/bin/dkpurge index ab70fe6..bd153b5 100755 --- a/bin/dkpurge +++ b/bin/dkpurge @@ -3,7 +3,7 @@ if [ "$1" == '-h' ] || [ "$1" == '--help' ]; then cat << EOF Usage: $0 [Default-answer] -Clean all Docker ressources. +Delete all Docker ressources. root permission not necessary so the binary can be placed in $HOME/[.local/]bin. From f2815ef7f3a9e8ece16ed9251ee16c9950d1fcb5 Mon Sep 17 00:00:00 2001 From: AngeD Date: Fri, 16 Sep 2022 19:24:16 +0200 Subject: [PATCH 3/5] fix volume slider +/-2 instead of 5 --- .config/awesome/rc.lua | 4 ++-- .config/sway/config.d/10-variables.conf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index bdc53aa..b1fc032 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -294,14 +294,14 @@ globalkeys = gears.table.join( awful.key( {}, "XF86AudioRaiseVolume", function() - awful.spawn("set-vol +5") + awful.spawn("set-vol +2") end, {description = "raise volume", group = "shortcut"} ), awful.key( {}, "XF86AudioLowerVolume", function() - awful.spawn("set-vol -5") + awful.spawn("set-vol -2") end, {description = "lower volume", group = "shortcut"} ), diff --git a/.config/sway/config.d/10-variables.conf b/.config/sway/config.d/10-variables.conf index 144a928..5bd84ae 100644 --- a/.config/sway/config.d/10-variables.conf +++ b/.config/sway/config.d/10-variables.conf @@ -13,8 +13,8 @@ set $wallpapers $HOME/.config/wallpapers set $lock swaylock -F -f -i $wallpapers/lock.png set $screenshot grim - | wl-copy set $screenshot_rect grim -g "$(slurp)" - | wl-copy -set $raise_volume set-vol +5 -set $lower_volume set-vol -5 +set $raise_volume set-vol +2 +set $lower_volume set-vol -2 set $raise_backlight set-light +10 set $lower_backlight set-light -10 From 0424c30fd450b98872dfaba702e6deec304cf169 Mon Sep 17 00:00:00 2001 From: AngeD Date: Fri, 16 Sep 2022 19:24:39 +0200 Subject: [PATCH 4/5] add VIRTUAL_ENV variable for pyright --- .zshenv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.zshenv b/.zshenv index 92d978e..fd02bd0 100644 --- a/.zshenv +++ b/.zshenv @@ -1,6 +1,7 @@ export PYENV_ROOT="$HOME/.pyenv" +export VIRTUAL_ENV="$PYENV_ROOT" -path=(~/bin ~/.local/bin "$PYENV_ROOT"/bin $path) +path=(~/bin ~/.local/bin "$VIRTUAL_ENV"/bin $path) export XDG_CACHE_HOME="$HOME"/.cache export XDG_CONFIG_HOME="$HOME"/.config From 0e1adb69be02655a17b0d3718f19de945e6f46ff Mon Sep 17 00:00:00 2001 From: AngeD Date: Fri, 16 Sep 2022 19:27:51 +0200 Subject: [PATCH 5/5] style: fix indentation --- .config/awesome/rc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index b1fc032..9d14f23 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -118,7 +118,7 @@ local function set_wallpaper(s) if type(wallpaper) == "function" then wallpaper = wallpaper(s) end - gears.wallpaper.maximized(wallpaper, s, true) + gears.wallpaper.maximized(wallpaper, s, true) end end