diff --git a/dot_config/alacritty/alacritty.yml b/dot_config/alacritty/alacritty.yml new file mode 100644 index 0000000..73458b6 --- /dev/null +++ b/dot_config/alacritty/alacritty.yml @@ -0,0 +1,7 @@ +shell: + program: tmux +font: + normal: + family: FiraCode NF +window: + opacity: 0.5 # Require `picom -f &` in .xinitrc diff --git a/dot_config/awesome/error_handling.lua b/dot_config/awesome/error_handling.lua new file mode 100644 index 0000000..918a1ab --- /dev/null +++ b/dot_config/awesome/error_handling.lua @@ -0,0 +1,39 @@ +-- Notification library +local naughty = require("naughty") + +local function init(awesome) + -- {{{ Error handling + -- Check if awesome encountered an error during startup and fell back to + -- another config (This code will only ever execute for the fallback config) + if awesome.startup_errors then + naughty.notify({ + preset = naughty.config.presets.critical, + title = "Oops, there were errors during startup!", + text = awesome.startup_errors + }) + end + + -- Handle runtime errors after startup + do + local in_error = false + awesome.connect_signal("debug::error", function(err) + -- Make sure we don't go into an endless error loop + if in_error then + return + end + in_error = true + + naughty.notify({ + preset = naughty.config.presets.critical, + title = "Oops, an error happened!", + text = tostring(err) + }) + in_error = false + end) + end + -- }}} +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/awesome/keymapping/init.lua b/dot_config/awesome/keymapping/init.lua new file mode 100644 index 0000000..a0e8502 --- /dev/null +++ b/dot_config/awesome/keymapping/init.lua @@ -0,0 +1,10 @@ +local function bind(globalkeys, clientkeys, clientbuttons) + -- Media Control + globalkeys, clientkeys, clientbuttons = require('keymapping.mediacontrol').bind(globalkeys, clientkeys, clientbuttons) + + return globalkeys, clientkeys, clientbuttons +end + +return { + bind = bind +} \ No newline at end of file diff --git a/dot_config/awesome/keymapping/mediacontrol.lua b/dot_config/awesome/keymapping/mediacontrol.lua new file mode 100644 index 0000000..5b94b8d --- /dev/null +++ b/dot_config/awesome/keymapping/mediacontrol.lua @@ -0,0 +1,19 @@ +local awful = require("awful") +local gears = require("gears") + +local function bind(globalkeys, clientkeys, clientbuttons) + globalkeys = gears.table.join(globalkeys, + awful.key({ }, "XF86AudioPlay", function () awful.util.spawn_with_shell("playerctl play-pause") end), + awful.key({ }, "XF86AudioNext", function () awful.util.spawn_with_shell("playerctl next") end), + awful.key({ }, "XF86AudioPrev", function () awful.util.spawn_with_shell("playerctl previous") end), + awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn_with_shell("amixer -c 0 set Master 1dB+") end), + awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn_with_shell("amixer -c 0 set Master 1dB-") end), + awful.key({ }, "XF86AudioMute", function () awful.util.spawn_with_shell("amixer -c 0 set Master toggle") end) + ) + + return globalkeys, clientkeys, clientbuttons +end + +return { + bind = bind +} \ No newline at end of file diff --git a/dot_config/awesome/rc.lua b/dot_config/awesome/rc.lua new file mode 100644 index 0000000..3122fdb --- /dev/null +++ b/dot_config/awesome/rc.lua @@ -0,0 +1,602 @@ +-- If LuaRocks is installed, make sure that packages installed through it are +-- found (e.g. lgi). If LuaRocks is not installed, do nothing. +pcall(require, "luarocks.loader") + +-- Standard awesome library +local gears = require("gears") +local awful = require("awful") +require("awful.autofocus") +-- Widget and layout library +local wibox = require("wibox") +-- Theme handling library +local beautiful = require("beautiful") +local menubar = require("menubar") +local hotkeys_popup = require("awful.hotkeys_popup") +-- Enable hotkeys help widget for VIM and other apps +-- when client with a matching name is opened: +require("awful.hotkeys_popup.keys") +require("error_handling").init(awesome) + +-- {{{ Variable definitions +-- Themes define colours, icons, font and wallpapers. +beautiful.init(string.format("%s/.config/awesome/theme/theme.lua", os.getenv("HOME"))) + +-- This is used later as the default terminal and editor to run. +terminal = "alacritty" +editor = os.getenv("EDITOR") or "vim" +editor_cmd = terminal .. " -e " .. editor + +-- Default modkey. +-- Usually, Mod4 is the key with a logo between Control and Alt. +-- If you do not like this or do not have such a key, +-- I suggest you to remap Mod4 to another key using xmodmap or other tools. +-- However, you can use another modifier like Mod1, but it may interact with others. +modkey = "Mod4" + +-- Table of layouts to cover with awful.layout.inc, order matters. +awful.layout.layouts = {awful.layout.suit.floating, awful.layout.suit.tile, awful.layout.suit.tile.left, + awful.layout.suit.tile.bottom, awful.layout.suit.tile.top, awful.layout.suit.fair, + awful.layout.suit.fair.horizontal, awful.layout.suit.spiral, awful.layout.suit.spiral.dwindle, + awful.layout.suit.max, awful.layout.suit.max.fullscreen, awful.layout.suit.magnifier, + awful.layout.suit.corner.nw -- awful.layout.suit.corner.ne, +-- awful.layout.suit.corner.sw, +-- awful.layout.suit.corner.se, +} +-- }}} + +-- {{{ Menu +-- Create a launcher widget and a main menu +myawesomemenu = {{"hotkeys", function() + hotkeys_popup.show_help(nil, awful.screen.focused()) +end}, {"manual", terminal .. " -e man awesome"}, {"edit config", editor_cmd .. " " .. awesome.conffile}, + {"restart", awesome.restart}, {"quit", function() + awesome.quit() +end}} + +mymainmenu = awful.menu({ + items = {{"awesome", myawesomemenu, beautiful.awesome_icon}, {"open terminal", terminal}} +}) + +mylauncher = awful.widget.launcher({ + image = beautiful.awesome_icon, + menu = mymainmenu +}) + +-- Menubar configuration +menubar.utils.terminal = terminal -- Set the terminal for applications that require it +-- }}} + +-- Keyboard map indicator and switcher +mykeyboardlayout = awful.widget.keyboardlayout() + +-- {{{ Wibar +-- Create a textclock widget +mytextclock = wibox.widget.textclock() + +local volume_widget = require('awesome-wm-widgets.volume-widget.volume') +local cpu_widget = require("awesome-wm-widgets.cpu-widget.cpu-widget") +local ram_widget = require("awesome-wm-widgets.ram-widget.ram-widget") +local net_speed_widget = require("awesome-wm-widgets.net-speed-widget.net-speed") +local mpris_widget = require("awesome-wm-widgets.mpris-widget") + +-- Create a wibox for each screen and add it +local taglist_buttons = gears.table.join(awful.button({}, 1, function(t) + t:view_only() +end), awful.button({modkey}, 1, function(t) + if client.focus then + client.focus:move_to_tag(t) + end +end), awful.button({}, 3, awful.tag.viewtoggle), awful.button({modkey}, 3, function(t) + if client.focus then + client.focus:toggle_tag(t) + end +end), awful.button({}, 4, function(t) + awful.tag.viewnext(t.screen) +end), awful.button({}, 5, function(t) + awful.tag.viewprev(t.screen) +end)) + +local tasklist_buttons = gears.table.join(awful.button({}, 1, function(c) + if c == client.focus then + c.minimized = true + else + c:emit_signal("request::activate", "tasklist", { + raise = true + }) + end +end), awful.button({}, 3, function() + awful.menu.client_list({ + theme = { + width = 250 + } + }) +end), awful.button({}, 4, function() + awful.client.focus.byidx(1) +end), awful.button({}, 5, function() + awful.client.focus.byidx(-1) +end)) + +local function set_wallpaper(s) + -- Wallpaper + if beautiful.wallpaper then + local wallpaper = beautiful.wallpaper + -- If wallpaper is a function, call it with the screen + if type(wallpaper) == "function" then + wallpaper = wallpaper(s) + end + gears.wallpaper.maximized(wallpaper, s, true) + end +end + +-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) +screen.connect_signal("property::geometry", set_wallpaper) + +awful.screen.connect_for_each_screen(function(s) + -- Wallpaper + set_wallpaper(s) + + -- Each screen has its own tag table. + awful.tag({"1", "2", "3", "4", "5", "6", "7", "8", "9"}, s, awful.layout.layouts[1]) + + -- Create a promptbox for each screen + s.mypromptbox = awful.widget.prompt() + -- Create an imagebox widget which will contain an icon indicating which layout we're using. + -- We need one layoutbox per screen. + s.mylayoutbox = awful.widget.layoutbox(s) + s.mylayoutbox:buttons(gears.table.join(awful.button({}, 1, function() + awful.layout.inc(1) + end), awful.button({}, 3, function() + awful.layout.inc(-1) + end), awful.button({}, 4, function() + awful.layout.inc(1) + end), awful.button({}, 5, function() + awful.layout.inc(-1) + end))) + -- Create a taglist widget + s.mytaglist = awful.widget.taglist { + screen = s, + filter = awful.widget.taglist.filter.all, + buttons = taglist_buttons + } + + -- Create a tasklist widget + s.mytasklist = awful.widget.tasklist { + screen = s, + filter = awful.widget.tasklist.filter.currenttags, + buttons = tasklist_buttons + } + + -- Create the wibox + s.mywibox = awful.wibar({ + position = "top", + screen = s + }) + + -- Add widgets to the wibox + s.mywibox:setup{ + layout = wibox.layout.align.horizontal, + { -- Left widgets + layout = wibox.layout.fixed.horizontal, + mylauncher, + s.mytaglist, + s.mypromptbox + }, + s.mytasklist, -- Middle widget + { -- Right widgets + layout = wibox.layout.fixed.horizontal, + mpris_widget(), + volume_widget({ widget_type = 'arc' }), + cpu_widget({ width = 40 }), + ram_widget(), + net_speed_widget(), + mykeyboardlayout, + wibox.widget.systray(), + mytextclock, + s.mylayoutbox + } + } +end) +-- }}} + +-- {{{ Mouse bindings +root.buttons(gears.table.join(awful.button({}, 3, function() + mymainmenu:toggle() +end), awful.button({}, 4, awful.tag.viewnext), awful.button({}, 5, awful.tag.viewprev))) +-- }}} + +-- {{{ Key bindings +globalkeys = gears.table.join(awful.key({modkey}, "s", hotkeys_popup.show_help, { + escription = "show help", + group = "awesome" +}), awful.key({modkey}, "Left", awful.tag.viewprev, { + description = "view previous", + group = "tag" +}), awful.key({modkey}, "Right", awful.tag.viewnext, { + description = "view next", + group = "tag" +}), awful.key({modkey}, "Escape", awful.tag.history.restore, { + description = "go back", + group = "tag" +}), awful.key({modkey}, "j", function() + awful.client.focus.byidx(1) +end, { + description = "focus next by index", + group = "client" +}), awful.key({modkey}, "k", function() + awful.client.focus.byidx(-1) +end, { + description = "focus previous by index", + group = "client" +}), awful.key({modkey}, "w", function() + mymainmenu:show() +end, { + description = "show main menu", + group = "awesome" +}), -- Layout manipulation +awful.key({modkey, "Shift"}, "j", function() + awful.client.swap.byidx(1) +end, { + description = "swap with next client by index", + group = "client" +}), awful.key({modkey, "Shift"}, "k", function() + awful.client.swap.byidx(-1) +end, { + description = "swap with previous client by index", + group = "client" +}), awful.key({modkey, "Control"}, "j", function() + awful.screen.focus_relative(1) +end, { + description = "focus the next screen", + group = "screen" +}), awful.key({modkey, "Control"}, "k", function() + awful.screen.focus_relative(-1) +end, { + description = "focus the previous screen", + group = "screen" +}), awful.key({modkey}, "u", awful.client.urgent.jumpto, { + description = "jump to urgent client", + group = "client" +}), awful.key({modkey}, "Tab", function() + awful.client.focus.history.previous() + if client.focus then + client.focus:raise() + end +end, { + description = "go back", + group = "client" +}), -- Standard program +awful.key({modkey}, "Return", function() + awful.spawn(terminal) +end, { + description = "open a terminal", + group = "launcher" +}), awful.key({modkey, "Control"}, "r", awesome.restart, { + description = "reload awesome", + group = "awesome" +}), awful.key({modkey, "Shift"}, "q", awesome.quit, { + description = "quit awesome", + group = "awesome" +}), awful.key({modkey}, "l", function() + awful.tag.incmwfact(0.05) +end, { + description = "increase master width factor", + group = "layout" +}), awful.key({modkey}, "h", function() + awful.tag.incmwfact(-0.05) +end, { + description = "decrease master width factor", + group = "layout" +}), awful.key({modkey, "Shift"}, "h", function() + awful.tag.incnmaster(1, nil, true) +end, { + description = "increase the number of master clients", + group = "layout" +}), awful.key({modkey, "Shift"}, "l", function() + awful.tag.incnmaster(-1, nil, true) +end, { + description = "decrease the number of master clients", + group = "layout" +}), awful.key({modkey, "Control"}, "h", function() + awful.tag.incncol(1, nil, true) +end, { + description = "increase the number of columns", + group = "layout" +}), awful.key({modkey, "Control"}, "l", function() + awful.tag.incncol(-1, nil, true) +end, { + description = "decrease the number of columns", + group = "layout" +}), awful.key({modkey}, "space", function() + awful.layout.inc(1) +end, { + description = "select next", + group = "layout" +}), awful.key({modkey, "Shift"}, "space", function() + awful.layout.inc(-1) +end, { + description = "select previous", + group = "layout" +}), awful.key({modkey, "Control"}, "n", function() + local c = awful.client.restore() + -- Focus restored client + if c then + c:emit_signal("request::activate", "key.unminimize", { + raise = true + }) + end +end, { + description = "restore minimized", + group = "client" +}), -- Prompt +awful.key({modkey}, "r", function() + awful.screen.focused().mypromptbox:run() +end, { + description = "run prompt", + group = "launcher" +}), awful.key({modkey}, "x", function() + awful.prompt.run { + prompt = "Run Lua code: ", + textbox = awful.screen.focused().mypromptbox.widget, + exe_callback = awful.util.eval, + history_path = awful.util.get_cache_dir() .. "/history_eval" + } +end, { + description = "lua execute prompt", + group = "awesome" +}), -- Menubar +awful.key({modkey}, "p", function() + awful.spawn.with_shell("rofi -show drun &>> /tmp/rofi.log") + -- menubar.show() +end, { + description = "show the menubar", + group = "launcher" +})) + +clientkeys = gears.table.join(awful.key({modkey}, "f", function(c) + c.fullscreen = not c.fullscreen + c:raise() +end, { + description = "toggle fullscreen", + group = "client" +}), awful.key({modkey, "Shift"}, "c", function(c) + c:kill() +end, { + description = "close", + group = "client" +}), awful.key({modkey, "Control"}, "space", awful.client.floating.toggle, { + description = "toggle floating", + group = "client" +}), awful.key({modkey, "Control"}, "Return", function(c) + c:swap(awful.client.getmaster()) +end, { + description = "move to master", + group = "client" +}), awful.key({modkey}, "o", function(c) + c:move_to_screen() +end, { + description = "move to screen", + group = "client" +}), awful.key({modkey}, "t", function(c) + c.ontop = not c.ontop +end, { + description = "toggle keep on top", + group = "client" +}), awful.key({modkey}, "n", function(c) + -- The client currently has the input focus, so it cannot be + -- minimized, since minimized clients can't have the focus. + c.minimized = true +end, { + description = "minimize", + group = "client" +}), awful.key({modkey}, "m", function(c) + c.maximized = not c.maximized + c:raise() +end, { + description = "(un)maximize", + group = "client" +}), awful.key({modkey, "Control"}, "m", function(c) + c.maximized_vertical = not c.maximized_vertical + c:raise() +end, { + description = "(un)maximize vertically", + group = "client" +}), awful.key({modkey, "Shift"}, "m", function(c) + c.maximized_horizontal = not c.maximized_horizontal + c:raise() +end, { + description = "(un)maximize horizontally", + group = "client" +})) + +-- Bind all key numbers to tags. +-- Be careful: we use keycodes to make it work on any keyboard layout. +-- This should map on the top row of your keyboard, usually 1 to 9. +for i = 1, 9 do + globalkeys = gears.table.join(globalkeys, -- View tag only. + awful.key({modkey}, "#" .. i + 9, function() + local screen = awful.screen.focused() + local tag = screen.tags[i] + if tag then + tag:view_only() + end + end, { + description = "view tag #" .. i, + group = "tag" + }), -- Toggle tag display. + awful.key({modkey, "Control"}, "#" .. i + 9, function() + local screen = awful.screen.focused() + local tag = screen.tags[i] + if tag then + awful.tag.viewtoggle(tag) + end + end, { + description = "toggle tag #" .. i, + group = "tag" + }), -- Move client to tag. + awful.key({modkey, "Shift"}, "#" .. i + 9, function() + if client.focus then + local tag = client.focus.screen.tags[i] + if tag then + client.focus:move_to_tag(tag) + end + end + end, { + description = "move focused client to tag #" .. i, + group = "tag" + }), -- Toggle tag on focused client. + awful.key({modkey, "Control", "Shift"}, "#" .. i + 9, function() + if client.focus then + local tag = client.focus.screen.tags[i] + if tag then + client.focus:toggle_tag(tag) + end + end + end, { + description = "toggle focused client on tag #" .. i, + group = "tag" + })) +end + +clientbuttons = gears.table.join(awful.button({}, 1, function(c) + c:emit_signal("request::activate", "mouse_click", { + raise = true + }) +end), awful.button({modkey}, 1, function(c) + c:emit_signal("request::activate", "mouse_click", { + raise = true + }) + awful.mouse.client.move(c) +end), awful.button({modkey}, 3, function(c) + c:emit_signal("request::activate", "mouse_click", { + raise = true + }) + awful.mouse.client.resize(c) +end)) + +globalkeys, clientkeys, clientbuttons = require('keymapping').bind(globalkeys, clientkeys, clientbuttons) + +-- Set keys +root.keys(globalkeys) +-- }}} + +-- {{{ Rules +-- Rules to apply to new clients (through the "manage" signal). +awful.rules.rules = { -- All clients will match this rule. +{ + rule = {}, + properties = { + border_width = beautiful.border_width, + border_color = beautiful.border_normal, + focus = awful.client.focus.filter, + raise = true, + keys = clientkeys, + buttons = clientbuttons, + screen = awful.screen.preferred, + placement = awful.placement.no_overlap + awful.placement.no_offscreen + } +}, -- Floating clients. +{ + rule_any = { + instance = {"DTA", -- Firefox addon DownThemAll. + "copyq", -- Includes session name in class. + "pinentry"}, + class = {"Arandr", "Blueman-manager", "Gpick", "Kruler", "MessageWin", -- kalarm. + "Sxiv", "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size. + "Wpa_gui", "veromix", "xtightvncviewer"}, + + -- Note that the name property shown in xprop might be set slightly after creation of the client + -- and the name shown there might not match defined rules here. + name = {"Event Tester" -- xev. + }, + role = {"AlarmWindow", -- Thunderbird's calendar. + "ConfigManager", -- Thunderbird's about:config. + "pop-up" -- e.g. Google Chrome's (detached) Developer Tools. + } + }, + properties = { + floating = true + } +}, -- Add titlebars to normal clients and dialogs +{ + rule_any = { + type = {"normal", "dialog"} + }, + properties = { + titlebars_enabled = true + } +} -- Set Firefox to always map on the tag named "2" on screen 1. +-- { rule = { class = "Firefox" }, +-- properties = { screen = 1, tag = "2" } }, +} +-- }}} + +-- {{{ Signals +-- Signal function to execute when a new client appears. +client.connect_signal("manage", function(c) + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + -- if not awesome.startup then awful.client.setslave(c) end + + if awesome.startup and not c.size_hints.user_position and not c.size_hints.program_position then + -- Prevent clients from being unreachable after screen count changes. + awful.placement.no_offscreen(c) + end +end) + +-- Add a titlebar if titlebars_enabled is set to true in the rules. +client.connect_signal("request::titlebars", function(c) + -- buttons for the titlebar + local buttons = gears.table.join(awful.button({}, 1, function() + c:emit_signal("request::activate", "titlebar", { + raise = true + }) + awful.mouse.client.move(c) + end), awful.button({}, 3, function() + c:emit_signal("request::activate", "titlebar", { + raise = true + }) + awful.mouse.client.resize(c) + end)) + + awful.titlebar(c):setup{ + { -- Left + awful.titlebar.widget.iconwidget(c), + buttons = buttons, + layout = wibox.layout.fixed.horizontal + }, + { -- Middle + { -- Title + align = "center", + widget = awful.titlebar.widget.titlewidget(c) + }, + buttons = buttons, + layout = wibox.layout.flex.horizontal + }, + { -- Right + awful.titlebar.widget.floatingbutton(c), + awful.titlebar.widget.maximizedbutton(c), + awful.titlebar.widget.stickybutton(c), + awful.titlebar.widget.ontopbutton(c), + awful.titlebar.widget.closebutton(c), + layout = wibox.layout.fixed.horizontal() + }, + layout = wibox.layout.align.horizontal + } +end) + +-- Enable sloppy focus, so that focus follows mouse. +client.connect_signal("mouse::enter", function(c) + c:emit_signal("request::activate", "mouse_enter", { + raise = false + }) +end) + +client.connect_signal("focus", function(c) + c.border_color = beautiful.border_focus +end) +client.connect_signal("unfocus", function(c) + c.border_color = beautiful.border_normal +end) +-- }}} + +os.execute('picom -f &') diff --git a/dot_config/awesome/theme/README b/dot_config/awesome/theme/README new file mode 100644 index 0000000..1ddb349 --- /dev/null +++ b/dot_config/awesome/theme/README @@ -0,0 +1,3 @@ +Background images: + Mikael Eriksson + Licensed under CC-BY-SA-3.0 diff --git a/dot_config/awesome/theme/background.png b/dot_config/awesome/theme/background.png new file mode 100644 index 0000000..8f52b6b Binary files /dev/null and b/dot_config/awesome/theme/background.png differ diff --git a/dot_config/awesome/theme/background_white.png b/dot_config/awesome/theme/background_white.png new file mode 100644 index 0000000..bb0c5d0 Binary files /dev/null and b/dot_config/awesome/theme/background_white.png differ diff --git a/dot_config/awesome/theme/layouts/cornerne.png b/dot_config/awesome/theme/layouts/cornerne.png new file mode 100644 index 0000000..c85bd56 Binary files /dev/null and b/dot_config/awesome/theme/layouts/cornerne.png differ diff --git a/dot_config/awesome/theme/layouts/cornernew.png b/dot_config/awesome/theme/layouts/cornernew.png new file mode 100644 index 0000000..c3fd986 Binary files /dev/null and b/dot_config/awesome/theme/layouts/cornernew.png differ diff --git a/dot_config/awesome/theme/layouts/cornernw.png b/dot_config/awesome/theme/layouts/cornernw.png new file mode 100644 index 0000000..dfe78b3 Binary files /dev/null and b/dot_config/awesome/theme/layouts/cornernw.png differ diff --git a/dot_config/awesome/theme/layouts/cornernww.png b/dot_config/awesome/theme/layouts/cornernww.png new file mode 100644 index 0000000..f489010 Binary files /dev/null and b/dot_config/awesome/theme/layouts/cornernww.png differ diff --git a/dot_config/awesome/theme/layouts/cornerse.png b/dot_config/awesome/theme/layouts/cornerse.png new file mode 100644 index 0000000..023ae79 Binary files /dev/null and b/dot_config/awesome/theme/layouts/cornerse.png differ diff --git a/dot_config/awesome/theme/layouts/cornersew.png b/dot_config/awesome/theme/layouts/cornersew.png new file mode 100644 index 0000000..f7cfa1c Binary files /dev/null and b/dot_config/awesome/theme/layouts/cornersew.png differ diff --git a/dot_config/awesome/theme/layouts/cornersw.png b/dot_config/awesome/theme/layouts/cornersw.png new file mode 100644 index 0000000..c1453c9 Binary files /dev/null and b/dot_config/awesome/theme/layouts/cornersw.png differ diff --git a/dot_config/awesome/theme/layouts/cornersww.png b/dot_config/awesome/theme/layouts/cornersww.png new file mode 100644 index 0000000..a65a043 Binary files /dev/null and b/dot_config/awesome/theme/layouts/cornersww.png differ diff --git a/dot_config/awesome/theme/layouts/dwindle.png b/dot_config/awesome/theme/layouts/dwindle.png new file mode 100644 index 0000000..9902d22 Binary files /dev/null and b/dot_config/awesome/theme/layouts/dwindle.png differ diff --git a/dot_config/awesome/theme/layouts/dwindlew.png b/dot_config/awesome/theme/layouts/dwindlew.png new file mode 100644 index 0000000..9199049 Binary files /dev/null and b/dot_config/awesome/theme/layouts/dwindlew.png differ diff --git a/dot_config/awesome/theme/layouts/fairh.png b/dot_config/awesome/theme/layouts/fairh.png new file mode 100644 index 0000000..d41deea Binary files /dev/null and b/dot_config/awesome/theme/layouts/fairh.png differ diff --git a/dot_config/awesome/theme/layouts/fairhw.png b/dot_config/awesome/theme/layouts/fairhw.png new file mode 100644 index 0000000..bb50e3a Binary files /dev/null and b/dot_config/awesome/theme/layouts/fairhw.png differ diff --git a/dot_config/awesome/theme/layouts/fairv.png b/dot_config/awesome/theme/layouts/fairv.png new file mode 100644 index 0000000..f5f0288 Binary files /dev/null and b/dot_config/awesome/theme/layouts/fairv.png differ diff --git a/dot_config/awesome/theme/layouts/fairvw.png b/dot_config/awesome/theme/layouts/fairvw.png new file mode 100644 index 0000000..4f4ed52 Binary files /dev/null and b/dot_config/awesome/theme/layouts/fairvw.png differ diff --git a/dot_config/awesome/theme/layouts/floating.png b/dot_config/awesome/theme/layouts/floating.png new file mode 100644 index 0000000..b8061a0 Binary files /dev/null and b/dot_config/awesome/theme/layouts/floating.png differ diff --git a/dot_config/awesome/theme/layouts/floatingw.png b/dot_config/awesome/theme/layouts/floatingw.png new file mode 100644 index 0000000..4815894 Binary files /dev/null and b/dot_config/awesome/theme/layouts/floatingw.png differ diff --git a/dot_config/awesome/theme/layouts/fullscreen.png b/dot_config/awesome/theme/layouts/fullscreen.png new file mode 100644 index 0000000..d02f6fc Binary files /dev/null and b/dot_config/awesome/theme/layouts/fullscreen.png differ diff --git a/dot_config/awesome/theme/layouts/fullscreenw.png b/dot_config/awesome/theme/layouts/fullscreenw.png new file mode 100644 index 0000000..5c35bfa Binary files /dev/null and b/dot_config/awesome/theme/layouts/fullscreenw.png differ diff --git a/dot_config/awesome/theme/layouts/magnifier.png b/dot_config/awesome/theme/layouts/magnifier.png new file mode 100644 index 0000000..2925414 Binary files /dev/null and b/dot_config/awesome/theme/layouts/magnifier.png differ diff --git a/dot_config/awesome/theme/layouts/magnifierw.png b/dot_config/awesome/theme/layouts/magnifierw.png new file mode 100644 index 0000000..6209556 Binary files /dev/null and b/dot_config/awesome/theme/layouts/magnifierw.png differ diff --git a/dot_config/awesome/theme/layouts/max.png b/dot_config/awesome/theme/layouts/max.png new file mode 100644 index 0000000..8d20844 Binary files /dev/null and b/dot_config/awesome/theme/layouts/max.png differ diff --git a/dot_config/awesome/theme/layouts/maxw.png b/dot_config/awesome/theme/layouts/maxw.png new file mode 100644 index 0000000..85f5ce3 Binary files /dev/null and b/dot_config/awesome/theme/layouts/maxw.png differ diff --git a/dot_config/awesome/theme/layouts/spiral.png b/dot_config/awesome/theme/layouts/spiral.png new file mode 100644 index 0000000..d9434be Binary files /dev/null and b/dot_config/awesome/theme/layouts/spiral.png differ diff --git a/dot_config/awesome/theme/layouts/spiralw.png b/dot_config/awesome/theme/layouts/spiralw.png new file mode 100644 index 0000000..b78dd86 Binary files /dev/null and b/dot_config/awesome/theme/layouts/spiralw.png differ diff --git a/dot_config/awesome/theme/layouts/tile.png b/dot_config/awesome/theme/layouts/tile.png new file mode 100644 index 0000000..3ede21e Binary files /dev/null and b/dot_config/awesome/theme/layouts/tile.png differ diff --git a/dot_config/awesome/theme/layouts/tilebottom.png b/dot_config/awesome/theme/layouts/tilebottom.png new file mode 100644 index 0000000..6f8c257 Binary files /dev/null and b/dot_config/awesome/theme/layouts/tilebottom.png differ diff --git a/dot_config/awesome/theme/layouts/tilebottomw.png b/dot_config/awesome/theme/layouts/tilebottomw.png new file mode 100644 index 0000000..a1de7b2 Binary files /dev/null and b/dot_config/awesome/theme/layouts/tilebottomw.png differ diff --git a/dot_config/awesome/theme/layouts/tileleft.png b/dot_config/awesome/theme/layouts/tileleft.png new file mode 100644 index 0000000..31d6870 Binary files /dev/null and b/dot_config/awesome/theme/layouts/tileleft.png differ diff --git a/dot_config/awesome/theme/layouts/tileleftw.png b/dot_config/awesome/theme/layouts/tileleftw.png new file mode 100644 index 0000000..cf14c25 Binary files /dev/null and b/dot_config/awesome/theme/layouts/tileleftw.png differ diff --git a/dot_config/awesome/theme/layouts/tiletop.png b/dot_config/awesome/theme/layouts/tiletop.png new file mode 100644 index 0000000..98cade2 Binary files /dev/null and b/dot_config/awesome/theme/layouts/tiletop.png differ diff --git a/dot_config/awesome/theme/layouts/tiletopw.png b/dot_config/awesome/theme/layouts/tiletopw.png new file mode 100644 index 0000000..d1d0872 Binary files /dev/null and b/dot_config/awesome/theme/layouts/tiletopw.png differ diff --git a/dot_config/awesome/theme/layouts/tilew.png b/dot_config/awesome/theme/layouts/tilew.png new file mode 100644 index 0000000..fde2ca4 Binary files /dev/null and b/dot_config/awesome/theme/layouts/tilew.png differ diff --git a/dot_config/awesome/theme/submenu.png b/dot_config/awesome/theme/submenu.png new file mode 100644 index 0000000..b2778e2 Binary files /dev/null and b/dot_config/awesome/theme/submenu.png differ diff --git a/dot_config/awesome/theme/taglist/squarefw.png b/dot_config/awesome/theme/taglist/squarefw.png new file mode 100644 index 0000000..2a86430 Binary files /dev/null and b/dot_config/awesome/theme/taglist/squarefw.png differ diff --git a/dot_config/awesome/theme/taglist/squarew.png b/dot_config/awesome/theme/taglist/squarew.png new file mode 100644 index 0000000..913f2ca Binary files /dev/null and b/dot_config/awesome/theme/taglist/squarew.png differ diff --git a/dot_config/awesome/theme/theme.lua b/dot_config/awesome/theme/theme.lua new file mode 100644 index 0000000..9733bf6 --- /dev/null +++ b/dot_config/awesome/theme/theme.lua @@ -0,0 +1,130 @@ +--------------------------- +-- Default awesome theme -- +--------------------------- + +local theme_assets = require("beautiful.theme_assets") +local xresources = require("beautiful.xresources") +local dpi = xresources.apply_dpi + +local themes_path = string.format("%s/.config/awesome/theme/", os.getenv("HOME")) + +local theme = {} + +theme.font = "sans 8" + +theme.bg_normal = "#222222" +theme.bg_focus = "#535d6c" +theme.bg_urgent = "#ff0000" +theme.bg_minimize = "#444444" +theme.bg_systray = theme.bg_normal + +theme.fg_normal = "#aaaaaa" +theme.fg_focus = "#ffffff" +theme.fg_urgent = "#ffffff" +theme.fg_minimize = "#ffffff" + +theme.useless_gap = dpi(0) +theme.border_width = dpi(1) +theme.border_normal = "#000000" +theme.border_focus = "#535d6c" +theme.border_marked = "#91231c" + +-- There are other variable sets +-- overriding the default one when +-- defined, the sets are: +-- taglist_[bg|fg]_[focus|urgent|occupied|empty|volatile] +-- tasklist_[bg|fg]_[focus|urgent] +-- titlebar_[bg|fg]_[normal|focus] +-- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] +-- mouse_finder_[color|timeout|animate_timeout|radius|factor] +-- prompt_[fg|bg|fg_cursor|bg_cursor|font] +-- hotkeys_[bg|fg|border_width|border_color|shape|opacity|modifiers_fg|label_bg|label_fg|group_margin|font|description_font] +-- Example: +--theme.taglist_bg_focus = "#ff0000" + +-- Generate taglist squares: +local taglist_square_size = dpi(4) +theme.taglist_squares_sel = theme_assets.taglist_squares_sel( + taglist_square_size, theme.fg_normal +) +theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel( + taglist_square_size, theme.fg_normal +) + +-- Variables set for theming notifications: +-- notification_font +-- notification_[bg|fg] +-- notification_[width|height|margin] +-- notification_[border_color|border_width|shape|opacity] + +-- Variables set for theming the menu: +-- menu_[bg|fg]_[normal|focus] +-- menu_[border_color|border_width] +theme.menu_submenu_icon = themes_path.."submenu.png" +theme.menu_height = dpi(15) +theme.menu_width = dpi(100) + +-- You can add as many variables as +-- you wish and access them by using +-- beautiful.variable in your rc.lua +--theme.bg_widget = "#cc0000" + +-- Define the image to load +theme.titlebar_close_button_normal = themes_path.."titlebar/close_normal.png" +theme.titlebar_close_button_focus = themes_path.."titlebar/close_focus.png" + +theme.titlebar_minimize_button_normal = themes_path.."titlebar/minimize_normal.png" +theme.titlebar_minimize_button_focus = themes_path.."titlebar/minimize_focus.png" + +theme.titlebar_ontop_button_normal_inactive = themes_path.."titlebar/ontop_normal_inactive.png" +theme.titlebar_ontop_button_focus_inactive = themes_path.."titlebar/ontop_focus_inactive.png" +theme.titlebar_ontop_button_normal_active = themes_path.."titlebar/ontop_normal_active.png" +theme.titlebar_ontop_button_focus_active = themes_path.."titlebar/ontop_focus_active.png" + +theme.titlebar_sticky_button_normal_inactive = themes_path.."titlebar/sticky_normal_inactive.png" +theme.titlebar_sticky_button_focus_inactive = themes_path.."titlebar/sticky_focus_inactive.png" +theme.titlebar_sticky_button_normal_active = themes_path.."titlebar/sticky_normal_active.png" +theme.titlebar_sticky_button_focus_active = themes_path.."titlebar/sticky_focus_active.png" + +theme.titlebar_floating_button_normal_inactive = themes_path.."titlebar/floating_normal_inactive.png" +theme.titlebar_floating_button_focus_inactive = themes_path.."titlebar/floating_focus_inactive.png" +theme.titlebar_floating_button_normal_active = themes_path.."titlebar/floating_normal_active.png" +theme.titlebar_floating_button_focus_active = themes_path.."titlebar/floating_focus_active.png" + +theme.titlebar_maximized_button_normal_inactive = themes_path.."titlebar/maximized_normal_inactive.png" +theme.titlebar_maximized_button_focus_inactive = themes_path.."titlebar/maximized_focus_inactive.png" +theme.titlebar_maximized_button_normal_active = themes_path.."titlebar/maximized_normal_active.png" +theme.titlebar_maximized_button_focus_active = themes_path.."titlebar/maximized_focus_active.png" + +theme.wallpaper = themes_path.."background.png" + +-- You can use your own layout icons like this: +theme.layout_fairh = themes_path.."layouts/fairhw.png" +theme.layout_fairv = themes_path.."layouts/fairvw.png" +theme.layout_floating = themes_path.."layouts/floatingw.png" +theme.layout_magnifier = themes_path.."layouts/magnifierw.png" +theme.layout_max = themes_path.."layouts/maxw.png" +theme.layout_fullscreen = themes_path.."layouts/fullscreenw.png" +theme.layout_tilebottom = themes_path.."layouts/tilebottomw.png" +theme.layout_tileleft = themes_path.."layouts/tileleftw.png" +theme.layout_tile = themes_path.."layouts/tilew.png" +theme.layout_tiletop = themes_path.."layouts/tiletopw.png" +theme.layout_spiral = themes_path.."layouts/spiralw.png" +theme.layout_dwindle = themes_path.."layouts/dwindlew.png" +theme.layout_cornernw = themes_path.."layouts/cornernww.png" +theme.layout_cornerne = themes_path.."layouts/cornernew.png" +theme.layout_cornersw = themes_path.."layouts/cornersww.png" +theme.layout_cornerse = themes_path.."layouts/cornersew.png" + +-- Generate Awesome icon: +theme.awesome_icon = theme_assets.awesome_icon( + theme.menu_height, theme.bg_focus, theme.fg_focus +) + +-- Define the icon theme for application icons. If not set then the icons +-- from /usr/share/icons and /usr/share/icons/hicolor will be used. +theme.icon_theme = nil + +return theme + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/dot_config/awesome/theme/titlebar/close_focus.png b/dot_config/awesome/theme/titlebar/close_focus.png new file mode 100644 index 0000000..01ef825 Binary files /dev/null and b/dot_config/awesome/theme/titlebar/close_focus.png differ diff --git a/dot_config/awesome/theme/titlebar/close_normal.png b/dot_config/awesome/theme/titlebar/close_normal.png new file mode 100644 index 0000000..5448ed8 Binary files /dev/null and b/dot_config/awesome/theme/titlebar/close_normal.png differ diff --git a/dot_config/awesome/theme/titlebar/floating_focus_active.png b/dot_config/awesome/theme/titlebar/floating_focus_active.png new file mode 100644 index 0000000..82dcc7c Binary files /dev/null and b/dot_config/awesome/theme/titlebar/floating_focus_active.png differ diff --git a/dot_config/awesome/theme/titlebar/floating_focus_inactive.png b/dot_config/awesome/theme/titlebar/floating_focus_inactive.png new file mode 100644 index 0000000..c19ba80 Binary files /dev/null and b/dot_config/awesome/theme/titlebar/floating_focus_inactive.png differ diff --git a/dot_config/awesome/theme/titlebar/floating_normal_active.png b/dot_config/awesome/theme/titlebar/floating_normal_active.png new file mode 100644 index 0000000..62342d1 Binary files /dev/null and b/dot_config/awesome/theme/titlebar/floating_normal_active.png differ diff --git a/dot_config/awesome/theme/titlebar/floating_normal_inactive.png b/dot_config/awesome/theme/titlebar/floating_normal_inactive.png new file mode 100644 index 0000000..e2bbdfa Binary files /dev/null and b/dot_config/awesome/theme/titlebar/floating_normal_inactive.png differ diff --git a/dot_config/awesome/theme/titlebar/maximized_focus_active.png b/dot_config/awesome/theme/titlebar/maximized_focus_active.png new file mode 100644 index 0000000..d7dffd7 Binary files /dev/null and b/dot_config/awesome/theme/titlebar/maximized_focus_active.png differ diff --git a/dot_config/awesome/theme/titlebar/maximized_focus_inactive.png b/dot_config/awesome/theme/titlebar/maximized_focus_inactive.png new file mode 100644 index 0000000..844389f Binary files /dev/null and b/dot_config/awesome/theme/titlebar/maximized_focus_inactive.png differ diff --git a/dot_config/awesome/theme/titlebar/maximized_normal_active.png b/dot_config/awesome/theme/titlebar/maximized_normal_active.png new file mode 100644 index 0000000..a705f81 Binary files /dev/null and b/dot_config/awesome/theme/titlebar/maximized_normal_active.png differ diff --git a/dot_config/awesome/theme/titlebar/maximized_normal_inactive.png b/dot_config/awesome/theme/titlebar/maximized_normal_inactive.png new file mode 100644 index 0000000..4c1ab1f Binary files /dev/null and b/dot_config/awesome/theme/titlebar/maximized_normal_inactive.png differ diff --git a/dot_config/awesome/theme/titlebar/minimize_focus.png b/dot_config/awesome/theme/titlebar/minimize_focus.png new file mode 100644 index 0000000..caaceb2 Binary files /dev/null and b/dot_config/awesome/theme/titlebar/minimize_focus.png differ diff --git a/dot_config/awesome/theme/titlebar/minimize_normal.png b/dot_config/awesome/theme/titlebar/minimize_normal.png new file mode 100644 index 0000000..36621d0 Binary files /dev/null and b/dot_config/awesome/theme/titlebar/minimize_normal.png differ diff --git a/dot_config/awesome/theme/titlebar/ontop_focus_active.png b/dot_config/awesome/theme/titlebar/ontop_focus_active.png new file mode 100644 index 0000000..312c00b Binary files /dev/null and b/dot_config/awesome/theme/titlebar/ontop_focus_active.png differ diff --git a/dot_config/awesome/theme/titlebar/ontop_focus_inactive.png b/dot_config/awesome/theme/titlebar/ontop_focus_inactive.png new file mode 100644 index 0000000..a48e1c5 Binary files /dev/null and b/dot_config/awesome/theme/titlebar/ontop_focus_inactive.png differ diff --git a/dot_config/awesome/theme/titlebar/ontop_normal_active.png b/dot_config/awesome/theme/titlebar/ontop_normal_active.png new file mode 100644 index 0000000..117a203 Binary files /dev/null and b/dot_config/awesome/theme/titlebar/ontop_normal_active.png differ diff --git a/dot_config/awesome/theme/titlebar/ontop_normal_inactive.png b/dot_config/awesome/theme/titlebar/ontop_normal_inactive.png new file mode 100644 index 0000000..d3a10c8 Binary files /dev/null and b/dot_config/awesome/theme/titlebar/ontop_normal_inactive.png differ diff --git a/dot_config/awesome/theme/titlebar/sticky_focus_active.png b/dot_config/awesome/theme/titlebar/sticky_focus_active.png new file mode 100644 index 0000000..814499b Binary files /dev/null and b/dot_config/awesome/theme/titlebar/sticky_focus_active.png differ diff --git a/dot_config/awesome/theme/titlebar/sticky_focus_inactive.png b/dot_config/awesome/theme/titlebar/sticky_focus_inactive.png new file mode 100644 index 0000000..21b000d Binary files /dev/null and b/dot_config/awesome/theme/titlebar/sticky_focus_inactive.png differ diff --git a/dot_config/awesome/theme/titlebar/sticky_normal_active.png b/dot_config/awesome/theme/titlebar/sticky_normal_active.png new file mode 100644 index 0000000..bdb5595 Binary files /dev/null and b/dot_config/awesome/theme/titlebar/sticky_normal_active.png differ diff --git a/dot_config/awesome/theme/titlebar/sticky_normal_inactive.png b/dot_config/awesome/theme/titlebar/sticky_normal_inactive.png new file mode 100644 index 0000000..a96b9b1 Binary files /dev/null and b/dot_config/awesome/theme/titlebar/sticky_normal_inactive.png differ diff --git a/dot_config/i3/config b/dot_config/i3/config new file mode 100644 index 0000000..3eaf6a5 --- /dev/null +++ b/dot_config/i3/config @@ -0,0 +1,515 @@ + +# exec --no-startup-id ~/set_once.sh +# This file is a modified version based on default i3-config-wizard config +# source is available here: +# https://raw.githubusercontent.com/endeavouros-team/endeavouros-i3wm-setup/master/.config/i3/config +# Maintainer: joekamprad [joekamprad@endeavouros.com] +# https://endeavouros.com +# +# iconic font icon search: https://fontawesome.com/v4.7/cheatsheet/ +# +# --> to update this run the following command (will backup existing setup file) +# wget --backups=1 https://raw.githubusercontent.com/endeavouros-team/endeavouros-i3wm-setup/main/.config/i3/config -P ~/.config/i3/ +# +# Endeavouros-i3 config file +# Source for complete framework of our i3 config and theming here: https://github.com/endeavouros-team/endeavouros-i3wm-setup +# EndeavourOS wiki holds some Information also: https://discovery.endeavouros.com/window-tiling-managers/i3-wm/ +# Please see http://i3wm.org/docs/userguide.html for the official i3 reference! + +####################### +# config starts here: # +####################### + +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +# This font is widely installed, provides lots of unicode glyphs, right-to-left +# text rendering and scalability on retina/hidpi displays (thanks to pango). +font pango:Noto Sans Regular 10 + +# set the mod key to the winkey: +set $mod Mod4 + +##################### +# workspace layout: # +##################### + +# default i3 tiling mode: +workspace_layout default + +# i3 stacking layout: +# Each window will be fullscreen and tabbed top to bottom. +#workspace_layout stacking + +# i3 tabbed layout: +# Each new window will open fullscreen as a tab (left to right) +#workspace_layout tabbed + +############################## +# extra options for windows: # +############################## + +#border indicator on windows: +new_window pixel 2 + +# thin borders +# hide_edge_borders both + +# Set inner/outer gaps +gaps inner 6 +gaps outer 3 + + + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# switch to workspace +bindsym $mod+1 workspace $ws1 +bindsym $mod+2 workspace $ws2 +bindsym $mod+3 workspace $ws3 +bindsym $mod+4 workspace $ws4 +bindsym $mod+5 workspace $ws5 +bindsym $mod+6 workspace $ws6 +bindsym $mod+7 workspace $ws7 +bindsym $mod+8 workspace $ws8 +bindsym $mod+9 workspace $ws9 +bindsym $mod+0 workspace $ws10 + +# switch to workspace with numpad keys +bindcode $mod+87 workspace 1 +bindcode $mod+88 workspace 2 +bindcode $mod+89 workspace 3 +bindcode $mod+83 workspace 4 +bindcode $mod+84 workspace 5 +bindcode $mod+85 workspace 6 +bindcode $mod+79 workspace 7 +bindcode $mod+80 workspace 8 +bindcode $mod+81 workspace 9 +bindcode $mod+90 workspace 10 + +# switch to workspace with numlock numpad keys +bindcode $mod+Mod2+87 workspace $ws1 +bindcode $mod+Mod2+88 workspace $ws2 +bindcode $mod+Mod2+89 workspace $ws3 +bindcode $mod+Mod2+83 workspace $ws4 +bindcode $mod+Mod2+84 workspace $ws5 +bindcode $mod+Mod2+85 workspace $ws6 +bindcode $mod+Mod2+79 workspace $ws7 +bindcode $mod+Mod2+80 workspace $ws8 +bindcode $mod+Mod2+81 workspace $ws9 +bindcode $mod+Mod2+90 workspace $ws10 + + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace $ws1 +bindsym $mod+Shift+2 move container to workspace $ws2 +bindsym $mod+Shift+3 move container to workspace $ws3 +bindsym $mod+Shift+4 move container to workspace $ws4 +bindsym $mod+Shift+5 move container to workspace $ws5 +bindsym $mod+Shift+6 move container to workspace $ws6 +bindsym $mod+Shift+7 move container to workspace $ws7 +bindsym $mod+Shift+8 move container to workspace $ws8 +bindsym $mod+Shift+9 move container to workspace $ws9 +bindsym $mod+Shift+0 move container to workspace $ws10 + + +# move focused container to workspace with numpad keys +bindcode $mod+Shift+Mod2+87 move container to workspace $ws1 +bindcode $mod+Shift+Mod2+88 move container to workspace $ws2 +bindcode $mod+Shift+Mod2+89 move container to workspace $ws3 +bindcode $mod+Shift+Mod2+83 move container to workspace $ws4 +bindcode $mod+Shift+Mod2+84 move container to workspace $ws5 +bindcode $mod+Shift+Mod2+85 move container to workspace $ws6 +bindcode $mod+Shift+Mod2+79 move container to workspace $ws7 +bindcode $mod+Shift+Mod2+80 move container to workspace $ws8 +bindcode $mod+Shift+Mod2+81 move container to workspace $ws9 +bindcode $mod+Shift+Mod2+90 move container to workspace $ws10 + +# move focused container to workspace with numpad keys +bindcode $mod+Shift+87 move container to workspace $ws1 +bindcode $mod+Shift+88 move container to workspace $ws2 +bindcode $mod+Shift+89 move container to workspace $ws3 +bindcode $mod+Shift+83 move container to workspace $ws4 +bindcode $mod+Shift+84 move container to workspace $ws5 +bindcode $mod+Shift+85 move container to workspace $ws6 +bindcode $mod+Shift+79 move container to workspace $ws7 +bindcode $mod+Shift+80 move container to workspace $ws8 +bindcode $mod+Shift+81 move container to workspace $ws9 +bindcode $mod+Shift+90 move container to workspace $ws10 + +# resize window (you can also use the mouse for that): +mode "resize" { +# These bindings trigger as soon as you enter the resize mode +# Pressing left will shrink the window’s width. +# Pressing right will grow the window’s width. +# Pressing up will shrink the window’s height. +# Pressing down will grow the window’s height. + bindsym j resize shrink width 1 px or 1 ppt + bindsym k resize grow height 1 px or 1 ppt + bindsym l resize shrink height 1 px or 1 ppt + bindsym ntilde resize grow width 1 px or 1 ppt + +# same bindings, but for the arrow keys + bindsym Left resize shrink width 1 px or 1 ppt + bindsym Down resize grow height 1 px or 1 ppt + bindsym Up resize shrink height 1 px or 1 ppt + bindsym Right resize grow width 1 px or 1 ppt + +# back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" +} + +bindsym $mod+r mode "resize" + +###################################### +# keybindings for different actions: # +###################################### + +# start a terminal +bindsym $mod+Return exec xfce4-terminal + +# kill focused window +bindsym $mod+q kill + +# exit-menu +bindsym $mod+Shift+e exec ~/.config/i3/scripts/powermenu + +# Lock the system +# lock with a picture: +#bindsym $mod+l exec i3lock -i ~/.config/i3/i3-lock-screen.png -p default|win -t +# lock by blurring the screen: +bindsym $mod+l exec ~/.config/i3/scripts/blur-lock + +# reload the configuration file +bindsym $mod+Shift+c reload + +# restart i3 inplace (preserves your layout/session, can be used to update i3) +bindsym $mod+Shift+r restart + +# keybinding in fancy rofi (automated): +bindsym F1 exec ~/.config/i3/scripts/keyhint-2 +# alternative +# keybinding list in editor: +# bindsym $mod+F1 exec xed ~/.config/i3/keybindings + +# Backlight control +bindsym XF86MonBrightnessUp exec xbacklight +10 +bindsym XF86MonBrightnessDown exec xbacklight -10 + +# change focus +bindsym $mod+j focus left +bindsym $mod+k focus down +bindsym $mod+b focus up +bindsym $mod+o focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# move focused window +bindsym $mod+Shift+j move left +bindsym $mod+Shift+k move down +bindsym $mod+Shift+b move up +bindsym $mod+Shift+o move right + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+h split h + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+g layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# open new empty workspace +bindsym $mod+Shift+n exec ~/.config/i3/scripts/empty_workspace + +## Multimedia Keys + +# volume +bindsym XF86AudioRaiseVolume exec amixer -D pulse sset Master 5%+ && pkill -RTMIN+1 i3blocks +bindsym XF86AudioLowerVolume exec amixer -D pulse sset Master 5%- && pkill -RTMIN+1 i3blocks + + +# Pulse Audio controls + +#volume up +#bindsym XF86AudioRaiseVolume exec pamixer -i 5 --allow-boost && dunstify -h string:x-dunst-stack-tag:volume volume: $(pamixer --get-volume)% +#volume down +#bindsym XF86AudioLowerVolume exec pamixer -d 5 --allow-boost && dunstify -h string:x-dunst-stack-tag:volume volume: $(pamixer --get-volume)% +#mute +#bindsym XF86AudioMute exec pamixer -t && dunstify -h string:x-dunst-stack-tag:mute mute: $(pamixer --get-mute)! + +# gradular volume control +bindsym $mod+XF86AudioRaiseVolume exec amixer -D pulse sset Master 1%+ && pkill -RTMIN+1 i3blocks +bindsym $mod+XF86AudioLowerVolume exec amixer -D pulse sset Master 1%- && pkill -RTMIN+1 i3blocks + +# mute +#bindsym XF86AudioMute exec amixer sset Master toggle && killall -USR1 i3blocks +#mute +bindsym XF86AudioMute exec pamixer -t && notify-send "mute: $(pamixer --get-mute)" + +bindsym XF86AudioPlay exec playerctl play +bindsym XF86AudioPause exec playerctl pause +bindsym XF86AudioNext exec playerctl next +bindsym XF86AudioPrev exec playerctl previous + +# Redirect sound to headphones +bindsym $mod+p exec /usr/local/bin/switch-audio-port + +## App shortcuts +bindsym $mod+w exec /usr/bin/firefox +bindsym $mod+n exec /usr/bin/thunar +bindsym Print exec "scrot ~/%Y-%m-%d-%T-screenshot.png" + +########################################## +# configuration for workspace behaviour: # +########################################## + +# Define names for default workspaces for which we configure key bindings later on. +# We use variables to avoid repeating the names in multiple places. +set $ws1 "1:" +set $ws2 "2:" +set $ws3 "3:" +set $ws4 "4:" +set $ws5 "5:" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + +# use workspaces on different displays: +# where you have to replace VGA-0/HDMI-0 with the names for your displays +# you can get from xrandr command +#workspace $ws1 output VGA-0 +#workspace $ws2 output VGA-0 +#workspace $ws3 output HDMI-0 +#workspace $ws4 output HDMI-0 +#workspace $ws5 output HDMI-0 + +# bind program to workspace and focus to them on startup: +assign [class="Xfce4-terminal"] $ws1 +assign [class="(?i)firefox"] $ws2 +assign [class="Thunar"] $ws3 +assign [class="Thunderbird"] $ws4 +assign [class="TelegramDesktop"] $ws5 + + +# automatic set focus new window if it opens on another workspace then the current: +for_window [class=Xfce4-terminal] focus +for_window [class=(?i)firefox] focus +for_window [class=Thunar] focus +for_window [class=Thunderbird] focus +for_window [class=TelegramDesktop] focus + +############################################# +# autostart applications/services on login: # +############################################# + +#get auth work with polkit-gnome +exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 + +# dex execute .desktop files +# keep in mind that it can cause issues +# when second to i3 a DE is installed or mixed usage of i3 + xfce4 or GNOME +# in this cases better disable dex and use manual starting apps using xdg/autostart +# if enabled you should comment welcome app. +#exec --no-startup-id dex -a -s /etc/xdg/autostart/:~/.config/autostart/ +exec --no-startup-id dex --autostart --environment i3 + +# start welcome app +#exec --no-startup-id sh /usr/share/endeavouros/scripts/welcome --startdelay=3 + +# num lock activated +exec --no-startup-id numlockx on +# configure multiple keyboard layouts and hotkey to switch (Alt+CAPSLOCK in this example) +#exec --no-startup-id setxkbmap -layout 'us,sk' -variant altgr-intl,qwerty -option 'grp:alt_caps_toggle' + +# start conky: +#exec_always --no-startup-id conky + +# start a script to setup displays +# uncomment the next line, use arandr to setup displays and save the file as monitor: +exec --no-startup-id ~/.screenlayout/monitor.sh + +# start blueberry app for managing bluetooth devices from tray: +exec --no-startup-id blueberry-tray + +# transparency +# uncomment one of them to be used (picom package is installed per default) +# options could need changes, related to used GPU and drivers. +# to find the right setting consult the archwiki or ask at the forum. +# xcompmgr: https://wiki.archlinux.org/title/Xcompmgr +#exec --no-startup-id xcompmgr -C -n & +# or an more specialized config like this: +#exec --no-startup-id xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55 & +# or: +# picom: https://wiki.archlinux.org/title/Picom +exec --no-startup-id picom -CGb + +# networkmanager-applet +exec --no-startup-id nm-applet + +# set wallpaper +exec --no-startup-id nitrogen --restore +#exec --no-startup-id feh --bg-fill /usr/share/endeavouros/backgrounds/endeavouros_i3.png + +# set powersavings for display: +exec --no-startup-id xset s 480 dpms 600 600 600 + +# Desktop notifications +exec --no-startup-id dbus-launch dunst --config ~/.config/dunst/dunstrc +# alternative if you installed aside with XFCE4: +# exec --no-startup-id /usr/lib/xfce4/notifyd/xfce4-notifyd & + +# Autostart apps as you like +#exec --no-startup-id sleep 2 && xfce4-terminal +#exec --no-startup-id sleep 7 && firefox https://github.com/endeavouros-team/endeavouros-i3wm-setup/blob/main/force-knowledge.md +#exec --no-startup-id sleep 3 && thunar + +# set floating (nontiling)for apps needing it +for_window [class="Yad" instance="yad"] floating enable +for_window [class="Galculator" instance="galculator"] floating enable +for_window [class="Blueberry.py" instance="blueberry.py"] floating enable + +# set floating (nontiling) for special apps +for_window [class="Xsane" instance="xsane"] floating enable +for_window [class="Pavucontrol" instance="pavucontrol"] floating enable +for_window [class="qt5ct" instance="qt5ct"] floating enable +for_window [class="Blueberry.py" instance="blueberry.py"] floating enable +for_window [class="Bluetooth-sendto" instance="bluetooth-sendto"] floating enable +for_window [class="Pamac-manager"] floating enable + +###################################### +# color settings for bar and windows # +###################################### + +# Define colors variables: +set $darkbluetrans #08052be6 +set $darkblue #08052b +set $lightblue #5294e2 +set $urgentred #e53935 +set $white #ffffff +set $black #000000 +set $purple #e345ff +set $darkgrey #383c4a +set $grey #b0b5bd +set $mediumgrey #8b8b8b +set $yellowbrown #e1b700 + +# define colors for windows: +#class border bground text indicator child_border +client.focused $lightblue $darkblue $white $purple $mediumgrey +client.unfocused $darkblue $darkblue $grey $purple $darkgrey +client.focused_inactive $darkblue $darkblue $grey $purple $black +client.urgent $urgentred $urgentred $white $purple $yellowbrown + + +############################################ +# bar settings (input comes from i3blocks) # +############################################ + +# Start i3bar to display a workspace bar +# (plus the system information i3status finds out, if available) +bar { + font pango:Noto Sans Regular 10, FontAwesome 10 + status_command i3blocks -c ~/.config/i3/i3blocks.conf + position bottom +# i3bar_command i3bar --transparency +# it could be that you have no primary display set: set one (xrandr --output --primary) +# reference: https://i3wm.org/docs/userguide.html#_tray_output + tray_output primary + tray_padding 0 + +# When strip_workspace_numbers is set to yes, +# any workspace that has a name of the form +# “[n][:][NAME]” will display only the name. +strip_workspace_numbers yes +##strip_workspace_name no + + colors { + separator $purple + background $darkgrey + statusline $white +# border bg txt indicator + focused_workspace $mediumgrey $grey $darkgrey $purple + active_workspace $lightblue $mediumgrey $darkgrey $purple + inactive_workspace $darkgrey $darkgrey $grey $purple + urgent_workspace $urgentred $urgentred $white $purple + } +} + +# you can add different bars for multidisplay setups on each display: +# set output HDMI-0 to the display you want the bar, --transparency can be set. +# Transparency needs rgba color codes to be used where the last two letters are the transparency factor see here: +# https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4 +# #08052be6 --> e6=90% + +# bar { +# font pango:Noto Sans Regular 9, FontAwesome 9 +# status_command i3blocks -c ~/.config/i3/i3blocks-2.conf +# i3bar_command i3bar --transparency +# output HDMI-0 +# position bottom +# +# When strip_workspace_numbers is set to yes, +# any workspace that has a name of the form +# “[n][:][NAME]” will display only the name. +#strip_workspace_numbers yes +##strip_workspace_name no +# +# colors { +# separator $purple +# background $darkbluetrans +# statusline $white +# border bg txt indicator +# focused_workspace $lighterblue $lighterblue $darkblue $purple +# active_workspace $lightdblue $lightdblue $darkblue $purple +# inactive_workspace $darkblue $darkblue $lightdblue $purple +# urgent_workspace $urgentred $urgentred $white $purple +# } +#} + +##################################### +# Application menu handled by rofi: # +##################################### + +## rofi bindings fancy application menu ($mod+d /F9 optional disabled) + +bindsym $mod+d exec rofi -modi drun -show drun \ + -config ~/.config/rofi/rofidmenu.rasi + +#bindsym F9 exec rofi -modi drun -show drun \ +# -config ~/.config/rofi/rofidmenu.rasi + +## rofi bindings for window menu ($mod+t /F10 optional disabled) + +bindsym $mod+t exec rofi -show window \ + -config ~/.config/rofi/rofidmenu.rasi + +#bindsym F10 exec rofi -show window \ +# -config ~/.config/rofi/rofidmenu.rasi diff --git a/dot_config/i3/i3blocks.conf b/dot_config/i3/i3blocks.conf new file mode 100644 index 0000000..1967a11 --- /dev/null +++ b/dot_config/i3/i3blocks.conf @@ -0,0 +1,155 @@ +# i3blocks config file changed for EndeavourOS-i3 setup + +# source is available here: +# https://raw.githubusercontent.com/endeavouros-team/endeavouros-i3wm-setup/main/.config/i3/i3blocks.conf +# Maintainer: joekamprad [joekamprad@endeavouros.com] +# Former Visual Designer: Florent Valetti [@FLVAL EndeavourOS] +# created for i3wm setup on EndeavourOS +# https://endeavouros.com + +# cheatsheet for icon fonts used on the block-bar: +# https://fontawesome.com/v4.7/cheatsheet/ + +# --> to update this run the following command: +# wget --backups=1 https://raw.githubusercontent.com/endeavouros-team/endeavouros-i3wm-setup/main/.config/i3/i3blocks.conf -P ~/.config/i3/ + +# Please see man i3blocks for a complete reference! +# The man page is also hosted at http://vivien.github.io/i3blocks + + +# List of valid properties: +# +# align +# color +# command +# full_text +# instance +# interval +# label +# min_width +# name +# separator +# separator_block_width +# short_text +# signal +# urgent + +# Global properties +# +# The top properties below are applied to every block, but can be overridden. +separator=false +markup=pango + +[terminal] +full_text=  +color=#807dfe +command=i3-msg -q exec xfce4-terminal + +[browser] +full_text=  +color=#ff7f81 +command=i3-msg -q exec firefox + +[files] +full_text=  +color=#7f3fbf +command=i3-msg -q exec thunar ~/ + +#[mail] +#full_text=  +#color=#dbcb75 +#command=i3-msg -q exec thunderbird + +[simple-2] +full_text=: : +color=#717171 + +# Disk usage +# +# The directory defaults to $HOME if the instance is not specified. +# The script may be called with a optional argument to set the alert +# (defaults to 10 for 10%). +[disk] +label= +instance=/ +command=~/.config/i3/scripts/disk +interval=30 + +# Memory usage +# +# The type defaults to "mem" if the instance is not specified. +[memory] +label= +command=~/.config/i3/scripts/memory +interval=2 + +[cpu_usage] +label= +command=~/.config/i3/scripts/cpu_usage +#min_width=CPU: 100.00% +interval=2 + +[CPU-temperature] +label= +command=~/.config/i3/scripts/temperature +interval=30 +#T_WARN=70 +#T_CRIT=90 +#SENSOR_CHIP="" +# where SENSOR_CHIP can be find with sensors output +# can be used also for GPU temperature or other temperature sensors lm-sensors detects. + +# showing name of connected network (enable for wifi use) +#[net] +#label= +#command=echo "$(LANG=C nmcli d | grep connected | awk '{print $4}')" +#interval=30 + +[bandwidth] +command=~/.config/i3/scripts/bandwidth2 +interval=persist + +# Battery indicator +#[battery] +#command=~/.config/i3/scripts/battery2 +# for alternative battery script change to battery1 +# change this to battery-pinebook-pro if you are running on pinebook-pro +#label= +#interval=30 + +[simple-2] +full_text=: : +color=#717171 + +[pavucontrol] +full_text= +command=pavucontrol + +[volume-pulseaudio] +command=~/.config/i3/scripts/volume +instance=Master +interval=1 + +# display keyboard layout name +# for keyboard layouts switcher +# see i3 config file +#[keyboard-layout] +#command=~/.config/i3/scripts/keyboard-layout +#interval=2 + +[keybindings] +full_text= +command=~/.config/i3/scripts/keyhint + +[time] +#label= +command=date '+%a %d %b %H:%M:%S' +interval=1 + +[shutdown_menu] +full_text= +command=~/.config/i3/scripts/powermenu + +[simple-2] +full_text=: : +color=#717171 diff --git a/dot_config/i3/keybindings b/dot_config/i3/keybindings new file mode 100644 index 0000000..693a1ad --- /dev/null +++ b/dot_config/i3/keybindings @@ -0,0 +1,103 @@ +EndeavourOS i3wm Keybindings cheat sheet: + +--> to update this run the following command: +wget --backups=1 https://raw.githubusercontent.com/endeavouros-team/endeavouros-i3wm-setup/main/.config/i3/keybindings -P ~/.config/i3/ + +All sources and updates are available at GitHub: +https://github.com/endeavouros-team/endeavouros-i3wm-setup + +For reference consult our WIKI: +https://discovery.endeavouros.com/window-tiling-managers/i3-wm/ + + = windows key + +# start xfce4-terminal ++Return + +# kill focused window ++q + +# Application menu search by typing (fancy Rofi menu): ++d + +# Window switcher menu (fancy Rofi menu): ++t + +# fancy exit-menu on bottom right: ++Shift+e + +# Lock the system +# lock with a picture or blurring the screen (options in config) ++l + +# reload the configuration file ++Shift+c + +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) ++Shift+r + +# full keybinding list in editor: ++F1 + +# change window focus ++j focus left ++k focus down ++b focus up ++o focus right + +# alternatively, you can use the cursor keys: ++Left focus left ++Down focus down ++Up focus up ++Right focus right + +# move a focused window ++Shift+j move left ++Shift+k move down ++Shift+b move up ++Shift+o move right + +# alternatively, you can use the cursor keys: ++Shift+Left move left ++Shift+Down move down ++Shift+Up move up ++Shift+Right move right + +# split in horizontal orientation ++h split h + +# split in vertical orientation ++v split v + +# enter fullscreen mode for the focused container ++f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) ++s layout stacking ++g layout tabbed ++e layout toggle split + +# toggle tiling / floating ++Shift+space floating toggle + +# change focus between tiling / floating windows ++space focus mode_toggle + +# focus the parent container ++a focus parent + +# focus the child container +#+d focus child + +# resize floating window ++right mouse button + +## Multimedia Keys + +# Redirect sound to headphones ++p + +## App shortcuts ++w starts Firefox ++n starts Thunar + Button screenshot diff --git a/dot_config/i3/scripts/bandwidth2 b/dot_config/i3/scripts/bandwidth2 new file mode 100644 index 0000000..b03250e --- /dev/null +++ b/dot_config/i3/scripts/bandwidth2 @@ -0,0 +1,104 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2015 James Murphy +# Licensed under the terms of the GNU GPL v2 only. +# +# i3blocks blocklet script to monitor bandwidth usage + +iface="${BLOCK_INSTANCE}" +iface="${IFACE:-$iface}" +dt="${DT:-3}" +unit="${UNIT:-MB}" +LABEL="${LABEL:-}" # down arrow up arrow +printf_command="${PRINTF_COMMAND:-"printf \"${LABEL}%1.0f/%1.0f %s/s\\n\", rx, wx, unit;"}" + +function default_interface { + ip route | awk '/^default via/ {print $5; exit}' +} + +function check_proc_net_dev { + if [ ! -f "/proc/net/dev" ]; then + echo "/proc/net/dev not found" + exit 1 + fi +} + +function list_interfaces { + check_proc_net_dev + echo "Interfaces in /proc/net/dev:" + grep -o "^[^:]\\+:" /proc/net/dev | tr -d " :" +} + +while getopts i:t:u:p:lh opt; do + case "$opt" in + i) iface="$OPTARG" ;; + t) dt="$OPTARG" ;; + u) unit="$OPTARG" ;; + p) printf_command="$OPTARG" ;; + l) list_interfaces && exit 0 ;; + h) printf \ +"Usage: bandwidth3 [-i interface] [-t time] [-u unit] [-p printf_command] [-l] [-h] +Options: +-i\tNetwork interface to measure. Default determined using \`ip route\`. +-t\tTime interval in seconds between measurements. Default: 3 +-u\tUnits to measure bytes in. Default: Mb +\tAllowed units: Kb, KB, Mb, MB, Gb, GB, Tb, TB +\tUnits may have optional it/its/yte/ytes on the end, e.g. Mbits, KByte +-p\tAwk command to be called after a measurement is made. +\tDefault: printf \"%%-5.1f/%%5.1f %%s/s\\\\n\", rx, wx, unit; +\tExposed variables: rx, wx, tx, unit, iface +-l\tList available interfaces in /proc/net/dev +-h\tShow this help text +" && exit 0;; + esac +done + +check_proc_net_dev + +iface="${iface:-$(default_interface)}" +while [ -z "$iface" ]; do + echo No default interface + sleep "$dt" + iface=$(default_interface) +done + +case "$unit" in + Kb|Kbit|Kbits) bytes_per_unit=$((1024 / 8));; + KB|KByte|KBytes) bytes_per_unit=$((1024));; + Mb|Mbit|Mbits) bytes_per_unit=$((1024 * 1024 / 8));; + MB|MByte|MBytes) bytes_per_unit=$((1024 * 1024));; + Gb|Gbit|Gbits) bytes_per_unit=$((1024 * 1024 * 1024 / 8));; + GB|GByte|GBytes) bytes_per_unit=$((1024 * 1024 * 1024));; + Tb|Tbit|Tbits) bytes_per_unit=$((1024 * 1024 * 1024 * 1024 / 8));; + TB|TByte|TBytes) bytes_per_unit=$((1024 * 1024 * 1024 * 1024));; + *) echo Bad unit "$unit" && exit 1;; +esac + +scalar=$((bytes_per_unit * dt)) +init_line=$(cat /proc/net/dev | grep "^[ ]*$iface:") +if [ -z "$init_line" ]; then + echo Interface not found in /proc/net/dev: "$iface" + exit 1 +fi + +init_received=$(awk '{print $2}' <<< $init_line) +init_sent=$(awk '{print $10}' <<< $init_line) + +(while true; do cat /proc/net/dev; sleep "$dt"; done) |\ + stdbuf -oL grep "^[ ]*$iface:" |\ + awk -v scalar="$scalar" -v unit="$unit" -v iface="$iface" ' +BEGIN{old_received='"$init_received"';old_sent='"$init_sent"'} +{ + received=$2 + sent=$10 + rx=(received-old_received)/scalar; + wx=(sent-old_sent)/scalar; + tx=rx+wr; + old_received=received; + old_sent=sent; + if(rx >= 0 && wx >= 0){ + '"$printf_command"'; + fflush(stdout); + } +} +' diff --git a/dot_config/i3/scripts/battery-pinebook-pro b/dot_config/i3/scripts/battery-pinebook-pro new file mode 100644 index 0000000..fd97370 --- /dev/null +++ b/dot_config/i3/scripts/battery-pinebook-pro @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +#simple Shellscript for i3blocks on Pinebook pro +#05012020 geri123@gmx.net Gerhard S. +#battery-symbols: on Manjaro you need the awesome-terminal-fonts package installed! +PERCENT=$(cat /sys/class/power_supply/cw2015-battery/capacity) +STATUS=$(cat /sys/class/power_supply/cw2015-battery/status) +case $(( + $PERCENT >= 0 && $PERCENT <= 20 ? 1 : + $PERCENT > 20 && $PERCENT <= 40 ? 2 : + $PERCENT > 40 && $PERCENT <= 60 ? 3 : + $PERCENT > 60 && $PERCENT <= 80 ? 4 : 5)) in +# + (1) echo $STATUS:"" :$PERCENT%;; + (2) echo $STATUS:"" :$PERCENT%;; + (3) echo $STATUS:"" :$PERCENT%;; + (4) echo $STATUS:"" :$PERCENT%;; + (5) echo $STATUS:"" :$PERCENT%;; +esac diff --git a/dot_config/i3/scripts/battery1 b/dot_config/i3/scripts/battery1 new file mode 100644 index 0000000..3b9d5a7 --- /dev/null +++ b/dot_config/i3/scripts/battery1 @@ -0,0 +1,114 @@ +#!/usr/bin/perl +# +# Copyright 2014 Pierre Mavro +# Copyright 2014 Vivien Didelot +# +# Licensed under the terms of the GNU GPL v3, or any later version. +# +# This script is meant to use with i3blocks. It parses the output of the "acpi" +# command (often provided by a package of the same name) to read the status of +# the battery, and eventually its remaining time (to full charge or discharge). +# +# The color will gradually change for a percentage below 85%, and the urgency +# (exit code 33) is set if there is less that 5% remaining. + +# Edited by Andreas Lindlbauer + +use strict; +use warnings; +use utf8; + +# otherwise we get in console "Wide character in print at" +binmode(STDOUT, ':utf8'); + +# my $acpi; +my $upower; +my $percent; +my $bat_state; +my $status; +my $ac_adapt; +my $full_text; +my $short_text; +my $label = '😅'; +my $bat_number = $ENV{BLOCK_INSTANCE} || 0; + +open (UPOWER, "upower -i /org/freedesktop/UPower/devices/battery_BAT$bat_number | grep 'percentage' |") or die; +$upower = ; +close(UPOWER); + +# fail on unexpected output +if ($upower !~ /: (\d+)%/) { + die "$upower\n"; +} + +$percent = $1; +$full_text = "$percent%"; + +open (BAT_STATE, "upower -i /org/freedesktop/UPower/devices/battery_BAT$bat_number | grep 'state' |") or die; +$bat_state = ; +close(BAT_STATE); + +if ($bat_state !~ /: (\w+)/) { + die "$bat_state\n"; +} +$status = $1; + +if ($status eq 'discharging') { + $full_text .= ' '; +} elsif ($status eq 'charging') { + $full_text .= ' '; +} elsif ($status eq 'Unknown') { + open (AC_ADAPTER, "acpi -a |") or die; + $ac_adapt = ; + close(AC_ADAPTER); + + if ($ac_adapt =~ /: ([\w-]+)/) { + $ac_adapt = $1; + + if ($ac_adapt eq 'on-line') { + $full_text .= ' CHR'; + } elsif ($ac_adapt eq 'off-line') { + $full_text .= ' DIS'; + } + } +} + +$short_text = $full_text; + +if ($percent < 20) { + $label = ''; +} elsif ($percent < 45) { + $label = ''; +} elsif ($percent < 70) { + $label = ''; +} elsif ($percent < 95) { + $label = ''; +} else { + $label = ''; +} + +# print text +print " ${label}"; +print " $full_text\n"; +print " ${label}"; +print " $short_text\n"; + +# consider color and urgent flag only on discharge +if ($status eq 'discharging') { + + if ($percent < 20) { + print "#FF0000\n"; + } elsif ($percent < 40) { + print "#FFAE00\n"; + } elsif ($percent < 60) { + print "#FFF600\n"; + } elsif ($percent < 85) { + print "#A8FF00\n"; + } + + if ($percent < 5) { + exit(33); + } +} + +exit(0); diff --git a/dot_config/i3/scripts/battery2 b/dot_config/i3/scripts/battery2 new file mode 100644 index 0000000..2d55dab --- /dev/null +++ b/dot_config/i3/scripts/battery2 @@ -0,0 +1,106 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2016 James Murphy +# Licensed under the GPL version 2 only +# +# A battery indicator blocklet script for i3blocks + +from subprocess import check_output +import os +import re + +config = dict(os.environ) +status = check_output(['acpi'], universal_newlines=True) + +if not status: + # stands for no battery found + color = config.get("color_10", "red") + fulltext = "\uf00d \uf240".format(color) + percentleft = 100 +else: + # if there is more than one battery in one laptop, the percentage left is + # available for each battery separately, although state and remaining + # time for overall block is shown in the status of the first battery + batteries = status.split("\n") + state_batteries=[] + commasplitstatus_batteries=[] + percentleft_batteries=[] + time = "" + for battery in batteries: + if battery!='': + state_batteries.append(battery.split(": ")[1].split(", ")[0]) + commasplitstatus = battery.split(", ") + if not time: + time = commasplitstatus[-1].strip() + # check if it matches a time + time = re.match(r"(\d+):(\d+)", time) + if time: + time = ":".join(time.groups()) + timeleft = " ({})".format(time) + else: + timeleft = "" + + p = int(commasplitstatus[1].rstrip("%\n")) + if p>0: + percentleft_batteries.append(p) + commasplitstatus_batteries.append(commasplitstatus) + state = state_batteries[0] + commasplitstatus = commasplitstatus_batteries[0] + if percentleft_batteries: + percentleft = int(sum(percentleft_batteries)/len(percentleft_batteries)) + else: + percentleft = 0 + + # stands for charging + color = config.get("color_charging", "yellow") + FA_LIGHTNING = "\uf0e7".format(color) + + # stands for plugged in + FA_PLUG = "\uf1e6" + + # stands for using battery + FA_BATTERY = "\uf240" + + # stands for unknown status of battery + FA_QUESTION = "\uf128" + + + if state == "Discharging": + fulltext = FA_BATTERY + " " + elif state == "Full": + fulltext = FA_PLUG + " " + timeleft = "" + elif state == "Unknown": + fulltext = FA_QUESTION + " " + FA_BATTERY + " " + timeleft = "" + else: + fulltext = FA_LIGHTNING + " " + FA_PLUG + " " + + def color(percent): + if percent < 10: + # exit code 33 will turn background red + return config.get("color_10", "#FFFFFF") + if percent < 20: + return config.get("color_20", "#FF3300") + if percent < 30: + return config.get("color_30", "#FF6600") + if percent < 40: + return config.get("color_40", "#FF9900") + if percent < 50: + return config.get("color_50", "#FFCC00") + if percent < 60: + return config.get("color_60", "#FFFF00") + if percent < 70: + return config.get("color_70", "#FFFF33") + if percent < 80: + return config.get("color_80", "#FFFF66") + return config.get("color_full", "#FFFFFF") + + form = '{}%' + fulltext += form.format(color(percentleft), percentleft) + #fulltext += timeleft + +print(fulltext) +print(fulltext) +if percentleft < 10: + exit(33) diff --git a/dot_config/i3/scripts/blur-lock b/dot_config/i3/scripts/blur-lock new file mode 100644 index 0000000..08e6bf3 --- /dev/null +++ b/dot_config/i3/scripts/blur-lock @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +PICTURE=/tmp/i3lock.png +SCREENSHOT="scrot $PICTURE" + +BLUR="5x4" + +$SCREENSHOT +convert $PICTURE -blur $BLUR $PICTURE +i3lock -i $PICTURE +rm $PICTURE diff --git a/dot_config/i3/scripts/cpu_usage b/dot_config/i3/scripts/cpu_usage new file mode 100644 index 0000000..d12e5d6 --- /dev/null +++ b/dot_config/i3/scripts/cpu_usage @@ -0,0 +1,62 @@ +#!/usr/bin/perl +# +# Copyright 2014 Pierre Mavro +# Copyright 2014 Vivien Didelot +# Copyright 2014 Andreas Guldstrand +# +# Licensed under the terms of the GNU GPL v3, or any later version. + +use strict; +use warnings; +use utf8; +use Getopt::Long; + +# default values +my $t_warn = $ENV{T_WARN} // 50; +my $t_crit = $ENV{T_CRIT} // 80; +my $cpu_usage = -1; +my $decimals = $ENV{DECIMALS} // 0; +my $label = $ENV{LABEL} // ""; + +sub help { + print "Usage: cpu_usage [-w ] [-c ] [-d ]\n"; + print "-w : warning threshold to become yellow\n"; + print "-c : critical threshold to become red\n"; + print "-d : Use decimals for percentage (default is $decimals) \n"; + exit 0; +} + +GetOptions("help|h" => \&help, + "w=i" => \$t_warn, + "c=i" => \$t_crit, + "d=i" => \$decimals, +); + +# Get CPU usage +$ENV{LC_ALL}="en_US"; # if mpstat is not run under en_US locale, things may break, so make sure it is +open (MPSTAT, 'mpstat 1 1 |') or die; +while () { + if (/^.*\s+(\d+\.\d+)[\s\x00]?$/) { + $cpu_usage = 100 - $1; # 100% - %idle + last; + } +} +close(MPSTAT); + +$cpu_usage eq -1 and die 'Can\'t find CPU information'; + +# Print short_text, full_text +print "${label}"; +printf "%.${decimals}f%%\n", $cpu_usage; +print "${label}"; +printf "%.${decimals}f%%\n", $cpu_usage; + +# Print color, if needed +if ($cpu_usage >= $t_crit) { + print "#FF0000\n"; + exit 33; +} elsif ($cpu_usage >= $t_warn) { + print "#FFFC00\n"; +} + +exit 0; diff --git a/dot_config/i3/scripts/disk b/dot_config/i3/scripts/disk new file mode 100644 index 0000000..e18c7aa --- /dev/null +++ b/dot_config/i3/scripts/disk @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +# Copyright (C) 2014 Julien Bonjean + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +DIR="${DIR:-$BLOCK_INSTANCE}" +DIR="${DIR:-$HOME}" +ALERT_LOW="${ALERT_LOW:-$1}" +ALERT_LOW="${ALERT_LOW:-10}" # color will turn red under this value (default: 10%) + +LOCAL_FLAG="-l" +if [ "$1" = "-n" ] || [ "$2" = "-n" ]; then + LOCAL_FLAG="" +fi + +df -h -P $LOCAL_FLAG "$DIR" | awk -v label="$LABEL" -v alert_low=$ALERT_LOW ' +/\/.*/ { + # full text + print label $4 + + # short text + print label $4 + + use=$5 + + # no need to continue parsing + exit 0 +} + +END { + gsub(/%$/,"",use) + if (100 - use < alert_low) { + # color + print "#FF0000" + } +} +' diff --git a/dot_config/i3/scripts/empty_workspace b/dot_config/i3/scripts/empty_workspace new file mode 100644 index 0000000..b962cde --- /dev/null +++ b/dot_config/i3/scripts/empty_workspace @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +MAX_DESKTOPS=20 + +WORKSPACES=$(seq -s '\n' 1 1 ${MAX_DESKTOPS}) + +EMPTY_WORKSPACE=$( (i3-msg -t get_workspaces | tr ',' '\n' | grep num | awk -F: '{print int($2)}' ; \ + echo -e ${WORKSPACES} ) | sort -n | uniq -u | head -n 1) + +i3-msg workspace ${EMPTY_WORKSPACE} diff --git a/dot_config/i3/scripts/keyboard-switch b/dot_config/i3/scripts/keyboard-switch new file mode 100644 index 0000000..9a3e314 --- /dev/null +++ b/dot_config/i3/scripts/keyboard-switch @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +KBD=$(/usr/bin/xkblayout-state print '%s') +echo $KBD + diff --git a/dot_config/i3/scripts/keyhint b/dot_config/i3/scripts/keyhint new file mode 100644 index 0000000..4997786 --- /dev/null +++ b/dot_config/i3/scripts/keyhint @@ -0,0 +1,25 @@ +#!/bin/bash + +Main() { + source /usr/share/endeavouros/scripts/eos-script-lib-yad || return 1 + + local command=( + eos_yad --title="EndeavourOS i3-wm keybindings:" --no-buttons --geometry=400x345-15-400 --list + --column=key: --column=description: --column=command: + "ESC" "close this app" "" + "=" "modkey" "(set mod Mod4)" + "+enter" "open a terminal" "" + "+Shift+n" "new empty workspace" "" + "+w" "open Browser" "" + "+n" "open Filebrowser" "" + "+d" "app menu" "" + "+q" "close focused app" "" + "Print-key" "screenshot" "" + "+Shift+e" "logout menu" "" + "+F1" "open keybinding helper" "" + ) + + "${command[@]}" +} + +Main "$@" diff --git a/dot_config/i3/scripts/keyhint-2 b/dot_config/i3/scripts/keyhint-2 new file mode 100644 index 0000000..2e86d12 --- /dev/null +++ b/dot_config/i3/scripts/keyhint-2 @@ -0,0 +1,6 @@ +I3_CONFIG=$HOME/.config/i3/config +mod_key=$(sed -nre 's/^set \$mod (.*)/\1/p' ${I3_CONFIG}) +grep "^bindsym" ${I3_CONFIG} \ + | sed "s/-\(-\w\+\)\+//g;s/\$mod/${mod_key}/g;s/Mod1/Alt/g;s/exec //;s/bindsym //;s/^\s\+//;s/^\([^ ]\+\) \(.\+\)$/\2: \1/;s/^\s\+//" \ + | tr -s ' ' \ + | rofi -dmenu -theme ~/.config/rofi/rofikeyhint.rasi diff --git a/dot_config/i3/scripts/memory b/dot_config/i3/scripts/memory new file mode 100644 index 0000000..6a69a6f --- /dev/null +++ b/dot_config/i3/scripts/memory @@ -0,0 +1,69 @@ +#!/usr/bin/env bash +# Copyright (C) 2014 Julien Bonjean + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +TYPE="${BLOCK_INSTANCE:-mem}" + +awk -v type=$TYPE ' +/^MemTotal:/ { + mem_total=$2 +} +/^MemFree:/ { + mem_free=$2 +} +/^Buffers:/ { + mem_free+=$2 +} +/^Cached:/ { + mem_free+=$2 +} +/^SwapTotal:/ { + swap_total=$2 +} +/^SwapFree:/ { + swap_free=$2 +} +END { + if (type == "swap") { + free=swap_free/1024/1024 + used=(swap_total-swap_free)/1024/1024 + total=swap_total/1024/1024 + } else { + free=mem_free/1024/1024 + used=(mem_total-mem_free)/1024/1024 + total=mem_total/1024/1024 + } + + pct=0 + if (total > 0) { + pct=used/total*100 + } + + # full text + # printf("%.1fG/%.1fG (%.f%%)\n", used, total, pct) + + # short text + printf("%.f%%\n", pct) + + # color + if (pct > 90) { + print("#FF0000") + } else if (pct > 80) { + print("#FFAE00") + } else if (pct > 70) { + print("#FFF600") + } +} +' /proc/meminfo diff --git a/dot_config/i3/scripts/openweather b/dot_config/i3/scripts/openweather new file mode 100644 index 0000000..ad1f8c7 --- /dev/null +++ b/dot_config/i3/scripts/openweather @@ -0,0 +1,93 @@ +#!/usr/bin/env bash +# Edited by Andreas Lindlbauer + +temps=("#0600FF" "#0500FF" "#0400FF" "#0300FF" "#0200FF" "#0100FF" "#0000FF" "#0002FF" "#0012FF" "#0022FF" "#0032FF" "#0044FF" "#0054FF" "#0064FF" "#0074FF" "#0084FF" "#0094FF" "#00A4FF" "#00B4FF" "#00C4FF" "#00D4FF" "#00E4FF" "#00FFF4" "#00FFD0" "#00FFA8" "#00FF83" "#00FF5C" "#00FF36" "#00FF10" "#17FF00" "#3EFF00" "#65FF00" "#B0FF00" "#FDFF00" "#FFF000" "#FFDC00" "#FFC800" "#FFB400" "#FFA000" "#FF8C00" "#FF7800" "#FF6400" "#FF5000" "#FF3C00" "#FF2800" "#FF1400" "#FF0000") + +command -v jq >/dev/null 2>&1 || { echo >&2 "Program 'jq' required but it is not installed. +Aborting."; exit 1; } +command -v wget >/dev/null 2>&1 || { echo >&2 "Program 'wget' required but is not installed. +Aborting."; exit 1; } + +APIKEY="get your key first" +#ZIPCODE="1234" +#CITY_ID="Get your City ID first" +#URL="http://api.openweathermap.org/data/2.5/weather?id=${CITY_ID}&units=metric&APPID=${APIKEY}" +LAT="Find out your position with your latitude" +LON="and longitude" +URL="http://api.openweathermap.org/data/2.5/onecall?lat=${LAT}&lon=${LON}&units=metric&exclude=minutely,hourly,daily&APPID=${APIKEY}" +WEATHER_RESPONSE=$(wget -qO- "${URL}") + +WEATHER_CONDITION=$(echo "$WEATHER_RESPONSE" | jq '.current.weather[0].main' | sed 's/"//g') +WEATHER_TEMP=$(echo "$WEATHER_RESPONSE" | jq '.current.feels_like') +WEATHER_INT=${WEATHER_TEMP%.*} + +TIME_NOW=$( echo "$WEATHER_RESPONSE" | jq '.current.dt') +SUNRISE=$( echo "$WEATHER_RESPONSE" | jq '.current.sunrise') +SUNSET=$( echo "$WEATHER_RESPONSE" | jq '.current.sunset') +DESCRIPTION=$( echo "$WEATHER_RESPONSE" | jq '.current.weather[0].description' | sed 's/"//g') +WEATHER_ALERT=$( echo "$WEATHER_RESPONSE" | jq '.alerts[0].event' | sed 's/"//g') +DAYTIME="n" + +if [[ "$TIME_NOW" > "$SUNRISE" ]] && [[ "$TIME_NOW" < "$SUNSET" ]]; then + DAYTIME="d" +fi + +case $WEATHER_CONDITION in + 'Clouds') + if [ "$DAYTIME" == "d" ]; then + WEATHER_ICON="" + else + WEATHER_ICON="" + fi + ;; + 'Rain') + WEATHER_ICON="" + ;; + 'Drizzle') + if [ "$DAYTIME" == "d" ]; then + WEATHER_ICON="" + else + WEATHER_ICON="" + fi + ;; + 'Thunderstorm') + WEATHER_ICON="" + ;; + 'Snow') + WEATHER_ICON="" + ;; + 'Clear') + if [ "$DAYTIME" == "d" ]; then + WEATHER_ICON="" + else + WEATHER_ICON="" + fi + ;; + *) + WEATHER_ICON="🌫" + ;; +esac + +WEATHER_COLOR="#FFFFFF" +if [ "$WEATHER_INT" -lt "-11" ]; then + WEATHER_COLOR="#0000FF" +elif [ "$WEATHER_INT" -gt 35 ]; then + WEATHER_COLOR="#FF0000" +else + WEATHER_INT=$(( WEATHER_INT + 11 )) + WEATHER_COLOR="${temps[$WEATHER_INT]}" +fi + +full_text="${WEATHER_ICON} ${WEATHER_TEMP}°C: ${DESCRIPTION} " +if [ "$WEATHER_ALERT" != "null" ]; then + WARN_START=$(echo "$WEATHER_RESPONSE" | jq '.alerts[0].start') + WARN_END=$(echo "$WEATHER_RESPONSE" | jq '.alerts[0].end') + WARN_START=$(date -d @"$WARN_START" +%a_%k:%M) + WARN_END=$(date -d @"$WARN_END" +%a_%k:%M) + full_text="${WEATHER_ICON} ${WEATHER_TEMP}°C: ${DESCRIPTION}  ${WEATHER_ALERT} from ${WARN_START} to ${WARN_END}  " +fi + + +echo "${full_text}" +echo "${WEATHER_TEMP}°C " +echo "${WEATHER_COLOR}" diff --git a/dot_config/i3/scripts/openweather.conf b/dot_config/i3/scripts/openweather.conf new file mode 100644 index 0000000..f11aa86 --- /dev/null +++ b/dot_config/i3/scripts/openweather.conf @@ -0,0 +1,5 @@ +# Weather +[Weather] +command=~/.config/i3/scripts/openweather +interval=1800 +color=#7275b3 diff --git a/dot_config/i3/scripts/powermenu b/dot_config/i3/scripts/powermenu new file mode 100644 index 0000000..dd0702f --- /dev/null +++ b/dot_config/i3/scripts/powermenu @@ -0,0 +1,186 @@ +#!/usr/bin/env bash +# +# Use rofi/zenity to change system runstate thanks to systemd. +# +# Note: this currently relies on associative array support in the shell. +# +# Inspired from i3pystatus wiki: +# https://github.com/enkore/i3pystatus/wiki/Shutdown-Menu +# +# Copyright 2015 Benjamin Chrétien +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# modified to work with latest rofi update by joekamprad + +####################################################################### +# BEGIN CONFIG # +####################################################################### + +# Use a custom lock script +#LOCKSCRIPT="i3lock-extra -m pixelize" + +# Colors: FG (foreground), BG (background), HL (highlighted) +FG_COLOR="#bbbbbb" +BG_COLOR="#111111" +HLFG_COLOR="#111111" +HLBG_COLOR="#bbbbbb" +BORDER_COLOR="#222222" + +# Options not related to colors (most rofi options do not work anymore) +ROFI_OPTIONS=(-theme ~/.config/rofi/powermenu.rasi) +# Zenity options +ZENITY_TITLE="Power Menu" +ZENITY_TEXT="Action:" +ZENITY_OPTIONS=(--column= --hide-header) + +####################################################################### +# END CONFIG # +####################################################################### + +# Whether to ask for user's confirmation +enable_confirmation=false + +# Preferred launcher if both are available +preferred_launcher="rofi" + +usage="$(basename "$0") [-h] [-c] [-p name] -- display a menu for shutdown, reboot, lock etc. + +where: + -h show this help text + -c ask for user confirmation + -p preferred launcher (rofi or zenity) + +This script depends on: + - systemd, + - i3, + - rofi or zenity." + +# Check whether the user-defined launcher is valid +launcher_list=(rofi zenity) +function check_launcher() { + if [[ ! "${launcher_list[@]}" =~ (^|[[:space:]])"$1"($|[[:space:]]) ]]; then + echo "Supported launchers: ${launcher_list[*]}" + exit 1 + else + # Get array with unique elements and preferred launcher first + # Note: uniq expects a sorted list, so we cannot use it + i=1 + launcher_list=($(for l in "$1" "${launcher_list[@]}"; do printf "%i %s\n" "$i" "$l"; let i+=1; done \ + | sort -uk2 | sort -nk1 | cut -d' ' -f2- | tr '\n' ' ')) + fi +} + +# Parse CLI arguments +while getopts "hcp:" option; do + case "${option}" in + h) echo "${usage}" + exit 0 + ;; + c) enable_confirmation=true + ;; + p) preferred_launcher="${OPTARG}" + check_launcher "${preferred_launcher}" + ;; + *) exit 1 + ;; + esac +done + +# Check whether a command exists +function command_exists() { + command -v "$1" &> /dev/null 2>&1 +} + +# systemctl required +if ! command_exists systemctl ; then + exit 1 +fi + +# menu defined as an associative array +typeset -A menu + +# Menu with keys/commands + +menu=( + [ Shutdown]="systemctl poweroff" + [ Reboot]="systemctl reboot" + [ Suspend]="systemctl suspend" + [ Hibernate]="systemctl hibernate" + [ Lock]="~/.config/i3/scripts/blur-lock.sh" + [ Logout]="i3-msg exit" + [ Cancel]="" +) + +menu_nrows=${#menu[@]} + +# Menu entries that may trigger a confirmation message +menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout" + +launcher_exe="" +launcher_options="" +rofi_colors="" + +function prepare_launcher() { + if [[ "$1" == "rofi" ]]; then + rofi_colors=(-bc "${BORDER_COLOR}" -bg "${BG_COLOR}" -fg "${FG_COLOR}" \ + -hlfg "${HLFG_COLOR}" -hlbg "${HLBG_COLOR}") + launcher_exe="rofi" + launcher_options=(-dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \ + "${rofi_colors}" "${ROFI_OPTIONS[@]}") + elif [[ "$1" == "zenity" ]]; then + launcher_exe="zenity" + launcher_options=(--list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \ + "${ZENITY_OPTIONS[@]}") + fi +} + +for l in "${launcher_list[@]}"; do + if command_exists "${l}" ; then + prepare_launcher "${l}" + break + fi +done + +# No launcher available +if [[ -z "${launcher_exe}" ]]; then + exit 1 +fi + +launcher=(${launcher_exe} "${launcher_options[@]}") +selection="$(printf '%s\n' "${!menu[@]}" | sort | "${launcher[@]}")" + +function ask_confirmation() { + if [ "${launcher_exe}" == "rofi" ]; then + confirmed=$(echo -e "Yes\nNo" | rofi -dmenu -i -lines 2 -p "${selection}?" \ + "${rofi_colors}" "${ROFI_OPTIONS[@]}") + [ "${confirmed}" == "Yes" ] && confirmed=0 + elif [ "${launcher_exe}" == "zenity" ]; then + zenity --question --text "Are you sure you want to ${selection,,}?" + confirmed=$? + fi + + if [ "${confirmed}" == 0 ]; then + i3-msg -q "exec ${menu[${selection}]}" + fi +} + +if [[ $? -eq 0 && ! -z ${selection} ]]; then + if [[ "${enable_confirmation}" = true && \ + ${menu_confirm} =~ (^|[[:space:]])"${selection}"($|[[:space:]]) ]]; then + ask_confirmation + else + i3-msg -q "exec ${menu[${selection}]}" + fi +fi diff --git a/dot_config/i3/scripts/temperature b/dot_config/i3/scripts/temperature new file mode 100644 index 0000000..4e31610 --- /dev/null +++ b/dot_config/i3/scripts/temperature @@ -0,0 +1,86 @@ +#!/usr/bin/env perl +# Copyright 2014 Pierre Mavro +# Copyright 2014 Vivien Didelot +# Copyright 2014 Andreas Guldstrand +# Copyright 2014 Benjamin Chretien + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# Edited by Andreas Lindlbauer + +use strict; +use warnings; +use utf8; +use Getopt::Long; + +binmode(STDOUT, ":utf8"); + +# default values +my $t_warn = $ENV{T_WARN} || 70; +my $t_crit = $ENV{T_CRIT} || 90; +my $chip = $ENV{SENSOR_CHIP} || ""; +my $temperature = -9999; +my $label = "😀 "; + +sub help { + print "Usage: temperature [-w ] [-c ] [--chip ]\n"; + print "-w : warning threshold to become yellow\n"; + print "-c : critical threshold to become red\n"; + print "--chip : sensor chip\n"; + exit 0; +} + +GetOptions("help|h" => \&help, + "w=i" => \$t_warn, + "c=i" => \$t_crit, + "chip=s" => \$chip); + +# Get chip temperature +open (SENSORS, "sensors -u $chip |") or die; +while () { + if (/^\s+temp1_input:\s+[\+]*([\-]*\d+\.\d)/) { + $temperature = $1; + last; + } +} +close(SENSORS); + +$temperature eq -9999 and die 'Cannot find temperature'; + +if ($temperature < 45) { + $label = ''; +} elsif ($temperature < 55) { + $label = ''; +} elsif ($temperature < 65) { + $label = ''; +} elsif ($temperature < 75) { + $label = ''; +} else { + $label = ''; +} +# Print short_text, full_text +print "${label}"; +print " $temperature°C\n"; +print "${label}"; +print " $temperature°C\n"; + +# Print color, if needed +if ($temperature >= $t_crit) { + print "#FF0000\n"; + exit 33; +} elsif ($temperature >= $t_warn) { + print "#FFFC00\n"; +} + +exit 0; diff --git a/dot_config/i3/scripts/volume b/dot_config/i3/scripts/volume new file mode 100644 index 0000000..4f0a2c2 --- /dev/null +++ b/dot_config/i3/scripts/volume @@ -0,0 +1,83 @@ +#!/usr/bin/env bash +# Copyright (C) 2014 Julien Bonjean +# Copyright (C) 2014 Alexander Keller + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +#------------------------------------------------------------------------ + +# The second parameter overrides the mixer selection +# For PulseAudio users, eventually use "pulse" +# For Jack/Jack2 users, use "jackplug" +# For ALSA users, you may use "default" for your primary card +# or you may use hw:# where # is the number of the card desired +if [[ -z "$MIXER" ]] ; then + MIXER="pulse" + if command -v pulseaudio >/dev/null 2>&1 && pulseaudio --check ; then + # pulseaudio is running, but not all installations use "pulse" + if amixer -D pulse info >/dev/null 2>&1 ; then + MIXER="pulse" + fi + fi + [ -n "$(lsmod | grep jack)" ] && MIXER="jackplug" + MIXER="${2:-$MIXER}" +fi + +# The instance option sets the control to report and configure +# This defaults to the first control of your selected mixer +# For a list of the available, use `amixer -D $Your_Mixer scontrols` +if [[ -z "$SCONTROL" ]] ; then + SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols | + sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" | + head -n1 + )}" +fi + +# The first parameter sets the step to change the volume by (and units to display) +# This may be in in % or dB (eg. 5% or 3dB) +if [[ -z "$STEP" ]] ; then + STEP="${1:-5%}" +fi + +#------------------------------------------------------------------------ + +capability() { # Return "Capture" if the device is a capture device + amixer -D $MIXER get $SCONTROL | + sed -n "s/ Capabilities:.*cvolume.*/Capture/p" +} + +volume() { + amixer -D $MIXER get $SCONTROL $(capability) +} + +format() { + + perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)' + perl_filter+='{CORE::say $4 eq "off" ? "MUTE" : "' + # If dB was selected, print that instead + perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1') + perl_filter+='"; exit}' + output=$(perl -ne "$perl_filter") + echo "$LABEL$output" +} + +#------------------------------------------------------------------------ + +case $BLOCK_BUTTON in + 3) amixer -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute + 4) amixer -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;; # scroll up, increase + 5) amixer -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;; # scroll down, decrease +esac + +volume | format diff --git a/dot_config/i3/scripts/vpn b/dot_config/i3/scripts/vpn new file mode 100644 index 0000000..a348f96 --- /dev/null +++ b/dot_config/i3/scripts/vpn @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2021 Andreas Lindlbauer +# Licensed under the terms of EUPLv1.2. +# +# i3blocks blocklet script to monitor the (nord)vpn connection + +vpnstatus="📢" +nordvpn_output=$(nordvpn status | cat -v | head -1 | sed -e 's/\^M-^M ^M//g' ) +if [ "${nordvpn_output}" = "Status: Connected" ]; then + vpnstatus="🥸" +elif [ "${nordvpn_output}" = "A new version of NordVPN is available! Please update the application." ]; then + nordvpn_output=$(nordvpn status | cat -v | head -2 | tail -1 | sed -e 's/\^M-^M ^M//g' ) + if [ "${nordvpn_output}" = "Status: Connected" ]; then + vpnstatus="🥴" + elif [ "${nordvpn_output}" = "Status: Disconnected" ]; then + vpnstatus="📢" + fi +elif [ "${nordvpn_output}" = "Status: Disconnected" ]; then + vpnstatus="📢" +elif [[ "$nordvpn_output" == *\/* ]] || [[ "$nordvpn_output" == *\\* ]]; then + vpnstatus="Something's very wrong" +fi + +echo "$vpnstatus" diff --git a/dot_config/lazygit/config.yml b/dot_config/lazygit/config.yml new file mode 100644 index 0000000..e3679f8 --- /dev/null +++ b/dot_config/lazygit/config.yml @@ -0,0 +1,3 @@ +git: + pull: + mode: 'rebase' # one of 'auto' | 'merge' | 'rebase' | 'ff-only', auto reads from git configuration \ No newline at end of file diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua new file mode 100644 index 0000000..cf59ffd --- /dev/null +++ b/dot_config/nvim/init.lua @@ -0,0 +1,11 @@ +-------------------- HELPERS ------------------------------- +local helpers = require('helpers') + +-------------------- OPTIONS ------------------------------- +helpers.call_with_helpers(require('options').init) + +-------------------- PLUGINS ------------------------------- +helpers.call_with_helpers(require('plugins').init) + +-------------------- MAPPINGS ------------------------------ +helpers.call_with_helpers(require('mappings').init) \ No newline at end of file diff --git a/dot_config/nvim/lua/helpers.lua b/dot_config/nvim/lua/helpers.lua new file mode 100644 index 0000000..4090abe --- /dev/null +++ b/dot_config/nvim/lua/helpers.lua @@ -0,0 +1,42 @@ +local cmd = vim.cmd -- to execute Vim commands e.g. cmd('pwd') +local fn = vim.fn -- to call Vim functions e.g. fn.bufnr() +local g = vim.g -- a table to access global variables +local opt = vim.opt -- to set options +local o = vim.o -- to set options + +local function map(mode, lhs, rhs, opts) + local options = {noremap = true} + if opts then options = vim.tbl_extend('force', options, opts) end + vim.api.nvim_set_keymap(mode, lhs, rhs, options) +end + +local function dump(...) + local objects = vim.tbl_map(vim.inspect, {...}) + print(unpack(objects)) +end + +local function call_with_helpers(user_func) + setfenv(user_func, + vim.tbl_extend('force', getfenv(), get_helpers())) + local status, err = pcall(user_func) + if not status then + print('Failure running setup function: ' .. vim.inspect(err)) + else + return status + end +end + +function get_helpers() + return { + map = map, + cmd = cmd, + fn = fn, + g = g, + opt = opt, + o = o, + dump = dump, + call_with_helpers = call_with_helpers, + } +end + +return get_helpers() \ No newline at end of file diff --git a/dot_config/nvim/lua/mappings.lua b/dot_config/nvim/lua/mappings.lua new file mode 100644 index 0000000..a73a54a --- /dev/null +++ b/dot_config/nvim/lua/mappings.lua @@ -0,0 +1,79 @@ +local function init() + -- command! LogPath :lua print(vim.inspect(vim.lsp.get_log_path())) + + -------------------- Telescope ----------------------------- + map('n', 'ff', 'Telescope find_files') + map('n', 'fg', 'Telescope live_grep') + map('n', 'fb', 'Telescope buffers') + map('n', 'fh', 'Telescope help_tags') + map('n', 'ps', [[lua require('telescope.builtin').grep_string({ search = vim.fn.input("Grep For >")})]]) + + -------------------- NvimTreeToggle ------------------------ + map('n', 'tt', 'NvimTreeToggle') + map('n', 'tr', 'NvimTreeRefresh') + map('n', 'tf', 'NvimTreeFocus') + + -------------------- Github Copilot ------------------------ + map('n', 'gd', 'Copilot disable') + map('n', 'ge', 'Copilot enable') + map('n', 'gi', 'Copilot setup') + + -------------------- BarBar -------------------------------- + -- Move to previous/next + map('n', '', ':BufferPrevious', opts) + map('n', '', ':BufferNext', opts) + -- Re-order to previous/next + map('n', '', ':BufferMovePrevious', opts) + map('n', '>', ':BufferMoveNext', opts) + -- Close buffer + map('n', '', ':BufferClose', opts) + + -------------------- LSP ----------------------------------- + map('n', ',', 'lua vim.lsp.diagnostic.goto_prev()') + map('n', ';', 'lua vim.lsp.diagnostic.goto_next()') + map('n', 'a', 'lua vim.lsp.buf.code_action()') + map('n', 'd', 'lua vim.lsp.buf.definition()') + map('n', 'f', 'lua vim.lsp.buf.formatting()') + map('n', 'h', 'lua vim.lsp.buf.hover()') + map('n', 'm', 'lua vim.lsp.buf.rename()') + map('n', 'r', 'lua vim.lsp.buf.references()') + map('n', 's', 'lua vim.lsp.buf.document_symbol()') + map('n', 'T', 'lua require\'lsp_extensions\'.inlay_hints()') + + -------------------- HlsLens ------------------------------- + map('n', 'n', "execute('normal! ' . v:count1 . 'n')lua require('hlslens').start()") + map('n', 'N', "execute('normal! ' . v:count1 . 'N')lua require('hlslens').start()") + map('n', '*', "*lua require('hlslens').start()") + map('n', '#', "#lua require('hlslens').start()") + map('n', 'g*', "g*lua require('hlslens').start()") + map('n', 'g#', "g#lua require('hlslens').start()") + + -------------------- DAP ----------------------------------- + map('n', '', 'lua require\'dap\'.toggle_breakpoint()', opts) + map('n', '', 'lua require\'dap\'.set_breakpoint(vim.fn.input(\'Breakpoint condition: \'))', opts) + map('n', '', 'lua require\'dap\'.continue()', opts) + map('n', '', 'lua require\'dap\'.repl.toggle()', opts) + + -------------------- FTerm --------------------------------- + map('n', '', 'lua require("FTerm").toggle()') + map('t', '', 'lua require("FTerm").toggle()') + + -------------------- LAZYGIT ------------------------------- + -- Install docs : https://github.com/jesseduffield/lazygit + map('n', '', 'LazyGit') + + -------------------- OTHER --------------------------------- + map('i', '', ':w') + map('n', '', ':w') + + -------------------- COMMANDS ------------------------------ + cmd 'au TextYankPost * lua vim.highlight.on_yank {on_visual = false}' -- disabled in visual mode + + -------------------- GITHUB COPILOT ------------------------ + map('i', '', [[copilot#Accept("\")]], {noremap=true, silent=true, expr=true}) + cmd('let g:copilot_no_tab_map = v:true') -- Disable tab autocomplete github copilot +end + +return { + init = init +} diff --git a/dot_config/nvim/lua/options.lua b/dot_config/nvim/lua/options.lua new file mode 100644 index 0000000..40e6faf --- /dev/null +++ b/dot_config/nvim/lua/options.lua @@ -0,0 +1,30 @@ +local function init() + cmd('colorscheme moonlight') + + opt.completeopt = {'menuone', 'noinsert', 'noselect'} -- Completion options (for deoplete) + opt.expandtab = true -- Use spaces instead of tabs + opt.hidden = true -- Enable background buffers + opt.ignorecase = true -- Ignore case + opt.joinspaces = false -- No double spaces with join + opt.list = true -- Show some invisible characters + opt.number = true -- Show line numbers + opt.relativenumber = true -- Relative line numbers + opt.scrolloff = 4 -- Lines of context + opt.shiftround = true -- Round indent + opt.shiftwidth = 2 -- Size of an indent + opt.sidescrolloff = 8 -- Columns of context + opt.smartcase = true -- Do not ignore case with capitals + opt.autoindent = true -- Insert indents automatically + opt.splitbelow = true -- Put new windows below current + opt.splitright = true -- Put new windows right of current + opt.tabstop = 2 -- Number of spaces tabs count for + opt.termguicolors = true -- True color support + opt.wildmode = {'list', 'longest'} -- Command-line completion mode + opt.wrap = false -- Disable line wrap + opt.mouse = 'a' -- Enable mouse for all previous modes + o.clipboard = 'unnamedplus' -- Enabled clipboard shared yank +end + +return { + init = init +} diff --git a/dot_config/nvim/lua/plugins/compe.lua b/dot_config/nvim/lua/plugins/compe.lua new file mode 100644 index 0000000..0877dbd --- /dev/null +++ b/dot_config/nvim/lua/plugins/compe.lua @@ -0,0 +1,31 @@ +local function init() + vim.o.completeopt = "menuone,noselect" + require'compe'.setup { + enabled = true; + autocomplete = true; + debug = false; + min_length = 1; + preselect = 'enable'; + throttle_time = 80; + source_timeout = 200; + incomplete_delay = 400; + max_abbr_width = 100; + max_kind_width = 100; + max_menu_width = 100; + documentation = true; + + source = { + path = true; + buffer = true; + calc = true; + nvim_lsp = true; + nvim_lua = true; + vsnip = true; + ultisnips = true; + }; + } +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/dap/init.lua b/dot_config/nvim/lua/plugins/dap/init.lua new file mode 100644 index 0000000..eea1e9b --- /dev/null +++ b/dot_config/nvim/lua/plugins/dap/init.lua @@ -0,0 +1,7 @@ +local function init() + call_with_helpers(require('plugins.dap.lldb').init) +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/dap/lldb.lua b/dot_config/nvim/lua/plugins/dap/lldb.lua new file mode 100644 index 0000000..a3255a8 --- /dev/null +++ b/dot_config/nvim/lua/plugins/dap/lldb.lua @@ -0,0 +1,32 @@ +local dap = require('dap') + +local function init() + dap.adapters.lldb = { + type = 'executable', + command = '/usr/bin/lldb-vscode', + name = 'lldb' + } + dap.configurations.cpp = { + { + name = "Launch", + type = "lldb", + request = "launch", + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end, + cwd = '${workspaceFolder}', + stopOnEntry = false, + args = {}, + runInTerminal = false, + }, + } + dap.configurations.c = dap.configurations.cpp + -- dap.configurations.rust = dap.configurations.cpp + -- dap.configurations.rust[1].program = function() + -- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/target/debug/', 'file') + -- end +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/init.lua b/dot_config/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..7bddccc --- /dev/null +++ b/dot_config/nvim/lua/plugins/init.lua @@ -0,0 +1,150 @@ +function configure_packages() + call_with_helpers(require('plugins.lspconfig').init) + call_with_helpers(require('plugins.dap').init) + call_with_helpers(require('plugins.compe').init) + call_with_helpers(require('plugins.nvim-rust-tools').init) + call_with_helpers(require('plugins.nvim-tree').init) + call_with_helpers(require('plugins.nvim-treesitter').init) + call_with_helpers(require('plugins.nvim-web-devicons').init) + call_with_helpers(require('plugins.nvim-autopairs').init) + call_with_helpers(require('plugins.nvim-notify').init) + call_with_helpers(require('plugins.nvim-hlslens').init) + call_with_helpers(require('plugins.nvim-flutter-tools').init) + call_with_helpers(require('plugins.nvim-fterm').init) + call_with_helpers(require('plugins.nvim-feline').init) + call_with_helpers(require('plugins.nvim-todo-comments').init) + call_with_helpers(require('plugins.nvim-lightspeed').init) + call_with_helpers(require('plugins.nvim-numb').init) + call_with_helpers(require('plugins.nvim-neoscroll').init) + call_with_helpers(require('plugins.nvim-lspkind').init) + call_with_helpers(require('plugins.nvim-signature').init) + call_with_helpers(require('plugins.nvim-gutentags').init) + call_with_helpers(require('plugins.nvim-indent-blankline').init) + call_with_helpers(require('plugins.nvim-editorconfig').init) + call_with_helpers(require('plugins.nvim-ctrlsf').init) +end + +function install_packages() + -- Packer can manage itself as an optional plugin + use 'wbthomason/packer.nvim' + + -- LSP + use 'neovim/nvim-lspconfig' + use 'onsails/lspkind-nvim' + use 'kabouzeid/nvim-lspinstall' + use 'simrat39/rust-tools.nvim' + + -- Autocomplete + use 'hrsh7th/nvim-compe' + use 'SirVer/ultisnips' + use 'honza/vim-snippets' + use 'windwp/nvim-autopairs' + use 'AndrewRadev/tagalong.vim' + use 'andymass/vim-matchup' + + -- Treesitter + use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' } + use 'p00f/nvim-ts-rainbow' + use 'lukas-reineke/indent-blankline.nvim' + use 'JoosepAlviste/nvim-ts-context-commentstring' + use 'romgrk/nvim-treesitter-context' + + -- Syntax + use 'moll/vim-node' + -- use 'zinit-zsh/zplugin-vim-syntax' -- NOT WORKING + use 'editorconfig/editorconfig-vim' + use 'chrisbra/csv.vim' + use 'npxbr/glow.nvim' + use 'junegunn/vim-easy-align' + + -- Icons + use 'kyazdani42/nvim-web-devicons' + use 'ryanoasis/vim-devicons' + + -- Status Line and Bufferline + use 'famiu/feline.nvim' -- A minimal, stylish and customizable statusline for Neovim written in Lua + use 'romgrk/barbar.nvim' -- Tabs, as understood by any other editor. + + -- Telescope project search + use 'nvim-lua/popup.nvim' + use 'nvim-lua/plenary.nvim' + use 'nvim-telescope/telescope.nvim' + use 'nvim-telescope/telescope-fzy-native.nvim' + use 'nvim-telescope/telescope-project.nvim' + use 'fhill2/telescope-ultisnips.nvim' + + -- Explorer + use 'kyazdani42/nvim-tree.lua' + + -- Git + use 'kdheepak/lazygit.nvim' + + -- Flutter + use 'akinsho/flutter-tools.nvim' + + -- Move & Search & replace + use 'windwp/nvim-spectre' + use 'nacro90/numb.nvim' + use 'dyng/ctrlsf.vim' + use 'kevinhwang91/nvim-hlslens' -- nvim-hlslens helps you better glance at matched information, seamlessly jump between matched instances. + use 'ggandor/lightspeed.nvim' + use 'kshenoy/vim-signature' + use 'karb94/neoscroll.nvim' + use 'dstein64/nvim-scrollview' + use 'chaoren/vim-wordmotion' + + -- Tim Pope docet + use 'tpope/vim-sensible' + use 'tpope/vim-rails' + use 'tpope/vim-abolish' + use 'tpope/vim-surround' + use 'tpope/vim-bundler' + use 'tpope/vim-capslock' + use 'tpope/vim-repeat' + use 'tpope/vim-endwise' -- auto complete block with end + use 'tpope/vim-rvm' + use 'tpope/vim-dispatch' + use 'tpope/vim-dadbod' + use 'tpope/vim-jdaddy' + use 'tpope/vim-fugitive' + use 'tpope/vim-commentary' + + -- Tmux + use 'christoomey/vim-tmux-navigator' + + -- Colorschema + use 'dracula/vim' + use 'whatyouhide/vim-gotham' + use 'shaunsingh/moonlight.nvim' + + -- Tags + use 'ludovicchabant/vim-gutentags' + + -- General Plugins + use 'github/copilot.vim' -- Copilot is a vim plugin that helps you to create your own vim plugins. + use 'rcarriga/nvim-notify' -- fancy notification + use 'mfussenegger/nvim-dap' -- debugger + use 'numtostr/FTerm.nvim' -- Floating terminal + use 'folke/todo-comments.nvim' + use 'lambdalisue/suda.vim' + use 'mhinz/vim-startify' -- The fancy start screen for Vim. +end + +function init() + local install_path = fn.stdpath('data')..'/site/pack/packer/opt/packer.nvim' + + if fn.empty(fn.glob(install_path)) > 0 then + fn.system({'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path}) + cmd 'packadd packer.nvim' + end + + cmd 'packadd packer.nvim' + + require('packer').startup(install_packages) + + call_with_helpers(configure_packages) +end + +return { + init = init +} diff --git a/dot_config/nvim/lua/plugins/lspconfig/init.lua b/dot_config/nvim/lua/plugins/lspconfig/init.lua new file mode 100644 index 0000000..4d7421b --- /dev/null +++ b/dot_config/nvim/lua/plugins/lspconfig/init.lua @@ -0,0 +1,11 @@ +local function init() + call_with_helpers(require('plugins.lspconfig.lua').init) + call_with_helpers(require('plugins.lspconfig.rust').init) + call_with_helpers(require('plugins.lspconfig.typescript').init) + call_with_helpers(require('plugins.lspconfig.ruby').init) + call_with_helpers(require('plugins.lspconfig.php').init) +end + +return { + init = init +} diff --git a/dot_config/nvim/lua/plugins/lspconfig/lua.lua b/dot_config/nvim/lua/plugins/lspconfig/lua.lua new file mode 100644 index 0000000..8175d4f --- /dev/null +++ b/dot_config/nvim/lua/plugins/lspconfig/lua.lua @@ -0,0 +1,48 @@ +local function init() + local system_name + if vim.fn.has("mac") == 1 then + system_name = "macOS" + elseif vim.fn.has("unix") == 1 then + system_name = "Linux" + elseif vim.fn.has('win32') == 1 then + system_name = "Windows" + else + print("Unsupported system for sumneko") + end + + local sumneko_root_path = fn.stdpath('cache')..'/lspconfig/sumneko_lua/lua-language-server' + local sumneko_binary = sumneko_root_path.."/bin/"..system_name.."/lua-language-server" + + require'lspconfig'.sumneko_lua.setup{ + cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"}; + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT', + -- Setup your lua path + path = vim.split(package.path, ';'), + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = {'vim'}, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = { + [vim.fn.expand('$VIMRUNTIME/lua')] = true, + [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true, + }, + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + }, + } +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/lspconfig/php.lua b/dot_config/nvim/lua/plugins/lspconfig/php.lua new file mode 100644 index 0000000..cba5eaa --- /dev/null +++ b/dot_config/nvim/lua/plugins/lspconfig/php.lua @@ -0,0 +1,7 @@ +local function init() + require'lspconfig'.phpactor.setup{} +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/lspconfig/ruby.lua b/dot_config/nvim/lua/plugins/lspconfig/ruby.lua new file mode 100644 index 0000000..1523565 --- /dev/null +++ b/dot_config/nvim/lua/plugins/lspconfig/ruby.lua @@ -0,0 +1,7 @@ +local function init() + require'lspconfig'.sorbet.setup{} +end + +return { + init = init +} diff --git a/dot_config/nvim/lua/plugins/lspconfig/rust.lua b/dot_config/nvim/lua/plugins/lspconfig/rust.lua new file mode 100644 index 0000000..97572cc --- /dev/null +++ b/dot_config/nvim/lua/plugins/lspconfig/rust.lua @@ -0,0 +1,7 @@ +local function init() + require'lspconfig'.rust_analyzer.setup{} +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/lspconfig/typescript.lua b/dot_config/nvim/lua/plugins/lspconfig/typescript.lua new file mode 100644 index 0000000..b41fa45 --- /dev/null +++ b/dot_config/nvim/lua/plugins/lspconfig/typescript.lua @@ -0,0 +1,7 @@ +local function init() + require'lspconfig'.tsserver.setup{} +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-autopairs.lua b/dot_config/nvim/lua/plugins/nvim-autopairs.lua new file mode 100644 index 0000000..a054985 --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-autopairs.lua @@ -0,0 +1,11 @@ +local function init() + require('nvim-autopairs').setup() + require("nvim-autopairs.completion.compe").setup({ + map_cr = true, -- map on insert mode + map_complete = true -- it will auto insert `(` after select function or method item + }) +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-ctrlsf.lua b/dot_config/nvim/lua/plugins/nvim-ctrlsf.lua new file mode 100644 index 0000000..c97c136 --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-ctrlsf.lua @@ -0,0 +1,9 @@ +local function init() + g.ctrlsf_ackprg = 'rg' + g.ctrls_auto_preview = 1 + g.ctrlsf_search_mode = 'async' +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-editorconfig.lua b/dot_config/nvim/lua/plugins/nvim-editorconfig.lua new file mode 100644 index 0000000..edcc6fd --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-editorconfig.lua @@ -0,0 +1,7 @@ +local function init() + g.EditorConfig_exclude_patterns = { 'fugitive://.*', 'scp://.*' } +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-feline.lua b/dot_config/nvim/lua/plugins/nvim-feline.lua new file mode 100644 index 0000000..2ca3ac9 --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-feline.lua @@ -0,0 +1,7 @@ +local function init() + require('feline').setup() +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-flutter-tools.lua b/dot_config/nvim/lua/plugins/nvim-flutter-tools.lua new file mode 100644 index 0000000..d43029a --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-flutter-tools.lua @@ -0,0 +1,15 @@ +local function init() + require('flutter-tools').setup { + decorations = { + statusline = { + app_version = true, + device = true + } + }, + fvm = true + } +end + +return { + init = init +} diff --git a/dot_config/nvim/lua/plugins/nvim-fterm.lua b/dot_config/nvim/lua/plugins/nvim-fterm.lua new file mode 100644 index 0000000..98e69cc --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-fterm.lua @@ -0,0 +1,15 @@ +local function init() + require'FTerm'.setup { + border = 'double', + dimensions = { + height = 0.8, + width = 0.8, + x = 0.5, + y = 0.5 + } + } +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-gutentags.lua b/dot_config/nvim/lua/plugins/nvim-gutentags.lua new file mode 100644 index 0000000..bf733b9 --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-gutentags.lua @@ -0,0 +1,17 @@ +local function init() + cmd('set tags+=tags,.git/tags') + g.gutentags_enabled = 1 + g.gutentags_generate_on_missing = 1 + g.gutentags_generate_on_write = 1 + g.gutentags_resolve_symlinks = 1 + g.gutentags_ctags_tagfile = '.git/tags' + g.gutentags_project_root = { '.git' } + g.gutentags_ctags_extra_args = { '--fields=+l' } + g.gutentags_add_default_project_roots = 0 + g.gutentags_ctags_executable_ruby = 'ripper-tags' + g.gutentags_ctags_extra_args = { '--ignore-unsupported-options', '--recursive' } +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-hlslens.lua b/dot_config/nvim/lua/plugins/nvim-hlslens.lua new file mode 100644 index 0000000..53d1031 --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-hlslens.lua @@ -0,0 +1,36 @@ +local function init() + require('hlslens').setup { + calm_down = true, + override_lens = function(render, plist, nearest, idx, r_idx) + local sfw = vim.v.searchforward == 1 + local indicator, text, chunks + local abs_r_idx = math.abs(r_idx) + if abs_r_idx > 1 then + indicator = string.format('%d%s', abs_r_idx, sfw ~= (r_idx > 1) and '' or '') + elseif abs_r_idx == 1 then + indicator = sfw ~= (r_idx == 1) and '' or '' + else + indicator = '' + end + + local lnum, col = unpack(plist[idx]) + if nearest then + local cnt = #plist + if indicator ~= '' then + text = string.format('[%s %d/%d]', indicator, idx, cnt) + else + text = string.format('[%d/%d]', idx, cnt) + end + chunks = {{' ', 'Ignore'}, {text, 'HlSearchLensNear'}} + else + text = string.format('[%s %d]', indicator, idx) + chunks = {{' ', 'Ignore'}, {text, 'HlSearchLens'}} + end + render.set_virt(0, lnum - 1, col - 1, chunks, nearest) + end + } +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-indent-blankline.lua b/dot_config/nvim/lua/plugins/nvim-indent-blankline.lua new file mode 100644 index 0000000..9c5a278 --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-indent-blankline.lua @@ -0,0 +1,12 @@ +local function init() + g.indent_blankline_show_current_context = true + g.indent_blankline_buftype_exclude = {'terminal'} + g.indent_blankline_filetype_exclude = {'help', 'startify', 'dashboard', 'packer', 'neogitstatus', 'NvimTree'} + g.indent_blankline_char = '▏' + g.indent_blankline_use_treesitter = true + g.indent_blankline_show_trailing_blankline_indent = false +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-lightspeed.lua b/dot_config/nvim/lua/plugins/nvim-lightspeed.lua new file mode 100644 index 0000000..e3fbd94 --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-lightspeed.lua @@ -0,0 +1,7 @@ +local function init() + require("lightspeed").setup {} +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-lspkind.lua b/dot_config/nvim/lua/plugins/nvim-lspkind.lua new file mode 100644 index 0000000..b240e21 --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-lspkind.lua @@ -0,0 +1,9 @@ +local function init() + require('lspkind').init { + with_text = true, + } +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-neoscroll.lua b/dot_config/nvim/lua/plugins/nvim-neoscroll.lua new file mode 100644 index 0000000..45c4efe --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-neoscroll.lua @@ -0,0 +1,7 @@ +local function init() + require('neoscroll').setup() +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-notify.lua b/dot_config/nvim/lua/plugins/nvim-notify.lua new file mode 100644 index 0000000..b3b52d4 --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-notify.lua @@ -0,0 +1,7 @@ +local function init() + vim.notify = require("notify") +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-numb.lua b/dot_config/nvim/lua/plugins/nvim-numb.lua new file mode 100644 index 0000000..a2cec5a --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-numb.lua @@ -0,0 +1,10 @@ +local function init() + require('numb').setup { + show_numbers = true, -- Enable 'number' for the window while peeking + show_cursorline = true -- Enable 'cursorline' for the window while peeking + } +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-rust-tools.lua b/dot_config/nvim/lua/plugins/nvim-rust-tools.lua new file mode 100644 index 0000000..76519e4 --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-rust-tools.lua @@ -0,0 +1,119 @@ +local opts = { + tools = { -- rust-tools options + -- Automatically set inlay hints (type hints) + autoSetHints = true, + + -- Whether to show hover actions inside the hover window + -- This overrides the default hover handler + hover_with_actions = true, + + -- how to execute terminal commands + -- options right now: termopen / quickfix + executor = require("rust-tools/executors").termopen, + + runnables = { + -- whether to use telescope for selection menu or not + use_telescope = true + + -- rest of the opts are forwarded to telescope + }, + + debuggables = { + -- whether to use telescope for selection menu or not + use_telescope = true + + -- rest of the opts are forwarded to telescope + }, + + -- These apply to the default RustSetInlayHints command + inlay_hints = { + + -- Only show inlay hints for the current line + only_current_line = false, + + -- Event which triggers a refersh of the inlay hints. + -- You can make this "CursorMoved" or "CursorMoved,CursorMovedI" but + -- not that this may cause higher CPU usage. + -- This option is only respected when only_current_line and + -- autoSetHints both are true. + only_current_line_autocmd = "CursorHold", + + -- wheter to show parameter hints with the inlay hints or not + show_parameter_hints = true, + + -- prefix for parameter hints + parameter_hints_prefix = "<- ", + + -- prefix for all the other hints (type, chaining) + other_hints_prefix = "=> ", + + -- whether to align to the length of the longest line in the file + max_len_align = false, + + -- padding from the left if max_len_align is true + max_len_align_padding = 1, + + -- whether to align to the extreme right or not + right_align = false, + + -- padding from the right if right_align is true + right_align_padding = 7, + + -- The color of the hints + highlight = "Comment", + }, + + hover_actions = { + -- the border that is used for the hover window + -- see vim.api.nvim_open_win() + border = { + {"╭", "FloatBorder"}, {"─", "FloatBorder"}, + {"╮", "FloatBorder"}, {"│", "FloatBorder"}, + {"╯", "FloatBorder"}, {"─", "FloatBorder"}, + {"╰", "FloatBorder"}, {"│", "FloatBorder"} + }, + + -- whether the hover action window gets automatically focused + auto_focus = false + }, + + -- settings for showing the crate graph based on graphviz and the dot + -- command + crate_graph = { + -- Backend used for displaying the graph + -- see: https://graphviz.org/docs/outputs/ + -- default: x11 + backend = "x11", + -- where to store the output, nil for no output stored (relative + -- path from pwd) + -- default: nil + output = nil, + -- true for all crates.io and external crates, false only the local + -- crates + -- default: true + full = true, + } + }, + + -- all the opts to send to nvim-lspconfig + -- these override the defaults set by rust-tools.nvim + -- see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer + server = {}, -- rust-analyer options + + -- debugging stuff + dap = { + adapter = { + type = 'executable', + command = 'lldb-vscode', + name = "rt_lldb" + } + } +} + +local function init() + require('rust-tools').setup(opts) +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-signature.lua b/dot_config/nvim/lua/plugins/nvim-signature.lua new file mode 100644 index 0000000..9f93972 --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-signature.lua @@ -0,0 +1,8 @@ +local function init() + g.SignatureMarkTextHLDynamic = 1 + g.SignatureMarkerTextHLDynamic = 1 +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-todo-comments.lua b/dot_config/nvim/lua/plugins/nvim-todo-comments.lua new file mode 100644 index 0000000..bf56103 --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-todo-comments.lua @@ -0,0 +1,61 @@ +local function init() + require("todo-comments").setup { + signs = true, -- show icons in the signs column + sign_priority = 8, -- sign priority + -- keywords recognized as todo comments + keywords = { + FIX = { + icon = " ", -- icon used for the sign, and in search results + color = "error", -- can be a hex color, or a named color (see below) + alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords + -- signs = false, -- configure signs for some keywords individually + }, + TODO = { icon = " ", color = "info" }, + HACK = { icon = " ", color = "warning" }, + WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } }, + PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } }, + NOTE = { icon = " ", color = "hint", alt = { "INFO" } }, + }, + merge_keywords = true, -- when true, custom keywords will be merged with the defaults + -- highlighting of the line containing the todo comment + -- * before: highlights before the keyword (typically comment characters) + -- * keyword: highlights of the keyword + -- * after: highlights after the keyword (todo text) + highlight = { + before = "", -- "fg" or "bg" or empty + keyword = "wide", -- "fg", "bg", "wide" or empty. (wide is the same as bg, but will also highlight surrounding characters) + after = "fg", -- "fg" or "bg" or empty + pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlightng (vim regex) + comments_only = true, -- uses treesitter to match keywords in comments only + max_line_len = 400, -- ignore lines longer than this + exclude = {}, -- list of file types to exclude highlighting + }, + -- list of named colors where we try to extract the guifg from the + -- list of hilight groups or use the hex color if hl not found as a fallback + colors = { + error = { "LspDiagnosticsDefaultError", "ErrorMsg", "#DC2626" }, + warning = { "LspDiagnosticsDefaultWarning", "WarningMsg", "#FBBF24" }, + info = { "LspDiagnosticsDefaultInformation", "#2563EB" }, + hint = { "LspDiagnosticsDefaultHint", "#10B981" }, + default = { "Identifier", "#7C3AED" }, + }, + search = { + command = "rg", + args = { + "--color=never", + "--no-heading", + "--with-filename", + "--line-number", + "--column", + }, + -- regex that will be used to match keywords. + -- don't replace the (KEYWORDS) placeholder + pattern = [[\b(KEYWORDS):]], -- ripgrep regex + -- pattern = [[\b(KEYWORDS)\b]], -- match without the extra colon. You'll likely get false positives + }, + } +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-tree.lua b/dot_config/nvim/lua/plugins/nvim-tree.lua new file mode 100644 index 0000000..c9c370c --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-tree.lua @@ -0,0 +1,7 @@ +local function init() + require'nvim-tree'.setup {} +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-treesitter.lua b/dot_config/nvim/lua/plugins/nvim-treesitter.lua new file mode 100644 index 0000000..1f64e47 --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-treesitter.lua @@ -0,0 +1,16 @@ +local function init() + require'nvim-treesitter.configs'.setup { + ensure_installed = "all", -- list of languages + highlight = { + enable = true, + }, + rainbow = { + enable = true, + extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean + } + } +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/nvim/lua/plugins/nvim-web-devicons.lua b/dot_config/nvim/lua/plugins/nvim-web-devicons.lua new file mode 100644 index 0000000..77e6749 --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-web-devicons.lua @@ -0,0 +1,12 @@ +local function init() + require'nvim-web-devicons'.setup { + -- globally enable default icons (default to false) + -- will get overriden by `get_icons` option + default = true; + } + require'nvim-web-devicons'.get_icons() +end + +return { + init = init +} \ No newline at end of file diff --git a/dot_config/picom/picom.conf b/dot_config/picom/picom.conf new file mode 100644 index 0000000..e973b21 --- /dev/null +++ b/dot_config/picom/picom.conf @@ -0,0 +1,181 @@ +# Performance and behaviour related +# Settings for glx backend +backend = "glx"; +glx-no-stencil = false; +glx-copy-from-front = false; +use-damage = true; +# refresh-rate = 0; +# vsync = "opengl-swc"; +dbe = false; +sw-opti = false; + +# Settings for xrender backend +# backend = "xrender"; +# vsync = false; +# refresh-rate = 0; +# xrender-sync-fence = true; + +unredir-if-possible = true; +detect-transient = true; +detect-client-leader = true; + +# These might or might NOT help with performance +# glx-no-stencil = true; +# glx-copy-from-front = false; # When enbled on intel GPU: screen broken until compton is killed. +# glx-use-copysubbuffermesa = true +# glx-no-rebind-pixmap = false +# glx-swap-method = 1 + +opacity-rule = [ + #"60:class_g ?= 'rofi'", + # i3 titlebar transparency + #"60:class_g = 'i3-frame'" + # For i3wm tabbed/stacked layout transparency + #"0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", + # herbstluftwm frame + #"60:class_g = '_HERBST_FRAME'" +]; + +focus-exclude = [ + #"class_g ?= 'rofi'" + #'_NET_WM_NAME@:s = "rofi"' + "class_g ?= 'slop'", + "name = 'rofi'", + "class_g ?= 'Steam'", + "_NET_WM_WINDOW_TYPE@:a *= 'MENU'", + "window_type *= 'menu'", + "window_type = 'utility'", + "window_type = 'dropdown_menu'", + "window_type = 'popup_menu'" +]; + +# === Shadows === +# Enabled client-side shadows on windows. +shadow = true; +# Detect rounded corners +# (it doesn't really do anything for shadows) +detect-rounded-corners = true; + +# Shadow color +# shadow-red = 1 +# shadow-green = 0.2 +# shadow-blue = 0.45 + +# shadow-radius: The blur radius for shadows. (default 12) +# shadow-offset-x: The left offset for shadows. (default -15) +# shadow-offset-y: The top offset for shadows. (default -15) +# shadow-opacity: The translucency for shadows. (default .75) + +shadow-radius = 40; +shadow-offset-x = -20; +shadow-offset-y = -20; +shadow-opacity = 0.3; + +shadow-exclude = [ + "class_i ?= 'riotclientservices.exe'", + "class_g ?= 'slop'", + "class_g ?= 'Polybar'", + "class_g ?= 'Visualizer'", + # "class_g ?= 'rofi'", + # i3wm titlebar shadows (tabbed/stacked) + "class_g ?= 'i3-frame'", + # i3wm hidden window shadows (tabbed/stacked) + # "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", + "_NET_WM_WINDOW_TYPE@:a *= 'SPLASH'", + # "_NET_WM_WINDOW_TYPE@:a *= 'NOTIFICATION'", + "window_type *= 'menu'", + "window_type = 'utility'", + "window_type = 'dropdown_menu'", + "window_type = 'popup_menu'" +]; + +# === Transparency === +# active-opacity = 0.95 +# inactive-opacity = 0.95 +# inactive-dim = 0.10 + +# Border and titlebar opacity +# frame-opacity = 0.4; + +# === Fading === +# Fade windows during opacity changes. +fading = true; +# The time between steps in a fade in milliseconds. (default 10). +fade-delta = 5; +# fade-delta = 3; +# Opacity change between steps while fading in. (default 0.028). +fade-in-step = 0.03; +# Opacity change between steps while fading out. (default 0.03). +fade-out-step = 0.03; +# Fade windows in/out when opening/closing +no-fading-openclose = false; + +# Specify a list of conditions of windows that should not be faded. +fade-exclude = [ + # "name = '???'", + # "width >= 3440", + # "fullscreen" + # Only fade AwesomeWM wiboxes + # (Notice the inverse condition) + "class_g != 'awesome'" +]; + +# === Blurring === +blur-background = true; +blur-method = "kawase"; +# blur-method = "convolution"; +blur-strength = 7; +blur-background-fixed = true; +# Blur background of opaque windows with transparent frames as well. +# blur-background-frame = true; +# Predefined +# blur-kern = "3x3box" +# blur-kern = "3x3gaussian" +# blur-kern = "5x5box" +# blur-kern = "5x5gaussian" +# blur-kern = "7x7box" +# blur-kern = "7x7gaussian" +# blur-kern = "9x9gaussian" +# blur-kern = "11x11gaussian" +# Strong-ish blur +# blur-kern = "7,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1" +# Medium blur +# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1" +# Weak blur +# blur-kern = "3,3,1,1,1,1,1,1,1,1" + +blur-background-exclude = [ + # Exclude everything except windows of type "splash" + # (Notice the inverse condition) + "window_type != 'splash'" +]; + + +# >> Rounded corners +corner-radius = 8 +# For HiDPI +# corner-radius = 18 + +rounded-corners-exclude = [ + # "_NET_WM_WINDOW_TYPE@:a *= 'NOTIFICATION'", + "window_type *= 'dock'", + # "class_g = 'awesome'", + "class_g = 'Tint2'", + "window_type = 'menu'", + "window_type = 'tooltip'", + "window_type = 'popup_menu'", + "window_type = 'dropdown_menu'" +]; + +# Window type settings +wintypes: +{ + tooltip = { fade = true; shadow = false; }; + menu = { shadow = false; }; + dnd = { shadow = false; }; + dock = { shadow = false; }; + dropdown_menu = { shadow = false; }; + popup_menu = { shadow = false; }; + utility = { shadow = false; }; +}; + diff --git a/dot_config/rofi/colors.rasi b/dot_config/rofi/colors.rasi new file mode 100644 index 0000000..869f4a1 --- /dev/null +++ b/dot_config/rofi/colors.rasi @@ -0,0 +1,20 @@ +* { + xbg: #1D1F28; + xfg: #FDFDFD; + x0: #282A36; + x1: #F37F97; + x2: #5ADECD; + x3: #F2A272; + x4: #8897F4; + x5: #C574DD; + x6: #79E6F3; + x7: #FDFDFD; + x8: #414458; + x9: #FF4971; + x10: #18E3C8; + x11: #FF8037; + x12: #556FFF; + x13: #B043D1; + x14: #3FDCEE; + x15: #FDFDFD; +} diff --git a/dot_config/rofi/config.rasi b/dot_config/rofi/config.rasi new file mode 100644 index 0000000..9e0424e --- /dev/null +++ b/dot_config/rofi/config.rasi @@ -0,0 +1,208 @@ +configuration { + modi: "combi,windowcd,run"; + lines: 10; + columns: 2; + font: "sans 13"; + bw: 0; + location: 0; + padding: 0; + fixed-num-lines: true; + show-icons: false; + sidebar-mode: true; + combi-modi: "window,run"; + separator-style: "none"; + hide-scrollbar: true; + fullscreen: false; + fake-transparency: false; + scroll-method: 1; + window-format: "[{w}] ·· {c} ·· {t}"; + click-to-exit: true; + show-match: false; + color-normal: "@xbg, @xfg, @xbg, @xfg, @xbg"; + color-urgent: "@xbg, @x1, @xbg, @x1, @xfg"; + color-active: "@xbg, @xfg, @xbg, @xfg, @xbg"; + color-window: "@xbg, @x1, @xfg"; + combi-hide-mode-prefix: false; + display-window: ""; + display-windowcd: ""; + display-run: ""; + display-ssh: ""; + display-drun: ""; + display-combi: ""; + kb-remove-word-back: "Control+BackSpace,Alt+d,Alt+BackSpace"; + kb-accept-entry: "Control+m,Return,KP_Enter,Alt+m"; + kb-mode-next: "Shift+Right,Control+Tab,Alt+l,Alt+Tab"; + kb-mode-previous: "Shift+Left,Control+ISO_Left_Tab,Alt+h"; + kb-row-left: "Control+Page_Up,Control+Alt+h"; + kb-row-right: "Control+Page_Down,Control+Alt+l"; + kb-row-up: "Up,Control+p,ISO_Left_Tab,Alt+k"; + kb-row-down: "Down,Control+n,Alt+j"; + kb-select-1: ""; + kb-select-2: ""; + kb-select-3: ""; + kb-select-4: ""; + kb-select-5: ""; + kb-select-6: ""; + kb-select-7: ""; + kb-select-8: ""; + kb-select-9: ""; + kb-select-10: ""; + me-select-entry: ""; + me-accept-entry: "MousePrimary"; + me-accept-custom: "MouseMiddle"; +} +* { + selected-normal-foreground: rgba ( 52, 60, 72, 100 % ); + foreground: rgba ( 224, 224, 224, 100 % ); + normal-foreground: @foreground; + alternate-normal-background: rgba ( 52, 60, 72, 100 % ); + red: rgba ( 220, 50, 47, 100 % ); + selected-urgent-foreground: rgba ( 224, 224, 224, 100 % ); + blue: rgba ( 38, 139, 210, 100 % ); + urgent-foreground: rgba ( 240, 98, 146, 100 % ); + alternate-urgent-background: rgba ( 52, 60, 72, 100 % ); + active-foreground: rgba ( 224, 224, 224, 100 % ); + lightbg: rgba ( 238, 232, 213, 100 % ); + selected-active-foreground: rgba ( 52, 60, 72, 100 % ); + alternate-active-background: rgba ( 52, 60, 72, 100 % ); + background: rgba ( 52, 60, 72, 100 % ); + alternate-normal-foreground: @foreground; + normal-background: rgba ( 52, 60, 72, 100 % ); + lightfg: rgba ( 88, 104, 117, 100 % ); + selected-normal-background: rgba ( 224, 224, 224, 100 % ); + border-color: rgba ( 240, 98, 146, 100 % ); + spacing: 2; + separatorcolor: rgba ( 224, 224, 224, 100 % ); + urgent-background: rgba ( 52, 60, 72, 100 % ); + selected-urgent-background: rgba ( 240, 98, 146, 100 % ); + alternate-urgent-foreground: @urgent-foreground; + background-color: rgba ( 0, 0, 0, 0 % ); + alternate-active-foreground: @active-foreground; + active-background: rgba ( 52, 60, 72, 100 % ); + selected-active-background: rgba ( 224, 224, 224, 100 % ); +} +window { + background-color: @xbg; + border: 0; + border-color: @x14; + border-radius: 12px; + padding: 40; + width: 50%; + height: 50%; +} +mainbox { + border: 0; + border-color: @x0; + padding: 6; +} +message { + border: 0px; + border-color: @x6; + padding: 1px; +} +textbox { + text-color: @xfg; +} +listview { + fixed-height: 0; + border: 0px; + border-color: @x6; + spacing: 2px; + scrollbar: false; + padding: 2px 0px 0px; +} +element { + border: 0; + padding: 1px; +} +element normal.normal { + background-color: rgba (0,0,0,0%); + text-color: @xfg; +} +element normal.urgent { + background-color: rgba (0,0,0,0%); + text-color: @x9; +} +element normal.active { + background-color: rgba (0,0,0,0%); + text-color: @x5; +} +element selected.normal { + background-color: rgba (0,0,0,0%); + text-color: @x13; +} +element selected.urgent { + background-color: rgba (0,0,0,0%); + text-color: @x13; +} +element selected.active { + background-color: rgba (0,0,0,0%); + text-color: @x13; +} +element alternate.normal { + background-color: rgba (0,0,0,0%); + text-color: @xfg; +} +element alternate.urgent { + background-color: rgba (0,0,0,0%); + text-color: @x9; +} +element alternate.active { + background-color: rgba (0,0,0,0%); + text-color: @x5; +} +scrollbar { + width: 4px ; + border: 0; + handle-color: @xfg; + handle-width: 8px ; + padding: 0; +} +sidebar { + border: 0px; + border-color: @x4; + border-radius: 20px; +} +button { + margin: 5px; + padding: 5px; + background-color: @xbg; + text-color: @x8; + border: 0px; + border-radius: 20px; + border-color: @x8; +} +button selected { + background-color: @xbg; + text-color: @x7; + border: 3px; + border-radius: 20px; + border-color: @x7; +} +inputbar { + spacing: 0px ; + text-color: @xfg; + padding: 1px ; + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} +case-indicator { + spacing: 0; + text-color: @xfg; +} +entry { + spacing: 0; + text-color: @xfg; +} +prompt { + spacing: 0; + border: 0; + text-color: @xfg; +} +textbox-prompt-colon { + expand: false; + str: " "; + margin: 0px 0.3000em 0.0000em 0.0000em ; + text-color: inherit; +} + +@import "colors.rasi" diff --git a/run_once_windows_symlink_gitui.ps1 b/run_once_prepare_windows.ps1 similarity index 94% rename from run_once_windows_symlink_gitui.ps1 rename to run_once_prepare_windows.ps1 index 05a9b15..a1b1cd1 100644 --- a/run_once_windows_symlink_gitui.ps1 +++ b/run_once_prepare_windows.ps1 @@ -11,5 +11,4 @@ if (Test-Path $symlink_folder) { Remove-Item -Recurse $symlink_folder } -New-Item -Path $symlink_folder -ItemType SymbolicLink -Value $config_folder -Start-Sleep -Seconds 5 \ No newline at end of file +New-Item -Path $symlink_folder -ItemType SymbolicLink -Value $config_folder \ No newline at end of file