diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-02-12 06:55:21 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-02-12 06:55:21 +0900 |
| commit | cf369fa72f5863b04b8e6755040a744ab248130a (patch) | |
| tree | f62740de8c97f56eb8754738aebc68c4884b276f | |
| parent | f6a3b6ccb678823f1296b95c38c4fad4c895b0f2 (diff) | |
modified qutebrowser/config.py, modified statusbar/sb-music
| -rw-r--r-- | ar/.config/qutebrowser/config.py | 10 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-music | 21 |
2 files changed, 16 insertions, 15 deletions
diff --git a/ar/.config/qutebrowser/config.py b/ar/.config/qutebrowser/config.py index 167f130..756be73 100644 --- a/ar/.config/qutebrowser/config.py +++ b/ar/.config/qutebrowser/config.py @@ -707,7 +707,7 @@ c.content.autoplay = False ## - adblock: Use Brave's ABP-style adblocker ## - hosts: Use hosts blocking ## - both: Use both hosts blocking and Brave's ABP-style adblocker -# c.content.blocking.method = "auto" +c.content.blocking.method = "both" ## A list of patterns that should always be loaded, despite being blocked ## by the ad-/host-blocker. Local domains are always exempt from @@ -1232,7 +1232,7 @@ c.editor.command = ["st", "-e", "nvim", "{file}", "+{line}", "+normal {column0}l ## Filename of the file to be written to. If not contained in any ## argument, the standard output of the command is read instead. ## Type: ShellCommand -# c.fileselect.folder.command = ['xterm', '-e', 'ranger', '--choosedir={}'] +c.fileselect.folder.command = ["st", "-e", "lf", "{}"] ## Handler for selecting file(s) in forms. If `external`, then the ## commands specified by `fileselect.single_file.command`, @@ -1252,7 +1252,7 @@ c.editor.command = ["st", "-e", "nvim", "{file}", "+{line}", "+normal {column0}l ## contained in any argument, the standard output of the command is ## read instead. ## Type: ShellCommand -# c.fileselect.multiple_files.command = ['xterm', '-e', 'ranger', '--choosefiles={}'] +c.fileselect.multiple_files.command = ["st", "-e", "lf", "{}"] ## Command (and arguments) to use for selecting a single file in forms. ## The command should write the selected file path to the specified file @@ -1260,7 +1260,7 @@ c.editor.command = ["st", "-e", "nvim", "{file}", "+{line}", "+normal {column0}l ## the file to be written to. If not contained in any argument, the ## standard output of the command is read instead. ## Type: ShellCommand -# c.fileselect.single_file.command = ['xterm', '-e', 'ranger', '--choosefile={}'] +c.fileselect.single_file.command = ["st", "-e", "lf", "{}"] ## Font used in the completion categories. ## Type: Font @@ -1384,7 +1384,7 @@ c.editor.command = ["st", "-e", "nvim", "{file}", "+{line}", "+normal {column0}l ## - unique-match: Auto-follow whenever there is a unique non-empty match in either the hint string (word mode) or filter (number mode). ## - full-match: Follow the hint when the user typed the whole hint (letter, word or number mode) or the element's text (only in number mode). ## - never: The user will always need to press Enter to follow a hint. -c.hints.auto_follow = "unique-match" +# c.hints.auto_follow = "unique-match" ## Duration (in milliseconds) to ignore normal-mode key bindings after a ## successful auto-follow. diff --git a/ar/.local/bin/statusbar/sb-music b/ar/.local/bin/statusbar/sb-music index b852378..61e6777 100755 --- a/ar/.local/bin/statusbar/sb-music +++ b/ar/.local/bin/statusbar/sb-music @@ -12,7 +12,7 @@ truncate_string() { filter() { if ps -C mpd >/dev/null 2>&1; then - screen_width=$(xrandr | grep '\*' | awk '{print $1}' | cut -d'x' -f1) + screen_width=$(xrandr | awk '/\*/ {split($1, res, "x"); print res[1]; exit}') artist=$(mpc current -f %artist%) title=$(mpc current -f %title%) @@ -36,20 +36,21 @@ filter() { [ "$(mpc status %random%)" = "on" ] && indicators="${indicators}🔂" [ "$(mpc status %repeat%)" = "on" ] && indicators="${indicators}🔁" - sig=$(grep "${0##*/}" "${XDG_SOURCES_HOME:-${HOME}/.local/src}/suckless/dwmblocks/config.def.h" | awk -F',' '{print $3}') - case $sig in - *0*) - echo "$prefix$artist - $title$([ -n "$indicators" ] && echo "$indicators")" - ;; - *1*) - echo "$prefix$artist - $title $(mpc status %currenttime%)/$(mpc status %totaltime%)$([ -n "$indicators" ] && echo "$indicators")" + case "$(awk -F',' -v name="${0##*/}" '$0 ~ name {gsub(/[[:space:]]/, "", $3); print $3}' "${XDG_SOURCES_HOME:-${HOME}/.local/src}/suckless/dwmblocks/config.def.h")" in + 0) echo "$prefix$artist - $title${indicators:+$indicators}" ;; + [1-9]*) + current_time=$(mpc status %currenttime%) + total_time=$(mpc status %totaltime%) + echo "$prefix$artist - $title ${current_time:+$current_time/}$total_time${indicators:+$indicators}" ;; + *) return ;; esac + fi } -[ "$(grep "${0##*/}" "${XDG_SOURCES_HOME:-${HOME}/.local/src}/suckless/dwmblocks/config.def.h" | awk -F',' '{print $3}')" -eq 0 ] && { - pidof -x sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 & +[ "$(awk -F',' -v name="${0##*/}" '$0 ~ name {print $3; exit}' "${XDG_SOURCES_HOME:-${HOME}/.local/src}/suckless/dwmblocks/config.def.h")" -eq 0 ] && { + pidof -x sb-mpdup >/dev/null 2>&1 || (kill -57 "$(pidof "${STATUSBAR:-dwmblocks}")" && sb-mpdup >/dev/null 2>&1 &) } # Handling interaction based on button press |
