--- A *default windowfilter* (not to be confused with the default filter *within* a windowfilter) is provided as convenience; --- it excludes some known apps and windows that are transient in nature, therefore unlikely to be "interesting" for e.g. window management. --- `hs.window.filter.new()` (with no arguments) returns a copy of the default windowfilter that you can further tailor to your needs - see `hs.window.filter.default` and `hs.window.filter.new()` for more information.
--- --- -- set the exact scope of what you're interested in - see hs.window.filter:setAppFilter() --- wf_terminal = wf.new{'Terminal','iTerm2'} -- all visible terminal windows --- wf_timewaster = wf.new(false):setAppFilter('Safari',{allowTitles='reddit'}) -- any Safari windows with "reddit" anywhere in the title --- wf_leftscreen = wf.new{override={visible=true,fullscreen=false,allowScreens='-1,0',currentSpace=true}} --- -- all visible and non-fullscreen windows that are on the screen to the left of the primary screen in the current Space --- wf_editors_righthalf = wf.new{'TextEdit','Sublime Text','BBEdit'}:setRegions(hs.screen.primaryScreen():fromUnitRect'0.5,0/1,1') --- -- text editor windows that are on the right half of the primary screen --- wf_bigwindows = wf.new(function(w)return w:frame().area>3000000 end) -- only very large windows --- wf_notif = wf.new{['Notification Center']={allowRoles='AXNotificationCenterAlert'}} -- notification center alerts --- --- -- subscribe to events --- wf_terminal:subscribe(wf.windowFocused,some_fn) -- run a function whenever a terminal window is focused --- wf_timewaster:subscribe(wf.hasWindow,startAnnoyingMe):subscribe(wf.hasNoWindows,stopAnnoyingMe) -- fight procrastination :) ---
-----------------------mine start----------------------------- -- ADD by Thomas localfunctionChinese() hs.console.printStyledtext("chinese") hs.keycodes.currentSourceID("com.apple.inputmethod.SCIM.ITABC") end
localfunctionEnglish() hs.console.printStyledtext(hs.keycodes.currentSourceID()) hs.keycodes.currentSourceID("com.apple.keylayout.ABC") end
- local localpath = os.getenv("HOME") .. "/.Trash/" .. hs.http.urlParts(obj.full_url).lastPathComponent - hs.screen.mainScreen():desktopImageURL("file://" .. localpath) + local localpath = os.getenv("HOME") .. "/Public/bing/" .. hs.http.urlParts(obj.full_url).queryItems[1].id + hs.console.printStyledtext("desktopIMG:" .. localpath) + hs.screen.primaryScreen():desktopImageURL("file://" .. localpath) + local scs=hs.screen.allScreens() + local count = 0 + for _ inpairs(scs) do count = count + 1end + hs.console.printStyledtext("table.size: " .. count) + for i=1,#scs do scs[i]:desktopImageURL("file://" .. localpath) end
- local user_agent_str = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/603.2.4 (KHTML, like Gecko) Version/10.1.1 Safari/603.2.4" + local user_agent_str = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" - hs.http.asyncGet(json_req_url, {["User-Agent"]=user_agent_str}, function(stat,body,header) + hs.http.asyncGet(json_req_url, {["User-Agent"]=user_agent_str,["cookie"]="ENSEARCH=BENVER=1"}, function(stat,body,header)
- local localpath = os.getenv("HOME") .. "/.Trash/" .. hs.http.urlParts(obj.full_url).lastPathComponent + local localpath = os.getenv("HOME") .. "/Public/bing/" .. hs.http.urlParts(obj.full_url).queryItems[1].id