Merge branch 'main' of ssh://git.pogmom.me:1022/pogmommy/dotfiles
This commit is contained in:
commit
6aaf0714e1
4 changed files with 101 additions and 0 deletions
|
@ -39,3 +39,9 @@ shadow_color $color5aa
|
||||||
shadow_inactive_color $color055
|
shadow_inactive_color $color055
|
||||||
shadow_blur_radius 6
|
shadow_blur_radius 6
|
||||||
corner_radius 8
|
corner_radius 8
|
||||||
|
#default_dim_inactive 0.25
|
||||||
|
#set $trans 0.8
|
||||||
|
#set $alphamark "α"
|
||||||
|
#for_window [con_mark=$alphamark] opacity set $trans
|
||||||
|
#bindsym $mod+Control+a mark --toggle "$alphamark" ; [con_id=__focused__] opacity set 1 ;[con_mark=$alphamark con_id=__focused__] opacity set $trans
|
||||||
|
exec '/usr/bin/python3 $HOME/.config/sway/scripts/inactive-windows-transparency.py -o 0.75'
|
||||||
|
|
|
@ -47,6 +47,7 @@ for_window {
|
||||||
[app_id="Alacritty_Float"] $float
|
[app_id="Alacritty_Float"] $float
|
||||||
[class="^Signal$"] $float
|
[class="^Signal$"] $float
|
||||||
[app_id="org.kde.dolphin" title="^Extracting Files"] $float
|
[app_id="org.kde.dolphin" title="^Extracting Files"] $float
|
||||||
|
[app_id="gurk-rs"] $float
|
||||||
|
|
||||||
#game - inhibit idle focus, no border, fullscreen, floating
|
#game - inhibit idle focus, no border, fullscreen, floating
|
||||||
[instance="origin.exe"] $game
|
[instance="origin.exe"] $game
|
||||||
|
|
|
@ -0,0 +1,91 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
# This script requires i3ipc-python package (install it from a system package manager
|
||||||
|
# or pip).
|
||||||
|
# It makes inactive windows transparent. Use `transparency_val` variable to control
|
||||||
|
# transparency strength in range of 0…1 or use the command line argument -o.
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import signal
|
||||||
|
import sys
|
||||||
|
from functools import partial
|
||||||
|
|
||||||
|
import i3ipc
|
||||||
|
|
||||||
|
|
||||||
|
def on_window(args, ipc, event):
|
||||||
|
global focused_set
|
||||||
|
|
||||||
|
# To get the workspace for a container, we need to have received its
|
||||||
|
# parents, so fetch the whole tree
|
||||||
|
tree = ipc.get_tree()
|
||||||
|
|
||||||
|
focused = tree.find_focused()
|
||||||
|
if focused is None:
|
||||||
|
return
|
||||||
|
|
||||||
|
focused_workspace = focused.workspace()
|
||||||
|
|
||||||
|
focused.command("opacity " + args.focused)
|
||||||
|
focused_set.add(focused.id)
|
||||||
|
|
||||||
|
to_remove = set()
|
||||||
|
for window_id in focused_set:
|
||||||
|
if window_id == focused.id:
|
||||||
|
continue
|
||||||
|
window = tree.find_by_id(window_id)
|
||||||
|
if window is None:
|
||||||
|
to_remove.add(window_id)
|
||||||
|
elif args.global_focus or window.workspace() == focused_workspace:
|
||||||
|
window.command("opacity " + args.opacity)
|
||||||
|
to_remove.add(window_id)
|
||||||
|
|
||||||
|
focused_set -= to_remove
|
||||||
|
|
||||||
|
def remove_opacity(ipc, focused_opacity):
|
||||||
|
for workspace in ipc.get_tree().workspaces():
|
||||||
|
for w in workspace:
|
||||||
|
w.command("opacity " + focused_opacity)
|
||||||
|
ipc.main_quit()
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
description="This script allows you to set the transparency of unfocused windows in sway."
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--opacity",
|
||||||
|
"-o",
|
||||||
|
type=str,
|
||||||
|
default="0.80",
|
||||||
|
help="set inactive opacity value in range 0...1",
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--focused",
|
||||||
|
"-f",
|
||||||
|
type=str,
|
||||||
|
default="1.0",
|
||||||
|
help="set focused opacity value in range 0...1",
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--global-focus",
|
||||||
|
"-g",
|
||||||
|
action="store_true",
|
||||||
|
help="only have one opaque window across all workspaces",
|
||||||
|
)
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
ipc = i3ipc.Connection()
|
||||||
|
focused_set = set()
|
||||||
|
|
||||||
|
for window in ipc.get_tree():
|
||||||
|
if window.focused:
|
||||||
|
focused_set.add(window.id)
|
||||||
|
window.command("opacity " + args.focused)
|
||||||
|
else:
|
||||||
|
window.command("opacity " + args.opacity)
|
||||||
|
for sig in [signal.SIGINT, signal.SIGTERM]:
|
||||||
|
signal.signal(sig, lambda signal, frame: remove_opacity(ipc, args.focused))
|
||||||
|
ipc.on("window", partial(on_window, args))
|
||||||
|
ipc.main()
|
3
de/home/.config/sway/scripts/lock.sh
Normal file
3
de/home/.config/sway/scripts/lock.sh
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue