diff options
author | Indrajith K L | 2023-09-08 14:43:41 +0530 |
---|---|---|
committer | Indrajith K L | 2023-09-08 14:43:41 +0530 |
commit | 0f144c1ef9d831b1c663ef998f40e22c33156d9e (patch) | |
tree | dd20b22ce18b5e6e0b00b43d1b5a2699792563f1 /.config/kitty/kitty-themes/.tools/windowid.swift | |
download | DotFiles-0f144c1ef9d831b1c663ef998f40e22c33156d9e.tar.gz DotFiles-0f144c1ef9d831b1c663ef998f40e22c33156d9e.tar.bz2 DotFiles-0f144c1ef9d831b1c663ef998f40e22c33156d9e.zip |
* Adds Basic dot files configs
Diffstat (limited to '.config/kitty/kitty-themes/.tools/windowid.swift')
-rwxr-xr-x | .config/kitty/kitty-themes/.tools/windowid.swift | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/.config/kitty/kitty-themes/.tools/windowid.swift b/.config/kitty/kitty-themes/.tools/windowid.swift new file mode 100755 index 0000000..1dc95e6 --- /dev/null +++ b/.config/kitty/kitty-themes/.tools/windowid.swift @@ -0,0 +1,20 @@ +#!/usr/bin/swift +import Foundation +import Cocoa +import CoreGraphics.CGWindow + +let windows : NSArray = CGWindowListCopyWindowInfo(CGWindowListOption.excludeDesktopElements, kCGNullWindowID)! as NSArray + +let search_for_app = CommandLine.arguments[1] +let search_for_win = CommandLine.arguments[2] + +for window in windows { + let window = window as! NSDictionary + + let app_name = window[kCGWindowOwnerName] as! String + let window_name = window[kCGWindowName] as? String + + if app_name == search_for_app && window_name == search_for_win { + print("\(window[kCGWindowNumber]!)") + } +} |