Add mako and update confs

This commit is contained in:
2021-11-10 15:38:52 +01:00
parent 02a9e46f96
commit 6cf171227a
23 changed files with 314 additions and 863 deletions

View File

@@ -22,7 +22,10 @@ set $term kitty
set $menu rofi -no-levenshtein-sort -color-enabled -show run\
-run-command "zsh -i -c '{cmd}'" | xargs swaymsg exec --
set $srclocker swaylock -c 222222 -u -i eDP-1:~/wallpapers/radiance.png\
-i DP-5:~/wallpapers/hornet.jpg -i DP-4:~/wallpapers/knight.jpg
-i DP-5:~/wallpapers/hornet.jpg -i DP-4:~/wallpapers/knight.jpg\
-i DP-7:~/wallpapers/hornet.jpg -i DP-6:~/wallpapers/knight.jpg\
-i DP-9:~/wallpapers/hornet.jpg -i DP-8:~/wallpapers/knight.jpg\
-i HDMI-A-1:~/wallpapers/radiance.png
### Output configuration
#
@@ -34,6 +37,8 @@ output "Samsung Electric Company SyncMaster H1AK500000" res 3840 2160
output "Dell Inc. DELL U2410 F525M0A1082L" pos 1920 680 res 1920 1200
#output "Dell Inc. DELL U2717D JXRPT83GAHKS" pos 3840 0 mode --custom 2560x1440@39Hz transform 90
output "Dell Inc. DELL U2717D JXRPT83GAHKS" pos 1920 1480 mode 2560 1440
output "Hewlett Packard HP LA2405x CN43480QK5" pos 3840 320 mode 1920 1200 transform 270
output "Dell Inc. DELL U2410 F525M98C17AL" pos 0 680 mode 1920 1200
output * bg ~/wallpapers/filianore-u.jpg fill
focus output eDP-1
#
@@ -98,10 +103,10 @@ input "9653:84:Samsung_electronics_inc._Samsung_HID_Multi-Touch"\
bindsym $mod+Shift+q kill
# Sound
bindsym XF86AudioRaiseVolume exec amixer -c 0 sset Master 5%+
bindsym XF86AudioLowerVolume exec amixer -c 0 sset Master 5%-
bindsym XF86AudioMute exec 'amixer -c 0 sset Master toggle && amixer -c 0 sset Speaker on && amixer -c 0 sset Headphone on'
bindsym XF86AudioMicMute exec amixer -c 0 sset Capture toggle
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
# Brightness
bindsym XF86MonBrightnessUp exec xbacklight -inc 5
@@ -256,7 +261,9 @@ bar {
# The default just shows the current date and time.
#status_command while ~/.config/sway/status.sh; do sleep 1; done
status_command i3status-rs ~/.config/sway/status.toml
# swaybar_command waybar
status_padding 0
height 22
colors {
statusline #ffffff
@@ -267,6 +274,9 @@ bar {
}
}
bindswitch --locked --reload lid:on output eDP-1 disable
bindswitch --locked --reload lid:off output eDP-1 enable
bindsym Ctrl+m exec mpv "$(wl-paste -t text)"
hide_edge_borders both
@@ -279,7 +289,7 @@ include /etc/sway/config.d/*
# Assignments
assign [class="discord"] workspace 3
assign [class="Spotify"] workspace 3
for_window [class="Spotify"] opacity 0.8
#for_window [class="Spotify"] opacity 0.8
#for_window [class="Chromium"] opacity 0.9
exec redshift -O 4500 -m wayland
@@ -289,7 +299,7 @@ exec nm-applet --indicator
#exec cadence
#exec ~/.local/start_jack.sh
exec ~/.config/sway/workspace-rename.sh
exec ~/.config/sway/workspace_rename.py
for_window [class="Tor Browser"] floating enable

5
.config/sway/run-once.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
if ! pgrep -x $1; then
${@:1}
fi

9
.config/sway/status.sh Executable file
View File

@@ -0,0 +1,9 @@
date_formatted=$(date +'%d/%m/%Y %R')
battery_status=$(acpi -b | awk '{printf "%3d%", substr($4, 1, length($4)-1)}')
ram_status=$(free -m | awk '/Mem/{mem = $3}; END {printf "%5dMB", mem}')
cpu_status=$(top -bn1 | awk '/Cpu/{cpu = 100 - $8}; END {printf "%3d\%", cpu}')
echo "| RAM: ${ram_status} | CPU: $cpu_status | BAT: $battery_status | $date_formatted |"

View File

@@ -9,11 +9,12 @@ good_bg = "#859900cc"
warning_bg = "#b58900cc"
critical_bg = "#dc322fcc"
alternating_tint_bg = "#00000000"
#separator = "<span font='14'>\ue0b2</span>"
separator = ""
[[block]]
block = "focused_window"
max_width = 100
#[[block]]
#block = "focused_window"
#max_width = 100
[[block]]
block = "music"
@@ -25,19 +26,22 @@ marquee = true
[[block]]
block = "sound"
driver = "alsa"
#device = "hw:0"
driver = "auto"
show_volume_when_muted = true
headphones_indicator = true
step_width = 3
[[block]]
block = "memory"
display_type = "memory"
format_mem = "{Mum}MB"
format_mem = "{mem_used;M}"
clickable = false
on_click = "kitty btop"
[[block]]
block = "cpu"
interval = 1
on_click = "kitty btop"
#[[block]]
#block = "sound"
@@ -46,6 +50,23 @@ interval = 1
block = "battery"
interval = 10
[[block]]
block = "pacman"
interval = 600
format = "{both} updates available"
format_singular = "{both} update available"
format_up_to_date = "up to date"
hide_when_uptodate = true
critical_updates_regex = "(^(linux-|sway|wl)|pipewire)"
aur_command = "yay -Qua"
on_click = "kitty zsh -i -c update"
[[block]]
block = "networkmanager"
on_click = "networkmanager_dmenu"
device_format = "{icon}{ap}"
interface_name_exclude = ["br\\-[0-9a-f]{12}", "docker\\d+"]
[[block]]
block = "time"
interval = 60

View File

@@ -13,7 +13,7 @@ swaymsg -t subscribe -m '[ "window" ]' | while read -r event ; do
if [ "$app_name" = "kitty" ] ; then
app_name=""
elif [ "$app_name" = "chromium" ] ; then
elif [ "$app_name" = "Chromium" ] || [ "$app_name" = "google-chrome" ]; then
case "$(jq -r '.container.name' <<< $event)" in
*YouTube*)
app_name=""

View File

@@ -0,0 +1,52 @@
#!/bin/python3
import asyncio
from i3ipc import Event
from i3ipc.aio import Connection
async def main():
sway = await Connection().connect()
def on(event, handler=None):
def on_wrapped(handler):
sway.on(event, handler)
return handler
if handler:
return on_wrapped(handler)
else:
return on_wrapped
@on(Event.WINDOW_FOCUS)
async def on_window_focus(sway, e):
focused_window = (await sway.get_tree()).find_focused()
focused_workspace = focused_window.workspace()
new_name = f'{focused_workspace.num}:'
app_name = e.container.app_id
if not app_name:
app_name = e.container.window_instance
if app_name == 'kitty':
new_name += ''
elif app_name in ['Chromium', 'google-chrome']:
if 'YouTube' in e.container.name:
new_name += ''
else:
new_name += ''
elif app_name == 'discord':
new_name += ''
elif app_name == 'spotify':
new_name += ''
elif app_name in ['GEMOC Studio', 'code-oss']:
new_name += ''
elif app_name:
new_name += app_name
await sway.command(f'rename workspace to "{new_name}"')
await sway.main()
asyncio.get_event_loop().run_until_complete(main())