Browse Source

better music dotfiles

Noah Vogt 3 years ago
parent
commit
317dfa376e

+ 12 - 138
dot-config/dunst/dunstrc

@@ -1,153 +1,27 @@
 [global]
     monitor = 0
     follow = keyboard
-    geometry = "350x5-0+24"
-    indicate_hidden = yes
-    shrink = yes
-    transparency = 20
-    notification_height = 0
-    separator_height = 2
-    padding = 0
-    horizontal_padding = 8
-    frame_width = 3
-    frame_color = "#282828"
-
-    # Define a color for the separator.
-    # possible values are:
-    #  * auto: dunst tries to find a color fitting to the background;
-    #  * foreground: use the same color as the foreground;
-    #  * frame: use the same color as the frame;
-    #  * anything else will be interpreted as a X color.
-    separator_color = frame
-
-    # Sort messages by urgency.
-    sort = yes
-
-    idle_threshold = 120
-    font = Monospace 14
-    line_height = 0
-    markup = full
-
-    # The format of the message.  Possible variables are:
-    #   %a  appname
-    #   %s  summary
-    #   %b  body
-    #   %i  iconname (including its path)
-    #   %I  iconname (without its path)
-    #   %p  progress value if set ([  0%] to [100%]) or nothing
-    #   %n  progress value if set without any extra characters
-    #   %%  Literal %
-    # Markup is allowed
+    width = 370
+    height = 350
+    offset = 0x19
+    padding = 2
+    horizontal_padding = 2
+    transparency = 25
+    font = Monospace 12
     format = "<b>%s</b>\n%b"
 
-    alignment = left
-    show_age_threshold = 60
-    word_wrap = yes
-    ellipsize = middle
-    ignore_newline = no
-    stack_duplicates = true
-    hide_duplicate_count = true
-    show_indicators = yes
-    icon_position = left
-    max_icon_size = 40
-    icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/:/usr/share/icons/Adwaita/256x256/status/
-    sticky_history = yes
-    history_length = 20
-    dmenu = /usr/bin/dmenu -p dunst:
-    browser = /usr/bin/firefox -new-tab
-
-    # Always run rule-defined scripts, even if the notification is suppressed
-    always_run_script = true
-
-    title = Dunst
-    class = Dunst
-    startup_notification = false
-    force_xinerama = false
-[experimental]
-    per_monitor_dpi = false
-
-[shortcuts]
-    close = ctrl+space
-    close_all = ctrl+shift+space
-    history = ctrl++shift+h
-    context = ctrl+shift+period
-
 [urgency_low]
-    # IMPORTANT: colors have to be defined in quotation marks.
-    # Otherwise the "#" and following would be interpreted as a comment.
-    background = "#282828"
+    background = "#1d2021"
     foreground = "#928374"
-    timeout = 5
-    # Icon for notifications with low urgency, uncomment to enable
-    #icon = /path/to/icon
+    timeout = 3
 
 [urgency_normal]
-    background = "#458588"
     foreground = "#ebdbb2"
+    background = "#458588"
     timeout = 5
 
 [urgency_critical]
-    background = "#cc2421"
+    background = "#1cc24d"
     foreground = "#ebdbb2"
     frame_color = "#fabd2f"
-    timeout = 0
-
-# Every section that isn't one of the above is interpreted as a rules to
-# override settings for certain messages.
-# Messages can be matched by "appname", "summary", "body", "icon", "category",
-# "msg_urgency" and you can override the "timeout", "urgency", "foreground",
-# "background", "new_icon" and "format".
-# Shell-like globbing will get expanded.
-#
-# SCRIPTING
-# You can specify a script that gets run when the rule matches by
-# setting the "script" option.
-# The script will be called as follows:
-#   script appname summary body icon urgency
-# where urgency can be "LOW", "NORMAL" or "CRITICAL".
-#
-# NOTE: if you don't want a notification to be displayed, set the format
-# to "".
-# NOTE: It might be helpful to run dunst -print in a terminal in order
-# to find fitting options for rules.
-
-#[espeak]
-#    summary = "*"
-#    script = dunst_espeak.sh
-
-#[script-test]
-#    summary = "*script*"
-#    script = dunst_test.sh
-
-#[ignore]
-#    # This notification will not be displayed
-#    summary = "foobar"
-#    format = ""
-
-#[history-ignore]
-#    # This notification will not be saved in history
-#    summary = "foobar"
-#    history_ignore = yes
-
-#[signed_on]
-#    appname = Pidgin
-#    summary = "*signed on*"
-#    urgency = low
-#
-#[signed_off]
-#    appname = Pidgin
-#    summary = *signed off*
-#    urgency = low
-#
-#[says]
-#    appname = Pidgin
-#    summary = *says*
-#    urgency = critical
-#
-#[twitter]
-#    appname = Pidgin
-#    summary = *twitter.com*
-#    urgency = normal
-#
-# vim: ft=cfg
-
+    timeout = 10

+ 23 - 0
dot-config/mpd/mpd.conf

@@ -0,0 +1,23 @@
+music_directory		"~/mus"
+playlist_directory	"~/.local/share/mpd/playlists"
+
+auto_update "yes"
+bind_to_address "127.0.0.1"
+restore_paused "yes"
+max_output_buffer_size "16384"
+
+volume_normalization		"yes"
+
+audio_output {
+	type "pulse"
+	name "pulse"
+	#type  "alsa"
+	#name  "ALSA"
+}
+
+audio_output {
+       type	"fifo"
+       name	"Visualizer feed"
+       path	"/tmp/mpd.fifo"
+       format	"44100:16:2"
+}

+ 479 - 0
dot-config/ncmpcpp/bindings

@@ -0,0 +1,479 @@
+##############################################################
+## This is the example bindings file. Copy it to            ##
+## ~/.ncmpcpp/bindings or $XDG_CONFIG_HOME/ncmpcpp/bindings ##
+## and set up your preferences                              ##
+##############################################################
+#
+#def_key "mouse"
+#  mouse_event
+#
+#def_key "up"
+#  scroll_up
+#
+#def_key "shift-up"
+#  select_item
+#  scroll_up
+#
+#def_key "down"
+#  scroll_down
+#
+#def_key "shift-down"
+#  select_item
+#  scroll_down
+#
+#def_key "["
+#  scroll_up_album
+#
+#def_key "]"
+#  scroll_down_album
+#
+#def_key "{"
+#  scroll_up_artist
+#
+#def_key "}"
+#  scroll_down_artist
+#
+#def_key "page_up"
+#  page_up
+#
+#def_key "page_down"
+#  page_down
+#
+#def_key "home"
+#  move_home
+#
+#def_key "end"
+#  move_end
+#
+#def_key "insert"
+#  select_item
+#
+#def_key "enter"
+#  enter_directory
+#
+#def_key "enter"
+#  toggle_output
+#
+#def_key "enter"
+#  run_action
+#
+#def_key "enter"
+#  play_item
+#
+#def_key "space"
+#  add_item_to_playlist
+#
+#def_key "space"
+#  toggle_lyrics_update_on_song_change
+#
+#def_key "space"
+#  toggle_visualization_type
+#
+#def_key "delete"
+#  delete_playlist_items
+#
+#def_key "delete"
+#  delete_browser_items
+#
+#def_key "delete"
+#  delete_stored_playlist
+#
+#def_key "right"
+#  next_column
+#
+#def_key "right"
+#  slave_screen
+#
+#def_key "right"
+#  volume_up
+#
+#def_key "+"
+#  volume_up
+#
+#def_key "left"
+#  previous_column
+#
+#def_key "left"
+#  master_screen
+#
+#def_key "left"
+#  volume_down
+#
+#def_key "-"
+#  volume_down
+#
+#def_key ":"
+#  execute_command
+#
+#def_key "tab"
+#  next_screen
+#
+#def_key "shift-tab"
+#  previous_screen
+#
+#def_key "f1"
+#  show_help
+#
+#def_key "1"
+#  show_playlist
+#
+#def_key "2"
+#  show_browser
+#
+#def_key "2"
+#  change_browse_mode
+#
+#def_key "3"
+#  show_search_engine
+#
+#def_key "3"
+#  reset_search_engine
+#
+#def_key "4"
+#  show_media_library
+#
+#def_key "4"
+#  toggle_media_library_columns_mode
+#
+#def_key "5"
+#  show_playlist_editor
+#
+#def_key "6"
+#  show_tag_editor
+#
+#def_key "7"
+#  show_outputs
+#
+#def_key "8"
+#  show_visualizer
+#
+#def_key "="
+#  show_clock
+#
+#def_key "@"
+#  show_server_info
+#
+#def_key "s"
+#  stop
+#
+#def_key "p"
+#  pause
+#
+#def_key ">"
+#  next
+#
+#def_key "<"
+#  previous
+#
+#def_key "ctrl-h"
+#  jump_to_parent_directory
+#
+#def_key "ctrl-h"
+#  replay_song
+#
+#def_key "backspace"
+#  jump_to_parent_directory
+#
+#def_key "backspace"
+#  replay_song
+#
+#def_key "f"
+#  seek_forward
+#
+#def_key "b"
+#  seek_backward
+#
+#def_key "r"
+#  toggle_repeat
+#
+#def_key "z"
+#  toggle_random
+#
+#def_key "y"
+#  save_tag_changes
+#
+#def_key "y"
+#  start_searching
+#
+#def_key "y"
+#  toggle_single
+#
+#def_key "R"
+#  toggle_consume
+#
+#def_key "Y"
+#  toggle_replay_gain_mode
+#
+#def_key "T"
+#  toggle_add_mode
+#
+#def_key "|"
+#  toggle_mouse
+#
+#def_key "#"
+#  toggle_bitrate_visibility
+#
+#def_key "Z"
+#  shuffle
+#
+#def_key "x"
+#  toggle_crossfade
+#
+#def_key "X"
+#  set_crossfade
+#
+#def_key "u"
+#  update_database
+#
+#def_key "ctrl-s"
+#  sort_playlist
+#
+#def_key "ctrl-s"
+#  toggle_browser_sort_mode
+#
+#def_key "ctrl-s"
+#  toggle_media_library_sort_mode
+#
+#def_key "ctrl-r"
+#  reverse_playlist
+#
+#def_key "ctrl-f"
+#  apply_filter
+#
+#def_key "ctrl-_"
+#  select_found_items
+#
+#def_key "/"
+#  find
+#
+#def_key "/"
+#  find_item_forward
+#
+#def_key "?"
+#  find
+#
+#def_key "?"
+#  find_item_backward
+#
+#def_key "."
+#  next_found_item
+#
+#def_key ","
+#  previous_found_item
+#
+#def_key "w"
+#  toggle_find_mode
+#
+#def_key "e"
+#  edit_song
+#
+#def_key "e"
+#  edit_library_tag
+#
+#def_key "e"
+#  edit_library_album
+#
+#def_key "e"
+#  edit_directory_name
+#
+#def_key "e"
+#  edit_playlist_name
+#
+#def_key "e"
+#  edit_lyrics
+#
+#def_key "i"
+#  show_song_info
+#
+#def_key "I"
+#  show_artist_info
+#
+#def_key "g"
+#  jump_to_position_in_song
+#
+#def_key "l"
+#  show_lyrics
+#
+#def_key "ctrl-v"
+#  select_range
+#
+#def_key "v"
+#  reverse_selection
+#
+#def_key "V"
+#  remove_selection
+#
+#def_key "B"
+#  select_album
+#
+#def_key "a"
+#  add_selected_items
+#
+#def_key "c"
+#  clear_playlist
+#
+#def_key "c"
+#  clear_main_playlist
+#
+#def_key "C"
+#  crop_playlist
+#
+#def_key "C"
+#  crop_main_playlist
+#
+#def_key "m"
+#  move_sort_order_up
+#
+#def_key "m"
+#  move_selected_items_up
+#
+#def_key "n"
+#  move_sort_order_down
+#
+#def_key "n"
+#  move_selected_items_down
+#
+#def_key "M"
+#  move_selected_items_to
+#
+#def_key "A"
+#  add
+#
+#def_key "S"
+#  save_playlist
+#
+#def_key "o"
+#  jump_to_playing_song
+#
+#def_key "G"
+#  jump_to_browser
+#
+#def_key "G"
+#  jump_to_playlist_editor
+#
+#def_key "~"
+#  jump_to_media_library
+#
+#def_key "E"
+#  jump_to_tag_editor
+#
+#def_key "U"
+#  toggle_playing_song_centering
+#
+#def_key "P"
+#  toggle_display_mode
+#
+#def_key "\\"
+#  toggle_interface
+#
+#def_key "!"
+#  toggle_separators_between_albums
+#
+#def_key "L"
+#  toggle_lyrics_fetcher
+#
+#def_key "F"
+#  fetch_lyrics_in_background
+#
+#def_key "alt-l"
+#  toggle_fetching_lyrics_in_background
+#
+#def_key "ctrl-l"
+#  toggle_screen_lock
+#
+#def_key "`"
+#  toggle_library_tag_type
+#
+#def_key "`"
+#  refetch_lyrics
+#
+#def_key "`"
+#  add_random_items
+#
+#def_key "ctrl-p"
+#  set_selected_items_priority
+#
+#def_key "q"
+#  quit
+#
+#
+#def_key "f"
+#	find
+#def_key "f"
+#	find_item_forward
+
+def_key "+"
+    show_clock
+def_key "="
+    volume_up
+
+def_key "j"
+    scroll_down
+def_key "k"
+    scroll_up
+
+def_key "ctrl-u"
+    page_up
+#push_characters "kkkkkkkkkkkkkkk"
+def_key "ctrl-d"
+    page_down
+#push_characters "jjjjjjjjjjjjjjj"
+def_key "u"
+    page_up
+#push_characters "kkkkkkkkkkkkkkk"
+def_key "d"
+    page_down
+#push_characters "jjjjjjjjjjjjjjj"
+def_key "h"
+    previous_column
+def_key "l"
+    next_column
+
+def_key "."
+    show_lyrics
+
+def_key "n"
+    next_found_item
+def_key "N"
+    previous_found_item
+
+# not used but bound
+def_key "J"
+    move_sort_order_down
+def_key "K"
+    move_sort_order_up
+def_key "h"
+  jump_to_parent_directory
+def_key "l"
+  enter_directory
+def_key "l"
+  run_action
+def_key "l"
+  play_item
+def_key "m"
+  show_media_library
+def_key "m"
+  toggle_media_library_columns_mode
+def_key "t"
+  show_tag_editor
+def_key "v"
+  show_visualizer
+def_key "G"
+  move_end
+def_key "g"
+  move_home
+#jump_to_position_in_song
+def_key "U"
+  update_database
+def_key "s"
+  reset_search_engine
+def_key "s"
+  show_search_engine
+def_key "f"
+  show_browser
+def_key "f"
+  change_browse_mode
+def_key "x"
+  delete_playlist_items
+def_key "P"
+  show_playlist

+ 32 - 0
dot-config/ncmpcpp/config

@@ -0,0 +1,32 @@
+# vim: filetype=conf
+
+ncmpcpp_directory = "~/.config/ncmpcpp"
+lyrics_directory = "~/.local/share/lyrics"
+mpd_music_dir = "~/Music"
+message_delay_time = "1"
+visualizer_type = "spectrum"
+song_list_format = {$4%a - }{%t}|{$8%f$9}$R{$3(%l)$9}
+song_status_format = $b{{$8"%t"}} $3by {$4%a{ $3in $7%b{ (%y)}} $3}|{$8%f}
+song_library_format = {%n - }{%t}|{%f}
+alternative_header_first_line_format = $b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b
+alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}
+current_item_prefix = $(cyan)$r$b
+current_item_suffix = $/r$(end)$/b
+current_item_inactive_column_prefix = $(magenta)$r
+current_item_inactive_column_suffix = $/r$(end)
+playlist_display_mode = columns
+browser_display_mode = columns
+progressbar_look = ->
+media_library_primary_tag = album_artist
+media_library_albums_split_by_date = no
+startup_screen = "media_library"
+display_volume_level = no
+ignore_leading_the = yes
+external_editor = nvim
+use_console_editor = yes
+empty_tag_color = magenta
+main_window_color = white
+progressbar_color = black:b
+progressbar_elapsed_color = blue:b
+statusbar_color = red
+statusbar_time_color = cyan:b

+ 2 - 1
dot-config/picom.conf

@@ -8,5 +8,6 @@ shadow = true;
 round-borders = 1;
 corner-radius = 15.0;
 rounded-corners-exclude = [
-  "class_g = 'dwm'"
+  "class_g = 'dwm'",
+  "class_g = 'Dunst'"
 ];

+ 56 - 25
dot-config/xbindkeys/config

@@ -1,19 +1,3 @@
-"dec-kbd-blt"
-   XF86KbdBrightnessDown
-"dec-kbd-blt"
-   Mod4 + F9
-
-"inc-kbd-blt"
-   XF86KbdBrightnessUp
-"inc-kbd-blt"
-   Mod4 + F10
-
-"rfkill toggle wifi && pkill -RTMIN+3 dwmblocks"
-   Mod4 + F5
-
-"rfkill toggle all && pkill -RTMIN+3 dwmblocks"
-   Mod4 + F4
-
 # toggle mute
 "amixer set Master toggle && pkill -RTMIN+1 dwmblocks"
    XF86AudioMute
@@ -32,6 +16,16 @@
 "amixer set Master 5%+ && pkill -RTMIN+1 dwmblocks"
    Mod4 + F3
 
+"rfkill toggle all && pkill -RTMIN+3 dwmblocks"
+   Mod4 + F4
+
+"rfkill toggle wifi && pkill -RTMIN+3 dwmblocks"
+   Mod4 + F5
+
+# open htop in new terminal window
+"st -e htop"
+   Mod4 + F6
+
 # dmenu mount prompt
 "dmenumount"
    Mod4 + F7
@@ -40,16 +34,26 @@
 "dmenuumount"
    Mod4 + F8
 
+"dec-kbd-blt"
+   XF86KbdBrightnessDown
+"dec-kbd-blt"
+   Mod4 + F9
+
+"inc-kbd-blt"
+   XF86KbdBrightnessUp
+"inc-kbd-blt"
+   Mod4 + F10
+
 # decrease monitor brightness
-"dec-brightness && brightness-save && set-brt"
+"dec-brightness 5 && brightness-save && set-brt"
    XF86MonBrightnessDown
-"dec-brightness && brightness-save && set-brt"
+"dec-brightness 5 && brightness-save && set-brt"
    Mod4 + F11
 
 # increase monitor brightness
-"inc-brightness && brightness-save && set-brt"
+"inc-brightness 5 && brightness-save && set-brt"
    XF86MonBrightnessUp
-"inc-brightness && brightness-save && set-brt"
+"inc-brightness 5 && brightness-save && set-brt"
    Mod4 + F12
 
 # select area of screenshot
@@ -93,13 +97,40 @@
    Mod4 + A
 
 # open newsboat in new terminal window
-"st-exec newsboat"
+"st -e newsboat"
    Mod4 + U
 
 # open neomutt in new terminal window
-"st-exec neomutt"
+"st -e neomutt"
    Mod4 + Z
 
-# open htop in new terminal window
-"st-exec htop"
-   Mod4 + F6
+# open ncmpcpp in new terminal window
+"st -e ncmpcpp"
+   Mod4 + section
+
+
+### MPD CPMMANDS
+
+"mpc next"
+   XF86AudioNext
+"mpc next"
+   Mod4 + Shift + less
+
+"mpc prev"
+   XF86AudioPrev
+"mpc prev"
+   Mod4 + less
+
+"mpc toggle"
+  XF86AudioPlay
+"mpc toggle"
+   Mod4 + Y
+
+"mpc seek -00:00:05"
+   Mod4 + Left
+
+"mpc seek +00:00:05"
+   Mod4 + Right
+
+"echo \"$(mpc current)\" | xargs notify-send"
+   Mod4 + C

+ 17 - 8
local-bin/battery

@@ -1,14 +1,23 @@
-#!/bin/bash
+#!/bin/sh
 
 # script to display the battery state in dwmblocks
 
-acpi -b | grep -q "Battery 0" || { printf ""; exit; }
+#acpi -b | grep -q "Battery 0" || { printf ""; exit; }
+#
+#BATTERYSTATE=$( acpi -b | awk '{ split($5,a,":"); print substr($3,0,2), $4, "["a[1]":"a[2]"]" }' | tr -d ',DiFu' )
+#if [[ $BATTERYSTATE =~ "Ch" ]]; then
+    #icon="⚡"
+#else
+    #icon="🔋"
+#fi
+#batterypercent=$(echo "$BATTERYSTATE" | tr -d 'Ch' | sed 's/cargng:/?/')
 
-BATTERYSTATE=$( acpi -b | awk '{ split($5,a,":"); print substr($3,0,2), $4, "["a[1]":"a[2]"]" }' | tr -d ',DiFu' )
-if [[ $BATTERYSTATE =~ "Ch" ]]; then
-    icon="⚡"
-else
+if grep -q 'Discharging' /sys/class/power_supply/BAT0/status; then
     icon="🔋"
+elif grep -q 'Charging' /sys/class/power_supply/BAT0/status; then
+    icon="⚡"
+elif grep -q 'Full' /sys/class/power_supply/BAT0/status; then
+    icon="🔌"
 fi
-batterypercent=$(echo "$BATTERYSTATE" | tr -d 'Ch' | sed 's/cargng:/?/')
-printf "%s%s\\n" "$icon" "$batterypercent"
+
+printf "%s %s%%\\n" "$icon" "$(cat /sys/class/power_supply/BAT0/capacity)"

+ 5 - 2
local-bin/brightness

@@ -2,9 +2,12 @@
 
 # script to display the brightness state in dwmblocks
 
+#printf "🔆 %s%%\\n" "$(xbacklight -get | sed 's/\..*$//')"
+#exit
+
 device=$(brightnessctl -l | grep "class 'backlight'" | tail -n +3 | awk '{print $2}' | tr -d "'")
-if brightnessctl -l | grep "class 'backlight'" | grep -q "^Device 'acpi_video0'"; then
-    device="acpi_video0"
+if brightnessctl -l | grep "class 'backlight'" | grep -q "^Device 'intel_backlight'"; then
+    device="intel_backlight"
 fi
 [ -z "$device" ] && { printf ""; exit; }
 

+ 2 - 2
local-bin/brightness-save

@@ -3,8 +3,8 @@
 # script to save the brightness state so it is the same after a restart
 
 device=$(brightnessctl -l | grep "class 'backlight'" | tail -n +3 | awk '{print $2}' | tr -d "'")
-if brightnessctl -l | grep "class 'backlight'" | grep -q "^Device 'acpi_video0'"; then
-    device="acpi_video0"
+if brightnessctl -l | grep "class 'backlight'" | grep -q "^Device 'intel_backlight'"; then
+    device="intel_backlight"
 fi
 [ -z "$device" ] && { printf ""; exit; }
 

+ 9 - 4
local-bin/dec-brightness

@@ -1,12 +1,17 @@
 #!/bin/sh
 
-# script to decrease the display brightness by 5%
+# script to decrease the display brightness by $1%
+
+[ -z "$1" ] && echo "Error: please give percent as argument" && exit 1
+
+#xbacklight -dec "$1"
+#exit
 
 device=$(brightnessctl -l | grep "class 'backlight'" | tail -n +3 | awk '{print $2}' | tr -d "'")
-if brightnessctl -l | grep "class 'backlight'" | grep -q "^Device 'acpi_video0'"; then
-    device="acpi_video0"
+if brightnessctl -l | grep "class 'backlight'" | grep -q "^Device 'intel_backlight'"; then
+    device="intel_backlight"
 fi
 
-brightness=$(brightnessctl -d "${device}" | grep Current | awk -F '[)(]' '{print $2 - 5}')
+brightness=$(brightnessctl -d "${device}" | grep Current | awk -F '[)(]' "{print \$2 - $1}")
 
 brightnessctl -d "${device}" set "$brightness"%

+ 9 - 4
local-bin/inc-brightness

@@ -1,13 +1,18 @@
 #!/bin/sh
 
-# script to increase the display brightness by 5%
+# script to increase the display brightness by $1%
+
+[ -z "$1" ] && echo "Error: please give percent as argument" && exit 1
+
+#xbacklight -inc "$1"
+#exit
 
 device=$(brightnessctl -l | grep "class 'backlight'" | tail -n +3 | awk '{print $2}' | tr -d "'")
-if brightnessctl -l | grep "class 'backlight'" | grep -q "^Device 'acpi_video0'"; then
-    device="acpi_video0"
+if brightnessctl -l | grep "class 'backlight'" | grep -q "^Device 'intel_backlight'"; then
+    device="intel_backlight"
 fi
 
-brightness=$(brightnessctl -d "${device}" | grep Current | awk -F '[)(]' '{print $2 + 5}')
+brightness=$(brightnessctl -d "${device}" | grep Current | awk -F '[)(]' "{print \$2 + $1}")
 
 if [ "$(cat .config/norisa/brightness-state)" -eq "100" ]; then
     exit 1

+ 12 - 13
local-bin/internet

@@ -5,12 +5,15 @@ wifi=$(iwgetid -r)
 upstate=$(ip a | grep BROADCAST,MULTICAST | awk '{print $9}')
 if [ -z "$wifi" ]; then
     if echo "$upstate" | grep -q "DOWN"; then
-        if [ "$(rfkill | grep 'blocked' | awk '{print $4 $5}' | sed 's/unblocked//g' | uniq | wc -l)" -eq "1" ]; then
-            if [ "$(rfkill | grep 'blocked' | awk '{print $4 $5}' | sed 's/unblocked//g' | grep . | wc -l)" -gt "0" ]; then
-                echo "📡 off"; exit
+        if [ "$(rfkill | grep 'blocked' | awk '{print $4 $5}' | \
+            sed 's/unblocked//g' | uniq | wc -l)" -eq "1" ]; then
+                if [ "$(rfkill | grep 'blocked' | awk '{print $4 $5}' | \
+                    sed 's/unblocked//g' | grep . | wc -l)" -gt "0" ]; then
+                        echo "📡 off"; exit
             fi
-        elif rfkill list wifi | grep 'Soft blocked' | awk '{print $3}' | grep -q 'yes'; then
-            echo "📶 off"; exit
+        elif rfkill list wifi | grep 'Soft blocked' | awk '{print $3}' | \
+            grep -q 'yes'; then
+                echo "📶 off"; exit
         fi
     fi
     printf "%s\\n" "🔌 $upstate"; exit
@@ -21,17 +24,13 @@ if [ -z "$wifi" ]; then
 
 		percent=$(awk '/^\s*w/ { print int($3 * 100 / 70) }' \
                   /proc/net/wireless | head -n 1)
-		if [ "$percent" -gt 80 ];
-		then
+		if [ "$percent" -gt 80 ]; then
 			echo "🟩🟩🟩🟩🟩"
-		elif [ "$percent" -gt 60 ];
-		then
+		elif [ "$percent" -gt 60 ]; then
 			echo "🟩🟩🟩🟩🟧"
-		elif [ "$percent" -gt 40 ];
-		then
+		elif [ "$percent" -gt 40 ]; then
 			echo "🟩🟩🟩🟧🟧"
-		elif [ "$percent" -gt 20 ];
-		then
+		elif [ "$percent" -gt 20 ]; then
 			echo "🟩🟩🟧🟧🟧"
 		else
 			echo "🟩🟧🟧🟧🟧"