gianmarco
/
dotfiles
Archived
1
0
Fork 0

Fifth experimental commit for the new bspwm-based rice

master
gianmarco 2022-01-20 22:22:53 +01:00
parent 00b0bdbd0b
commit f017d4c718
11 changed files with 503 additions and 10 deletions

View File

@ -33,6 +33,7 @@ bspc rule -a Authenticator-rs state=floating
bspc rule -a kcharselect state=floating
bspc rule -a plasma.emojier state=floating
bspc rule -a rpi-imager state=floating
bspc rule -a 'FF Multi Converter' state=floating
bspc rule -a desktop="Desktop" locked=on
~/Scripts/autostart.sh

View File

@ -302,16 +302,25 @@
background = "#2A2C2B"
foreground = "#e5e5e5"
timeout = 10
fullscreen = yes
# Icon for notifications with normal urgency, uncomment to enable
#default_icon = /path/to/icon
[urgency_critical]
background = "#2A2C2B"
foreground = "#e5e5e5"
background = "#ea8f89"
foreground = "#2a2c2b"
timeout = 0
fullscreen = yes
# Icon for notifications with critical urgency, uncomment to enable
#default_icon = /path/to/icon
[osd]
background = "#2A2C2B"
foreground = "#e5e5e5"
timeout = 2
fullscreen = yes
history_ignore = yes
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
#

View File

@ -248,6 +248,222 @@ cursor-scroll =
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
[bar/taskbar]
; Use either of the following command to list available outputs:
; If unspecified, the application will pick the first one it finds.
; $ polybar -m | cut -d ':' -f 1
; $ xrandr -q | grep " connected" | cut -d ' ' -f1
monitor =
; Use the specified monitor as a fallback if the main one is not found.
monitor-fallback =
; Require the monitor to be in connected state
; XRandR sometimes reports my monitor as being disconnected (when in use)
monitor-strict = false
; Tell the Window Manager not to configure the window.
; Use this to detach the bar if your WM is locking its size/position.
override-redirect = false
; Put the bar at the bottom of the screen
bottom = true
; Prefer fixed center position for the `modules-center` block
; When false, the center position will be based on the size of the other blocks.
fixed-center = true
; Dimension defined as pixel value (e.g. 35) or percentage (e.g. 50%),
; the percentage can optionally be extended with a pixel offset like so:
; 50%:-10, this will result in a width or height of 50% minus 10 pixels
width = 100%
height = 35
; Offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
; the percentage can optionally be extended with a pixel offset like so:
; 50%:-10, this will result in an offset in the x or y direction
; of 50% minus 10 pixels
offset-x = 0%
offset-y = 0%
; Background ARGB color (e.g. #f00, #ff992a, #ddff1023)
background = ${color.background}
; Foreground ARGB color (e.g. #f00, #ff992a, #ddff1023)
foreground = ${color.foreground}
; Background gradient (vertical steps)
; background-[0-9]+ = #aarrggbb
;;background-0 =
; Value used for drawing rounded corners
; Note: This shouldn't be used together with border-size because the border
; doesn't get rounded
; Individual top/bottom values can be defined using:
; radius-{top,bottom}
radius-top = 0.0
radius-bottom = 0.0
; Under-/overline pixel size and argb color
; Individual values can be defined using:
; {overline,underline}-size
; {overline,underline}-color
line-size = 2s
line-color = ${color.primary}
; Values applied to all borders
; Individual side values can be defined using:
; border-{left,top,right,bottom}-size
; border-{left,top,right,bottom}-color
; The top and bottom borders are added to the bar height, so the effective
; window height is:
; height + border-top-size + border-bottom-size
; Meanwhile the effective window width is defined entirely by the width key and
; the border is placed withing this area. So you effectively only have the
; following horizontal space on the bar:
; width - border-right-size - border-left-size
border-size = 0
border-color = ${color.background}
; Number of spaces to add at the beginning/end of the bar
; Individual side values can be defined using:
; padding-{left,right}
padding-left = 4
; Number of spaces to add before/after each module
; Individual side values can be defined using:
; module-margin-{left,right}
module-margin = 2
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
; Fonts are defined using <font-name>;<vertical-offset>
; Font names are specified using a fontconfig pattern.
; font-0 = NotoSans-Regular:size=8;2
; font-1 = MaterialIcons:size=10
; font-2 = Termsynu:size=8;-1
; font-3 = FontAwesome:size=10
; See the Fonts wiki page for more details
font-0 = "Roboto:style=Medium:pixelsize=10;3"
font-1 = "Material\-Design\-Iconic\-Font:size=13;3"
font-2 = "Roboto Mono:pixelsize=10;3"
; Modules are added to one of the available blocks
; modules-left = cpu ram
; modules-center = xwindow xbacklight
; modules-right = ipc clock
modules-left =
modules-center = polywins
modules-right =
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
; The separator will be inserted between the output of each module
separator =
; Opacity value between 0.0 and 1.0 used on fade in/out
dim-value = 1.0
; Value to be used to set the WM_NAME atom
; If the value is empty or undefined, the atom value
; will be created from the following template: polybar-[BAR]_[MONITOR]
; NOTE: The placeholders are not available for custom values
wm-name =
; Locale used to localize various module data (e.g. date)
; Expects a valid libc locale, for example: sv_SE.UTF-8
locale = it_IT.UTF-8
; 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
; If true, the bar will not shift its
; contents when the tray changes
tray-detached = false
; Tray icon max size
tray-maxsize = 16
; Background color for the tray container
; ARGB color (e.g. #f00, #ff992a, #ddff1023)
; By default the tray container will use the bar
; background color.
tray-background = ${color.background}
; Tray 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 = 0
; Scale factor for tray clients
tray-scale = 1.0
; Restack the bar window and put it above the
; selected window manager's root
;
; Fixes the issue where the bar is being drawn
; on top of fullscreen window's
;
; Currently supported WM's:
; bspwm
; i3 (requires: `override-redirect = true`)
wm-restack = bspwm
; Set a DPI values used when rendering text
; This only affects scalable fonts
; dpi =
; Enable support for inter-process messaging
; See the Messaging wiki page for more details.
enable-ipc = true
; Fallback click handlers that will be called if
; there's no matching module handler found.
click-left =
click-middle =
click-right =
scroll-up =
scroll-down =
double-click-left =
double-click-middle =
double-click-right = exec ~/.config/polybar/launch.sh --gmg &
; Requires polybar to be built with xcursor support (xcb-util-cursor)
; Possible values are:
; - default : The default pointer as before, can also be an empty string (default)
; - pointer : Typically in the form of a hand
; - ns-resize : Up and down arrows, can be used to indicate scrolling
cursor-click =
cursor-scroll =
;; WM Workspace Specific
; bspwm
;;scroll-up = bspwm-desknext
;;scroll-down = bspwm-deskprev
;;scroll-up = bspc desktop -f prev.local
;;scroll-down = bspc desktop -f next.local
;i3
;;scroll-up = i3wm-wsnext
;;scroll-down = i3wm-wsprev
;;scroll-up = i3-msg workspace next_on_output
;;scroll-down = i3-msg workspace prev_on_output
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
;; Application Settings
[settings]

View File

@ -0,0 +1,242 @@
#!/bin/sh
# POLYWINS
# SETTINGS {{{ ---
active_text_color="#eb4034"
active_bg=
active_underline="#eb4034"
inactive_text_color="#e5e5e5"
inactive_bg=
inactive_underline=
separator=" "
show="window_class" # options: window_title, window_class, window_classname
forbidden_classes="Polybar Conky Gmrun"
empty_desktop_message=""
char_limit=30
max_windows=50
char_case="normal" # normal, upper, lower
add_spaces="true"
resize_increment=16
wm_border_width=10 # setting this might be required for accurate resize position
# --- }}}
main() {
# If no argument passed...
if [ -z "$2" ]; then
# ...print new window list every time
# the active window changes or
# a window is opened or closed
xprop -root -spy _NET_CLIENT_LIST _NET_ACTIVE_WINDOW |
while IFS= read -r _; do
generate_window_list
done
# If arguments are passed, run requested on-click function
else
"$@"
fi
}
# ON-CLICK FUNCTIONS {{{ ---
raise_or_minimize() {
if [ "$(get_active_wid)" = "$1" ]; then
wmctrl -ir "$1" -b toggle,hidden
else
wmctrl -ir "$1" -b remove,hidden; wmctrl -ia "$1"
fi
}
close() {
wmctrl -ic "$1"
}
slop_resize() {
wmctrl -ia "$1"
wmctrl -ir "$1" -e "$(slop -f 0,%x,%y,%w,%h)"
}
increment_size() {
while IFS="[ .]" read -r wid ws wx wy ww wh _; do
test "$wid" != "$1" && continue
x=$(( wx - wm_border_width * 2 - resize_increment / 2 ))
y=$(( wy - wm_border_width * 2 - resize_increment / 2 ))
w=$(( ww + resize_increment ))
h=$(( wh + resize_increment ))
done <<-EOF
$(wmctrl -lG)
EOF
wmctrl -ir "$1" -e "0,$x,$y,$w,$h"
}
decrement_size() {
while IFS="[ .]" read -r wid ws wx wy ww wh _; do
test "$wid" != "$1" && continue
x=$(( wx - wm_border_width * 2 + resize_increment / 2 ))
y=$(( wy - wm_border_width * 2 + resize_increment / 2 ))
w=$(( ww - resize_increment ))
h=$(( wh - resize_increment ))
done <<-EOF
$(wmctrl -lG)
EOF
wmctrl -ir "$1" -e "0,$x,$y,$w,$h"
}
# --- }}}
# WINDOW LIST SETUP {{{ ---
active_left="%{F$active_text_color}"
active_right="%{F-}"
inactive_left="%{F$inactive_text_color}"
inactive_right="%{F-}"
separator="%{F$inactive_text_color}$separator%{F-}"
if [ -n "$active_underline" ]; then
active_left="${active_left}%{+u}%{u$active_underline}"
active_right="%{-u}${active_right}"
fi
if [ -n "$active_bg" ]; then
active_left="${active_left}%{B$active_bg}"
active_right="%{B-}${active_right}"
fi
if [ -n "$inactive_underline" ]; then
inactive_left="${inactive_left}%{+u}%{u$inactive_underline}"
inactive_right="%{-u}${inactive_right}"
fi
if [ -n "$inactive_bg" ]; then
inactive_left="${inactive_left}%{B$inactive_bg}"
inactive_right="%{B-}${inactive_right}"
fi
get_active_wid() {
active_wid=$(xprop -root _NET_ACTIVE_WINDOW)
active_wid="${active_wid#*\# }"
active_wid="${active_wid%,*}" # Necessary for XFCE
while [ ${#active_wid} -lt 10 ]; do
active_wid="0x0${active_wid#*x}"
done
echo "$active_wid"
}
get_active_workspace() {
wmctrl -d |
while IFS="[ .]" read -r number active_status _; do
test "$active_status" = "*" && echo "$number" && break
done
}
generate_window_list() {
active_workspace=$(get_active_workspace)
active_wid=$(get_active_wid)
window_count=0
on_click="$0"
# Format each window name one by one
# Space and . are both used as IFS,
# because classname and class are separated by '.'
while IFS="[ .\.]" read -r wid ws cname cls host title; do
# Don't show the window if on another workspace (-1 = sticky)
if [ "$ws" != "$active_workspace" ] && [ "$ws" != "-1" ]; then
continue
fi
# Don't show the window if its class is forbidden
case "$forbidden_classes" in
*$cls*) continue ;;
esac
# If max number of windows reached, just increment
# the windows counter
if [ "$window_count" -ge "$max_windows" ]; then
window_count=$(( window_count + 1 ))
continue
fi
# Show the user-selected window property
case "$show" in
"window_class") w_name="$cls" ;;
"window_classname") w_name="$cname" ;;
"window_title") w_name="$title" ;;
esac
# Use user-selected character case
case "$char_case" in
"lower") w_name=$(
echo "$w_name" | tr '[:upper:]' '[:lower:]'
) ;;
"upper") w_name=$(
echo "$w_name" | tr '[:lower:]' '[:upper:]'
) ;;
esac
# Truncate displayed name to user-selected limit
if [ "${#w_name}" -gt "$char_limit" ]; then
w_name="$(echo "$w_name" | cut -c1-$((char_limit-1)))"
fi
# Apply add-spaces setting
if [ "$add_spaces" = "true" ]; then
w_name=" $w_name "
fi
# Add left and right formatting to displayed name
if [ "$wid" = "$active_wid" ]; then
w_name="${active_left}${w_name}${active_right}"
else
w_name="${inactive_left}${w_name}${inactive_right}"
fi
# Add separator unless the window is first in list
if [ "$window_count" != 0 ]; then
printf "%s" "$separator"
fi
# Add on-click action Polybar formatting
printf "%s" "%{A1:$on_click raise_or_minimize $wid:}"
printf "%s" "%{A2:$on_click close $wid:}"
printf "%s" "%{A3:$on_click slop_resize $wid:}"
printf "%s" "%{A4:$on_click increment_size $wid:}"
printf "%s" "%{A5:$on_click decrement_size $wid:}"
# Print the final window name
printf "%s" "$w_name"
printf "%s" "%{A}%{A}%{A}%{A}%{A}"
window_count=$(( window_count + 1 ))
done <<-EOF
$(wmctrl -lx)
EOF
# After printing all the windows,
# print number of hidden windows
if [ "$window_count" -gt "$max_windows" ]; then
printf "%s" "+$(( window_count - max_windows ))"
fi
# Print empty desktop message if no windows are open
if [ "$window_count" = 0 ]; then
printf "%s" "$empty_desktop_message"
fi
# Print newline
echo ""
}
# --- }}}
main "$@"

View File

@ -7,6 +7,14 @@
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
[module/polywins]
type = custom/script
exec = ~/.config/polybar/gmg/scripts/polywins.sh 2>/dev/null
format = <label>
label = %output%
label-padding = 1
tail = true
[module/pulseaudio-control]
type = custom/script
tail = true

View File

@ -17,7 +17,7 @@ launch_bar() {
elif [[ "$style" == "pwidgets" ]]; then
bash "$dir"/pwidgets/launch.sh --main
elif [[ "$style" == "gmg" ]]; then
polybar -q main -c "$dir/$style/config.ini" &
polybar -q main -c "$dir/$style/config.ini" & polybar -q taskbar -c "$dir/$style/config.ini" &
else
polybar -q main -c "$dir/$style/config.ini" &
fi

View File

@ -6,7 +6,7 @@ standard_dialogs=kde
style=Breeze
[Fonts]
fixed=@Variant(\0\0\0@\0\0\0$\0R\0o\0\x62\0o\0t\0o\0 \0M\0o\0n\0o\0 \0[\0G\0O\0O\0G\0]@$\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\0\x10)
fixed=@Variant(\0\0\0@\0\0\0$\0R\0o\0\x62\0o\0t\0o\0 \0M\0o\0n\0o\0 \0[\0G\0O\0O\0G\0]@$\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
general=@Variant(\0\0\0@\0\0\0\f\0R\0o\0\x62\0o\0t\0o@$\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
[Interface]
@ -25,7 +25,7 @@ underline_shortcut=1
wheel_scroll_lines=3
[SettingsWindow]
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\x3\xc5\0\0\0-\0\0\au\0\0\x4-\0\0\x3\xc8\0\0\0\x30\0\0\ar\0\0\x4*\0\0\0\0\0\0\0\0\a\x80\0\0\x3\xc8\0\0\0\x30\0\0\ar\0\0\x4*)
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\x2+\0\0\0\xc2\0\0\x5j\0\0\x3\xa0\0\0\x2.\0\0\0\xc5\0\0\x5g\0\0\x3\x9d\0\0\0\0\0\0\0\0\a\x80\0\0\x2.\0\0\0\xc5\0\0\x5g\0\0\x3\x9d)
[Troubleshooting]
force_raster_widgets=1

View File

@ -14,6 +14,14 @@ super + @space
alt + @space
rofi -show run
# rofi calculator
super + alt + c
rofi -show calc -modi calc -no-show-match -no-sort
# rofimoji
super + period
rofimoji
# LibreWolf
super + b
librewolf
@ -22,6 +30,14 @@ super + b
super + alt + b
librewolf --private-window
# Chromium
super + shift + b
chromium
# Chromium (incognito)
super + shift + alt + b
chromium --incognito
# Kate
super + k
kate

1
.zshrc
View File

@ -2,6 +2,7 @@
export HISTFILE=~/.zsh_history
export SAVEHIST=1000
export HISTSIZE=1000
source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.

View File

@ -19,8 +19,9 @@ ktorrent &
yakuake &
keepassxc &
syncthingtray --wait &
stalonetray &
#stalonetray &
nextcloud &
qlipper &
#i=1
#while [ $i -le 6 ]

View File

@ -18,9 +18,8 @@ function send_notification {
# Make the bar with the special character ─ (it's not dash -)
# https://en.wikipedia.org/wiki/Box-drawing_character
bar=$(seq -s "─" $(($volume / 5)) | sed 's/[0-9]//g')
# Send the notification
dunstify -i audio-on -t 2000 -r 2593 -u normal "$volume $bar" -a Volume
if [[ $(dunstctl is-paused) == "false" ]]; then play '~/Sounds/changevol.wav'; fi
# Send the notification
if [[ $(dunstctl is-paused) == "false" ]]; then dunstify -i audio-on -r 2593 -u osd "$volume $bar" -a Volume & play '~/Sounds/changevol.wav'; fi
}
case $1 in
@ -40,7 +39,7 @@ case $1 in
# Toggle mute
#amixer -D pulse set Master 1+ toggle > /dev/null
if is_mute ; then
dunstify -i audio-volume-muted -t 2000 -r 2593 -u normal "Muto" -a Volume
if [[ $(dunstctl is-paused) == "false" ]]; then dunstify -i audio-volume-muted -r 2593 -u osd "Muto" -a Volume; fi
else
send_notification
fi