Black and White

This commit is contained in:
Marco Thomas
2021-12-28 14:29:51 +01:00
parent 96732585f5
commit 68b1c4c0bc
8 changed files with 312 additions and 54 deletions

View File

@@ -4,7 +4,7 @@
monitor = 0
follow = mouse
geometry = "320x6-30+60"
geometry = "400x6-30+60"
indicate_hidden = yes
shrink = no
notification_height = 15
@@ -13,7 +13,7 @@
padding = 10
horizontal_padding = 10
frame_width = 0
frame_color = "#ffffff"
frame_color = "#aaaaaa"
separator_color = frame
sort = yes
idle_threshold = 120
@@ -38,7 +38,7 @@
icon_position = left
min_icon_size = 48
max_icon_size = 96
icon_path = /usr/share/icons/Qogir/status/48/:/usr/share/icons/Qogir/devices/48/:/usr/share/icons/Qogir/48x48/apps/
icon_path = /usr/share/icons/Papirus/48x48/status/:/usr/share/icons/Papirus/48x48/devices/:/usr/share/icons/Papirus/48x48/apps/
# History

View File

@@ -9,18 +9,14 @@ bindsym $mod+Shift+s exec --no-startup-id flameshot gui
# audio and brightness
bindsym XF86AudioMute exec --no-startup-id amixer -q set Master toggle
bindsym XF86AudioLowerVolume exec --no-startup-id amixer set Master 3%-
bindsym XF86AudioRaiseVolume exec --no-startup-id amixer set Master 3%+
bindsym XF86AudioLowerVolume exec --no-startup-id amixer set Master 1%-
bindsym XF86AudioRaiseVolume exec --no-startup-id amixer set Master 1%+
bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause
bindsym XF86AudioNext exec --no-startup-id playerctl next
bindsym XF86AudioPrev exec --no-startup-id playerctl previous
bindsym XF86MonBrightnessUp exec --no-startup-id light -A 10
bindsym XF86MonBrightnessDown exec --no-startup-id light -U 10
# smoother keyboard (autorepeat)
exec --no-startup-id xset r rate 300 50
# no mouse accel
exec --no-startup-id xset m 1
# kill focused window
bindsym $mod+Shift+BackSpace kill
@@ -39,12 +35,6 @@ bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+v split h
@@ -121,10 +111,10 @@ set $blue "#55b4d4"
set $yellow "#e7c547"
# class border backgr. text indicator child_border
client.focused $green $green $black $green $green
client.focused_inactive $yellow $yellow $black $yellow $yellow
client.unfocused $yellow $yellow $black $yellow $yellow
client.urgent $red $red $white $red $red
client.focused $green $green $black $green $black
client.focused_inactive $yellow $yellow $black $yellow $black
client.unfocused $white $white $black $white $black
client.urgent $red $red $white $red $black
# i3 bar
# flaoting on start
@@ -136,7 +126,7 @@ hide_edge_borders smart
for_window [class="^.*"] border pixel 0
# bar
exec --no-startup-id polybar -r titlebar
exec --no-startup-id polybar -r bar
# gaps
gaps inner 10
@@ -149,5 +139,4 @@ exec --no-startup-id nm-applet
exec --no-startup-id keepassxc
exec --no-startup-id seafile-applet
exec --no-startup-id fcitx5
exec --no-startup-id volumeicon
exec --no-startup-id picom
exec --no-startup-id picom --backend glx --no-vsync

View File

@@ -5,13 +5,14 @@ rounded-corners-exclude = [
"class_g = 'Polybar'",
];
detect-rounded-corners = true
shadow = true;
shadow-radius = 8;
shadow-offset-x = 8;
shadow-offset-y = 8;
shadow-radius = 15;
shadow-opacity = 0.2
shadow-exclude = [
"class_g = 'i3-frame'",
"class_g = 'Polybar'",
"class_g = 'Firefox'",
];

View File

@@ -8,31 +8,29 @@ scroll-down = i3wm-wsnext
fixed-center = true
tray-position = right
width = 100%
height = 30
background = #ffffff
foreground = #5c6773
radius-bottom = 2
bottom = false
#line-size = 1
#line-color = #f00
tray-position = right
line-size = 4
#border-size = 2
#border-color = #ffffff
padding-left = 1
padding-right = 1
module-margin = 1
modules-left = logo i3 title
modules-center =
modules-right = wireless-network pulseaudio date time
modules-left = logo i3 polywins
modules-center = date time
modules-right = backlight pulseaudio battery
[module/i3]
strip-wsnumbers = true
wrapping-scroll = false
type = internal/i3
format = <label-state> <label-mode>
@@ -47,7 +45,7 @@ label-visible = %index%
label-visible-padding = 1
label-urgent = %index%
label-urgent-background = #ff3333
label-urgent-overline = #ff3333
label-urgent-padding = 1
[module/date]
@@ -62,11 +60,12 @@ date = %H:%M:%S
[module/pulseaudio]
type = internal/pulseaudio
sink = alsa_output.pci-0000_12_00.3.analog-stereo
sink = master
use-ui-max = true
interval = 5
format-volume = <label-volume>
format-volume = 音 「<label-volume>
label-muted = muted
click-right = pavucontrol
[module/title]
type = internal/xwindow
@@ -78,12 +77,26 @@ type = custom/text
content = "花"
content-padding = 1
[module/wireless-network]
type = internal/network
interface = wlo1
interval = 3.0
udspeed-minwidth = 0
format-connected = <label-connected>
format-disconnected = <label-disconnected>
label-connected = %essid%
label-disconnected = "no wifi"
[module/battery]
type = internal/battery
full-at = 99
battery = BAT0
adapter = ADP1
time-format = %H:%M
label-charging = 電池 「charging %percentage%% - %time%」
label-discharging = 電池 「%percentage%%」
label-full = 電池 「full」
[module/backlight]
type = internal/backlight
card = amdgpu_bl0
label = 電気 「%percentage%%」
[module/polywins]
type = custom/script
exec = /home/marc/dots/files/polywins.sh 2>/dev/null
format = <label>
label = %output%
label-padding = 1
tail = true

View File

@@ -14,7 +14,7 @@ configuration {
// blur version
* {
bg: #ffffff;
ac: #0087af;
ac: #A6CC70;
}
* {

View File

@@ -6,6 +6,18 @@ xrdb -merge $HOME/.Xresources
# map CAPS to ~
setxkbmap -option caps:none
xmodmap -e "keycode 66 = grave asciitilde"
setxkbmap eu
# energy options
xset s off
xset -dpms
xset s noblank
# keyboard repeat
xset r rate 300 50
# no mouse accel
xset m 1
# path
export PATH=$PATH:$HOME/scripts:$HOME/.cargo/bin:$HOME/.cabal/bin:$HOME/.ghcup/bin:$HOME/.local/bin

View File

@@ -568,7 +568,8 @@
(rust-mode . lsp)
(java-mode . lsp)
(python-mode . lsp)
(haskell-mode . lsp))
(haskell-mode . lsp)
(c++-mode . lsp))
;; Tags (search e.g. for structs)
(use-package lsp-ivy
@@ -633,7 +634,7 @@
(use-package yasnippet-snippets
:straight (yasnippet-snippets :type git :host github :repo "AndreaCrotti/yasnippet-snippets"
:fork (:host github
:repo "crammk/yasnippet-snippets"))
:repo "marcothms/yasnippet-snippets"))
:after yasnippet)
;; Compilation for lsp
@@ -668,7 +669,7 @@
;; WebGpuShaderLanguage
(use-package wgsl-mode
:straight (wgsl-mode :type git :host github :repo "CramMK/wgsl-mode")
:straight (wgsl-mode :type git :host github :repo "marcothms/wgsl-mode")
:mode ("\\.wgsl\\'" . wgsl-mode))
;; Java

242
files/polywins.sh Executable file
View File

@@ -0,0 +1,242 @@
#!/bin/sh
# POLYWINS
# SETTINGS {{{ ---
active_text_color="#5c6773"
active_bg=
active_underline="#a6cc70"
inactive_text_color="#5c6773"
inactive_bg=
inactive_underline=
separator="·"
show="window_class" # options: window_title, window_class, window_classname
forbidden_classes="Polybar Conky Gmrun"
empty_desktop_message="Desktop"
char_limit=15
max_windows=15
char_case="normal" # normal, upper, lower
add_spaces="true"
resize_increment=16
wm_border_width=1 # 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 "$@"