Update
This commit is contained in:
@@ -139,6 +139,8 @@ input "9653:84:Samsung_electronics_inc._Samsung_HID_Multi-Touch"\
|
||||
|
||||
# Screenshot
|
||||
bindsym Print exec grim -g "$(slurp -d)" - | wl-copy -t image/png
|
||||
bindsym Ctrl+Print exec swaymsg -t get_tree | jq -r 'recurse(.nodes[], .floating_nodes[]) | select(.focused and .pid).rect | "\(.x),\(.y) \(.width)x\(.height)"' | grim -g - - | wl-copy -t image/png
|
||||
bindsym Shift+Print exec grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') - | wl-copy -t image/png
|
||||
#
|
||||
# Moving around:
|
||||
#
|
||||
@@ -208,6 +210,9 @@ input "9653:84:Samsung_electronics_inc._Samsung_HID_Multi-Touch"\
|
||||
# Make the current focus fullscreen
|
||||
bindsym $mod+f fullscreen
|
||||
|
||||
# Maximize current focus
|
||||
bindsym $mod+m exec swaymsg floating true && swaymsg resize set $(swaymsg -t get_workspaces | jq -r '.[] | select(.focused) | .rect | "\(.width)px \(.height)px"')
|
||||
|
||||
# Toggle the current focus between tiling and floating mode
|
||||
bindsym $mod+Shift+space floating toggle
|
||||
|
||||
@@ -262,7 +267,7 @@ bindsym Ctrl+Alt+l exec $srclocker
|
||||
bar {
|
||||
position top
|
||||
pango_markup enabled
|
||||
font pango:DejaVu Sans Mono, FontAwesome 10
|
||||
font pango:DejaVu Sans Mono, devicons, FontAwesome 10
|
||||
|
||||
# When the status_command prints a new line to stdout, swaybar updates.
|
||||
# The default just shows the current date and time.
|
||||
@@ -289,28 +294,20 @@ bindsym Ctrl+m exec mpv "$(wl-paste -t text)"
|
||||
hide_edge_borders both
|
||||
default_border none
|
||||
gaps inner 6
|
||||
#smart_gaps on
|
||||
|
||||
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="Chromium"] opacity 0.9
|
||||
|
||||
exec redshift -O 4500 -m wayland
|
||||
exec megasync
|
||||
exec nm-applet --indicator
|
||||
|
||||
#exec cadence
|
||||
#exec ~/.local/start_jack.sh
|
||||
|
||||
exec ~/.config/sway/workspace_rename.py
|
||||
exec ~/.config/sway/workspace_rename.py > ~/.cache/workspace_rename.log 2> ~/.cache/workspace_rename_error.log
|
||||
|
||||
for_window [class="Tor Browser"] floating enable
|
||||
|
||||
for_window [app_id="kitty-scratch"] {
|
||||
for_window [app_id="kitty-scratch|pavucontrol"] {
|
||||
move to scratchpad
|
||||
scratchpad show
|
||||
}
|
||||
@@ -321,8 +318,6 @@ exec $term
|
||||
workspace 2 output eDP-1
|
||||
|
||||
workspace 3 output eDP-1
|
||||
exec discord
|
||||
exec spotify
|
||||
|
||||
workspace 4 output "Dell Inc. DELL U2410 F525M0A1082L"
|
||||
|
||||
@@ -337,3 +332,7 @@ workspace 8 output "Dell Inc. DELL U2717D JXRPT83GAHKS"
|
||||
workspace 9 output "Dell Inc. DELL U2717D JXRPT83GAHKS"
|
||||
|
||||
exec xrdb -load ~/.Xresources
|
||||
|
||||
exec autotiling
|
||||
|
||||
exec "systemctl --user import-environment; systemctl --user start sway-session.target"
|
||||
|
||||
@@ -19,10 +19,9 @@ separator = "<span font='14'>\ue0b2</span>"
|
||||
[[block]]
|
||||
block = "music"
|
||||
player = "spotify"
|
||||
buttons = ["play", "next"]
|
||||
buttons = ["prev", "play", "next"]
|
||||
on_collapsed_click = "spotify"
|
||||
max_width = 21
|
||||
marquee = true
|
||||
max_width = 0
|
||||
|
||||
[[block]]
|
||||
block = "sound"
|
||||
@@ -30,6 +29,7 @@ driver = "auto"
|
||||
show_volume_when_muted = true
|
||||
headphones_indicator = true
|
||||
step_width = 3
|
||||
on_click = "pavucontrol"
|
||||
|
||||
[[block]]
|
||||
block = "memory"
|
||||
@@ -63,7 +63,7 @@ on_click = "kitty --class kitty-scratch -c ~/.config/kitty/kitty-scratch.conf zs
|
||||
|
||||
[[block]]
|
||||
block = "networkmanager"
|
||||
on_click = "networkmanager_dmenu"
|
||||
on_click = "kitty --class kitty-scratch -c ~/.config/kitty/kitty-scratch.conf nmtui"
|
||||
device_format = "{icon}{ap}"
|
||||
interface_name_exclude = ["br\\-[0-9a-f]{12}", "docker\\d+"]
|
||||
|
||||
|
||||
@@ -9,40 +9,53 @@ from i3ipc.aio import Connection
|
||||
async def main():
|
||||
sway = await Connection().connect()
|
||||
|
||||
@sway.on(Event.WINDOW_FOCUS)
|
||||
async def on_window_focus(sway, e):
|
||||
focused_window = (await sway.get_tree()).find_focused()
|
||||
focused_workspace = focused_window.workspace()
|
||||
@sway.on(Event.WINDOW_NEW)
|
||||
@sway.on(Event.WINDOW_CLOSE)
|
||||
@sway.on(Event.WINDOW_MOVE)
|
||||
@sway.on(Event.WINDOW_TITLE)
|
||||
async def on_window_change(sway, _):
|
||||
for w in (await sway.get_tree()).workspaces():
|
||||
new_name = f'{w.num}:'
|
||||
|
||||
new_name = f'{focused_workspace.num}:'
|
||||
first_descendant = True
|
||||
for d in w.descendants():
|
||||
app_name = d.app_id
|
||||
if not app_name:
|
||||
app_name = d.window_instance
|
||||
|
||||
app_name = e.container.app_id
|
||||
if not app_name:
|
||||
app_name = e.container.window_instance
|
||||
if app_name:
|
||||
if not first_descendant:
|
||||
new_name += ' '
|
||||
first_descendant = False
|
||||
|
||||
if app_name:
|
||||
if 'kitty' in app_name:
|
||||
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 'okular' in app_name:
|
||||
new_name += '<span font=\'FontAwesome 5 Free Solid\'></span>'
|
||||
elif app_name == 'pavucontrol':
|
||||
new_name += ''
|
||||
else:
|
||||
new_name += app_name
|
||||
if 'kitty' in app_name:
|
||||
if 'vim' in d.name:
|
||||
new_name += '<span font=\'12\' rise=\'-2500\'>\ue6c5</span>'
|
||||
else:
|
||||
new_name += ''
|
||||
elif app_name in ['Chromium', 'google-chrome', 'google-chrome-unstable']:
|
||||
if 'YouTube' in d.name:
|
||||
new_name += ''
|
||||
else:
|
||||
new_name += ''
|
||||
elif app_name == 'Navigator':
|
||||
new_name += ''
|
||||
elif app_name == 'discord':
|
||||
new_name += ''
|
||||
elif app_name == 'spotify':
|
||||
new_name += '<span font=\'11\' rise=\'-400\'></span>'
|
||||
elif app_name in ['GEMOC Studio', 'code-oss']:
|
||||
new_name += ''
|
||||
elif 'okular' in app_name or 'zathura' in app_name:
|
||||
new_name += '<span font=\'FontAwesome 5 Free Solid\'></span>'
|
||||
elif app_name == 'pavucontrol':
|
||||
new_name += ''
|
||||
else:
|
||||
new_name += app_name
|
||||
|
||||
await sway.command(f'rename workspace "{w.name}" to "{new_name}"')
|
||||
|
||||
await sway.command(f'rename workspace to "{new_name}"')
|
||||
|
||||
await sway.main()
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(main())
|
||||
asyncio.run(main())
|
||||
|
||||
Reference in New Issue
Block a user