diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua new file mode 100644 index 0000000..d4dd1b2 --- /dev/null +++ b/.config/awesome/rc.lua @@ -0,0 +1,359 @@ +pcall(require, "luarocks.loader") +local gears = require("gears") +local awful = require("awful") +require("awful.autofocus") +local wibox = require("wibox") +local beautiful = require("beautiful") +local naughty = require("naughty") +local menubar = require("menubar") +require("awful.hotkeys_popup.keys") + +-- {{{ 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 +-- }}} + +-- {{{ Variable definitions +-- Themes define colours, icons, font and wallpapers. +beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua") + +-- This is used later as the default terminal and editor to run. +terminal = "kitty" +editor = os.getenv("EDITOR") or "nvim" +editor_cmd = terminal .. " -e " .. editor + +mod = "Mod4" + +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, +} + +local tag_names = { "a", "s", "d", "f", "g", "z", "x", "c", "v", "b" } + +awful.screen.connect_for_each_screen(function(s) + -- Each screen has its own tag table. + awful.tag(tag_names, s, awful.layout.layouts[1]) +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( + + -- basics + awful.key({ mod }, "t", awesome.restart), + + -- focus + awful.key({ mod }, "h", awful.client.focus.bydirection("left")), + awful.key({ mod }, "j", awful.client.focus.bydirection("down")), + awful.key({ mod }, "k", awful.client.focus.bydirection("up")), + awful.key({ mod }, "l", awful.client.focus.bydirection("right")), + + -- shift + awful.key({ mod, "Shift" }, "h", awful.client.swap.bydirection("left")), + awful.key({ mod, "Shift" }, "j", awful.client.swap.bydirection("down")), + awful.key({ mod, "Shift" }, "k", awful.client.swap.bydirection("up")), + awful.key({ mod, "Shift" }, "l", awful.client.swap.bydirection("right")), + + -- cycle + awful.key({ mod }, "m", function() + awful.screen.focus_relative(1) + end), + + -- cycle layouts + awful.key({ mod }, "space", function() + awful.layout.inc(1) + end), + + -- Standard program + awful.key({ mod }, "Return", function() + awful.spawn(terminal) + end), + + awful.key({ mod }, "l", function() + awful.tag.incmwfact(0.05) + end), + awful.key({ mod, "Control" }, "h", function() + awful.tag.incmwfact(-0.05) + end), + awful.key({ mod, "Shift" }, "h", function() + awful.tag.incnmaster(1, nil, true) + end), + awful.key({ mod, "Shift" }, "l", function() + awful.tag.incnmaster(-1, nil, true) + end), + awful.key({ mod, "Control" }, "h", function() + awful.tag.incncol(1, nil, true) + end), + awful.key({ mod, "Control" }, "l", function() + awful.tag.incncol(-1, nil, true) + end), + awful.key({ mod, "Shift" }, "space", function() + awful.layout.inc(-1) + end), + + awful.key({ mod }, "1", function() + awful.spawn("thunar") + end), + awful.key({ mod }, "2", function() + awful.spawn("firefox") + end), + awful.key({ mod }, "3", function() + awful.spawn("rofi -show calc") + end), + awful.key({ mod }, "4", function() + awful.spawn("kitty -e ncmpcpp") + end), + awful.key({ mod }, "0", function() + awful.spawn("i3lock -c 000000") + end), + + awful.key({ mod, "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" }) +) + +clientkeys = gears.table.join( + -- basics + awful.key({ mod }, "w", function(c) + c:kill() + end), + + -- window attributes + awful.key({ mod, "Control" }, "e", function(c) + c.fullscreen = not c.fullscreen + c:raise() + end), + awful.key({ mod, "Control" }, "q", awful.client.floating.toggle), + + awful.key({ mod, "Control" }, "Return", function(c) + c:swap(awful.client.getmaster()) + end, { description = "move to master", group = "client" }), + awful.key({ mod }, "o", function(c) + c:move_to_screen() + end, { description = "move to screen", group = "client" }), + awful.key({ mod }, "t", function(c) + c.ontop = not c.ontop + end, { description = "toggle keep on top", group = "client" }), + awful.key({ mod }, "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({ mod }, "m", function(c) + c.maximized = not c.maximized + c:raise() + end, { description = "(un)maximize", group = "client" }), + awful.key({ mod, "Control" }, "m", function(c) + c.maximized_vertical = not c.maximized_vertical + c:raise() + end, { description = "(un)maximize vertically", group = "client" }), + awful.key({ mod, "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 +local tags = { "a", "s", "d", "f", "g", "z", "x", "c", "v", "b" } +for i, tag_name in ipairs(tags) do + globalkeys = gears.table.join( + globalkeys, + -- View tag only. + awful.key({ mod }, tag_name, function() + local screen = awful.screen.focused() + local tag = screen.tags[i] + if tag then + tag:view_only() + end + end), + -- Toggle tag display. + awful.key({ mod, "Control" }, tag_name, function() + local screen = awful.screen.focused() + local tag = screen.tags[i] + if tag then + awful.tag.viewtoggle(tag) + end + end), + -- Move client to tag. + awful.key({ mod, "Shift" }, tag_name, function() + if client.focus then + local tag = client.focus.screen.tags[i] + if tag then + client.focus:move_to_tag(tag) + end + end + end), + -- Toggle tag on focused client. + awful.key({ mod, "Control", "Shift" }, tag_name, function() + if client.focus then + local tag = client.focus.screen.tags[i] + if tag then + client.focus:toggle_tag(tag) + end + end + end) + ) +end + +clientbuttons = gears.table.join( + awful.button({}, 1, function(c) + c:emit_signal("request::activate", "mouse_click", { raise = true }) + end), + awful.button({ mod }, 1, function(c) + c:emit_signal("request::activate", "mouse_click", { raise = true }) + awful.mouse.client.move(c) + end), + awful.button({ mod }, 3, function(c) + c:emit_signal("request::activate", "mouse_click", { raise = true }) + awful.mouse.client.resize(c) + end) +) + +-- 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) + +-- 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) +-- }}} diff --git a/.config/i3/autostart.sh b/.config/i3/autostart.sh new file mode 100755 index 0000000..ce54ef5 --- /dev/null +++ b/.config/i3/autostart.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +pidof dunst || dunst & +pidof mpd || mpd & +pidof flameshot || flameshot & +pidof lxpolkit || lxpolkit & +pidof picom || picom --experimental-backends & +wal -R +~/.fehbg diff --git a/.config/i3/config b/.config/i3/config new file mode 100644 index 0000000..a1f418e --- /dev/null +++ b/.config/i3/config @@ -0,0 +1,167 @@ +set $mod Mod4 + +set $terminal kitty +set $browser firefox +set $calculator "rofi -show calc" +set $calendar "$terminal -e nvim +Agenda" +set $feed_reader "$terminal -e newsboat" +set $file_manager thunar +set $launcher "rofi -show run" +set $music_player "$terminal -e ncmpcpp" +set $screen_locker "i3lock -c 000000" + + +font pango:mononoki 12 + +# Start XDG autostart .desktop files using dex. See also +# https://wiki.archlinux.org/index.php/XDG_Autostart +exec --no-startup-id dex --autostart --environment i3 + +# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the +# screen before suspend. Use loginctl lock-session to lock your screen. +exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork + +# NetworkManager is the most popular way to manage wireless networks on Linux, +# and nm-applet is a desktop environment-independent system tray GUI for it. +exec --no-startup-id nm-applet + +# Use pactl to adjust volume in PulseAudio. +set $refresh_i3status killall -SIGUSR1 i3status +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status +bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# move tiling windows via drag & drop by left-clicking into the title bar, +# or left-clicking anywhere into the window while holding the floating modifier. +tiling_drag modifier titlebar + +# basics +bindsym $mod+w kill +bindsym $mod+t reload + +# focus +bindsym $mod+h focus left +bindsym $mod+j focus down +bindsym $mod+k focus up +bindsym $mod+l focus right + +# shift +bindsym $mod+Shift+h move left +bindsym $mod+Shift+j move down +bindsym $mod+Shift+k move up +bindsym $mod+Shift+l move right + +# frame splitting +bindsym $mod+o split h +bindsym $mod+u split v + +# resize +bindsym $mod+Control+h resize grow left 2 px or 2 ppt +bindsym $mod+Control+j resize grow down 2 px or 2 ppt +bindsym $mod+Control+k resize grow up 2 px or 2 ppt +bindsym $mod+Control+l resize grow right 2 px or 2 ppt + +# cycle layouts +# bindsym $mod+s layout stacking +# bindsym $mod+w layout tabbed +# bindsym $mod+e layout toggle split + +# window attributes +bindsym $mod+Control+w fullscreen toggle +bindsym $mod+Control+q floating toggle + +# +# launchers +# + +bindsym $mod+Return exec $terminal +bindsym $mod+space exec --no-startup-id $launcher + +bindsym $mod+grave exec flameshot gui +bindsym $mod+1 exec $file_manager +bindsym $mod+2 exec $browser +bindsym $mod+3 exec $calculator +bindsym $mod+4 exec $music_player +bindsym $mod+5 exec $calendar +bindsym $mod+6 exec $virt-manager +bindsym $mod+0 exec $screen_locker + +# change focus between tiling / floating windows +# bindsym $mod+space focus mode_toggle + +# focus the parent container +# bindsym $mod+a focus parent + +# focus the child container +#bindsym $mod+d focus child + +# 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 "a" +set $ws2 "s" +set $ws3 "d" +set $ws4 "f" +set $ws5 "g" +set $ws6 "z" +set $ws7 "x" +set $ws8 "c" +set $ws9 "v" +set $ws10 "b" + +# switch to workspace +bindsym $mod+a workspace $ws1 +bindsym $mod+s workspace $ws2 +bindsym $mod+d workspace $ws3 +bindsym $mod+f workspace $ws4 +bindsym $mod+g workspace $ws5 +bindsym $mod+z workspace $ws6 +bindsym $mod+x workspace $ws7 +bindsym $mod+c workspace $ws8 +bindsym $mod+v workspace $ws9 +bindsym $mod+b workspace $ws10 + +# move focused container to workspace +bindsym $mod+Shift+a move container to workspace $ws1 +bindsym $mod+Shift+s move container to workspace $ws2 +bindsym $mod+Shift+d move container to workspace $ws3 +bindsym $mod+Shift+f move container to workspace $ws4 +bindsym $mod+Shift+g move container to workspace $ws5 +bindsym $mod+Shift+z move container to workspace $ws6 +bindsym $mod+Shift+x move container to workspace $ws7 +bindsym $mod+Shift+c move container to workspace $ws8 +bindsym $mod+Shift+v move container to workspace $ws9 +bindsym $mod+Shift+b move container to workspace $ws10 + +# +# theme +# + +gaps inner 12 + +default_border pixel 2 + +set_from_resource $color0 i3wm.color0 #000000 +set_from_resource $color1 i3wm.color1 #000000 +set_from_resource $color8 i3wm.color8 #000000 + +# class border backgr. text indicator child_border +client.focused $color8 $color0 $color0 $color0 $color8 +client.focused_inactive $color8 $color0 $color0 $color0 $color0 +client.unfocused $color0 $color0 $color0 $color0 $color0 +client.urgent $color1 $color0 $color0 $color0 $color0 +client.placeholder $color1 $color0 $color0 $color0 $color0 + +client.background $color0 + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +# bar { +# status_command i3status +# } + +exec_always --no-startup-id $HOME/.config/i3/autostart.sh +exec_always --no-startup-id $HOME/.config/i3/panel.sh diff --git a/.config/i3/panel.sh b/.config/i3/panel.sh new file mode 100755 index 0000000..9151edb --- /dev/null +++ b/.config/i3/panel.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +polybar-msg cmd quit +polybar main 2>&1 & disown diff --git a/.config/qtile/config.py b/.config/qtile/config.py index ec51df0..0ab28b1 100644 --- a/.config/qtile/config.py +++ b/.config/qtile/config.py @@ -111,7 +111,7 @@ layout_theme = { "border_width": 2, "margin": 6, "border_on_single": True, - "border_focus": colors[8], + "border_focus": colors[7], "border_normal": colors[0], }