Add files via upload
This commit is contained in:
915
config/polybar/config.ini
Normal file
915
config/polybar/config.ini
Normal file
@@ -0,0 +1,915 @@
|
||||
[colors]
|
||||
fg-blue = #eee
|
||||
focus-dark = #1b2124
|
||||
blue = #73d0ff
|
||||
blue-darker = #000000
|
||||
archlogo = #cd241d
|
||||
green = #bae67e
|
||||
dark-green = #75c933
|
||||
red = #ff3333
|
||||
bg = #800A0E14
|
||||
fg = #bfbab0
|
||||
cyan = #95e6cb
|
||||
alpha = #00000000
|
||||
white = #fff
|
||||
yellow = #FFFF00
|
||||
lime = #00FF00
|
||||
fuchsia = #FF00FF
|
||||
double_white= #D5C4A1
|
||||
dunst = #EC6238
|
||||
golden_glow = #FFDE7D
|
||||
check_update = #bdae93
|
||||
#dunst = #808080
|
||||
|
||||
[gruvbox]
|
||||
black = #000000
|
||||
dark = #1d1d1d
|
||||
disabled = #262626
|
||||
red = #ea6962
|
||||
red-alt = #b22222
|
||||
orange = #fe8019
|
||||
orange-mat = #e78a4e
|
||||
yellow = #fabd2f
|
||||
yellow-mat = #d8a657
|
||||
green = #b8bb28
|
||||
green-alt = #98971a
|
||||
aqua = #8ec07c
|
||||
aqua-lm = #427b58
|
||||
purple = #d3869b
|
||||
purle-alt = #b162b6
|
||||
purple-lm = #8f3f71
|
||||
aqua-alt = #689d6a
|
||||
blue = #458588
|
||||
blue-alt = #83a598
|
||||
blue-lm = #076678
|
||||
grey = #313131
|
||||
orange-dark = #af3a03
|
||||
dark-grey = #222222
|
||||
cream = #ebdbb2
|
||||
white = #FFFFFF
|
||||
transparent = #00000000
|
||||
Stransparent = #CC000000
|
||||
|
||||
|
||||
|
||||
[bar/top]
|
||||
monitor = DisplayPort-0
|
||||
;monitor = HDMI-0
|
||||
|
||||
override-redirect = false
|
||||
locale = ru_RU.utf8
|
||||
|
||||
; Put the bar at the bottom of the screen
|
||||
bottom = false
|
||||
|
||||
; Prefer fixed center position for the `modules-center` block
|
||||
fixed-center = true
|
||||
|
||||
width = 100%
|
||||
height = 30
|
||||
|
||||
;offset-x =
|
||||
;offset-y =
|
||||
|
||||
; Background ARGB color (e.g. #f00, #ff992a, #ddff1023)
|
||||
background = ${colors.bg}
|
||||
|
||||
; Foreground ARGB color (e.g. #f00, #ff992a, #ddff1023)
|
||||
foreground = ${colors.fg}
|
||||
|
||||
line-size = 0
|
||||
line-color = #fff
|
||||
|
||||
; Number of spaces to add at the beginning/end of the bar
|
||||
; Individual side values can be defined using:
|
||||
; padding-{left,right}
|
||||
padding-right = 0
|
||||
padding-left = 0
|
||||
|
||||
; Number of spaces to add before/after each module
|
||||
; Individual side values can be defined using:
|
||||
; module-margin-{left,right}
|
||||
module-margin = 0
|
||||
|
||||
font-0 = "Iosevka Term:pixelsize=13;4"
|
||||
font-1 = "Ubuntu Mono:style=Medium:pixelsize=7;1"
|
||||
;;font-2 = "Noto Color Emoji:scale=5.5;3"
|
||||
;;font-2 = "Noto Color Emoji:pixelsize=16:style=Regular"
|
||||
;;font-2 = "Weather Icons:size=12;1"
|
||||
;;;;;;font-1 = "Ubuntu:style=Medium:pixelsize=6;1"
|
||||
;font-2 = "JetBrainsMono Nerd Font:size=10;0"
|
||||
;font-3 = "FontAwesome 5 Free:size=10:style=Solid;3"
|
||||
|
||||
; Стандартный шрифт
|
||||
;font-1 = "Iosevka Term:pixelsize=6;1"
|
||||
|
||||
; Define modules fot the bar
|
||||
; All modules need not be added here
|
||||
modules-left = sps66 powermenu sps6 bspwm sps0 obsidian hedgedoc vert sps00 title mode
|
||||
modules-center =
|
||||
modules-right = sps11 netspeed sps sps_note1 nvim_notes sps_note0 sps12 checkupdates sps1 sps22 xkeyboard sps2 sps33 pulseaudio sps3 sps44 cpu sps4 sps55 cputemp sps5 sps66 memory sps6 sps77 date sps7 sps88 dunst sps8 sps_stop_src1 stop_screensaver sps_stop_src0 sps99 wireguard sps9
|
||||
; Following modules are not enabled by default in Endeavour OS Bspwm Edition
|
||||
;
|
||||
; 1. mpd - Shows current playing track info.
|
||||
; Need to set host and port in module definition.
|
||||
;
|
||||
; 2. mpd_control - Shows previous, play/pause, next button to
|
||||
; control music playback via mpd.
|
||||
; Need to set host and port in module definition.
|
||||
;
|
||||
; 3. netspeed - Displays real time network speed
|
||||
; Need to set correct interface name in module definition.
|
||||
|
||||
; The separator will be inserted between the output of each module
|
||||
separator =
|
||||
|
||||
; This value is used to add extra spacing between elements
|
||||
; @deprecated: This parameter will be removed in an upcoming version
|
||||
spacing = 0
|
||||
|
||||
; Opacity value between 0.0 and 1.0 used on fade in/out
|
||||
dim-value = 1.0
|
||||
|
||||
;wm-name = i3
|
||||
|
||||
; Position of the system tray window
|
||||
; If empty or undefined, tray support will be disabled
|
||||
; NOTE: A center aligned tray will cover center aligned modules
|
||||
;
|
||||
; Available positions:
|
||||
; left
|
||||
; center
|
||||
; right
|
||||
; none
|
||||
;tray-position = right
|
||||
;;;;;;;;;;tray-position = none
|
||||
|
||||
; If true, the bar will not shift its
|
||||
; contents when the tray changes
|
||||
;;;;;;;;;;tray-detached = false
|
||||
|
||||
; Tray icon max size
|
||||
;;;;;;;;;;tray-maxsize = 16
|
||||
|
||||
;;;;;;;;;;tray-background = ${colors.bg}
|
||||
;offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
|
||||
|
||||
;;;;;;;;;;tray-offset-x = 0
|
||||
;;;;;;;;;;tray-offset-y = 0
|
||||
|
||||
; Pad the sides of each tray icon
|
||||
;;;;;;;;;;tray-padding = 2
|
||||
|
||||
; Scale factor for tray clients
|
||||
;;;;;;;;;;tray-scale = 1
|
||||
|
||||
wm-restack = bspwm
|
||||
|
||||
;dpi-x = 133
|
||||
;dpi-y = 133
|
||||
dpi-x = 180
|
||||
dpi-y = 180
|
||||
|
||||
enable-ipc = true
|
||||
|
||||
;border-left-size = 1%
|
||||
;border-right-size = 1%
|
||||
;border-top-size = 1%
|
||||
;border-bottom-size = 25
|
||||
border-color = ${colors.alpha}
|
||||
|
||||
[module/tray]
|
||||
type = internal/tray
|
||||
|
||||
tray-position = modules-right
|
||||
tray-maxsize = 16
|
||||
tray-padding = 0px
|
||||
tray-spacing = 8px
|
||||
format-margin = 8px
|
||||
|
||||
[module/bspwm]
|
||||
type = internal/bspwm
|
||||
pin-workspaces = true
|
||||
inline-mode = false
|
||||
enable-click = true
|
||||
enable-scroll = true
|
||||
reverse-scroll = false
|
||||
fuzzy-match = true
|
||||
|
||||
ws-icon-0 = "I;%{T1} %{T-}"
|
||||
;ws-icon-1 = "II;%{T1} %{T-}"
|
||||
ws-icon-1 = "II;%{T1} %{T-}"
|
||||
ws-icon-2 = "III;%{T1} %{T-}"
|
||||
ws-icon-3 = "IV;%{T1} %{T-}"
|
||||
ws-icon-4 = "V;%{T1} %{T-}"
|
||||
ws-icon-5 = "VI;%{T1} 說 %{T-}"
|
||||
ws-icon-6 = "VII;%{T1} ﰭ %{T-}"
|
||||
;ws-icon-7 = "VIII;%{T1} 磊 %{T-}"
|
||||
ws-icon-7 = "VIII;%{T1} 輸 %{T-}"
|
||||
ws-icon-8 = "IX;%{T1} 藍 %{T-}"
|
||||
ws-icon-9 = "X;%{T1} %{T-}"
|
||||
ws-icon-default = %{T1} %{T-}
|
||||
|
||||
format = <label-state> <label-mode>
|
||||
|
||||
label-monitor = %name%
|
||||
|
||||
;label-dimmed-foreground = #555
|
||||
;label-dimmed-underline = ${bar/top.background}
|
||||
;label-dimmed-focused-background = #f00
|
||||
|
||||
label-mode = %mode%
|
||||
label-mode-padding = 1
|
||||
label-mode-background = ${gruvbox.red-alt}
|
||||
label-mode-foreground = ${gruvbox.white}
|
||||
|
||||
label-focused = %icon%
|
||||
label-focused-foreground = ${gruvbox.yellow}
|
||||
label-focused-background = ${gruvbox.disabled}
|
||||
;label-focused-underline = #fba922
|
||||
;
|
||||
label-unfocused = %icon%
|
||||
label-unfocused-font = 5
|
||||
label-unfocused-foreground = ${gruvbox.cream}
|
||||
label-unfocused-background= ${gruvbox.black}
|
||||
|
||||
label-urgent = %icon%
|
||||
label-urgent-font = 5
|
||||
label-urgent-foreground = ${gruvbox.red}
|
||||
;label-urgent-background= ${gruvbox.grey}
|
||||
|
||||
label-occupied = %icon%
|
||||
label-occupied-padding = 0
|
||||
label-occupied-foreground = ${gruvbox.blue}
|
||||
|
||||
label-empty = %icon%
|
||||
label-empty-foreground = #55
|
||||
label-empty-padding = 0
|
||||
|
||||
label-separator =
|
||||
label-separator-padding = 0
|
||||
label-separator-foreground = ${gruvbox.transparent}
|
||||
|
||||
|
||||
[module/mode]
|
||||
type = internal/bspwm
|
||||
|
||||
format = <label-mode>
|
||||
format-background = ${colors.bg}
|
||||
format-foreground = ${colors.red}
|
||||
;format-padding = 1
|
||||
|
||||
;label-monocle = "Monocle"
|
||||
;label-tiled = "%{T-}%{T2}[Tiled]%{T-}"
|
||||
|
||||
;label-floating = ", Float"
|
||||
;label-pseudotiled = ", Pseudo"
|
||||
;label-fullscreen = ", Full"
|
||||
|
||||
label-locked = "%{T2}%{T-}"
|
||||
label-sticky = "%{T2}%{T-}"
|
||||
label-private = "%{T2}PR%{T-}"
|
||||
|
||||
|
||||
[module/xkeyboard]
|
||||
type = internal/xkeyboard
|
||||
|
||||
; Available tags:
|
||||
; <label-layout> (default)
|
||||
; <label-indicator> (default)
|
||||
format = <label-layout> <label-indicator>
|
||||
format-spacing = 0
|
||||
|
||||
; Available tokens:
|
||||
; %layout%
|
||||
; %name%
|
||||
; %number%
|
||||
; %icon%
|
||||
; %variant% (New in version 3.6.0)
|
||||
; Default: %layout%
|
||||
label-layout = %icon%
|
||||
label-layout-padding = 1
|
||||
;label-layout-background = #bc99ed
|
||||
label-layout-foreground = ${gruvbox.cream}
|
||||
label-layout-background = ${gruvbox.aqua-lm}
|
||||
|
||||
; Available tokens:
|
||||
; %name%
|
||||
; Default: %name%
|
||||
; @deprecated, use label-indicator-on
|
||||
;;;label-indicator = %name%
|
||||
|
||||
; layout-icon-[0-9]+ = layout;icon
|
||||
; layout-icon-[0-9]+ = layout;variant;icon (New in version 3.6.0)
|
||||
; Assign each layout an icon that will be available as %icon% token for the
|
||||
; <label-layout> tag.
|
||||
; In the first configuration form, the `layout` will try to match %layout%
|
||||
; value ignoring the variant
|
||||
; In the second configuration form,
|
||||
; the `layout` will try to match %layout% value and the `variant` matches %variant%.
|
||||
; the `variant` can be empty (layout;;icon) to match against a %layout%
|
||||
; with an empty %variant%
|
||||
; the `variant` can be the wildcard '_' to match a %layout% and any variant.
|
||||
; This is equivalent to the first configuration form
|
||||
; the `layout` cannot be empty (;variant;icon)
|
||||
; the `layout` can be the wildcard '_' to match any %layout% with a
|
||||
; specific %variant%
|
||||
; Do not use the wildcard '_' for both `layout` and `variant`
|
||||
;layout-icon-default =
|
||||
;layout-icon-0 = ru;
|
||||
;layout-icon-1 = us;
|
||||
|
||||
;layout-icon-default =
|
||||
layout-icon-0 = ru;%{T-}%{T2} RU%{T-}
|
||||
layout-icon-1 = us;%{T-}%{T2} EN%{T-}
|
||||
|
||||
; indicator-icon-[0-9]+ = indicator;off icon;on icon
|
||||
; Provides the content of the %icon% token in label-indicator-*
|
||||
;;;indicator-icon-default =
|
||||
;;;indicator-icon-0 = caps lock;-CL;+CL
|
||||
;;;indicator-icon-1 = scroll lock;;+SL
|
||||
;;;indicator-icon-2 = num lock;-NL;+NL
|
||||
|
||||
; Replaces label-indicator
|
||||
; Available tokens:
|
||||
; %name%
|
||||
; %icon%
|
||||
; Default: %name%
|
||||
;;;;label-indicator-on = +%name%
|
||||
; Available tokens:
|
||||
; %name%
|
||||
; %icon%
|
||||
; Default: (none)
|
||||
;;;;label-indicator-off = -%name%
|
||||
|
||||
; Replaces label-indicator-* if for specific indicators
|
||||
; Available tokens:
|
||||
; %name%
|
||||
; %icon%
|
||||
label-indicator-on-capslock =
|
||||
label-indicator-off-capslock =
|
||||
label-indicator-on-numlock =
|
||||
label-indicator-off-numlock =
|
||||
label-indicator-on-scrolllock =
|
||||
label-indicator-off-scrolllock =
|
||||
|
||||
|
||||
[module/date]
|
||||
type = internal/date
|
||||
|
||||
; Seconds to sleep between updates
|
||||
interval = 1.0
|
||||
|
||||
; See "http://en.cppreference.com/w/cpp/io/manip/put_time" for details on how to format the date string
|
||||
; NOTE: if you want to use syntax tags here you need to use %%{...}
|
||||
date = %{T1} %{T-}%{T2} %a %d %b%{T-}
|
||||
; Optional time format
|
||||
time = %{T2} %H:%M:%S %{T-}
|
||||
|
||||
; if `date-alt` or `time-alt` is defined, clicking
|
||||
; the module will toggle between formats
|
||||
;date-alt = %{T1}%{T-}%{T2} %d-%m-%Y /%{T-}
|
||||
;time-alt = %{T2} %H:%M:%S%{T-}
|
||||
;click-left = kitty -e calcurse
|
||||
;click-left = ~/.config/polybar/scripts/calendar.sh
|
||||
|
||||
label = %date%%time%
|
||||
label-font = 0
|
||||
label-foreground = ${gruvbox.dark}
|
||||
label-background = ${gruvbox.cream}
|
||||
label-padding = 0
|
||||
|
||||
[module/cpu]
|
||||
type = internal/cpu
|
||||
|
||||
; Seconds to sleep between updates
|
||||
; Default: 1
|
||||
interval = 0.5
|
||||
|
||||
label = %{T1} %{T-}%{T2} %percentage:2%% %{T-}
|
||||
|
||||
label-foreground = ${gruvbox.cream}
|
||||
label-background = ${gruvbox.blue-lm}
|
||||
|
||||
|
||||
[module/memory]
|
||||
type = internal/memory
|
||||
|
||||
; Seconds to sleep between updates
|
||||
; Default: 1
|
||||
interval = 0.5
|
||||
format = <label>
|
||||
|
||||
; Available tokens:
|
||||
; %percentage_used% (default)
|
||||
; %percentage_free%
|
||||
; %gb_used%
|
||||
; %gb_free%
|
||||
; %gb_total%
|
||||
; %mb_used%
|
||||
; %mb_free%
|
||||
; %mb_total%
|
||||
; %percentage_swap_used%
|
||||
; %percentage_swap_free%
|
||||
; %mb_swap_total%
|
||||
; %mb_swap_free%
|
||||
; %mb_swap_used%
|
||||
; %gb_swap_total%
|
||||
; %gb_swap_free%
|
||||
; %gb_swap_used%
|
||||
|
||||
label = %{T1} %{T-}%{T2} %gb_used% %{T-}
|
||||
;label = %{T1}%{T-}%{T2} %percentage_used%%%{T-}
|
||||
|
||||
label-foreground = ${gruvbox.cream}
|
||||
label-background = ${gruvbox.red-alt}
|
||||
label-padding = 0
|
||||
|
||||
;An empty module used to add 1 unit spacings whenever needed
|
||||
[module/sps]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.blue-alt}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps0]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.grey}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps00]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.grey}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps11]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.blue-alt}
|
||||
format-padding = 0
|
||||
|
||||
|
||||
[module/sps1]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.yellow-mat}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps12]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.yellow-mat}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps2]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.aqua-lm}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps22]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.aqua-lm}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps3]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.green}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps33]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.green}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps4]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.blue-lm}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps44]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.blue-lm}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps5]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.yellow}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps55]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.yellow}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps6]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.red-alt}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps66]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.red-alt}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps7]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.cream}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps77]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.cream}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps8]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.orange}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps88]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.orange}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps9]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.purple-lm}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps99]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.purple-lm}
|
||||
format-padding = 0
|
||||
|
||||
|
||||
[module/sps_note0]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.orange-dark}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps_note1]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.orange-dark}
|
||||
format-padding = 0
|
||||
|
||||
|
||||
|
||||
|
||||
[module/sps222222]
|
||||
type = custom/text
|
||||
format = ""
|
||||
;label = "%{T1} %{T-}%{T2} %downspeed% %upspeed% %{T-}"
|
||||
format-padding = 0
|
||||
label-padding = 0
|
||||
format-foreground = ${gruvbox.blue-alt}
|
||||
format-background = ${gruvbox.dark}
|
||||
|
||||
|
||||
[module/netspeed]
|
||||
type = internal/network
|
||||
|
||||
; Set correct interface name for the module to work
|
||||
; Try eth0 for ethernet or wlan0 for wireless
|
||||
;
|
||||
; You can also run ifconfig in a terminal
|
||||
; to know the interace names on your system.
|
||||
;interface = wlan0
|
||||
interface = enp5s0
|
||||
interval = 1.0
|
||||
label-connected = "%{T1} %{T-}%{T2} %downspeed% %upspeed% %{T-}"
|
||||
;label-disconnected = "%{T2}0/0%{T-}"
|
||||
label-disconnected = "%{T2}ﮊ НЕТ СЕТИ%{T-}"
|
||||
label-connected-background = ${gruvbox.blue-alt}
|
||||
label-connected-foreground = ${gruvbox.dark}
|
||||
label-disconnected-foreground = ${colors.red}
|
||||
|
||||
|
||||
[module/title]
|
||||
type = internal/xwindow
|
||||
; Available tags:
|
||||
; <label> (default)
|
||||
format = <label>
|
||||
;format-background = ${gruvbox.black}
|
||||
format-foreground = ${gruvbox.green}
|
||||
format-padding = 1
|
||||
|
||||
; Available tokens:
|
||||
; %title%
|
||||
; Default: %title%
|
||||
label = "%{T1}%{T-}%{T2} %title%%{T-}"
|
||||
label-maxlen = 100
|
||||
|
||||
; Used instead of label when there is no window title
|
||||
; Available tokens:
|
||||
; None
|
||||
label-empty =%{T2}DESKTOP%{T-}
|
||||
label-empty-foreground = ${gruvbox.blue-alt}
|
||||
|
||||
|
||||
[module/pulseaudio]
|
||||
type = internal/pulseaudio
|
||||
|
||||
; Sink to be used, if it exists (find using `pacmd list-sinks`, name field)
|
||||
; If not, uses default sink
|
||||
; sink = alsa_output.pci-0000_12_00.3.analog-stereo
|
||||
; sink = alsa_output.pci-0000_00_1b.0.analog-stereo
|
||||
;sink = bluez_output.64_68_76_EE_EF_98.1
|
||||
;sink = bluez_output.40_72_18_78_11_A8.1
|
||||
|
||||
use-ui-max = false
|
||||
interval = 5
|
||||
format-volume = <label-volume>
|
||||
|
||||
format-muted = <label-muted>
|
||||
|
||||
label-volume = %{T1} 墳%{T-} %{T2}%percentage%% %{T-}
|
||||
label-volume-foreground = ${gruvbox.dark}
|
||||
label-volume-background = ${gruvbox.green}
|
||||
|
||||
label-muted = %{T1} 婢%{T-} %{T2}ВЫКЛ! %{T-}
|
||||
label-muted-foreground = ${gruvbox.dark}
|
||||
label-muted-background = ${gruvbox.green}
|
||||
|
||||
ramp-volume-0 = %{T1}%{T-}
|
||||
ramp-volume-1 = %{T1}奔%{T-}
|
||||
ramp-volume-2 = %{T1}墳%{T-}
|
||||
|
||||
click-right = pavucontrol &
|
||||
;click-right = pavucontrol-qt &
|
||||
; click-middle =
|
||||
|
||||
|
||||
[settings]
|
||||
pseudo-transparency = true
|
||||
|
||||
|
||||
[module/powermenu]
|
||||
type = custom/text
|
||||
format = ""
|
||||
click-left = ~/.config/rofi/powermenu.sh
|
||||
format-background = ${gruvbox.red-alt}
|
||||
format-foreground = ${gruvbox.cream}
|
||||
format-padding = 1
|
||||
margin-right = 0
|
||||
|
||||
|
||||
[module/obsidian]
|
||||
type = custom/text
|
||||
format = ""
|
||||
;click-left = kitty -e nvim /home/$USER/.config/changelog
|
||||
click-left = /opt/obsidian/Obsidian
|
||||
;click-right = xed /home/zloy_linux/Seafile/notes.txt
|
||||
;click-right = marktext ~/Seafile/notes.txt
|
||||
click-right = ~/.config/bspwm/scripts/nvim_notes.sh
|
||||
format-background = ${gruvbox.grey}
|
||||
format-foreground = ${gruvbox.orange}
|
||||
format-padding = 1
|
||||
margin-right = 0
|
||||
|
||||
[module/hedgedoc]
|
||||
type = custom/text
|
||||
format = ""
|
||||
;click-left = kitty -e nvim /home/$USER/.config/changelog
|
||||
click-left = vivaldi https://edit.zlinux.ru/
|
||||
;click-right = kitty -e pahis
|
||||
format-background = ${gruvbox.grey}
|
||||
format-foreground = ${gruvbox.aqua}
|
||||
format-padding = 1
|
||||
margin-right = 0
|
||||
|
||||
[module/vert]
|
||||
type = custom/text
|
||||
format = ""
|
||||
;click-left = kitty -e nvim /home/$USER/.config/changelog
|
||||
click-left = vivaldi https://vert.zlinux.ru/
|
||||
;click-right = kitty -e pahis
|
||||
format-background = ${gruvbox.grey}
|
||||
format-foreground = ${gruvbox.purle-alt}
|
||||
format-padding = 1
|
||||
margin-right = 0
|
||||
|
||||
|
||||
[module/nvim_notes]
|
||||
type = custom/script
|
||||
exec = ~/.config/polybar/scripts/nvim_notes_status.sh
|
||||
click-left = ~/.config/bspwm/scripts/nvim_notes.sh
|
||||
format-foreground = ${gruvbox.cream}
|
||||
format-background = ${gruvbox.orange-dark}
|
||||
interval = 1
|
||||
|
||||
|
||||
[module/temperature]
|
||||
type = internal/temperature
|
||||
;click-left = /usr/bin/psensor &
|
||||
; Seconds to sleep between updates
|
||||
; Default: 1
|
||||
interval = 0.5
|
||||
|
||||
; Thermal zone to use
|
||||
; To list all the zone types, run
|
||||
; $ for i in /sys/class/thermal/thermal_zone*; do echo "$i: $(<$i/type)"; done
|
||||
; Default: 0
|
||||
thermal-zone = 0
|
||||
|
||||
; Full path of temperature sysfs path
|
||||
; Use `sensors` to find preferred temperature source, then run
|
||||
; $ for i in /sys/class/hwmon/hwmon*/temp*_input; do echo "$(<$(dirname $i)/name): $(cat ${i%_*}_label 2>/dev/null || echo $(basename ${i%_*})) $(readlink -f $i)"; done
|
||||
; to find path to desired file
|
||||
; Default reverts to thermal zone setting
|
||||
;;hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input
|
||||
;;;hwmon-path = /sys/class/thermal/thermal_zone1/temp
|
||||
hwmon-path = /sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp1_input
|
||||
;hwmon-path = /sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon3/temp1_input
|
||||
|
||||
; Threshold temperature to display warning label (in degrees celsius)
|
||||
; Default: 80
|
||||
warn-temperature = 65
|
||||
|
||||
; Whether or not to show units next to the temperature tokens (°C, °F)
|
||||
; Default: true
|
||||
units = true
|
||||
|
||||
; Available tags:
|
||||
; <label> (default)
|
||||
; <ramp>
|
||||
format = <ramp> <label>
|
||||
format-foreground = ${gruvbox.yellow}
|
||||
format-padding = 0
|
||||
|
||||
; Available tags:
|
||||
; <label-warn> (default)
|
||||
; <ramp>
|
||||
format-warn = <ramp> <label-warn>
|
||||
format-warn-foreground = ${gruvbox.red}
|
||||
format-warn-padding = 0
|
||||
|
||||
; Available tokens:
|
||||
; %temperature% (deprecated)
|
||||
; %temperature-c% (default, temperature in °C)
|
||||
; %temperature-f% (temperature in °F)
|
||||
label = %{T2}%temperature-c%%{T-}
|
||||
|
||||
; Available tokens:
|
||||
; %temperature% (deprecated)
|
||||
; %temperature-c% (default, temperature in °C)
|
||||
; %temperature-f% (temperature in °F)
|
||||
label-warn = %{T2}%temperature-c%%{T-}
|
||||
label-warn-foreground = ${gruvbox.red-alt}
|
||||
|
||||
; Requires the <ramp> tag
|
||||
; The icon selection will range from 0 to `warn-temperature`
|
||||
; with the current temperature as index.
|
||||
ramp-0 =
|
||||
ramp-1 =
|
||||
ramp-2 =
|
||||
ramp-3 =
|
||||
ramp-4 =
|
||||
|
||||
[module/cputemp]
|
||||
type = custom/script
|
||||
label = %{F#1d1d1d}%{T1}%{T2}%output%%{T-}%{T-}
|
||||
exec = sensors | awk '/^Tctl:/ {print $2}'
|
||||
interval = 3
|
||||
format-prefix = " "
|
||||
format-prefix-foreground = ${gruvbox.dark}
|
||||
format-prefix-background = ${gruvbox.yellow}
|
||||
format-underline = ${gruvbox.yellow}
|
||||
format-padding = 1
|
||||
format-foreground = ${gruvbox.dark}
|
||||
format-background = ${gruvbox.yellow}
|
||||
|
||||
|
||||
[module/checkupdates]
|
||||
type = custom/script
|
||||
interval = 300
|
||||
;;;;exec = ~/.config/polybar/scripts/checkupdates.sh
|
||||
exec = ~/.config/polybar/scripts/updates.sh
|
||||
click-left = kitty -e yay -Syu --editmenu
|
||||
click-right = kitty -e pahis
|
||||
;label-empty = 0
|
||||
format-foreground = ${gruvbox.dark}
|
||||
format-background = ${gruvbox.yellow-mat}
|
||||
format-padding = 1
|
||||
|
||||
[module/internet]
|
||||
type = custom/script
|
||||
interval = 1
|
||||
exec = /home/zloy_linux/.config/polybar/scripts/internet.sh
|
||||
format = %{T1}直%{T-}%{T2}<label>%{T-}
|
||||
content-padding = 0
|
||||
margin-right = 0
|
||||
format-foreground = ${colors.white}
|
||||
|
||||
|
||||
[module/dunst]
|
||||
type = custom/ipc
|
||||
initial = 1
|
||||
format-foreground = ${gruvbox.dark}
|
||||
format-background = ${gruvbox.orange}
|
||||
hook-0 = echo "%{A1:dunstctl set-paused true && polybar-msg hook dunst 2:} %{A}" &
|
||||
hook-1 = echo "%{A1:dunstctl set-paused false && polybar-msg hook dunst 1:} %{A}" &
|
||||
click-right = dunstctl history-pop
|
||||
|
||||
[module/vpn-openvpn-isrunning]
|
||||
type = custom/script
|
||||
exec = ~/.config/polybar/scripts/vpn-openvpn-isrunning.sh
|
||||
interval = 5
|
||||
;format-foreground = ${colors.golden_glow}
|
||||
click-left = ~/.config/polybar/scripts/vpn-on-off.sh
|
||||
|
||||
[module/weather]
|
||||
type = custom/script
|
||||
exec = ~/.config/polybar/scripts/weather.sh
|
||||
click-left = kitty -e ~/.config/polybar/scripts/weather_full.sh
|
||||
;format-prefix = %{T2} %{T-}
|
||||
;label = %{T2}%output%%{T-}
|
||||
label = %{F#ff8700}%{T1} %{T2} %output% %{T-} %{T-}
|
||||
interval = 600
|
||||
label-font = 3
|
||||
|
||||
[module/newsboat]
|
||||
type = custom/script
|
||||
interval = 30
|
||||
exec = /usr/bin/newsboat -x print-unread | awk '{ print " " $1}'
|
||||
label = %{F#ff8700}%{T1} %{T2} %output% %{T-} %{T-}
|
||||
click-left = /usr/bin/kitty -e newsboat &
|
||||
|
||||
[module/wireguard]
|
||||
type = custom/script
|
||||
exec = /home/$USER/.config/polybar/scripts/wireguard.sh
|
||||
tail = false
|
||||
interval = 1
|
||||
click-left = /home/$USER/.config/polybar/scripts/wireguard.sh --toggle &
|
||||
label-background = ${gruvbox.purple-lm}
|
||||
label-foreground = ${gruvbox.cream}
|
||||
label-padding = 1
|
||||
|
||||
[module/cava]
|
||||
type = custom/script
|
||||
tail = true
|
||||
exec = $HOME/.config/polybar/scripts/cava.sh
|
||||
format = <label>
|
||||
label-foreground = #b8bb26
|
||||
format-font = 1
|
||||
label = %{T2}%output%%{T-}
|
||||
|
||||
|
||||
[module/info-cava]
|
||||
type = custom/script
|
||||
exec = ~/.config/polybar/scripts/cava -c average -f 60 -b 12
|
||||
|
||||
format = <label>
|
||||
label = %output%
|
||||
;format-foreground = ${color.BACKGROUND}
|
||||
;format-background = #8B60E5
|
||||
tail = true
|
||||
|
||||
|
||||
[module/stop_screensaver]
|
||||
type = custom/script
|
||||
exec = ~/.config/polybar/scripts/stop_screensaver_status.sh
|
||||
interval = 2
|
||||
click-left = ~/.config/polybar/scripts/stop_screensaver_toggle.sh
|
||||
label-background = ${gruvbox.green-alt}
|
||||
label-foreground = ${gruvbox.black}
|
||||
|
||||
[module/sps_stop_src0]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.green-alt}
|
||||
format-padding = 0
|
||||
|
||||
[module/sps_stop_src1]
|
||||
type = custom/text
|
||||
format = ""
|
||||
format-foreground = ${gruvbox.green-alt}
|
||||
format-padding = 0
|
||||
|
||||
[module/bluetooth]
|
||||
type = custom/script
|
||||
exec = ~/.config/polybar/scripts/rofi-bluetooth.sh --status
|
||||
interval = 1
|
||||
click-left = ~/.config/polybar/scripts/rofi-bluetooth
|
||||
format = <label>
|
||||
label = %{T2}%output%%{T-}
|
||||
format-foreground = ${colors.cyan}
|
||||
11
config/polybar/launch.sh
Executable file
11
config/polybar/launch.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Terminate already running bar instances
|
||||
killall -q polybar
|
||||
|
||||
# Wait until the processes have been shut down
|
||||
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
||||
|
||||
# Launch Polybar
|
||||
polybar top -c ~/.config/polybar/config.ini &
|
||||
#notify-send "Launched the main bar ..."
|
||||
4
config/polybar/scripts/calendar.sh
Executable file
4
config/polybar/scripts/calendar.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
#kitty --hold -e cal -y -m
|
||||
kitty --hold -e calcurse
|
||||
71
config/polybar/scripts/cava
Executable file
71
config/polybar/scripts/cava
Executable file
@@ -0,0 +1,71 @@
|
||||
#!/bin/env python3
|
||||
import argparse
|
||||
import os
|
||||
import signal
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
if len(sys.argv) > 1 and sys.argv[1] == '--subproc':
|
||||
ramp_list = ['▁', '▂', '▃', '▄', '▅', '▆', '▇', '█']
|
||||
colors = ['001F00','003F00','005F00','007F00','009F00','00BF00','00DF00','00FF00']
|
||||
while True:
|
||||
cava_input = input().strip().split()
|
||||
cava_input = [int(i) for i in cava_input]
|
||||
output = ''
|
||||
for bar in cava_input:
|
||||
if bar < len(ramp_list):
|
||||
output += "%{F#"+colors[bar]+"}"+ramp_list[bar] + "%{F-}"
|
||||
|
||||
else:
|
||||
output += "%{F#"+colors[-1]+"}"+ramp_list[-1] + "%{F-}"
|
||||
|
||||
print(output)
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-f', '--framerate', type=int, default=60,
|
||||
help='Framerate to be used by cava, default is 60')
|
||||
parser.add_argument('-b', '--bars', type=int, default=8,
|
||||
help='Amount of bars, default is 8')
|
||||
parser.add_argument('-e', '--extra_colors', default='fdd,fcc,fbb,faa',
|
||||
help='Color gradient used on higher values, separated by commas, default is')
|
||||
parser.add_argument('-c', '--channels', choices=['stereo', 'left', 'right', 'average'],
|
||||
help='Audio channels to be used, defaults to stereo')
|
||||
|
||||
opts = parser.parse_args()
|
||||
conf_channels = ''
|
||||
if opts.channels != 'stereo':
|
||||
conf_channels = (
|
||||
'channels=mono\n'
|
||||
f'mono_option={opts.channels}'
|
||||
)
|
||||
|
||||
conf_ascii_max_range = 12 + len([i for i in opts.extra_colors.split(',') if i])
|
||||
|
||||
cava_conf = tempfile.mkstemp('','polybar-cava-conf.')[1]
|
||||
with open(cava_conf, 'w') as cava_conf_file:
|
||||
cava_conf_file.write(
|
||||
'[general]\n'
|
||||
f'framerate={opts.framerate}\n'
|
||||
f'bars={opts.bars}\n'
|
||||
'[output]\n'
|
||||
'method=raw\n'
|
||||
'data_format=ascii\n'
|
||||
f'ascii_max_range={conf_ascii_max_range}\n'
|
||||
'bar_delimiter=32\n'
|
||||
+ conf_channels
|
||||
)
|
||||
|
||||
cava_proc = subprocess.Popen(['cava', '-p', cava_conf], stdout=subprocess.PIPE)
|
||||
self_proc = subprocess.Popen(['python3', __file__, '--subproc', opts.extra_colors], stdin=cava_proc.stdout)
|
||||
|
||||
def cleanup(sig, frame):
|
||||
os.remove(cava_conf)
|
||||
cava_proc.kill()
|
||||
self_proc.kill()
|
||||
sys.exit(0)
|
||||
|
||||
signal.signal(signal.SIGTERM, cleanup)
|
||||
signal.signal(signal.SIGINT, cleanup)
|
||||
|
||||
self_proc.wait()
|
||||
29
config/polybar/scripts/cava.sh
Executable file
29
config/polybar/scripts/cava.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#! /bin/bash
|
||||
|
||||
bar="▁▂▃▄▅▆▇█"
|
||||
dict="s/;//g;"
|
||||
|
||||
# creating "dictionary" to replace char with bar
|
||||
i=0
|
||||
while [ $i -lt ${#bar} ]; do
|
||||
dict="${dict}s/$i/${bar:$i:1}/g;"
|
||||
i=$((i = i + 1))
|
||||
done
|
||||
|
||||
# write cava config
|
||||
config_file="/tmp/polybar_cava_config"
|
||||
echo "
|
||||
[general]
|
||||
bars = 10
|
||||
|
||||
[output]
|
||||
method = raw
|
||||
raw_target = /dev/stdout
|
||||
data_format = ascii
|
||||
ascii_max_range = 7
|
||||
" >$config_file
|
||||
|
||||
# read stdout from cava
|
||||
cava -p $config_file | while read -r line; do
|
||||
echo $line | sed $dict
|
||||
done
|
||||
12
config/polybar/scripts/checkupdates.sh
Executable file
12
config/polybar/scripts/checkupdates.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
updates=$(sysupdate)
|
||||
|
||||
if [ -z "$updates" ]; then
|
||||
count=0
|
||||
else
|
||||
printf '%s\n' "$updates" >/tmp/bspwm-polybar-updates
|
||||
count=$(wc -l "/tmp/bspwm-polybar-updates" | awk '{print $1}')
|
||||
fi
|
||||
|
||||
echo "%{T1}%{T-} %{T2}$count %{T-}"
|
||||
55
config/polybar/scripts/cns.sh
Executable file
55
config/polybar/scripts/cns.sh
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/bin/bash
|
||||
|
||||
function capslock() {
|
||||
|
||||
caps=$(xset -q | grep Caps | awk '{ print $4 }')
|
||||
|
||||
if [ $caps == 'off' ]; then
|
||||
echo "%{T1}%{T-}"
|
||||
else
|
||||
echo "%{T1}בּ%{T-}"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
function numlock {
|
||||
|
||||
num=$(xset -q | grep Num | awk '{ print $8 }')
|
||||
|
||||
if [ $num == 'off' ]; then
|
||||
echo "%{T1}%{T-}"
|
||||
else
|
||||
echo "%{T1}%{T-}"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
function scroll() {
|
||||
|
||||
scroll=$(xset -q | grep Scroll | awk '{ print $12 }')
|
||||
|
||||
if [ $scroll == 'off' ]; then
|
||||
echo "%{T1}%{T-}"
|
||||
else
|
||||
echo "%{T1}%{T-}"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
main () {
|
||||
|
||||
if [ "$1" == "-c" ]; then
|
||||
capslock
|
||||
fi
|
||||
|
||||
if [ "$1" == "-n" ]; then
|
||||
numlock
|
||||
fi
|
||||
|
||||
if [ "$1" == "-s" ]; then
|
||||
scroll
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
main $1
|
||||
23
config/polybar/scripts/internet.sh
Executable file
23
config/polybar/scripts/internet.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $BLOCK_BUTTON in
|
||||
1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 dwmblocks ;;
|
||||
3) notify-send " Internet module" "\- Click to connect
|
||||
❌: wifi disabled
|
||||
📡: no wifi connection
|
||||
📶: wifi connection with quality
|
||||
❎: no ethernet
|
||||
🌐: ethernet working
|
||||
🔒: vpn is active
|
||||
" ;;
|
||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||
esac
|
||||
|
||||
if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then
|
||||
wifiicon="$(awk '/^\s*w/ { print "", int($3 * 100 / 70) "% " }' /proc/net/wireless)"
|
||||
elif grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null ; then
|
||||
grep -xq '0x1003' /sys/class/net/w*/flags && wifiicon="📡 " || wifiicon="❌ "
|
||||
fi
|
||||
|
||||
printf "%s%s%s\n" "$wifiicon" "$(sed "s/down/;s/up/" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/" /sys/class/net/tun*/operstate 2>/dev/null)"
|
||||
|
||||
42
config/polybar/scripts/nvim_notes_status.sh
Executable file
42
config/polybar/scripts/nvim_notes_status.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
WIN_CLASS="nvim_notes"
|
||||
#ICON=" "
|
||||
ICON=" "
|
||||
|
||||
# найти node id
|
||||
find_node() {
|
||||
for id in $(bspc query -N -n .window 2>/dev/null); do
|
||||
if xprop -id "$id" WM_CLASS 2>/dev/null | grep -q "$WIN_CLASS"; then
|
||||
echo "$id" && return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
NODE=$(find_node) || NODE=""
|
||||
|
||||
if [ -z "$NODE" ]; then
|
||||
echo "$ICON"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# проверить флаг hidden через JSON (надежно)
|
||||
if bspc query -T -n "$NODE" 2>/dev/null | grep -q '"hidden":[[:space:]]*true'; then
|
||||
echo "%{T1}$ICON%{T-}%{T2}Скрыто%{T-} "
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# если в фокусе — видно
|
||||
FOC=$(bspc query -N -n focused.window 2>/dev/null || echo "")
|
||||
if [ "$NODE" = "$FOC" ]; then
|
||||
echo "%{T1}$ICON%{T-}%{T2}Фокус%{T-} "
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# получить список окон текущего десктопа и проверить наличие
|
||||
CUR_DESK_WINDOWS=$(bspc query -N -n .window.local 2>/dev/null || bspc query -N -n .window 2>/dev/null)
|
||||
if echo "$CUR_DESK_WINDOWS" | grep -qx "$NODE"; then
|
||||
echo "%{T1}$ICON%{T-}%{T2}ON%{T-} "
|
||||
else
|
||||
echo "%{T1}$ICON%{T-}%{T2}ON%{T-} "
|
||||
fi
|
||||
303
config/polybar/scripts/rofi-bluetooth.sh
Executable file
303
config/polybar/scripts/rofi-bluetooth.sh
Executable file
@@ -0,0 +1,303 @@
|
||||
#!/bin/bash
|
||||
# __ _ _ _ _ _ _
|
||||
# _ __ ___ / _(_) | |__ | |_ _ ___| |_ ___ ___ | |_| |__
|
||||
# | '__/ _ \| |_| |_____| '_ \| | | | |/ _ \ __/ _ \ / _ \| __| '_ \
|
||||
# | | | (_) | _| |_____| |_) | | |_| | __/ || (_) | (_) | |_| | | |
|
||||
# |_| \___/|_| |_| |_.__/|_|\__,_|\___|\__\___/ \___/ \__|_| |_|
|
||||
#
|
||||
# Author: Nick Clyde (clydedroid)
|
||||
#
|
||||
# A script that generates a rofi menu that uses bluetoothctl to
|
||||
# connect to bluetooth devices and display status info.
|
||||
#
|
||||
# Inspired by networkmanager-dmenu (https://github.com/firecat53/networkmanager-dmenu)
|
||||
# Thanks to x70b1 (https://github.com/polybar/polybar-scripts/tree/master/polybar-scripts/system-bluetooth-bluetoothctl)
|
||||
#
|
||||
# Depends on:
|
||||
# Arch repositories: rofi, bluez-utils (contains bluetoothctl)
|
||||
|
||||
# Checks if bluetooth controller is powered on
|
||||
power_on() {
|
||||
if bluetoothctl show | grep -q "Powered: yes"; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Toggles power state
|
||||
toggle_power() {
|
||||
if power_on; then
|
||||
bluetoothctl power off
|
||||
else
|
||||
bluetoothctl power on
|
||||
fi
|
||||
}
|
||||
|
||||
# Checks if controller is scanning for new devices
|
||||
scan_on() {
|
||||
if bluetoothctl show | grep -q "Discovering: yes"; then
|
||||
echo "Scan: on"
|
||||
return 0
|
||||
else
|
||||
echo "Scan: off"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Toggles scanning state
|
||||
toggle_scan() {
|
||||
if scan_on; then
|
||||
kill $(pgrep -f "bluetoothctl scan on")
|
||||
bluetoothctl scan off
|
||||
else
|
||||
bluetoothctl scan on &
|
||||
fi
|
||||
}
|
||||
|
||||
# Checks if controller is able to pair to devices
|
||||
pairable_on() {
|
||||
if bluetoothctl show | grep -q "Pairable: yes"; then
|
||||
echo "Pairable: on"
|
||||
return 0
|
||||
else
|
||||
echo "Pairable: off"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Toggles pairable state
|
||||
toggle_pairable() {
|
||||
if pairable_on; then
|
||||
bluetoothctl pairable off
|
||||
else
|
||||
bluetoothctl pairable on
|
||||
fi
|
||||
}
|
||||
|
||||
# Checks if controller is discoverable by other devices
|
||||
discoverable_on() {
|
||||
if bluetoothctl show | grep -q "Discoverable: yes"; then
|
||||
echo "Discoverable: on"
|
||||
return 0
|
||||
else
|
||||
echo "Discoverable: off"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Toggles discoverable state
|
||||
toggle_discoverable() {
|
||||
if discoverable_on; then
|
||||
bluetoothctl discoverable off
|
||||
else
|
||||
bluetoothctl discoverable on
|
||||
fi
|
||||
}
|
||||
|
||||
# Checks if a device is connected
|
||||
device_connected() {
|
||||
device_info=$(bluetoothctl info "$1")
|
||||
if echo "$device_info" | grep -q "Connected: yes"; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Toggles device connection
|
||||
toggle_connection() {
|
||||
if device_connected $1; then
|
||||
bluetoothctl disconnect $1
|
||||
else
|
||||
bluetoothctl connect $1
|
||||
fi
|
||||
}
|
||||
|
||||
# Checks if a device is paired
|
||||
device_paired() {
|
||||
device_info=$(bluetoothctl info "$1")
|
||||
if echo "$device_info" | grep -q "Paired: yes"; then
|
||||
echo "Paired: yes"
|
||||
return 0
|
||||
else
|
||||
echo "Paired: no"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Toggles device paired state
|
||||
toggle_paired() {
|
||||
if device_paired $1; then
|
||||
bluetoothctl remove $1
|
||||
else
|
||||
bluetoothctl pair $1
|
||||
fi
|
||||
}
|
||||
|
||||
# Checks if a device is trusted
|
||||
device_trusted() {
|
||||
device_info=$(bluetoothctl info "$1")
|
||||
if echo "$device_info" | grep -q "Trusted: yes"; then
|
||||
echo "Trusted: yes"
|
||||
return 0
|
||||
else
|
||||
echo "Trusted: no"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Toggles device connection
|
||||
toggle_trust() {
|
||||
if device_trusted $1; then
|
||||
bluetoothctl untrust $1
|
||||
else
|
||||
bluetoothctl trust $1
|
||||
fi
|
||||
}
|
||||
|
||||
# Prints a short string with the current bluetooth status
|
||||
# Useful for status bars like polybar, etc.
|
||||
print_status() {
|
||||
if power_on; then
|
||||
printf ''
|
||||
|
||||
mapfile -t paired_devices < <(bluetoothctl paired-devices | grep Device | cut -d ' ' -f 2)
|
||||
counter=0
|
||||
|
||||
for device in "${paired_devices[@]}"; do
|
||||
if device_connected $device; then
|
||||
device_alias=$(bluetoothctl info $device | grep "Alias" | cut -d ' ' -f 2-)
|
||||
|
||||
if [ $counter -gt 0 ]; then
|
||||
printf ", %s" "$device_alias"
|
||||
else
|
||||
printf " %s" "$device_alias"
|
||||
fi
|
||||
|
||||
((counter++))
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $counter -eq 0 ]; then
|
||||
printf " On"
|
||||
fi
|
||||
else
|
||||
echo " off"
|
||||
fi
|
||||
}
|
||||
|
||||
# A submenu for a specific device that allows connecting, pairing, and trusting
|
||||
device_menu() {
|
||||
device=$1
|
||||
|
||||
# Get device name and mac address
|
||||
device_name=$(echo $device | cut -d ' ' -f 3-)
|
||||
mac=$(echo $device | cut -d ' ' -f 2)
|
||||
|
||||
# Build options
|
||||
if device_connected $mac; then
|
||||
connected="Connected: yes"
|
||||
else
|
||||
connected="Connected: no"
|
||||
fi
|
||||
paired=$(device_paired $mac)
|
||||
trusted=$(device_trusted $mac)
|
||||
options="$connected\n$paired\n$trusted"
|
||||
|
||||
# Open rofi menu, read chosen option
|
||||
chosen="$(echo -e "$options" | $rofi_command "$device_name")"
|
||||
|
||||
# Match chosen option to command
|
||||
case $chosen in
|
||||
"")
|
||||
echo "No option chosen."
|
||||
;;
|
||||
$connected)
|
||||
toggle_connection $mac
|
||||
sleep 0.5
|
||||
show_menu
|
||||
;;
|
||||
$paired)
|
||||
toggle_paired $mac
|
||||
sleep 0.5
|
||||
show_menu
|
||||
;;
|
||||
$trusted)
|
||||
toggle_trust $mac
|
||||
sleep 0.5
|
||||
show_menu
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Opens a rofi menu with current bluetooth status and options to connect
|
||||
show_menu() {
|
||||
# Get menu options
|
||||
if power_on; then
|
||||
power="Power: on"
|
||||
|
||||
# Human-readable names of devices, one per line
|
||||
# If scan is off, will only list paired devices
|
||||
devices=$(bluetoothctl devices | grep Device | cut -d ' ' -f 3-)
|
||||
|
||||
# Get controller flags
|
||||
scan=$(scan_on)
|
||||
pairable=$(pairable_on)
|
||||
discoverable=$(discoverable_on)
|
||||
divider="---------"
|
||||
|
||||
# Options passed to rofi
|
||||
options="$devices\n$divider\n$power\n$scan\n$pairable\n$discoverable"
|
||||
else
|
||||
power="Power: off"
|
||||
options="$power"
|
||||
fi
|
||||
|
||||
# Open rofi menu, read chosen option
|
||||
chosen="$(echo -e "$options" | $rofi_command "Bluetooth")"
|
||||
|
||||
# Match chosen option to command
|
||||
case $chosen in
|
||||
"" | $divider)
|
||||
echo "No option chosen."
|
||||
;;
|
||||
$power)
|
||||
toggle_power
|
||||
sleep 0.5
|
||||
show_menu
|
||||
;;
|
||||
$scan)
|
||||
toggle_scan
|
||||
sleep 0.5
|
||||
show_menu
|
||||
;;
|
||||
$discoverable)
|
||||
toggle_discoverable
|
||||
sleep 0.5
|
||||
show_menu
|
||||
;;
|
||||
$pairable)
|
||||
toggle_pairable
|
||||
sleep 0.5
|
||||
show_menu
|
||||
;;
|
||||
*)
|
||||
device=$(bluetoothctl devices | grep "$chosen")
|
||||
# Open a submenu if a device is selected
|
||||
if [[ $device ]]; then device_menu "$device"; fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Rofi command to pipe into, can add any options here
|
||||
rofi_command="rofi -dmenu -no-fixed-num-lines -yoffset -100 -i -p"
|
||||
|
||||
case "$1" in
|
||||
--status)
|
||||
print_status
|
||||
;;
|
||||
*)
|
||||
show_menu
|
||||
;;
|
||||
esac
|
||||
22
config/polybar/scripts/stop_screensaver_status.sh
Executable file
22
config/polybar/scripts/stop_screensaver_status.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
STATEFILE="/tmp/stop-screensaver.state"
|
||||
LABEL="stop-scr"
|
||||
ICON_ON=""
|
||||
ICON_OFF=""
|
||||
|
||||
if [ -f "$STATEFILE" ]; then
|
||||
state=$(cat "$STATEFILE")
|
||||
else
|
||||
state=""
|
||||
fi
|
||||
|
||||
# fallback проверка процесса, если statefile отсутствует/неактуален
|
||||
if pgrep -f "/usr/local/bin/stop-screensaver.sh" >/dev/null; then
|
||||
state="running"
|
||||
fi
|
||||
|
||||
if [ "$state" = "running" ]; then
|
||||
echo " $ICON_ON "
|
||||
else
|
||||
echo " $ICON_OFF "
|
||||
fi
|
||||
16
config/polybar/scripts/stop_screensaver_toggle.sh
Executable file
16
config/polybar/scripts/stop_screensaver_toggle.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
SCRIPT="/usr/local/bin/stop-screensaver.sh"
|
||||
STATEFILE="/tmp/stop-screensaver.state"
|
||||
|
||||
if pgrep -f "$SCRIPT" >/dev/null; then
|
||||
pkill -f "$SCRIPT"
|
||||
else
|
||||
nohup "$SCRIPT" >/dev/null 2>&1 &
|
||||
fi
|
||||
|
||||
# записать текущее состояние
|
||||
if pgrep -f "$SCRIPT" >/dev/null; then
|
||||
echo "running" >"$STATEFILE"
|
||||
else
|
||||
echo "stopped" >"$STATEFILE"
|
||||
fi
|
||||
24
config/polybar/scripts/updates.sh
Executable file
24
config/polybar/scripts/updates.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! updates_arch=$(checkupdates 2>/dev/null | wc -l); then
|
||||
updates_arch=0
|
||||
fi
|
||||
|
||||
if ! updates_aur=$(yay -Qum 2>/dev/null | wc -l); then
|
||||
# if ! updates_aur=$(paru -Qum 2> /dev/null | wc -l); then
|
||||
# if ! updates_aur=$(cower -u 2> /dev/null | wc -l); then
|
||||
# if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then
|
||||
#if ! updates_aur=$(pikaur -Qua 2> /dev/null | wc -l); then
|
||||
# if ! updates_aur=$(rua upgrade --printonly 2> /dev/null | wc -l); then
|
||||
updates_aur=0
|
||||
fi
|
||||
|
||||
updates=$((updates_arch + updates_aur))
|
||||
|
||||
#if [ "$updates" -gt 0 ]; then
|
||||
# echo "# $updates"
|
||||
#else
|
||||
# echo ""
|
||||
#fi
|
||||
#notify-send -i /home/$USER/.config/dunst/scripts/archlinux.svg "Доступно $updates обновлений"
|
||||
echo "%{T1}%{T-} %{T2}$updates%{T-}"
|
||||
10
config/polybar/scripts/vpn-openvpn-isrunning.sh
Executable file
10
config/polybar/scripts/vpn-openvpn-isrunning.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
#connection=$(pgrep -a openvpn$ | head -n 1 | awk '{print $NF }' | cut -d '.' -f 1)
|
||||
connection=$(pgrep -a wg0 | head -n 1 | awk '{print $NF }' | cut -d '.' -f 1)
|
||||
|
||||
if [ -n "$connection" ]; then
|
||||
echo "%{F#FFDE7D}%{T1}%{T-} %{T2}VPN: ON%{T-}"
|
||||
else
|
||||
echo "%{F#5f5f5f}%{T1}%{T-} %{T2}VPN: OFF%{T-}"
|
||||
fi
|
||||
54
config/polybar/scripts/wireguard.sh
Executable file
54
config/polybar/scripts/wireguard.sh
Executable file
@@ -0,0 +1,54 @@
|
||||
#! /bin/bash
|
||||
|
||||
connected_interface=$(awg show interfaces | grep -P "awg\d+" -o)
|
||||
|
||||
connect() {
|
||||
# doas wg-quick up wg0 && doas route add -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.1.1 enp5s0 && notify-send -i /home/$USER/.config/dunst/scripts/vpn.png 'VPN connected'
|
||||
doas awg-quick up awg0 && sleep 3 && doas route add -host 178.49.132.41 gw 192.168.1.1 enp5s0 && doas systemctl restart dnsproxy.service && notify-send -i /home/$USER/.config/dunst/scripts/vpn.png 'VPN connected'
|
||||
|
||||
# sudo wg-quick up wg0 && sudo route add -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.1.1 enp9s0 && notify-send -i /home/$USER/.config/dunst/scripts/vpn.png 'VPN connected'
|
||||
|
||||
# sudo wg-quick up wg0 && sudo route add -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.1.1 enp9s0 && sudo route add -host 78.47.125.180 gw 192.168.1.1 enp9s0 && notify-send -i /home/$USER/.config/dunst/scripts/vpn.png 'VPN connected'
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
# Normally we should have a single connected interface but technically
|
||||
# there's nothing stopping us from having multiple active intgerfaces so
|
||||
# let's do this in a loop:
|
||||
for connected_config in $(awg show interfaces | grep -P "awg\d+" -o); do
|
||||
doas awg-quick down awg0 && notify-send -i /home/$USER/.config/dunst/scripts/vpn.png 'VPN disconnected'
|
||||
done
|
||||
}
|
||||
|
||||
toggle() {
|
||||
if [[ $connected_interface ]]; then
|
||||
disconnect
|
||||
else
|
||||
connect
|
||||
fi
|
||||
}
|
||||
|
||||
print() {
|
||||
if [[ $connected_interface ]]; then
|
||||
echo "%{T1}說%{T-} %{T2}VPN: ON%{T-}"
|
||||
#echo "%{F#FFDE7D}%{T1}說%{T-} %{T2}VPN: ON%{T-}"
|
||||
else
|
||||
echo "%{T1}說%{T-} %{T2}VPN: OFF%{T-}"
|
||||
#echo "%{F#5f5f5f}%{T1}說%{T-} %{T2}VPN: OFF%{T-}"
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
--connect)
|
||||
connect
|
||||
;;
|
||||
--disconnect)
|
||||
disconnect
|
||||
;;
|
||||
--toggle)
|
||||
toggle
|
||||
;;
|
||||
*)
|
||||
print
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user