@@ -1,6 +1,16 @@ |
| 1 | 1 | -- gar default configuration |
| 2 | 2 | -- Copy to ~/.config/gar/init.lua to customize |
| 3 | 3 | |
| 4 | +-- Autostart applications (only run once per session) |
| 5 | +-- Uncomment the ones you want: |
| 6 | +-- gar.exec_once("polybar") -- Status bar |
| 7 | +-- gar.exec_once("picom") -- Compositor (for transparency/shadows) |
| 8 | +-- gar.exec_once("dunst") -- Notification daemon |
| 9 | +-- gar.exec_once("nm-applet") -- NetworkManager tray icon |
| 10 | +-- gar.exec_once("blueman-applet") -- Bluetooth tray icon |
| 11 | +-- gar.exec_once("feh --bg-scale ~/wallpaper.jpg") -- Wallpaper |
| 12 | +-- gar.exec_once("xss-lock -- i3lock -c 000000") -- Auto-lock on suspend |
| 13 | + |
| 4 | 14 | -- Appearance |
| 5 | 15 | gar.set("border_width", 2) |
| 6 | 16 | gar.set("border_color_focused", "#5294e2") |
@@ -8,6 +18,9 @@ gar.set("border_color_unfocused", "#2d2d2d") |
| 8 | 18 | gar.set("gap_inner", 8) |
| 9 | 19 | gar.set("gap_outer", 8) |
| 10 | 20 | |
| 21 | +-- Behavior |
| 22 | +gar.set("follow_window_on_move", true) -- Follow window when using Mod+Shift+number |
| 23 | + |
| 11 | 24 | -- Mod key: "mod" = Super/Win, "alt" = Alt |
| 12 | 25 | -- Use "mod" for real X session, "alt" for nested testing (Xephyr) |
| 13 | 26 | local mod = "mod" |
@@ -66,8 +79,11 @@ gar.bind(mod .. "+e", gar.equalize) |
| 66 | 79 | -- Toggle floating |
| 67 | 80 | gar.bind(mod .. "+f", gar.toggle_floating) |
| 68 | 81 | |
| 82 | +-- Toggle fullscreen |
| 83 | +gar.bind(mod .. "+shift+f", gar.toggle_fullscreen) |
| 84 | + |
| 69 | 85 | -- Cycle through floating windows |
| 70 | | -gar.bind(mod .. "+Tab", gar.cycle_floating) |
| 86 | +gar.bind(mod .. "+grave", gar.cycle_floating) -- Mod+` (backtick) |
| 71 | 87 | |
| 72 | 88 | -- Workspaces |
| 73 | 89 | for i = 1, 9 do |
@@ -82,3 +98,52 @@ gar.bind(mod .. "+comma", gar.focus_monitor("prev")) |
| 82 | 98 | gar.bind(mod .. "+period", gar.focus_monitor("next")) |
| 83 | 99 | gar.bind(mod .. "+shift+comma", gar.move_to_monitor("prev")) |
| 84 | 100 | gar.bind(mod .. "+shift+period", gar.move_to_monitor("next")) |
| 101 | + |
| 102 | +-- Launchers (rofi) |
| 103 | +-- Use -theme gar if you've installed config/rofi-gar.rasi to ~/.config/rofi/ |
| 104 | +gar.bind(mod .. "+space", function() |
| 105 | + gar.exec("rofi -show drun -show-icons") |
| 106 | +end) |
| 107 | +gar.bind(mod .. "+Tab", function() |
| 108 | + gar.exec("rofi -show window -show-icons") -- Window switcher (uses EWMH) |
| 109 | +end) |
| 110 | +gar.bind(mod .. "+r", function() |
| 111 | + gar.exec("rofi -show run") |
| 112 | +end) |
| 113 | + |
| 114 | +-- dmenu alternative (if rofi not available) |
| 115 | +gar.bind(mod .. "+p", function() |
| 116 | + gar.exec("dmenu_run") |
| 117 | +end) |
| 118 | + |
| 119 | +-- Screenshot (requires scrot or maim) |
| 120 | +gar.bind("Print", function() |
| 121 | + gar.exec("scrot -e 'mv $f ~/Pictures/' || maim ~/Pictures/screenshot-$(date +%s).png") |
| 122 | +end) |
| 123 | +gar.bind(mod .. "+Print", function() |
| 124 | + gar.exec("scrot -s -e 'mv $f ~/Pictures/' || maim -s ~/Pictures/screenshot-$(date +%s).png") |
| 125 | +end) |
| 126 | + |
| 127 | +-- Lock screen (requires i3lock, swaylock, or slock) |
| 128 | +gar.bind(mod .. "+Escape", function() |
| 129 | + gar.exec("i3lock -c 000000 || swaylock -c 000000 || slock") |
| 130 | +end) |
| 131 | + |
| 132 | +-- Volume controls (requires pactl/pamixer) |
| 133 | +gar.bind("XF86AudioRaiseVolume", function() |
| 134 | + gar.exec("pactl set-sink-volume @DEFAULT_SINK@ +5% || pamixer -i 5") |
| 135 | +end) |
| 136 | +gar.bind("XF86AudioLowerVolume", function() |
| 137 | + gar.exec("pactl set-sink-volume @DEFAULT_SINK@ -5% || pamixer -d 5") |
| 138 | +end) |
| 139 | +gar.bind("XF86AudioMute", function() |
| 140 | + gar.exec("pactl set-sink-mute @DEFAULT_SINK@ toggle || pamixer -t") |
| 141 | +end) |
| 142 | + |
| 143 | +-- Brightness controls (requires brightnessctl or light) |
| 144 | +gar.bind("XF86MonBrightnessUp", function() |
| 145 | + gar.exec("brightnessctl set +10% || light -A 10") |
| 146 | +end) |
| 147 | +gar.bind("XF86MonBrightnessDown", function() |
| 148 | + gar.exec("brightnessctl set 10%- || light -U 10") |
| 149 | +end) |