Migrate to rcm
This commit is contained in:
0
notion/.welcome_msg_displayed
Normal file
0
notion/.welcome_msg_displayed
Normal file
57
notion/cfg_kludges.lua
Normal file
57
notion/cfg_kludges.lua
Normal file
@@ -0,0 +1,57 @@
|
||||
--
|
||||
-- Options to get some programs work more nicely (or at all)
|
||||
--
|
||||
|
||||
defwinprop {
|
||||
class = "AcroRead",
|
||||
instance = "documentShell",
|
||||
acrobatic = true,
|
||||
}
|
||||
|
||||
defwinprop {
|
||||
class = "Xpdf",
|
||||
instance = "openDialog_popup",
|
||||
ignore_cfgrq = true,
|
||||
}
|
||||
|
||||
-- Better would be to apply these settings automatically whenever a window
|
||||
-- has type _NET_WM_WINDOW_TYPE_NOTIFICATION.
|
||||
defwinprop {
|
||||
class = "Xfce4-notifyd",
|
||||
float = true,
|
||||
userpos = true,
|
||||
switchto = false,
|
||||
}
|
||||
|
||||
-- Put all dockapps in the statusbar's systray, also adding the missing size
|
||||
-- hints necessary for this to work.
|
||||
defwinprop {
|
||||
is_dockapp = true,
|
||||
statusbar = "systray",
|
||||
-- max_size = { w = 64, h = 64},
|
||||
-- min_size = { w = 64, h = 64},
|
||||
}
|
||||
|
||||
-- Make an exception for Docker, which sets correct size hints.
|
||||
defwinprop {
|
||||
is_dockapp = true,
|
||||
class = "Docker",
|
||||
statusbar = "systray",
|
||||
}
|
||||
|
||||
-- https://sourceforge.net/tracker/?func=detail&aid=3471910&group_id=314802&atid=1324528
|
||||
defwinprop {
|
||||
class = "Gimp",
|
||||
acrobatic = true,
|
||||
}
|
||||
|
||||
-- Define some additional title shortening rules to use when the full title
|
||||
-- doesn't fit in the available space. The first-defined matching rule that
|
||||
-- succeeds in making the title short enough is used.
|
||||
ioncore.defshortening("(.*) - Mozilla(<[0-9]+>)", "$1$2$|$1$<...$2")
|
||||
ioncore.defshortening("(.*) - Mozilla", "$1$|$1$<...")
|
||||
ioncore.defshortening("XMMS - (.*)", "$1$|...$>$1")
|
||||
ioncore.defshortening("[^:]+: (.*)(<[0-9]+>)", "$1$2$|$1$<...$2")
|
||||
ioncore.defshortening("[^:]+: (.*)", "$1$|$1$<...")
|
||||
ioncore.defshortening("(.*)(<[0-9]+>)", "$1$2$|$1$<...$2")
|
||||
ioncore.defshortening("(.*)", "$1$|$1$<...")
|
||||
130
notion/cfg_notion.lua
Normal file
130
notion/cfg_notion.lua
Normal file
@@ -0,0 +1,130 @@
|
||||
--
|
||||
-- Notion main configuration file
|
||||
--
|
||||
-- This file only includes some settings that are rather frequently altered.
|
||||
-- The rest of the settings are in cfg_notioncore.lua and individual modules'
|
||||
-- configuration files (cfg_modulename.lua).
|
||||
--
|
||||
-- When any binding and other customisations that you want are minor, it is
|
||||
-- recommended that you include them in a copy of this file in ~/.notion/.
|
||||
-- Simply create or copy the relevant settings at the end of this file (from
|
||||
-- the other files), recalling that a key can be unbound by passing 'nil'
|
||||
-- (without the quotes) as the callback. For more information, please see
|
||||
-- the Notion configuration manual available from the Notion Web page.
|
||||
--
|
||||
|
||||
-- Set default modifiers. The default is the 'windows' key; it is usually mapped
|
||||
-- to Mod4 on Xorg-based systems. Any other modifier, such as Alt, can be used
|
||||
-- instead. The 'xmodmap' tool can be used to get/set which key codes correspond
|
||||
-- to which modifiers, and the 'xev' tool can be used to see what codes are
|
||||
-- generated by particular keys.
|
||||
--META="Mod4+"
|
||||
--ALTMETA=""
|
||||
|
||||
-- Terminal emulator.
|
||||
|
||||
-- Some basic settings.
|
||||
ioncore.set{
|
||||
-- Maximum delay between clicks in milliseconds to be considered a
|
||||
-- double click.
|
||||
--dblclick_delay=250,
|
||||
|
||||
-- For keyboard resize, time (in milliseconds) to wait after latest
|
||||
-- key press before automatically leaving resize mode (and doing
|
||||
-- the resize in case of non-opaque move).
|
||||
--kbresize_delay=1500,
|
||||
|
||||
-- Opaque resize?
|
||||
--opaque_resize=false,
|
||||
|
||||
-- Movement commands warp the pointer to frames instead of just
|
||||
-- changing focus. Enabled by default.
|
||||
--warp=true,
|
||||
|
||||
-- Switch frames to display newly mapped windows.
|
||||
--switchto=true,
|
||||
|
||||
-- Default index for windows in frames: one of 'last', 'next' (for
|
||||
-- after current), or 'next-act' (for after current and anything with
|
||||
-- activity right after it).
|
||||
--frame_default_index='next',
|
||||
|
||||
-- Auto-unsqueeze transients/menus/queries.
|
||||
--unsqueeze=true,
|
||||
|
||||
-- Display notification tooltips for activity on hidden workspace.
|
||||
--screen_notify=true,
|
||||
|
||||
-- Automatically save layout on restart and exit.
|
||||
autosave_layout=false,
|
||||
|
||||
-- Mouse focus mode; set to "sloppy" if you want the focus to follow the
|
||||
-- mouse, and to "disabled" otherwise.
|
||||
-- mousefocus="sloppy",
|
||||
mousefocus="disabled",
|
||||
|
||||
-- Controls Notion's reaction to stacking requests sent by clients. Set to
|
||||
-- "ignore" to ignore these requests, and to "activate" to set the activity
|
||||
-- flag on a window that requests to be stacked "Above".
|
||||
-- window_stacking_request="ignore",
|
||||
window_stacking_request="activate",
|
||||
|
||||
-- Time (in ms) that a window has to be focussed in order to be added to the
|
||||
-- focus list. Set this to <=0 (or comment it out) to disable the logic, and
|
||||
-- update the focus list immediately.
|
||||
--focuslist_insert_delay=1000,
|
||||
|
||||
-- If enabled, activity notifiers are displayed on ALL the screens, not just
|
||||
-- the screen that contains the window producing the notification. This is
|
||||
-- only relevant on multi-head setups. By default this is disabled.
|
||||
activity_notification_on_all_screens=true,
|
||||
|
||||
-- If enabled, a workspace indicator comes up at the bottom-left of the
|
||||
-- screen when a new workspace is selected. This indicator stays active for
|
||||
-- only as long as indicated by this variable (in ms). Timeout values <=0
|
||||
-- disable the indicator altogether. This is disabled by default.
|
||||
workspace_indicator_timeout=500,
|
||||
}
|
||||
|
||||
-- Load default settings. The file cfg_defaults loads all the files
|
||||
-- commented out below, except mod_dock. If you do not want to load
|
||||
-- something, comment out this line, and uncomment the lines corresponding
|
||||
-- the modules or configuration files that you want, below.
|
||||
-- The modules' configuration files correspond to the names of the
|
||||
-- modules with 'mod' replaced by 'cfg'.
|
||||
dopath("cfg_defaults")
|
||||
|
||||
-- Load configuration of the Notion 'core'. Most bindings are here.
|
||||
--dopath("cfg_notioncore")
|
||||
|
||||
-- Load some kludges to make apps behave better.
|
||||
--dopath("cfg_kludges")
|
||||
|
||||
-- Define some layouts.
|
||||
--dopath("cfg_layouts")
|
||||
|
||||
-- Load some modules. Bindings and other configuration specific to modules
|
||||
-- are in the files cfg_modulename.lua.
|
||||
--dopath("mod_query")
|
||||
--dopath("mod_menu")
|
||||
--dopath("mod_tiling")
|
||||
--dopath("mod_statusbar")
|
||||
--dopath("mod_dock")
|
||||
--dopath("mod_sp")
|
||||
--dopath("mod_notionflux")
|
||||
--dopath("mod_xrandr")
|
||||
|
||||
--
|
||||
-- Common customisations
|
||||
--
|
||||
|
||||
-- Uncommenting the following lines should get you plain-old-menus instead
|
||||
-- of query-menus.
|
||||
|
||||
--defbindings("WScreen", {
|
||||
-- kpress(ALTMETA.."F12", "mod_menu.menu(_, _sub, 'mainmenu', {big=true})"),
|
||||
--})
|
||||
--
|
||||
--defbindings("WMPlex.toplevel", {
|
||||
-- kpress(META.."M", "mod_menu.menu(_, _sub, 'ctxmenu')"),
|
||||
--})
|
||||
433
notion/cfg_notioncore.lua
Normal file
433
notion/cfg_notioncore.lua
Normal file
@@ -0,0 +1,433 @@
|
||||
--
|
||||
-- Notion core configuration file
|
||||
--
|
||||
|
||||
|
||||
--
|
||||
-- Bindings. This includes global bindings and bindings common to
|
||||
-- screens and all types of frames only. See modules' configuration
|
||||
-- files for other bindings.
|
||||
--
|
||||
|
||||
|
||||
-- WScreen context bindings
|
||||
--
|
||||
-- The bindings in this context are available all the time.
|
||||
--
|
||||
-- The variable META should contain a string of the form 'Mod4+'
|
||||
-- where Mod4 maybe replaced with the modifier you want to use for most
|
||||
-- of the bindings. Similarly ALTMETA may be redefined to add a
|
||||
-- modifier to some of the F-key bindings.
|
||||
|
||||
defbindings("WScreen", {
|
||||
bdoc("Switch to n:th object (workspace, full screen client window) "..
|
||||
"within current screen."),
|
||||
kpress(META.."1", "WScreen.switch_nth(_, 0)"),
|
||||
kpress(META.."2", "WScreen.switch_nth(_, 1)"),
|
||||
kpress(META.."3", "WScreen.switch_nth(_, 2)"),
|
||||
kpress(META.."4", "WScreen.switch_nth(_, 3)"),
|
||||
kpress(META.."5", "WScreen.switch_nth(_, 4)"),
|
||||
kpress(META.."6", "WScreen.switch_nth(_, 5)"),
|
||||
kpress(META.."7", "WScreen.switch_nth(_, 6)"),
|
||||
kpress(META.."8", "WScreen.switch_nth(_, 7)"),
|
||||
kpress(META.."9", "WScreen.switch_nth(_, 8)"),
|
||||
kpress(META.."0", "WScreen.switch_nth(_, 9)"),
|
||||
|
||||
bdoc("Switch to next/previous object within current screen."),
|
||||
kpress(META.."comma", "WScreen.switch_prev(_)"),
|
||||
kpress(META.."period", "WScreen.switch_next(_)"),
|
||||
|
||||
submap(META.."K", {
|
||||
bdoc("Go to first region demanding attention or previously active one."),
|
||||
kpress("K", "mod_menu.grabmenu(_, _sub, 'focuslist')"),
|
||||
-- Alternative without (cyclable) menu
|
||||
--kpress("K", "ioncore.goto_activity() or ioncore.goto_previous()"),
|
||||
|
||||
--bdoc("Go to previous active object."),
|
||||
--kpress("K", "ioncore.goto_previous()"),
|
||||
|
||||
--bdoc("Go to first object on activity/urgency list."),
|
||||
--kpress("I", "ioncore.goto_activity()"),
|
||||
|
||||
bdoc("Clear all tags."),
|
||||
kpress("T", "ioncore.tagged_clear()"),
|
||||
}),
|
||||
|
||||
bdoc("Go to n:th screen on multihead setup."),
|
||||
kpress(META.."Shift+1", "ioncore.goto_nth_screen(0)"),
|
||||
kpress(META.."Q", "ioncore.goto_nth_screen(0)"),
|
||||
kpress(META.."Shift+2", "ioncore.goto_nth_screen(1)"),
|
||||
kpress(META.."W", "ioncore.goto_nth_screen(1)"),
|
||||
kpress(META.."Shift+3", "ioncore.goto_nth_screen(2)"),
|
||||
kpress(META.."E", "ioncore.goto_nth_screen(2)"),
|
||||
|
||||
bdoc("Go to next/previous screen on multihead setup."),
|
||||
kpress(META.."Shift+comma", "ioncore.goto_prev_screen()"),
|
||||
kpress(META.."I", "ioncore.goto_prev_screen()"),
|
||||
kpress(META.."O", "ioncore.goto_next_screen()"),
|
||||
kpress(META.."grave", "ioncore.goto_next_screen()"),
|
||||
|
||||
--bdoc("Create a new workspace of chosen default type."),
|
||||
--kpress(META.."F9", "ioncore.create_ws(_)"),
|
||||
|
||||
bdoc("Display the main menu."),
|
||||
kpress(META.."F12", "mod_query.query_menu(_, _sub, 'mainmenu', 'Main menu:')"),
|
||||
--kpress(ALTMETA.."F12", "mod_menu.menu(_, _sub, 'mainmenu', {big=true})"),
|
||||
mpress("Button3", "mod_menu.pmenu(_, _sub, 'mainmenu')"),
|
||||
|
||||
bdoc("Display the window list menu."),
|
||||
mpress("Button2", "mod_menu.pmenu(_, _sub, 'windowlist')"),
|
||||
|
||||
bdoc("Forward-circulate focus."),
|
||||
-- '_chld' used here stands to for an actual child window that may not
|
||||
-- be managed by the screen itself, unlike '_sub', that is likely to be
|
||||
-- the managing group of that window. The right/left directions are
|
||||
-- used instead of next/prev, because they work better in conjunction
|
||||
-- with tilings.
|
||||
kpress(META.."Tab", "ioncore.goto_next(_chld, 'right')",
|
||||
"_chld:non-nil"),
|
||||
submap(META.."K", {
|
||||
bdoc("Backward-circulate focus."),
|
||||
kpress("AnyModifier+Tab", "ioncore.goto_next(_chld, 'left')",
|
||||
"_chld:non-nil"),
|
||||
|
||||
bdoc("Raise focused object, if possible."),
|
||||
kpress("AnyModifier+R", "WRegion.rqorder(_chld, 'front')",
|
||||
"_chld:non-nil"),
|
||||
}),
|
||||
|
||||
})
|
||||
|
||||
|
||||
-- Client window bindings
|
||||
--
|
||||
-- These bindings affect client windows directly.
|
||||
|
||||
defbindings("WClientWin", {
|
||||
submap(META.."K", {
|
||||
bdoc("Nudge the client window. This might help with some "..
|
||||
"programs' resizing problems."),
|
||||
kpress_wait(META.."L", "WClientWin.nudge(_)"),
|
||||
|
||||
-- bdoc("Kill client owning the client window."),
|
||||
-- kpress("C", "WClientWin.kill(_)"),
|
||||
|
||||
bdoc("Send next key press to the client window. "..
|
||||
"Some programs may not allow this by default."),
|
||||
kpress("Q", "WClientWin.quote_next(_)"),
|
||||
}),
|
||||
})
|
||||
|
||||
|
||||
-- Client window group bindings
|
||||
|
||||
defbindings("WGroupCW", {
|
||||
bdoc("Toggle client window group full-screen mode"),
|
||||
kpress_wait(META.."Return", "WGroup.set_fullscreen(_, 'toggle')"),
|
||||
})
|
||||
|
||||
|
||||
-- WMPlex context bindings
|
||||
--
|
||||
-- These bindings work in frames and on screens. The innermost of such
|
||||
-- contexts/objects always gets to handle the key press.
|
||||
|
||||
defbindings("WMPlex", {
|
||||
bdoc("Close current object."),
|
||||
kpress_wait(META.."Shift+C", "WRegion.rqclose_propagate(_, _sub)"),
|
||||
})
|
||||
|
||||
-- Frames for transient windows ignore this bindmap
|
||||
defbindings("WMPlex.toplevel", {
|
||||
bdoc("Toggle tag of current object."),
|
||||
kpress(META.."T", "WRegion.set_tagged(_sub, 'toggle')", "_sub:non-nil"),
|
||||
|
||||
bdoc("Lock screen"),
|
||||
kpress(META.."Shift+L", "notioncore.exec_on(_, 'locker')"),
|
||||
|
||||
bdoc("Query for manual page to be displayed."),
|
||||
kpress(META.."F1", "mod_query.query_man(_, ':man')"),
|
||||
|
||||
-- bdoc("Show the Notion manual page."),
|
||||
-- kpress(META.."F1", "ioncore.exec_on(_, ':man notion')"),
|
||||
|
||||
bdoc("Run password menu."),
|
||||
kpress(META.."V", "notioncore.exec_on(_, '/home/kressh/scripts/passmenu.sh')"),
|
||||
|
||||
--bdoc("Run a terminal emulator."),
|
||||
--kpress(META.."T", "mod_query.exec_on_merr(_, XTERM or 'urxvt')"),
|
||||
|
||||
bdoc("Run a browser."),
|
||||
kpress(META.."Shift+B", "notioncore.exec_on(_, 'browser')"),
|
||||
|
||||
bdoc("Query for command line to execute."),
|
||||
kpress(META.."F2", "mod_query.query_exec(_)"),
|
||||
|
||||
bdoc("Incr volume."),
|
||||
kpress(META.."KP_Add", "notioncore.exec_on(_, '/usr/local/bin/volume_control incr')"),
|
||||
|
||||
bdoc("Incr volume."),
|
||||
kpress(META.."KP_Subtract", "notioncore.exec_on(_, '/usr/local/bin/volume_control decr')"),
|
||||
|
||||
bdoc("Play/pause mpc."),
|
||||
kpress(META.."Down", "notioncore.exec_on(_, 'mpc toggle')"),
|
||||
|
||||
bdoc("Stop mpc."),
|
||||
kpress(META.."Up", "notioncore.exec_on(_, 'mpc stop')"),
|
||||
|
||||
bdoc("Play prev."),
|
||||
kpress(META.."Left", "notioncore.exec_on(_, 'mpc prev')"),
|
||||
|
||||
bdoc("Play next."),
|
||||
kpress(META.."Right", "notioncore.exec_on(_, 'mpc next')"),
|
||||
|
||||
--bdoc("Query for Lua code to execute."),
|
||||
--kpress(META.."F3", "mod_query.query_lua(_)"),
|
||||
|
||||
--bdoc("Query for host to connect to with SSH."),
|
||||
--kpress(ALTMETA.."F4", "mod_query.query_ssh(_, ':ssh')"),
|
||||
|
||||
-- bdoc("Zumhotface file!."),
|
||||
-- kpress(META.."Z",
|
||||
-- "mod_query.query_runfile(_, 'zhfup -f')"),
|
||||
--
|
||||
-- bdoc("Zumhotface from buffer."),
|
||||
-- kpress(META.."X",
|
||||
-- "ioncore.exec_on(_, 'zhfclip')"),
|
||||
|
||||
bdoc("Save screenshot."),
|
||||
kpress(META.."Print",
|
||||
"ioncore.exec_on(_, '/home/kressh/bin/screenshot-fs')"),
|
||||
|
||||
bdoc("Query for file to view."),
|
||||
kpress(META.."F3",
|
||||
"mod_query.query_runfile(_, 'xvim')"),
|
||||
--"mod_query.query_runfile(_, 'run-mailcap --action=view')"),
|
||||
|
||||
bdoc("Query for file to edit."),
|
||||
kpress(META.."F4",
|
||||
"mod_query.query_editfile(_, 'xvim')"),
|
||||
--"mod_query.query_editfile(_, 'run-mailcap --action=edit')"),
|
||||
|
||||
bdoc("Query for workspace to go to or create a new one."),
|
||||
kpress(META.."F9", "mod_query.query_workspace(_)"),
|
||||
|
||||
bdoc("Query for a client window to go to."),
|
||||
kpress(META.."G", "mod_query.query_gotoclient(_)"),
|
||||
|
||||
bdoc("Display context menu."),
|
||||
--kpress(META.."M", "mod_menu.menu(_, _sub, 'ctxmenu')"),
|
||||
kpress(META.."M", "mod_query.query_menu(_, _sub, 'ctxmenu', 'Context menu:')"),
|
||||
|
||||
submap(META.."K", {
|
||||
bdoc("Detach (float) or reattach an object to its previous location."),
|
||||
-- By using _chld instead of _sub, we can detach/reattach queries
|
||||
-- attached to a group. The detach code checks if the parameter
|
||||
-- (_chld) is a group 'bottom' and detaches the whole group in that
|
||||
-- case.
|
||||
kpress("D", "ioncore.detach(_chld, 'toggle')", "_chld:non-nil"),
|
||||
}),
|
||||
})
|
||||
|
||||
|
||||
-- WFrame context bindings
|
||||
--
|
||||
-- These bindings are common to all types of frames. Some additional
|
||||
-- frame bindings are found in some modules' configuration files.
|
||||
|
||||
defbindings("WFrame", {
|
||||
submap(META.."K", {
|
||||
bdoc("Maximize the frame horizontally/vertically."),
|
||||
kpress("H", "WFrame.maximize_horiz(_)"),
|
||||
kpress("V", "WFrame.maximize_vert(_)"),
|
||||
}),
|
||||
|
||||
bdoc("Display context menu."),
|
||||
mpress("Button3", "mod_menu.pmenu(_, _sub, 'ctxmenu')"),
|
||||
|
||||
bdoc("Begin move/resize mode."),
|
||||
kpress(META.."R", "WFrame.begin_kbresize(_)"),
|
||||
|
||||
bdoc("Switch the frame to display the object indicated by the tab."),
|
||||
mclick("Button1@tab", "WFrame.p_switch_tab(_)"),
|
||||
mclick("Button2@tab", "WFrame.p_switch_tab(_)"),
|
||||
|
||||
bdoc("Resize the frame."),
|
||||
mdrag("Button1@border", "WFrame.p_resize(_)"),
|
||||
mdrag(META.."Button3", "WFrame.p_resize(_)"),
|
||||
|
||||
bdoc("Move the frame."),
|
||||
mdrag(META.."Button1", "WFrame.p_move(_)"),
|
||||
|
||||
bdoc("Move objects between frames by dragging and dropping the tab."),
|
||||
mdrag("Button1@tab", "WFrame.p_tabdrag(_)"),
|
||||
mdrag("Button2@tab", "WFrame.p_tabdrag(_)"),
|
||||
|
||||
bdoc("Switch to next/previous object within the frame."),
|
||||
mclick(META.."Button4", "WFrame.switch_next(_)"),
|
||||
mclick(META.."Button5", "WFrame.switch_prev(_)"),
|
||||
})
|
||||
|
||||
-- Frames for transient windows ignore this bindmap
|
||||
|
||||
defbindings("WFrame.toplevel", {
|
||||
bdoc("Query for a client window to attach."),
|
||||
kpress(META.."A", "mod_query.query_attachclient(_)"),
|
||||
|
||||
submap(META.."K", {
|
||||
-- Display tab numbers when modifiers are released
|
||||
submap_wait("ioncore.tabnum.show(_)"),
|
||||
|
||||
bdoc("Switch to n:th object within the frame."),
|
||||
kpress("1", "WFrame.switch_nth(_, 0)"),
|
||||
kpress("2", "WFrame.switch_nth(_, 1)"),
|
||||
kpress("3", "WFrame.switch_nth(_, 2)"),
|
||||
kpress("4", "WFrame.switch_nth(_, 3)"),
|
||||
kpress("5", "WFrame.switch_nth(_, 4)"),
|
||||
kpress("6", "WFrame.switch_nth(_, 5)"),
|
||||
kpress("7", "WFrame.switch_nth(_, 6)"),
|
||||
kpress("8", "WFrame.switch_nth(_, 7)"),
|
||||
kpress("9", "WFrame.switch_nth(_, 8)"),
|
||||
kpress("0", "WFrame.switch_nth(_, 9)"),
|
||||
|
||||
bdoc("Switch to next/previous object within the frame."),
|
||||
kpress("N", "WFrame.switch_next(_)"),
|
||||
kpress("P", "WFrame.switch_prev(_)"),
|
||||
|
||||
bdoc("Move current object within the frame left/right."),
|
||||
kpress("comma", "WFrame.dec_index(_, _sub)", "_sub:non-nil"),
|
||||
kpress("period", "WFrame.inc_index(_, _sub)", "_sub:non-nil"),
|
||||
|
||||
bdoc("Maximize the frame horizontally/vertically."),
|
||||
kpress("H", "WFrame.maximize_horiz(_)"),
|
||||
kpress("V", "WFrame.maximize_vert(_)"),
|
||||
|
||||
bdoc("Attach tagged objects to this frame."),
|
||||
kpress("A", "ioncore.tagged_attach(_)"),
|
||||
}),
|
||||
})
|
||||
|
||||
-- Bindings for floating frames
|
||||
|
||||
defbindings("WFrame.floating", {
|
||||
bdoc("Toggle shade mode"),
|
||||
mdblclick("Button1@tab", "WFrame.set_shaded(_, 'toggle')"),
|
||||
|
||||
bdoc("Raise the frame."),
|
||||
mpress("Button1@tab", "WRegion.rqorder(_, 'front')"),
|
||||
mpress("Button1@border", "WRegion.rqorder(_, 'front')"),
|
||||
mclick(META.."Button1", "WRegion.rqorder(_, 'front')"),
|
||||
|
||||
bdoc("Lower the frame."),
|
||||
mclick(META.."Button3", "WRegion.rqorder(_, 'back')"),
|
||||
|
||||
bdoc("Move the frame."),
|
||||
mdrag("Button1@tab", "WFrame.p_move(_)"),
|
||||
})
|
||||
|
||||
|
||||
-- WMoveresMode context bindings
|
||||
--
|
||||
-- These bindings are available keyboard move/resize mode. The mode
|
||||
-- is activated on frames with the command begin_kbresize (bound to
|
||||
-- META.."R" above by default).
|
||||
|
||||
defbindings("WMoveresMode", {
|
||||
bdoc("Cancel the resize mode."),
|
||||
kpress("AnyModifier+Escape","WMoveresMode.cancel(_)"),
|
||||
|
||||
bdoc("End the resize mode."),
|
||||
kpress("AnyModifier+Return","WMoveresMode.finish(_)"),
|
||||
|
||||
bdoc("Grow in specified direction."),
|
||||
kpress("Left", "WMoveresMode.resize(_, 1, 0, 0, 0)"),
|
||||
kpress("Right", "WMoveresMode.resize(_, 0, 1, 0, 0)"),
|
||||
kpress("Up", "WMoveresMode.resize(_, 0, 0, 1, 0)"),
|
||||
kpress("Down", "WMoveresMode.resize(_, 0, 0, 0, 1)"),
|
||||
kpress("F", "WMoveresMode.resize(_, 1, 0, 0, 0)"),
|
||||
kpress("B", "WMoveresMode.resize(_, 0, 1, 0, 0)"),
|
||||
kpress("P", "WMoveresMode.resize(_, 0, 0, 1, 0)"),
|
||||
kpress("N", "WMoveresMode.resize(_, 0, 0, 0, 1)"),
|
||||
|
||||
bdoc("Shrink in specified direction."),
|
||||
kpress("Shift+Left", "WMoveresMode.resize(_,-1, 0, 0, 0)"),
|
||||
kpress("Shift+Right", "WMoveresMode.resize(_, 0,-1, 0, 0)"),
|
||||
kpress("Shift+Up", "WMoveresMode.resize(_, 0, 0,-1, 0)"),
|
||||
kpress("Shift+Down", "WMoveresMode.resize(_, 0, 0, 0,-1)"),
|
||||
kpress("Shift+F", "WMoveresMode.resize(_,-1, 0, 0, 0)"),
|
||||
kpress("Shift+B", "WMoveresMode.resize(_, 0,-1, 0, 0)"),
|
||||
kpress("Shift+P", "WMoveresMode.resize(_, 0, 0,-1, 0)"),
|
||||
kpress("Shift+N", "WMoveresMode.resize(_, 0, 0, 0,-1)"),
|
||||
|
||||
bdoc("Move in specified direction."),
|
||||
kpress(META.."Left", "WMoveresMode.move(_,-1, 0)"),
|
||||
kpress(META.."Right", "WMoveresMode.move(_, 1, 0)"),
|
||||
kpress(META.."Up", "WMoveresMode.move(_, 0,-1)"),
|
||||
kpress(META.."Down", "WMoveresMode.move(_, 0, 1)"),
|
||||
kpress(META.."F", "WMoveresMode.move(_,-1, 0)"),
|
||||
kpress(META.."B", "WMoveresMode.move(_, 1, 0)"),
|
||||
kpress(META.."P", "WMoveresMode.move(_, 0,-1)"),
|
||||
kpress(META.."N", "WMoveresMode.move(_, 0, 1)"),
|
||||
})
|
||||
|
||||
|
||||
--
|
||||
-- Menu definitions
|
||||
--
|
||||
|
||||
|
||||
-- Main menu
|
||||
defmenu("mainmenu", {
|
||||
menuentry("Run...", "mod_query.query_exec(_)"),
|
||||
menuentry("Terminal", "mod_query.exec_on_merr(_, XTERM or 'terminal')"),
|
||||
menuentry("Shrug", "mod_query.exec_on_merr(_, shrugger)"),
|
||||
menuentry("Lock screen",
|
||||
"notioncore.exec_on(_, 'locker')"),
|
||||
menuentry("Help", "mod_query.query_man(_)"),
|
||||
menuentry("About Notion", "mod_query.show_about_ion(_)"),
|
||||
submenu("Styles", "stylemenu"),
|
||||
submenu("Session", "sessionmenu"),
|
||||
})
|
||||
|
||||
|
||||
-- Session control menu
|
||||
defmenu("sessionmenu", {
|
||||
menuentry("Save", "ioncore.snapshot()"),
|
||||
menuentry("Restart", "ioncore.restart()"),
|
||||
--menuentry("Restart TWM", "ioncore.restart_other('twm')"),
|
||||
menuentry("Exit", "ioncore.shutdown()"),
|
||||
})
|
||||
|
||||
|
||||
-- Context menu (frame actions etc.)
|
||||
defctxmenu("WFrame", "Frame", {
|
||||
-- Note: this propagates the close to any subwindows; it does not
|
||||
-- destroy the frame itself, unless empty. An entry to destroy tiled
|
||||
-- frames is configured in cfg_tiling.lua.
|
||||
menuentry("Close", "WRegion.rqclose_propagate(_, _sub)"),
|
||||
-- Low-priority entries
|
||||
menuentry("Attach tagged", "ioncore.tagged_attach(_)", { priority = 0 }),
|
||||
menuentry("Clear tags", "ioncore.tagged_clear()", { priority = 0 }),
|
||||
menuentry("Window info", "mod_query.show_tree(_, _sub)", { priority = 0 }),
|
||||
})
|
||||
|
||||
|
||||
-- Context menu for groups (workspaces, client windows)
|
||||
defctxmenu("WGroup", "Group", {
|
||||
menuentry("Toggle tag", "WRegion.set_tagged(_, 'toggle')"),
|
||||
menuentry("De/reattach", "ioncore.detach(_, 'toggle')"),
|
||||
})
|
||||
|
||||
|
||||
-- Context menu for workspaces
|
||||
defctxmenu("WGroupWS", "Workspace", {
|
||||
menuentry("Close", "WRegion.rqclose(_)"),
|
||||
menuentry("Rename", "mod_query.query_renameworkspace(nil, _)"),
|
||||
menuentry("Attach tagged", "ioncore.tagged_attach(_)"),
|
||||
})
|
||||
|
||||
|
||||
-- Context menu for client windows
|
||||
defctxmenu("WClientWin", "Client window", {
|
||||
menuentry("Kill", "WClientWin.kill(_)"),
|
||||
})
|
||||
96
notion/cfg_statusbar.lua
Normal file
96
notion/cfg_statusbar.lua
Normal file
@@ -0,0 +1,96 @@
|
||||
--
|
||||
-- Notion statusbar module configuration file
|
||||
--
|
||||
|
||||
-- Create a statusbar.
|
||||
mod_statusbar.create{
|
||||
-- First screen, bottom left corner.
|
||||
screen=0,
|
||||
pos='bl',
|
||||
|
||||
-- Set this to true if you want a full-width statusbar.
|
||||
fullsize=true,
|
||||
|
||||
-- Swallow systray windows.
|
||||
systray=true,
|
||||
|
||||
-- Template. Tokens %string are replaced with the value of the
|
||||
-- corresponding meter. Currently supported meters are:
|
||||
-- date date
|
||||
-- load load average (1min, 5min, 15min)
|
||||
-- load_Nmin N minute load average (N=1, 5, 15)
|
||||
-- mail_new mail count (mbox format file $MAIL)
|
||||
-- mail_unread mail count
|
||||
-- mail_total mail count
|
||||
-- mail_*_new mail count (from an alternate mail folder, see below)
|
||||
-- mail_*_unread mail count
|
||||
-- mail_*_total mail count
|
||||
--
|
||||
-- Space preceded by % adds stretchable space for alignment of variable
|
||||
-- meter value widths. > before meter name aligns right using this
|
||||
-- stretchable space , < left, and | centers.
|
||||
-- Meter values may be zero-padded to a width preceding the meter name.
|
||||
-- These alignment and padding specifiers and the meter name may be
|
||||
-- enclosed in braces {}.
|
||||
--
|
||||
-- %filler causes things on the marker's sides to be aligned left and
|
||||
-- right, respectively, and %systray is a placeholder for system tray
|
||||
-- windows and icons.
|
||||
--
|
||||
template=" %battery %battery_remaining | %load | %mem_available | %filler%taskwarrior | %pomodoro [ %timelogger ] %systray | %date ",
|
||||
--template="[ %date || load:% %>load || mail:% %>mail_new/%>mail_total ] %filler%systray",
|
||||
--template="[ %date || load: %05load_1min || mail: %02mail_new/%02mail_total ] %filler%systray",
|
||||
}
|
||||
|
||||
-- Launch ion-statusd. This must be done after creating any statusbars
|
||||
-- for necessary statusd modules to be parsed from the templates.
|
||||
mod_statusbar.launch_statusd{
|
||||
-- Date meter
|
||||
date={
|
||||
-- ISO-8601 date format with additional abbreviated day name.
|
||||
--date_format='%a %Y-%m-%d %H:%M',
|
||||
-- Finnish etc. date format
|
||||
date_format='%A, %d.%m.%Y [ %H:%M ]',
|
||||
-- Locale date format (usually shows seconds, which would require
|
||||
-- updating rather often and can be distracting)
|
||||
-- date_format='%c',
|
||||
|
||||
-- Additional date formats.
|
||||
--[[
|
||||
formats={
|
||||
time = '%H:%M', -- %date_time
|
||||
}
|
||||
--]]
|
||||
},
|
||||
|
||||
-- Load meter
|
||||
load={
|
||||
--update_interval=10*1000,
|
||||
--important_threshold=1.5,
|
||||
--critical_threshold=4.0,
|
||||
},
|
||||
|
||||
-- Cpufreq
|
||||
cpufreq={
|
||||
update_interval=5*1000
|
||||
},
|
||||
|
||||
-- Mail meter
|
||||
--
|
||||
-- To monitor more mbox files, add them to the files table. For
|
||||
-- example, add mail_work_new and mail_junk_new to the template
|
||||
-- above, and define them in the files table:
|
||||
--
|
||||
-- files = { work = "/path/to/work_email", junk = "/path/to/junk" }
|
||||
--
|
||||
-- Don't use the keyword 'spool' as it's reserved for mbox.
|
||||
mail={
|
||||
--update_interval=60*1000,
|
||||
--mbox=os.getenv("MAIL"),
|
||||
--files={},
|
||||
},
|
||||
}
|
||||
|
||||
defwinprop{class="stalonetray",instance="stalonetray",statusbar="systray"}
|
||||
defwinprop{instance="stalonetray",statusbar="systray"}
|
||||
defwinprop{class="stalonetray",statusbar="systray"}
|
||||
113
notion/look_base16.lua
Normal file
113
notion/look_base16.lua
Normal file
@@ -0,0 +1,113 @@
|
||||
-- look_simpleblue.lua drawing engine configuration file for Notion.
|
||||
|
||||
if not gr.select_engine("de") then return end
|
||||
|
||||
de.reset()
|
||||
|
||||
de.defstyle("*", {
|
||||
shadow_colour = "black",
|
||||
highlight_colour = "black",
|
||||
background_colour = "#1d2021",
|
||||
foreground_colour = "#d5c4a1",
|
||||
padding_pixels = 0,
|
||||
highlight_pixels = 0,
|
||||
shadow_pixels = 0,
|
||||
border_style = "elevated",
|
||||
font = "-*-Fixedsys Excelsior-regular-r-*-*-13-*-*-*-*-*-*",
|
||||
text_align = "center",
|
||||
})
|
||||
|
||||
de.defstyle("frame", {
|
||||
shadow_colour = "black",
|
||||
highlight_colour = "#1d2021",
|
||||
padding_colour = "#1d2021",
|
||||
background_colour = "black",
|
||||
foreground_colour = "#1d2021",
|
||||
padding_pixels = 0,
|
||||
highlight_pixels = 0,
|
||||
shadow_pixels = 0,
|
||||
de.substyle("active", {
|
||||
shadow_colour = "black",
|
||||
highlight_colour = "black",
|
||||
background_colour = "#665c54",
|
||||
foreground_colour = "#1d2021",
|
||||
}),
|
||||
})
|
||||
|
||||
de.defstyle("tab", {
|
||||
de.substyle("active-selected", {
|
||||
shadow_colour = "black",
|
||||
highlight_colour = "black",
|
||||
background_colour = "#665c54",
|
||||
foreground_colour = "#fbf1c7",
|
||||
}),
|
||||
--de.substyle("active-unselected", {
|
||||
--shadow_colour = "black",
|
||||
--highlight_colour = "black",
|
||||
--background_colour = "#073642",
|
||||
--foreground_colour = "#9f9f9f",
|
||||
--}),
|
||||
--de.substyle("inactive-selected", {
|
||||
--shadow_colour = "black",
|
||||
--highlight_colour = "black",
|
||||
--background_colour = "#382C1B",
|
||||
--foreground_colour = "#bfbfbf",
|
||||
--}),
|
||||
--de.substyle("inactive-unselected", {
|
||||
--shadow_colour = "black",
|
||||
--highlight_colour = "black",
|
||||
--background_colour = "#073642",
|
||||
--foreground_colour = "#9f9f9f",
|
||||
--}),
|
||||
padding_pixels = 1,
|
||||
text_align = "left",
|
||||
})
|
||||
|
||||
de.defstyle("input", {
|
||||
shadow_colour = "black",
|
||||
highlight_colour = "black",
|
||||
background_colour = "#1d2021",
|
||||
foreground_colour = "#fbf1c7",
|
||||
padding_pixels = 1,
|
||||
highlight_pixels = 0,
|
||||
shadow_pixels = 0,
|
||||
border_style = "elevated",
|
||||
de.substyle("*-cursor", {
|
||||
background_colour = "#fdf6e3",
|
||||
foreground_colour = "#1d2021",
|
||||
}),
|
||||
de.substyle("*-selection", {
|
||||
background_colour = "#83a598",
|
||||
foreground_colour = "#1d2021",
|
||||
}),
|
||||
})
|
||||
|
||||
de.defstyle("input-menu", {
|
||||
padding_pixels=0,
|
||||
})
|
||||
|
||||
de.defstyle("stdisp", {
|
||||
shadow_pixels = 0,
|
||||
highlight_pixels = 0,
|
||||
text_align = "left",
|
||||
background_colour = "black",
|
||||
foreground_colour = "#bdae93",
|
||||
-- font = "-*-Fixedsys Excelsior-regular-r-*-*-13-*-*-*-*-*-*",
|
||||
font = "-*-Iosevka Term Bold-regular-r-*-*-13-*-*-*-*-*-*",
|
||||
|
||||
de.substyle("important", {
|
||||
background_colour = "black",
|
||||
foreground_colour = "#b8bb26",
|
||||
highlight_colour = "#1d2021",
|
||||
}),
|
||||
|
||||
de.substyle("critical", {
|
||||
background_colour = "black",
|
||||
foreground_colour = "#fb4934",
|
||||
highlight_colour = "#1d2021",
|
||||
}),
|
||||
})
|
||||
|
||||
-- dopath("lookcommon_clean")
|
||||
|
||||
gr.refresh()
|
||||
109
notion/look_simpleblue.lua
Normal file
109
notion/look_simpleblue.lua
Normal file
@@ -0,0 +1,109 @@
|
||||
-- look_simpleblue.lua drawing engine configuration file for Notion.
|
||||
|
||||
if not gr.select_engine("de") then return end
|
||||
|
||||
de.reset()
|
||||
|
||||
de.defstyle("*", {
|
||||
shadow_colour = "black",
|
||||
highlight_colour = "black",
|
||||
background_colour = "#073642",
|
||||
foreground_colour = "#93a1a1",
|
||||
padding_pixels = 0,
|
||||
highlight_pixels = 0,
|
||||
shadow_pixels = 0,
|
||||
border_style = "elevated",
|
||||
font = "-*-Fixedsys Excelsior-regular-r-*-*-13-*-*-*-*-*-*",
|
||||
text_align = "center",
|
||||
})
|
||||
|
||||
de.defstyle("frame", {
|
||||
shadow_colour = "black",
|
||||
highlight_colour = "black",
|
||||
padding_colour = "black",
|
||||
background_colour = "black",
|
||||
foreground_colour = "#ffffff",
|
||||
padding_pixels = 0,
|
||||
highlight_pixels = 0,
|
||||
shadow_pixels = 0,
|
||||
de.substyle("active", {
|
||||
shadow_colour = "black",
|
||||
highlight_colour = "black",
|
||||
background_colour = "#657b83",
|
||||
foreground_colour = "#ffffff",
|
||||
}),
|
||||
})
|
||||
|
||||
de.defstyle("tab", {
|
||||
de.substyle("active-selected", {
|
||||
shadow_colour = "black",
|
||||
highlight_colour = "black",
|
||||
background_colour = "#657b83",
|
||||
foreground_colour = "#fdf6e3",
|
||||
}),
|
||||
--de.substyle("active-unselected", {
|
||||
--shadow_colour = "black",
|
||||
--highlight_colour = "black",
|
||||
--background_colour = "#073642",
|
||||
--foreground_colour = "#9f9f9f",
|
||||
--}),
|
||||
--de.substyle("inactive-selected", {
|
||||
--shadow_colour = "black",
|
||||
--highlight_colour = "black",
|
||||
--background_colour = "#382C1B",
|
||||
--foreground_colour = "#bfbfbf",
|
||||
--}),
|
||||
--de.substyle("inactive-unselected", {
|
||||
--shadow_colour = "black",
|
||||
--highlight_colour = "black",
|
||||
--background_colour = "#073642",
|
||||
--foreground_colour = "#9f9f9f",
|
||||
--}),
|
||||
padding_pixels = 1,
|
||||
text_align = "left",
|
||||
})
|
||||
|
||||
de.defstyle("input", {
|
||||
shadow_colour = "black",
|
||||
highlight_colour = "black",
|
||||
background_colour = "#657b83",
|
||||
foreground_colour = "#fdf6e3",
|
||||
padding_pixels = 1,
|
||||
highlight_pixels = 0,
|
||||
shadow_pixels = 0,
|
||||
border_style = "elevated",
|
||||
de.substyle("*-cursor", {
|
||||
background_colour = "white",
|
||||
foreground_colour = "#3f3f3f",
|
||||
}),
|
||||
de.substyle("*-selection", {
|
||||
background_colour = "black",
|
||||
foreground_colour = "white",
|
||||
}),
|
||||
})
|
||||
|
||||
de.defstyle("input-menu", {
|
||||
padding_pixels=0,
|
||||
})
|
||||
|
||||
dopath("lookcommon_clean")
|
||||
|
||||
de.defstyle("stdisp", {
|
||||
shadow_pixels = 0,
|
||||
highlight_pixels = 0,
|
||||
text_align = "left",
|
||||
background_colour = "black",
|
||||
foreground_colour = "#93a1a1",
|
||||
font = "-*-Fixedsys Excelsior-regular-r-*-*-13-*-*-*-*-*-*",
|
||||
|
||||
de.substyle("important", {
|
||||
foreground_colour = "green",
|
||||
}),
|
||||
|
||||
de.substyle("critical", {
|
||||
foreground_colour = "red",
|
||||
}),
|
||||
})
|
||||
|
||||
gr.refresh()
|
||||
|
||||
88
notion/statusd_battery.lua
Normal file
88
notion/statusd_battery.lua
Normal file
@@ -0,0 +1,88 @@
|
||||
-- A battery statusbar meter for the ion3 window manager for Apple Powerbooks
|
||||
-- running Linux. These machines do not use APM or ACPI but have a PMU, Power
|
||||
-- Management Unit.
|
||||
--
|
||||
-- Install the meter in ~/.ion3/statusd_battery.lua
|
||||
--
|
||||
-- Edit your ~/.ion3/cfg_statusbar.lua to add this meter:
|
||||
-- template="%date - %battery %filler%systray",
|
||||
--
|
||||
-- When the battery is charged and you're on AC power, you don't see anything.
|
||||
-- When the system is on AC power and charging the battery, you'll see a tilde
|
||||
-- sign, ~, followed by the percentage that the battery is charged. When the
|
||||
-- system is running on battery power, you'll an equal, =, sign, followed by
|
||||
-- the remaining capacity in percentages.
|
||||
--
|
||||
-- See /usr/src/linux/include/battery.h and
|
||||
-- /usr/src/linux/drivers/macintosh/via-battery.c for some documentation on the
|
||||
-- exported data.
|
||||
--
|
||||
-- Author: Jeroen Pulles
|
||||
-- Rotterdam, 15 november 2007
|
||||
|
||||
|
||||
local battery_base_settings = {
|
||||
update_interval = 10*1000, -- every 15 sec
|
||||
important_threshold = 33 , -- 33% cap. remaining
|
||||
critical_threshold = 20, -- 15% capacity remaining
|
||||
}
|
||||
|
||||
local battery_settings = battery_base_settings
|
||||
|
||||
local battery_timer
|
||||
|
||||
|
||||
-- Read the battery battery info
|
||||
local function read_battery_data ()
|
||||
local f = assert(io.popen("upower -i /org/freedesktop/UPower/devices/battery_BAT0"))
|
||||
local data = f:read("*all")
|
||||
f:close()
|
||||
|
||||
local _, _, capacity = string.find(data, "percentage:%s*(%d+)")
|
||||
local _, _, remaining = string.find(data, "time to %w+:%s*(%d+\.?%d*%s*%w*)")
|
||||
local _, _, status = string.find(data, "state:%s*(%w+)")
|
||||
|
||||
return status, tonumber(capacity), remaining
|
||||
end
|
||||
|
||||
-- Write the current state to the statusbar:
|
||||
local function inform_battery ()
|
||||
|
||||
local status, cap, remaining = read_battery_data()
|
||||
|
||||
if status == 'Discharging' then
|
||||
-- On battery power, percentage remaining:
|
||||
statusd.inform("battery", string.format("BAT %d%%", cap))
|
||||
else
|
||||
-- Charging the battery on AC power, percentage charged:
|
||||
statusd.inform("battery", string.format("AC %d%%", cap))
|
||||
end
|
||||
|
||||
if cap <= battery_settings.critical_threshold then
|
||||
statusd.inform("battery_hint", "critical")
|
||||
elseif cap <= battery_settings.important_threshold then
|
||||
statusd.inform("battery_hint", "important")
|
||||
else
|
||||
statusd.inform("battery_hint", "normal")
|
||||
end
|
||||
|
||||
statusd.inform("battery_remaining", remaining)
|
||||
end
|
||||
|
||||
|
||||
-- Statusbar update loop:
|
||||
local function update_battery ()
|
||||
inform_battery()
|
||||
battery_timer:set(battery_settings.update_interval, update_battery)
|
||||
end
|
||||
|
||||
|
||||
-- Run the script:
|
||||
if statusd then
|
||||
-- we're a statusbar plugin:
|
||||
battery_settings = table.join(statusd.get_config("battery"), battery_base_settings)
|
||||
battery_timer = statusd.create_timer()
|
||||
update_battery()
|
||||
end
|
||||
|
||||
-- vim: set ts=4 sw=4 expandtab
|
||||
40
notion/statusd_cpufreq.lua
Normal file
40
notion/statusd_cpufreq.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
-- Authors: Unknown
|
||||
-- License: Public domain
|
||||
-- Last Changed: Unknown
|
||||
--
|
||||
-- statusd_cpufreq.lua
|
||||
--
|
||||
-- Public domain
|
||||
--
|
||||
-- Use the key "cpufreq_[KMG]" to get the current CPU frequency in
|
||||
-- K/M/GHz, according to /sys/devices/system/cpu/cpuX/cpufreq/. (This
|
||||
-- has the advantage of being a much "rounder" number than the one in
|
||||
-- /proc/cpuinfo, as provided by statusd_cpuspeed.lua.)
|
||||
--
|
||||
-- The "cpu" option to the statusd settings for cpufreq modifies which
|
||||
-- cpu we look at.
|
||||
|
||||
local defaults={ update_interval=2*1000, cpu=0 }
|
||||
local settings=table.join(statusd.get_config("cpufreq"), defaults)
|
||||
|
||||
function get_cpufreq()
|
||||
local f=io.open('/sys/devices/system/cpu/cpu'.. settings.cpu ..'/cpufreq/scaling_cur_freq')
|
||||
local cpufreq_K = f:read('*a')
|
||||
f:close()
|
||||
|
||||
local cpufreq_M = cpufreq_K / 1000
|
||||
local cpufreq_G = cpufreq_M / 1000
|
||||
|
||||
return tostring(cpufreq_K), tostring(cpufreq_M), tostring(cpufreq_G)
|
||||
end
|
||||
|
||||
function update_cpufreq()
|
||||
local cpufreq_K, cpufreq_M, cpufreq_G = get_cpufreq()
|
||||
statusd.inform("cpufreq_K", cpufreq_K)
|
||||
statusd.inform("cpufreq_M", cpufreq_M)
|
||||
statusd.inform("cpufreq_G", cpufreq_G)
|
||||
cpufreq_timer:set(settings.update_interval, update_cpufreq)
|
||||
end
|
||||
|
||||
cpufreq_timer = statusd.create_timer()
|
||||
update_cpufreq()
|
||||
88
notion/statusd_mem.lua
Normal file
88
notion/statusd_mem.lua
Normal file
@@ -0,0 +1,88 @@
|
||||
-------------------------------------------------------------------------------------------
|
||||
--
|
||||
-- PURPOSE:
|
||||
-- Shows system available memory catching [free] command outputs.
|
||||
-- It is intended to make it simpler than statusd_meminfo, plus user configurable
|
||||
-- measurement units and alarms for "all" available memory metters.
|
||||
--
|
||||
-- USAGE:
|
||||
-- Just set any of the following labels on cfg_statusbar.lua: %mem_hused, %mem_shared
|
||||
-- %mem_free, %mem_hfree, %mem_swap, %mem_used, %mem_cached. Example: [MF: %mem_free]
|
||||
--
|
||||
-- MEANINGS:
|
||||
--> ** "mem_hfree" poses as "htop free memory" or "mem_free +cached +buffers",
|
||||
-- in oposition, "mem_hused" is "mem_used -cached -buffers"; other labels have
|
||||
-- transparent meanings.
|
||||
--
|
||||
------- CONFIG EXAMPLE: ------------------------------------------------------------------
|
||||
--
|
||||
-- To modify settings is quite simple and flexible, write (on cfg_statusbar.lua)
|
||||
-- something like this, without comments:
|
||||
-- mem = {
|
||||
-- update_interval = 15*1000, --> Milliseconds
|
||||
-- free_alarm = 25, --> Limits percentaje ...
|
||||
-- used_alarm = 65,
|
||||
-- units = "m" --> "g" or "k" too
|
||||
-- }
|
||||
-- Write only the settings that do you want to change or leave this section as is...
|
||||
--> ** "update_interval" means "time in milliseconds to update info (default = 15)"
|
||||
-- "xx_alarm" means "do a color advise when memory *percentage* reaches this value".
|
||||
-- (both defaults are 50). "units" means Gb "g", Mb "m" or Kb "k" (default = "m")
|
||||
------------------------------------------------------------------------------------------
|
||||
--
|
||||
-- NOTES:
|
||||
-- * Alarms for used memory are inverse to alarms for free memory (think about it...)
|
||||
-- "mem_total" label is useless. If total memory varies, its time to open your
|
||||
-- hardware and check this script from barebone. Seriously, may be your video or wifi
|
||||
-- devices were claiming some free R.A.M. on your machine start-up.
|
||||
-- However, I included "mem_total" just in case.
|
||||
-- ** This script has non blocking I/O.
|
||||
--
|
||||
-- LICENSE:
|
||||
-- GPL2 Copyright(C)2006 Mario Garcia H.
|
||||
-- (Please see http://www.gnu.org/licenses/gpl.html to read complete license)
|
||||
--
|
||||
-- T.STAMP: Thu Dec 7 03:28:04 2006
|
||||
--
|
||||
-- DEPENDS: "free" command. Probably, all GNU/Linux distros have one.
|
||||
--
|
||||
-- INSECTS: Not known.
|
||||
--
|
||||
-- CONTACT:
|
||||
-- G.H. <drosophila (at) nmental (dot) com>
|
||||
--
|
||||
------- DEFAULT SETTINGS :-----------------------------------------------------------------
|
||||
|
||||
local mem_timer
|
||||
local defaults = { update_interval = 10*1000, free_alarm = 25, used_alarm = 50, units = "m" }
|
||||
local settings = table.join(statusd.get_config("mem"), defaults)
|
||||
|
||||
------- MEM MONITOR :----------------------------------------------------------------------
|
||||
|
||||
local function show_meminfo(status)
|
||||
while status do
|
||||
local ok, _, total, used, free, shared, buffers, cache, available =--
|
||||
string.find(status, "Mem:%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)")
|
||||
--
|
||||
if not ok then statusd.inform("mem_template", "--") return end
|
||||
--
|
||||
statusd.inform("mem_total", total)
|
||||
statusd.inform("mem_used", used)
|
||||
statusd.inform("mem_free", free)
|
||||
statusd.inform("mem_shared", shared)
|
||||
statusd.inform("mem_buffers", buffers)
|
||||
statusd.inform("mem_cache", cache)
|
||||
statusd.inform("mem_available", available)
|
||||
statusd.inform("mem_available_hint", available*100/total >= settings.free_alarm and "important" or "critical")
|
||||
|
||||
status = coroutine.yield()
|
||||
end
|
||||
end
|
||||
|
||||
local function update_mem()
|
||||
statusd.popen_bgread("free -"..settings.units.."w", coroutine.wrap(show_meminfo))
|
||||
mem_timer:set(settings.update_interval, update_mem)
|
||||
end
|
||||
|
||||
mem_timer = statusd.create_timer()
|
||||
update_mem()
|
||||
41
notion/statusd_pomodoro.lua
Normal file
41
notion/statusd_pomodoro.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
local pomodoro_base_settings = {
|
||||
update_interval = 5*1000 -- 5 seconds
|
||||
}
|
||||
|
||||
local pomodoro_settings = pomodoro_base_settings
|
||||
|
||||
local pomodoro_timer
|
||||
|
||||
-- Read the active pomodoro
|
||||
local function read_pomodoro_data ()
|
||||
local f = assert(io.popen("pomodoro status"))
|
||||
local data = f:read("*all")
|
||||
f:close()
|
||||
return data
|
||||
end
|
||||
|
||||
-- Write the current state to the statusbar:
|
||||
local function inform_pomodoro ()
|
||||
|
||||
local pomodoro = read_pomodoro_data()
|
||||
|
||||
statusd.inform("pomodoro", pomodoro)
|
||||
end
|
||||
|
||||
|
||||
-- Statusbar update loop:
|
||||
local function update_pomodoro ()
|
||||
inform_pomodoro()
|
||||
pomodoro_timer:set(pomodoro_settings.update_interval, update_pomodoro)
|
||||
end
|
||||
|
||||
|
||||
-- Run the script:
|
||||
if statusd then
|
||||
-- we're a statusbar plugin:
|
||||
pomodoro_settings = table.join(statusd.get_config("pomodoro"), pomodoro_base_settings)
|
||||
pomodoro_timer = statusd.create_timer()
|
||||
update_pomodoro()
|
||||
end
|
||||
|
||||
-- vim: set ts=4 sw=4 expandtab
|
||||
42
notion/statusd_taskwarrior.lua
Normal file
42
notion/statusd_taskwarrior.lua
Normal file
@@ -0,0 +1,42 @@
|
||||
local task_base_settings = {
|
||||
update_interval = 15*1000, -- every 15 seconds
|
||||
}
|
||||
|
||||
local task_settings = task_base_settings
|
||||
|
||||
local task_timer
|
||||
|
||||
-- Read the active task
|
||||
local function read_task_data ()
|
||||
local f = assert(io.popen("~/.notion/statusd_task"))
|
||||
local data = f:read("*all")
|
||||
f:close()
|
||||
return data
|
||||
end
|
||||
|
||||
-- Write the current state to the statusbar:
|
||||
local function inform_task ()
|
||||
|
||||
local task = read_task_data()
|
||||
|
||||
statusd.inform("taskwarrior", task)
|
||||
statusd.inform("taskwarrior_hint", "critical")
|
||||
end
|
||||
|
||||
|
||||
-- Statusbar update loop:
|
||||
local function update_task ()
|
||||
inform_task()
|
||||
task_timer:set(task_settings.update_interval, update_task)
|
||||
end
|
||||
|
||||
|
||||
-- Run the script:
|
||||
if statusd then
|
||||
-- we're a statusbar plugin:
|
||||
task_settings = table.join(statusd.get_config("task"), task_base_settings)
|
||||
task_timer = statusd.create_timer()
|
||||
update_task()
|
||||
end
|
||||
|
||||
-- vim: set ts=4 sw=4 expandtab
|
||||
7
notion/statusd_timeledger
Executable file
7
notion/statusd_timeledger
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
CURRENT_TASK=$(cd ~/.work-ledger && ./bin/ledger bal -p today --depth 1 ^Work | sed 's/\s\+/ /g')
|
||||
|
||||
echo $CURRENT_TASK
|
||||
|
||||
exit 0
|
||||
52
notion/statusd_timelogger.lua
Normal file
52
notion/statusd_timelogger.lua
Normal file
@@ -0,0 +1,52 @@
|
||||
local timelogger_base_settings = {
|
||||
update_interval = 5*1000 -- 5 seconds
|
||||
}
|
||||
|
||||
local timelogger_settings = timelogger_base_settings
|
||||
|
||||
local timelogger_timer
|
||||
|
||||
-- Read the active timelogger
|
||||
local function read_timelogger_data ()
|
||||
local f = assert(io.popen("timelogger status"))
|
||||
local current = f:read("*all")
|
||||
f:close()
|
||||
local f = assert(io.popen("timelogger today"))
|
||||
local total = f:read("*all")
|
||||
f:close()
|
||||
return tonumber(current), tonumber(total)
|
||||
end
|
||||
|
||||
-- Write the current state to the statusbar:
|
||||
local function inform_timelogger ()
|
||||
|
||||
local tl_current, tl_total = read_timelogger_data()
|
||||
|
||||
statusd.inform("timelogger", tostring(math.floor(tl_current/60).." min / "..tostring(math.ceil(tl_total/3600).." hr")))
|
||||
|
||||
if tl_current >= 40*60 then
|
||||
statusd.inform("timelogger_hint", "critical")
|
||||
elseif tl_current >= 25*60 then
|
||||
statusd.inform("timelogger_hint", "important")
|
||||
else
|
||||
statusd.inform("timelogger_hint", "normal")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Statusbar update loop:
|
||||
local function update_timelogger ()
|
||||
inform_timelogger()
|
||||
timelogger_timer:set(timelogger_settings.update_interval, update_timelogger)
|
||||
end
|
||||
|
||||
|
||||
-- Run the script:
|
||||
if statusd then
|
||||
-- we're a statusbar plugin:
|
||||
timelogger_settings = table.join(statusd.get_config("timelogger"), timelogger_base_settings)
|
||||
timelogger_timer = statusd.create_timer()
|
||||
update_timelogger()
|
||||
end
|
||||
|
||||
-- vim: set ts=4 sw=4 expandtab
|
||||
Reference in New Issue
Block a user