skhd + yabai + sketchybar
This commit is contained in:
210
__sketchybar/app_icons.lua
Normal file
210
__sketchybar/app_icons.lua
Normal file
@@ -0,0 +1,210 @@
|
||||
return {
|
||||
["Typora"] = ":text:",
|
||||
["Orion"] = ":orion:",
|
||||
["Orion RC"] = ":orion:",
|
||||
["Grammarly Editor"] = ":grammarly:",
|
||||
["kitty"] = ":kitty:",
|
||||
["ClickUp"] = ":click_up:",
|
||||
["Iris"] = ":iris:",
|
||||
["PomoDone App"] = ":pomodone:",
|
||||
["qutebrowser"] = ":qute_browser:",
|
||||
["Raindrop.io"] = ":raindrop_io:",
|
||||
["Airmail"] = ":airmail:",
|
||||
["Affinity Publisher 2"] = ":affinity_publisher_2:",
|
||||
["Calendar"] = ":calendar:",
|
||||
["日历"] = ":calendar:",
|
||||
["Fantastical"] = ":calendar:",
|
||||
["Cron"] = ":calendar:",
|
||||
["Amie"] = ":calendar:",
|
||||
["Figma"] = ":figma:",
|
||||
["Element"] = ":element:",
|
||||
["Signal"] = ":signal:",
|
||||
["Mattermost"] = ":mattermost:",
|
||||
["Caprine"] = ":caprine:",
|
||||
["Microsoft To Do"] = ":things:",
|
||||
["Things"] = ":things:",
|
||||
["Godot"] = ":godot:",
|
||||
["Android Messages"] = ":android_messages:",
|
||||
["Zed"] = ":zed:",
|
||||
["Anytype"] = ":anytype:",
|
||||
["TeamSpeak 3"] = ":team_speak:",
|
||||
["LibreWolf"] = ":libre_wolf:",
|
||||
["neovide"] = ":neovide:",
|
||||
["Spotlight"] = ":spotlight:",
|
||||
["微信"] = ":wechat:",
|
||||
["Dropbox"] = ":dropbox:",
|
||||
["Transmit"] = ":transmit:",
|
||||
["TickTick"] = ":tick_tick:",
|
||||
["Parallels Desktop"] = ":parallels:",
|
||||
["Audacity"] = ":audacity:",
|
||||
["Rider"] = ":rider:",
|
||||
["JetBrains Rider"] = ":rider:",
|
||||
["DEVONthink 3"] = ":devonthink3:",
|
||||
["Docker"] = ":docker:",
|
||||
["Docker Desktop"] = ":docker:",
|
||||
["Matlab"] = ":matlab:",
|
||||
["VLC"] = ":vlc:",
|
||||
["Alacritty"] = ":alacritty:",
|
||||
["Pages"] = ":pages:",
|
||||
["Pages 文稿"] = ":pages:",
|
||||
["Bear"] = ":bear:",
|
||||
["Pine"] = ":pine:",
|
||||
["Affinity Designer 2"] = ":affinity_designer_2:",
|
||||
["Keyboard Maestro"] = ":keyboard_maestro:",
|
||||
["Joplin"] = ":joplin:",
|
||||
["mpv"] = ":mpv:",
|
||||
["zoom.us"] = ":zoom:",
|
||||
["Affinity Photo 2"] = ":affinity_photo_2:",
|
||||
["Music"] = ":music:",
|
||||
["音乐"] = ":music:",
|
||||
["League of Legends"] = ":league_of_legends:",
|
||||
["Tor Browser"] = ":tor_browser:",
|
||||
["Hyper"] = ":hyper:",
|
||||
["WhatsApp"] = ":whats_app:",
|
||||
["카카오톡"] = ":kakaotalk:",
|
||||
["Discord"] = ":discord:",
|
||||
["Discord Canary"] = ":discord:",
|
||||
["Discord PTB"] = ":discord:",
|
||||
["Neovide"] = ":vim:",
|
||||
["MacVim"] = ":vim:",
|
||||
["Vim"] = ":vim:",
|
||||
["VimR"] = ":vim:",
|
||||
["Keynote"] = ":keynote:",
|
||||
["Keynote 讲演"] = ":keynote:",
|
||||
["iTerm"] = ":iterm:",
|
||||
["IntelliJ IDEA"] = ":idea:",
|
||||
["Finder"] = ":finder:",
|
||||
["访达"] = ":finder:",
|
||||
["Xcode"] = ":xcode:",
|
||||
["GoLand"] = ":goland:",
|
||||
["Android Studio"] = ":android_studio:",
|
||||
["MoneyMoney"] = ":bank:",
|
||||
["Spotify"] = ":spotify:",
|
||||
["KeePassXC"] = ":kee_pass_x_c:",
|
||||
["Alfred"] = ":alfred:",
|
||||
["Color Picker"] = ":color_picker:",
|
||||
["数码测色计"] = ":color_picker:",
|
||||
["Microsoft Word"] = ":microsoft_word:",
|
||||
["Microsoft PowerPoint"] = ":microsoft_power_point:",
|
||||
["Notes"] = ":notes:",
|
||||
["备忘录"] = ":notes:",
|
||||
["Microsoft Edge"] = ":microsoft_edge:",
|
||||
["Sublime Text"] = ":sublime_text:",
|
||||
["Sequel Ace"] = ":sequel_ace:",
|
||||
["Folx"] = ":folx:",
|
||||
["DingTalk"] = ":dingtalk:",
|
||||
["钉钉"] = ":dingtalk:",
|
||||
["阿里钉"] = ":dingtalk:",
|
||||
["WebStorm"] = ":web_storm:",
|
||||
["Sequel Pro"] = ":sequel_pro:",
|
||||
["Skype"] = ":skype:",
|
||||
["网易云音乐"] = ":netease_music:",
|
||||
["PyCharm"] = ":pycharm:",
|
||||
["Canary Mail"] = ":mail:",
|
||||
["HEY"] = ":mail:",
|
||||
["Mail"] = ":mail:",
|
||||
["Mailspring"] = ":mail:",
|
||||
["MailMate"] = ":mail:",
|
||||
["邮件"] = ":mail:",
|
||||
["Default"] = ":default:",
|
||||
["App Store"] = ":app_store:",
|
||||
["Calibre"] = ":book:",
|
||||
["Todoist"] = ":todoist:",
|
||||
["Emacs"] = ":emacs:",
|
||||
["Messenger"] = ":messenger:",
|
||||
["Tower"] = ":tower:",
|
||||
["VSCodium"] = ":vscodium:",
|
||||
["Drafts"] = ":drafts:",
|
||||
["Cypress"] = ":cypress:",
|
||||
["GitHub Desktop"] = ":git_hub:",
|
||||
["Telegram"] = ":telegram:",
|
||||
["Firefox Developer Edition"] = ":firefox_developer_edition:",
|
||||
["Firefox Nightly"] = ":firefox_developer_edition:",
|
||||
["Min"] = ":min_browser:",
|
||||
["Sketch"] = ":sketch:",
|
||||
["Affinity Photo"] = ":affinity_photo:",
|
||||
["MAMP"] = ":mamp:",
|
||||
["MAMP PRO"] = ":mamp:",
|
||||
["Insomnia"] = ":insomnia:",
|
||||
["Bitwarden"] = ":bit_warden:",
|
||||
["Warp"] = ":warp:",
|
||||
["System Preferences"] = ":gear:",
|
||||
["System Settings"] = ":gear:",
|
||||
["系统设置"] = ":gear:",
|
||||
["Affinity Designer"] = ":affinity_designer:",
|
||||
["Live"] = ":ableton:",
|
||||
["Arc"] = ":arc:",
|
||||
["Chromium"] = ":google_chrome:",
|
||||
["Google Chrome"] = ":google_chrome:",
|
||||
["Google Chrome Canary"] = ":google_chrome:",
|
||||
["Jellyfin Media Player"] = ":jellyfin:",
|
||||
["Zulip"] = ":zulip:",
|
||||
["1Password"] = ":one_password:",
|
||||
["FaceTime"] = ":face_time:",
|
||||
["FaceTime 通话"] = ":face_time:",
|
||||
["Citrix Workspace"] = ":citrix:",
|
||||
["Citrix Viewer"] = ":citrix:",
|
||||
["Logseq"] = ":logseq:",
|
||||
["Reeder"] = ":reeder5:",
|
||||
["Code"] = ":code:",
|
||||
["Code - Insiders"] = ":code:",
|
||||
["Notion"] = ":notion:",
|
||||
["Final Cut Pro"] = ":final_cut_pro:",
|
||||
["Zotero"] = ":zotero:",
|
||||
["Safari"] = ":safari:",
|
||||
["Safari浏览器"] = ":safari:",
|
||||
["Safari Technology Preview"] = ":safari:",
|
||||
["Blender"] = ":blender:",
|
||||
["Affinity Publisher"] = ":affinity_publisher:",
|
||||
["Spark Desktop"] = ":spark:",
|
||||
["Zeplin"] = ":zeplin:",
|
||||
["Replit"] = ":replit:",
|
||||
["Podcasts"] = ":podcasts:",
|
||||
["播客"] = ":podcasts:",
|
||||
["NordVPN"] = ":nord_vpn:",
|
||||
["Notability"] = ":notability:",
|
||||
["Numbers"] = ":numbers:",
|
||||
["Numbers 表格"] = ":numbers:",
|
||||
["Nova"] = ":nova:",
|
||||
["Microsoft Excel"] = ":microsoft_excel:",
|
||||
["Trello"] = ":trello:",
|
||||
["Pi-hole Remote"] = ":pihole:",
|
||||
["Linear"] = ":linear:",
|
||||
["CleanMyMac X"] = ":desktop:",
|
||||
["GrandTotal"] = ":dollar:",
|
||||
["Receipts"] = ":dollar:",
|
||||
["Evernote Legacy"] = ":evernote_legacy:",
|
||||
["OmniFocus"] = ":omni_focus:",
|
||||
["Terminal"] = ":terminal:",
|
||||
["终端"] = ":terminal:",
|
||||
["Atom"] = ":atom:",
|
||||
["Kakoune"] = ":kakoune:",
|
||||
["Reminders"] = ":reminders:",
|
||||
["提醒事项"] = ":reminders:",
|
||||
["Tana"] = ":tana:",
|
||||
["OBS"] = ":obsstudio:",
|
||||
["VMware Fusion"] = ":vmware_fusion:",
|
||||
["Tweetbot"] = ":twitter:",
|
||||
["Twitter"] = ":twitter:",
|
||||
["Microsoft Teams"] = ":microsoft_teams:",
|
||||
["Yuque"] = ":yuque:",
|
||||
["语雀"] = ":yuque:",
|
||||
["Slack"] = ":slack:",
|
||||
["Vivaldi"] = ":vivaldi:",
|
||||
["Setapp"] = ":setapp:",
|
||||
["TIDAL"] = ":tidal:",
|
||||
["Miro"] = ":miro:",
|
||||
["Messages"] = ":messages:",
|
||||
["信息"] = ":messages:",
|
||||
["Nachrichten"] = ":messages:",
|
||||
["Brave Browser"] = ":brave_browser:",
|
||||
["Preview"] = ":pdf:",
|
||||
["预览"] = ":pdf:",
|
||||
["Skim"] = ":pdf:",
|
||||
["zathura"] = ":pdf:",
|
||||
["Obsidian"] = ":obsidian:",
|
||||
["Thunderbird"] = ":thunderbird:",
|
||||
["Firefox"] = ":firefox:",
|
||||
["WezTerm"] = ":wezterm:",
|
||||
["default"] = ":default:",
|
||||
}
|
||||
9
__sketchybar/bar.lua
Normal file
9
__sketchybar/bar.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
local colors = require("colors")
|
||||
|
||||
sbar.bar({
|
||||
topmost = "window",
|
||||
height = 30,
|
||||
color = colors.bar.bg,
|
||||
padding_right = 2,
|
||||
padding_left = 2,
|
||||
})
|
||||
30
__sketchybar/colors.lua
Normal file
30
__sketchybar/colors.lua
Normal file
@@ -0,0 +1,30 @@
|
||||
return {
|
||||
black = 0xff181819,
|
||||
white = 0xffe2e2e3,
|
||||
red = 0xfffc5d7c,
|
||||
green = 0xff9ed072,
|
||||
blue = 0xff76cce0,
|
||||
yellow = 0xffe7c664,
|
||||
orange = 0xfff39660,
|
||||
magenta = 0xffb39df3,
|
||||
grey = 0xff7f8490,
|
||||
transparent = 0x00000000,
|
||||
|
||||
bar = {
|
||||
bg = 0xf02c2e34,
|
||||
border = 0xff2c2e34,
|
||||
},
|
||||
popup = {
|
||||
bg = 0xc02c2e34,
|
||||
border = 0xff7f8490,
|
||||
},
|
||||
bg1 = 0xff363944,
|
||||
bg2 = 0xff414550,
|
||||
|
||||
with_alpha = function(color, alpha)
|
||||
if alpha > 1.0 or alpha < 0.0 then
|
||||
return color
|
||||
end
|
||||
return (color & 0x00ffffff) | (math.floor(alpha * 255.0) << 24)
|
||||
end,
|
||||
}
|
||||
52
__sketchybar/default.lua
Normal file
52
__sketchybar/default.lua
Normal file
@@ -0,0 +1,52 @@
|
||||
local settings = require("settings")
|
||||
local colors = require("colors")
|
||||
|
||||
-- Equivalent to the --default domain
|
||||
sbar.default({
|
||||
updates = "when_shown",
|
||||
icon = {
|
||||
font = {
|
||||
family = settings.font.text,
|
||||
style = settings.font.style_map["Bold"],
|
||||
size = 14.0,
|
||||
},
|
||||
color = colors.white,
|
||||
padding_left = settings.paddings,
|
||||
padding_right = settings.paddings,
|
||||
background = { image = { corner_radius = 9 } },
|
||||
},
|
||||
label = {
|
||||
font = {
|
||||
family = settings.font.text,
|
||||
style = settings.font.style_map["Semibold"],
|
||||
size = 13.0,
|
||||
},
|
||||
color = colors.white,
|
||||
padding_left = settings.paddings,
|
||||
padding_right = settings.paddings,
|
||||
},
|
||||
background = {
|
||||
height = 21,
|
||||
corner_radius = 9,
|
||||
border_width = 2,
|
||||
border_color = colors.bg2,
|
||||
image = {
|
||||
corner_radius = 9,
|
||||
border_color = colors.grey,
|
||||
border_width = 1,
|
||||
},
|
||||
},
|
||||
popup = {
|
||||
background = {
|
||||
border_width = 2,
|
||||
corner_radius = 9,
|
||||
border_color = colors.popup.border,
|
||||
color = colors.popup.bg,
|
||||
shadow = { drawing = true },
|
||||
},
|
||||
blur_radius = 50,
|
||||
},
|
||||
padding_left = 5,
|
||||
padding_right = 5,
|
||||
scroll_texts = true,
|
||||
})
|
||||
4
__sketchybar/helpers/init.lua
Normal file
4
__sketchybar/helpers/init.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
-- Add the sketchybar module to the package cpath
|
||||
package.cpath = package.cpath .. ";/Users/" .. os.getenv("USER") .. "/.local/share/sketchybar_lua/?.so"
|
||||
|
||||
-- os.execute("(cd helpers && make)")
|
||||
3
__sketchybar/helpers/makefile
Normal file
3
__sketchybar/helpers/makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
all:
|
||||
($(MAKE)) >/dev/null
|
||||
($(MAKE)) >/dev/null
|
||||
14
__sketchybar/icons.lua
Normal file
14
__sketchybar/icons.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
local icons = {
|
||||
nerdfont = {
|
||||
battery = {
|
||||
_100 = "",
|
||||
_75 = "",
|
||||
_50 = "",
|
||||
_25 = "",
|
||||
_0 = "",
|
||||
charging = "",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return icons.nerdfont
|
||||
9
__sketchybar/init.lua
Normal file
9
__sketchybar/init.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
sbar = require("sketchybar")
|
||||
|
||||
sbar.begin_config()
|
||||
require("bar")
|
||||
require("default")
|
||||
require("items")
|
||||
sbar.end_config()
|
||||
|
||||
sbar.event_loop()
|
||||
72
__sketchybar/items/battery.lua
Normal file
72
__sketchybar/items/battery.lua
Normal file
@@ -0,0 +1,72 @@
|
||||
local icons = require("icons")
|
||||
local colors = require("colors")
|
||||
local settings = require("settings")
|
||||
|
||||
local battery = sbar.add("item", "widgets.battery", {
|
||||
position = "right",
|
||||
icon = {
|
||||
font = {
|
||||
style = settings.font.style_map["Regular"],
|
||||
size = 14.0,
|
||||
},
|
||||
},
|
||||
label = { font = { family = settings.font.numbers } },
|
||||
update_freq = 180,
|
||||
popup = { align = "center" },
|
||||
})
|
||||
|
||||
battery:subscribe({ "routine", "power_source_change", "system_woke" }, function()
|
||||
sbar.exec("pmset -g batt", function(batt_info)
|
||||
local icon = "!"
|
||||
local label = "?"
|
||||
|
||||
local found, _, charge = batt_info:find("(%d+)%%")
|
||||
if found then
|
||||
charge = tonumber(charge)
|
||||
label = charge .. "%"
|
||||
end
|
||||
|
||||
local color = colors.green
|
||||
local charging, _, _ = batt_info:find("AC Power")
|
||||
|
||||
if charging then
|
||||
icon = icons.battery.charging
|
||||
else
|
||||
if found and charge > 80 then
|
||||
icon = icons.battery._100
|
||||
elseif found and charge > 60 then
|
||||
icon = icons.battery._75
|
||||
elseif found and charge > 40 then
|
||||
icon = icons.battery._50
|
||||
elseif found and charge > 20 then
|
||||
icon = icons.battery._25
|
||||
color = colors.orange
|
||||
else
|
||||
icon = icons.battery._0
|
||||
color = colors.red
|
||||
end
|
||||
end
|
||||
|
||||
local lead = ""
|
||||
if found and charge < 10 then
|
||||
lead = "0"
|
||||
end
|
||||
|
||||
battery:set({
|
||||
icon = {
|
||||
string = icon,
|
||||
color = color,
|
||||
},
|
||||
label = { string = lead .. label },
|
||||
})
|
||||
end)
|
||||
end)
|
||||
|
||||
sbar.add("bracket", "widgets.battery.bracket", { battery.name }, {
|
||||
background = { color = colors.bg1 },
|
||||
})
|
||||
|
||||
sbar.add("item", "widgets.battery.padding", {
|
||||
position = "right",
|
||||
width = settings.group_paddings,
|
||||
})
|
||||
35
__sketchybar/items/calendar.lua
Normal file
35
__sketchybar/items/calendar.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
local settings = require("settings")
|
||||
local colors = require("colors")
|
||||
|
||||
sbar.add("item", { position = "right", width = settings.group_paddings })
|
||||
|
||||
local cal = sbar.add("item", {
|
||||
icon = {
|
||||
color = colors.white,
|
||||
padding_left = 8,
|
||||
font = {
|
||||
style = settings.font.style_map["Black"],
|
||||
size = 12.0,
|
||||
},
|
||||
},
|
||||
label = {
|
||||
color = colors.white,
|
||||
padding_right = 8,
|
||||
width = 49,
|
||||
align = "right",
|
||||
font = { family = settings.font.numbers },
|
||||
},
|
||||
position = "right",
|
||||
update_freq = 30,
|
||||
padding_left = 1,
|
||||
padding_right = 1,
|
||||
background = {
|
||||
color = colors.bg1,
|
||||
},
|
||||
})
|
||||
|
||||
sbar.add("item", { position = "right", width = settings.group_paddings })
|
||||
|
||||
cal:subscribe({ "forced", "routine", "system_woke" }, function(env)
|
||||
cal:set({ icon = os.date("%a %d %b"), label = os.date("%H:%M") })
|
||||
end)
|
||||
21
__sketchybar/items/front_app.lua
Normal file
21
__sketchybar/items/front_app.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
local settings = require("settings")
|
||||
|
||||
local front_app = sbar.add("item", "front_app", {
|
||||
display = "active",
|
||||
icon = { drawing = false },
|
||||
label = {
|
||||
font = {
|
||||
style = settings.font.style_map["Bold"],
|
||||
size = 13.0,
|
||||
},
|
||||
},
|
||||
updates = true,
|
||||
})
|
||||
|
||||
front_app:subscribe("front_app_switched", function(env)
|
||||
front_app:set({ label = { string = env.INFO } })
|
||||
end)
|
||||
|
||||
front_app:subscribe("mouse.clicked", function(env)
|
||||
sbar.trigger("swap_menus_and_spaces")
|
||||
end)
|
||||
4
__sketchybar/items/init.lua
Normal file
4
__sketchybar/items/init.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
require("items.spaces")
|
||||
require("items.front_app")
|
||||
require("items.calendar")
|
||||
require("items.battery")
|
||||
103
__sketchybar/items/spaces.lua
Normal file
103
__sketchybar/items/spaces.lua
Normal file
@@ -0,0 +1,103 @@
|
||||
local colors = require("colors")
|
||||
local settings = require("settings")
|
||||
local app_icons = require("app_icons")
|
||||
|
||||
local spaces = {}
|
||||
|
||||
for i = 1, 10, 1 do
|
||||
local space = sbar.add("space", "space." .. i, {
|
||||
space = i,
|
||||
icon = {
|
||||
font = { family = settings.font.numbers },
|
||||
string = i,
|
||||
padding_left = 15,
|
||||
padding_right = 8,
|
||||
color = colors.white,
|
||||
highlight_color = colors.red,
|
||||
},
|
||||
label = {
|
||||
padding_right = 20,
|
||||
color = colors.grey,
|
||||
highlight_color = colors.white,
|
||||
font = "sketchybar-app-font:Regular:15.0",
|
||||
y_offset = -1,
|
||||
},
|
||||
padding_right = 1,
|
||||
padding_left = 1,
|
||||
background = {
|
||||
color = colors.bg1,
|
||||
border_width = 1,
|
||||
height = 21,
|
||||
border_color = colors.black,
|
||||
},
|
||||
popup = { background = { border_width = 5, border_color = colors.black } },
|
||||
})
|
||||
|
||||
spaces[i] = space
|
||||
|
||||
-- Single item bracket for space items to achieve double border on highlight
|
||||
local space_bracket = sbar.add("bracket", { space.name }, {
|
||||
background = {
|
||||
color = colors.transparent,
|
||||
border_color = colors.bg2,
|
||||
height = 24,
|
||||
border_width = 3,
|
||||
},
|
||||
})
|
||||
|
||||
-- Padding space
|
||||
sbar.add("space", "space.padding." .. i, {
|
||||
space = i,
|
||||
script = "",
|
||||
width = settings.group_paddings,
|
||||
})
|
||||
|
||||
--[[ local space_popup = sbar.add("item", {
|
||||
position = "popup." .. space.name,
|
||||
padding_left = 5,
|
||||
padding_right = 0,
|
||||
background = {
|
||||
drawing = true,
|
||||
image = {
|
||||
corner_radius = 9,
|
||||
scale = 0.2,
|
||||
},
|
||||
},
|
||||
}) ]]
|
||||
|
||||
space:subscribe("space_change", function(env)
|
||||
local selected = env.SELECTED == "true"
|
||||
-- local color = selected and colors.grey or colors.bg2
|
||||
space:set({
|
||||
icon = { highlight = selected },
|
||||
label = { highlight = selected },
|
||||
background = { border_color = selected and colors.black or colors.bg2 },
|
||||
})
|
||||
space_bracket:set({
|
||||
background = { border_color = selected and colors.grey or colors.bg2 },
|
||||
})
|
||||
end)
|
||||
end
|
||||
|
||||
local space_window_observer = sbar.add("item", {
|
||||
drawing = false,
|
||||
updates = true,
|
||||
})
|
||||
|
||||
space_window_observer:subscribe("space_windows_change", function(env)
|
||||
local icon_line = ""
|
||||
local no_app = true
|
||||
for app, _ in pairs(env.INFO.apps) do
|
||||
no_app = false
|
||||
local lookup = app_icons[app]
|
||||
local icon = ((lookup == nil) and app_icons["default"] or lookup)
|
||||
icon_line = icon_line .. " " .. icon
|
||||
end
|
||||
|
||||
if no_app then
|
||||
icon_line = " —"
|
||||
end
|
||||
sbar.animate("tanh", 10, function()
|
||||
spaces[env.INFO.space]:set({ label = icon_line })
|
||||
end)
|
||||
end)
|
||||
19
__sketchybar/settings.lua
Normal file
19
__sketchybar/settings.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
paddings = 3,
|
||||
group_paddings = 5,
|
||||
|
||||
icons = "NerdFont",
|
||||
|
||||
font = {
|
||||
text = "MesloLGS Nerd Font Mono",
|
||||
numbers = "MesloLGS Nerd Font Mono",
|
||||
|
||||
style_map = {
|
||||
["Regular"] = "Regular",
|
||||
["Semibold"] = "Semibold",
|
||||
["Bold"] = "Bold",
|
||||
["Heavy"] = "Heavy",
|
||||
["Black"] = "Black",
|
||||
},
|
||||
},
|
||||
}
|
||||
4
__sketchybar/sketchybarrc
Executable file
4
__sketchybar/sketchybarrc
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env lua
|
||||
|
||||
require("helpers")
|
||||
require("init")
|
||||
20
sketchybar/items/battery.sh
Normal file
20
sketchybar/items/battery.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
COLOR="$BLUE"
|
||||
|
||||
sketchybar --add item battery right \
|
||||
--set battery \
|
||||
update_freq=60 \
|
||||
icon.color="$COLOR" \
|
||||
icon.padding_left=10 \
|
||||
label.padding_right=10 \
|
||||
label.color="$COLOR" \
|
||||
background.height=21 \
|
||||
background.corner_radius="$CORNER_RADIUS" \
|
||||
background.padding_right=5 \
|
||||
background.border_width="$BORDER_WIDTH" \
|
||||
background.border_color="$COLOR" \
|
||||
background.color="$BAR_COLOR" \
|
||||
background.drawing=on \
|
||||
script="$PLUGIN_DIR/power.sh" \
|
||||
--subscribe battery power_source_change
|
||||
18
sketchybar/items/calendar.sh
Normal file
18
sketchybar/items/calendar.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
COLOR="$BLUE"
|
||||
|
||||
sketchybar --add item calendar center\
|
||||
--set calendar update_freq=15 \
|
||||
icon.color="$COLOR" \
|
||||
icon.padding_left=10 \
|
||||
label.color="$COLOR" \
|
||||
label.padding_right=10 \
|
||||
background.height=21 \
|
||||
background.corner_radius="$CORNER_RADIUS" \
|
||||
background.padding_right=5 \
|
||||
background.border_width="$BORDER_WIDTH" \
|
||||
background.border_color="$COLOR" \
|
||||
background.color="$BAR_COLOR" \
|
||||
background.drawing=on \
|
||||
script="$PLUGIN_DIR/calendar.sh"
|
||||
21
sketchybar/items/clock.sh
Normal file
21
sketchybar/items/clock.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
COLOR="$BLUE"
|
||||
|
||||
sketchybar --add item clock right \
|
||||
--set clock update_freq=1 \
|
||||
icon.padding_left=10 \
|
||||
icon.color="$COLOR" \
|
||||
icon="" \
|
||||
label.color="$COLOR" \
|
||||
label.width=54 \
|
||||
label.padding_right=5 \
|
||||
align=center \
|
||||
background.height=21 \
|
||||
background.corner_radius="$CORNER_RADIUS" \
|
||||
background.padding_right=2 \
|
||||
background.border_width="$BORDER_WIDTH" \
|
||||
background.border_color="$COLOR" \
|
||||
background.color="$BAR_COLOR" \
|
||||
background.drawing=on \
|
||||
script="$PLUGIN_DIR/clock.sh"
|
||||
20
sketchybar/items/front_app.sh
Normal file
20
sketchybar/items/front_app.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
COLOR="$WHITE"
|
||||
|
||||
sketchybar \
|
||||
--add item front_app left \
|
||||
--set front_app script="$PLUGIN_DIR/front_app.sh" \
|
||||
icon.drawing=off \
|
||||
background.height=21 \
|
||||
background.padding_left=0 \
|
||||
background.padding_right=10 \
|
||||
background.border_width="$BORDER_WIDTH" \
|
||||
background.border_color="$COLOR" \
|
||||
background.corner_radius="$CORNER_RADIUS" \
|
||||
background.color="$BAR_COLOR" \
|
||||
label.color="$COLOR" \
|
||||
label.padding_left=10 \
|
||||
label.padding_right=10 \
|
||||
associated_display=active \
|
||||
--subscribe front_app front_app_switched
|
||||
43
sketchybar/items/spaces.sh
Normal file
43
sketchybar/items/spaces.sh
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source "$HOME/.config/sketchybar/variables.sh"
|
||||
|
||||
sketchybar --add item spacer.1 left \
|
||||
--set spacer.1 background.drawing=off \
|
||||
label.drawing=off \
|
||||
icon.drawing=off \
|
||||
width=10
|
||||
|
||||
for i in "${!SPACE_ICONS[@]}"; do
|
||||
sid=$((i + 1))
|
||||
sketchybar --add space space.$sid left \
|
||||
--set space.$sid associated_space=$sid \
|
||||
label.drawing=off \
|
||||
icon.padding_left=10 \
|
||||
icon.padding_right=10 \
|
||||
background.padding_left=-5 \
|
||||
background.padding_right=-5 \
|
||||
script="$PLUGIN_DIR/space.sh"
|
||||
done
|
||||
|
||||
sketchybar --add item spacer.2 left \
|
||||
--set spacer.2 background.drawing=off \
|
||||
label.drawing=off \
|
||||
icon.drawing=off \
|
||||
width=5
|
||||
|
||||
sketchybar --add bracket spaces '/space.*/' \
|
||||
--set spaces background.border_width="$BORDER_WIDTH" \
|
||||
background.border_color="$BLUE" \
|
||||
background.corner_radius="$CORNER_RADIUS" \
|
||||
background.color="$BAR_COLOR" \
|
||||
background.height=21 \
|
||||
background.drawing=on
|
||||
|
||||
sketchybar --add item separator left \
|
||||
icon.font="$FONT:Regular:16.0" \
|
||||
background.padding_left=26 \
|
||||
background.padding_right=15 \
|
||||
label.drawing=off \
|
||||
associated_display=active \
|
||||
icon.color="$YELLOW"
|
||||
3
sketchybar/plugins/calendar.sh
Executable file
3
sketchybar/plugins/calendar.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
sketchybar --set "$NAME" icon="" label="$(date '+%a, %d %b')"
|
||||
4
sketchybar/plugins/clock.sh
Executable file
4
sketchybar/plugins/clock.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
LABEL=$(date '+%H:%M')
|
||||
sketchybar --set "$NAME" label="$LABEL"
|
||||
7
sketchybar/plugins/front_app.sh
Executable file
7
sketchybar/plugins/front_app.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
case "$SENDER" in
|
||||
"front_app_switched")
|
||||
sketchybar --set "$NAME" label="$INFO"
|
||||
;;
|
||||
esac
|
||||
30
sketchybar/plugins/power.sh
Executable file
30
sketchybar/plugins/power.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
PERCENTAGE=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)
|
||||
CHARGING=$(pmset -g batt | grep 'AC Power')
|
||||
|
||||
if [ "$PERCENTAGE" = "" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case ${PERCENTAGE} in
|
||||
9[0-9] | 100)
|
||||
ICON=""
|
||||
;;
|
||||
[6-8][0-9])
|
||||
ICON=""
|
||||
;;
|
||||
[3-5][0-9])
|
||||
ICON=""
|
||||
;;
|
||||
[1-2][0-9])
|
||||
ICON=""
|
||||
;;
|
||||
*) ICON="" ;;
|
||||
esac
|
||||
|
||||
if [ "$CHARGING" != "" ]; then
|
||||
ICON=""
|
||||
fi
|
||||
|
||||
sketchybar --set "$NAME" icon="$ICON" label="${PERCENTAGE}% "
|
||||
17
sketchybar/plugins/space.sh
Executable file
17
sketchybar/plugins/space.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source "$HOME/.config/sketchybar/variables.sh" # Loads all defined colors
|
||||
|
||||
SPACE_CLICK_SCRIPT="yabai -m space --focus $SID 2>/dev/null"
|
||||
|
||||
if [ "$SELECTED" = "true" ]; then
|
||||
sketchybar --animate tanh 5 --set "$NAME" \
|
||||
icon.color="$BLUE" \
|
||||
icon="${SPACE_ICONS[$SID - 1]}" \
|
||||
click_script="$SPACE_CLICK_SCRIPT"
|
||||
else
|
||||
sketchybar --animate tanh 5 --set "$NAME" \
|
||||
icon.color="$COMMENT" \
|
||||
icon="${SPACE_ICONS[$SID - 1]}" \
|
||||
click_script="$SPACE_CLICK_SCRIPT"
|
||||
fi
|
||||
40
sketchybar/sketchybarrc
Executable file
40
sketchybar/sketchybarrc
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source "$HOME/.config/sketchybar/variables.sh"
|
||||
|
||||
sketchybar --bar height=27 \
|
||||
color="$TRANSPARENT" \
|
||||
shadow="$SHADOW" \
|
||||
position=top \
|
||||
y_offset=0 \
|
||||
padding_right=11 \
|
||||
padding_left=10 \
|
||||
blur_radius=0 \
|
||||
--default updates=when_shown \
|
||||
icon.font="$FONT:Bold:13.5" \
|
||||
icon.color="$ICON_COLOR" \
|
||||
icon.padding_left="$PADDINGS" \
|
||||
icon.padding_right="$PADDINGS" \
|
||||
label.font="$FONT:Bold:13.0" \
|
||||
label.color="$LABEL_COLOR" \
|
||||
label.padding_left="$PADDINGS" \
|
||||
label.padding_right="$PADDINGS" \
|
||||
background.padding_right="$PADDINGS" \
|
||||
background.padding_left="$PADDINGS" \
|
||||
# corner_radius="$CORNER_RADIUS" \
|
||||
# sticky=on \
|
||||
# margin=5 \
|
||||
|
||||
source "$ITEM_DIR/spaces.sh"
|
||||
source "$ITEM_DIR/front_app.sh"
|
||||
|
||||
source "$ITEM_DIR/calendar.sh"
|
||||
|
||||
source "$ITEM_DIR/clock.sh"
|
||||
source "$ITEM_DIR/battery.sh"
|
||||
|
||||
sketchybar --hotload true
|
||||
|
||||
sketchybar --update
|
||||
|
||||
echo "sketchybar configuration loaded.."
|
||||
53
sketchybar/variables.sh
Normal file
53
sketchybar/variables.sh
Normal file
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Color Palette
|
||||
# Tokyonight Night
|
||||
# BLACK=0xff24283b
|
||||
# WHITE=0xffa9b1d6
|
||||
# MAGENTA=0xffbb9af7
|
||||
# BLUE=0xff7aa2f7
|
||||
# CYAN=0xff7dcfff
|
||||
# GREEN=0xff9ece6a
|
||||
# YELLOW=0xffe0af68
|
||||
# ORANGE=0xffff9e64
|
||||
# RED=0xfff7768e
|
||||
# BAR_COLOR=0xff1a1b26
|
||||
# COMMENT=0xff565f89
|
||||
|
||||
# Oxocarbon Theme
|
||||
BLACK=0xff161616
|
||||
WHITE=0xfff2f4f8
|
||||
MAGENTA=0xffbe95ff
|
||||
BLUE=0xff82cfff
|
||||
CYAN=0xff3ddbd9
|
||||
GREEN=0xff42be65
|
||||
YELLOW=0xffffe97b
|
||||
ORANGE=0xffff7eb6
|
||||
RED=0xff3ddbd9
|
||||
BAR_COLOR=0xff161616
|
||||
COMMENT=0xff525252
|
||||
|
||||
# TRANSPARENT=0x110000cc
|
||||
TRANSPARENT=0x00ffffff
|
||||
|
||||
ICON_COLOR=$WHITE
|
||||
LABEL_COLOR=$WHITE
|
||||
|
||||
ITEM_DIR="$HOME/.config/sketchybar/items"
|
||||
PLUGIN_DIR="$HOME/.config/sketchybar/plugins"
|
||||
|
||||
FONT="MesloLGS Nerd Font Mono"
|
||||
|
||||
PADDINGS=3
|
||||
|
||||
POPUP_BORDER_WIDTH=2
|
||||
POPUP_CORNER_RADIUS=11
|
||||
POPUP_BACKGROUND_COLOR=$BLACK
|
||||
POPUP_BORDER_COLOR=$COMMENT
|
||||
|
||||
CORNER_RADIUS=15
|
||||
BORDER_WIDTH=1
|
||||
|
||||
SHADOW=on
|
||||
|
||||
SPACE_ICONS=("一" "二" "三" "四" "五" "六" "七" "八" "九" "十")
|
||||
@@ -42,7 +42,7 @@ cmd + alt - 3 : yabai -m space --focus 3
|
||||
# shift + cmd - z : yabai -m window --space next; yabai -m space --focus next
|
||||
shift + cmd - 1 : yabai -m window --space 1; yabai -m space --focus 1
|
||||
shift + cmd - 2 : yabai -m window --space 2; yabai -m space --focus 2
|
||||
shift + cmd - 3 : yabai -m window --space 3; yabai -m space --focus 3
|
||||
# shift + cmd - 3 : yabai -m window --space 3; yabai -m space --focus 3
|
||||
|
||||
# move floating window
|
||||
# shift + ctrl - a : yabai -m window --move rel:-20:0
|
||||
@@ -50,6 +50,7 @@ shift + cmd - 3 : yabai -m window --space 3; yabai -m space --focus 3
|
||||
|
||||
# increase window size
|
||||
shift + alt - a : yabai -m window --resize left:-20:0
|
||||
# cmd + alt - a : yabai -m window --resize left:-20:0
|
||||
shift + alt - w : yabai -m window --resize top:0:-20
|
||||
|
||||
# decrease window size
|
||||
|
||||
@@ -31,10 +31,10 @@ error_symbol = "[✗](bold red)"
|
||||
disabled = true
|
||||
|
||||
[directory]
|
||||
home_symbol= " "
|
||||
home_symbol= ""
|
||||
truncation_length = 3
|
||||
truncate_to_repo = true
|
||||
truncation_symbol = " "
|
||||
truncation_symbol = " "
|
||||
style = "bold blue"
|
||||
|
||||
[docker_context]
|
||||
|
||||
@@ -8,14 +8,14 @@ local config = {
|
||||
font_size = 14.0,
|
||||
-- color_scheme = "Catppuccin Mocha",
|
||||
color_scheme = "Carbon Fox",
|
||||
window_background_opacity = 0.8,
|
||||
window_background_opacity = 0.85,
|
||||
window_padding = {
|
||||
left = 0,
|
||||
right = 0,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 2,
|
||||
right = 2,
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
},
|
||||
-- window_background_image = "documents/wallpapers/slcdn6avjgn71.png",
|
||||
macos_window_background_blur = 10,
|
||||
}
|
||||
|
||||
config.leader = { key = "d", mods = "CTRL", timeout_milliseconds = 1000 }
|
||||
|
||||
@@ -5,7 +5,7 @@ sudo yabai --load-sa
|
||||
|
||||
# global settings
|
||||
yabai -m config \
|
||||
external_bar off:30:0 \
|
||||
external_bar all:30:0 \
|
||||
menubar_opacity 1.0 \
|
||||
mouse_follows_focus off \
|
||||
focus_follows_mouse off \
|
||||
@@ -45,12 +45,12 @@ yabai -m rule --add app="^System Settings$" manage=off
|
||||
yabai -m rule --add app="^Calculator$" manage=off
|
||||
yabai -m rule --add app="^Finder$" manage=off
|
||||
yabai -m rule --add app="^Spotify$" manage=off
|
||||
yabai -m rule --add app="^Safari$" manage=off
|
||||
# yabai -m rule --add app="^Safari$" manage=off
|
||||
yabai -m rule --add app="^App Store$" manage=off
|
||||
yabai -m rule --add app="^Activity Monitor$" manage=off
|
||||
yabai -m rule --add label="Software Update" title="Software Update" manage=off
|
||||
yabai -m rule --add app="System Information" manage=off
|
||||
|
||||
borders active_color=0xffe1e3e4 inactive_color=0xff494d64 width=4.0 &
|
||||
borders active_color=0xff82cfff inactive_color=0xff494d64 width=5.0 &
|
||||
|
||||
echo "yabai configuration loaded.."
|
||||
|
||||
Reference in New Issue
Block a user