gardesk/gar / 6bf1f71

Browse files

Config: keybinds, polybar/rofi examples, session scripts

- Mod+Space rofi drun, Mod+Tab window switcher, Mod+grave cycle float
- Mod+Shift+f fullscreen, follow_window_on_move option
- polybar-example.ini with gar/ewmh modules
- rofi-gar.rasi matching theme
- Session scripts updated for xrandr monitor setup
Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
6bf1f714bafaa26e3a16ea726bd8bf5ba7d1b582
Parents
79cf08a
Tree
8537b45

5 changed files

StatusFile+-
M gar-session.sh 7 0
M gar/config/default.lua 66 1
A gar/config/polybar-example.ini 122 0
A gar/config/rofi-gar.rasi 93 0
M start-gar.sh 7 0
gar-session.shmodified
@@ -8,6 +8,13 @@ xrandr \
88
   --output HDMI-1 --mode 2560x1440 --pos 1920x0 \
99
   --output HDMI-0 --mode 3840x2160 --pos 4480x0
1010
 
11
+# Launch compositor before WM (for proper screen repainting)
12
+# --use-ewmh-active-win uses _NET_ACTIVE_WINDOW for focus detection
13
+if command -v picom &> /dev/null; then
14
+    picom -b --use-ewmh-active-win &
15
+    sleep 0.1  # Brief pause to let compositor initialize
16
+fi
17
+
1118
 # Set log level
1219
 export GAR_LOG=info
1320
 
gar/config/default.luamodified
@@ -1,6 +1,16 @@
11
 -- gar default configuration
22
 -- Copy to ~/.config/gar/init.lua to customize
33
 
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
+
414
 -- Appearance
515
 gar.set("border_width", 2)
616
 gar.set("border_color_focused", "#5294e2")
@@ -8,6 +18,9 @@ gar.set("border_color_unfocused", "#2d2d2d")
818
 gar.set("gap_inner", 8)
919
 gar.set("gap_outer", 8)
1020
 
21
+-- Behavior
22
+gar.set("follow_window_on_move", true)  -- Follow window when using Mod+Shift+number
23
+
1124
 -- Mod key: "mod" = Super/Win, "alt" = Alt
1225
 -- Use "mod" for real X session, "alt" for nested testing (Xephyr)
1326
 local mod = "mod"
@@ -66,8 +79,11 @@ gar.bind(mod .. "+e", gar.equalize)
6679
 -- Toggle floating
6780
 gar.bind(mod .. "+f", gar.toggle_floating)
6881
 
82
+-- Toggle fullscreen
83
+gar.bind(mod .. "+shift+f", gar.toggle_fullscreen)
84
+
6985
 -- Cycle through floating windows
70
-gar.bind(mod .. "+Tab", gar.cycle_floating)
86
+gar.bind(mod .. "+grave", gar.cycle_floating)  -- Mod+` (backtick)
7187
 
7288
 -- Workspaces
7389
 for i = 1, 9 do
@@ -82,3 +98,52 @@ gar.bind(mod .. "+comma", gar.focus_monitor("prev"))
8298
 gar.bind(mod .. "+period", gar.focus_monitor("next"))
8399
 gar.bind(mod .. "+shift+comma", gar.move_to_monitor("prev"))
84100
 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)
gar/config/polybar-example.iniadded
@@ -0,0 +1,122 @@
1
+; Polybar config for gar window manager
2
+; Copy to ~/.config/polybar/config.ini
3
+;
4
+; Launch with: polybar gar &
5
+; Or add to your gar init.lua: gar.exec_once("polybar gar")
6
+
7
+[colors]
8
+background = #1a1a2e
9
+background-alt = #2d2d44
10
+foreground = #e0e0e0
11
+primary = #5294e2
12
+secondary = #6c7a89
13
+alert = #ff5555
14
+disabled = #707880
15
+
16
+[bar/gar]
17
+width = 100%
18
+height = 24pt
19
+radius = 0
20
+background = ${colors.background}
21
+foreground = ${colors.foreground}
22
+line-size = 3pt
23
+border-size = 0
24
+padding-left = 1
25
+padding-right = 2
26
+module-margin = 1
27
+separator = |
28
+separator-foreground = ${colors.disabled}
29
+
30
+font-0 = "monospace:size=10;2"
31
+font-1 = "Font Awesome 6 Free:style=Solid:size=10;2"
32
+
33
+modules-left = xworkspaces xwindow
34
+modules-right = pulseaudio memory cpu wlan battery date
35
+
36
+cursor-click = pointer
37
+cursor-scroll = ns-resize
38
+
39
+enable-ipc = true
40
+
41
+; This is critical - tells polybar to use EWMH
42
+wm-restack = generic
43
+
44
+[module/xworkspaces]
45
+type = internal/xworkspaces
46
+
47
+label-active = %name%
48
+label-active-background = ${colors.background-alt}
49
+label-active-underline= ${colors.primary}
50
+label-active-padding = 1
51
+
52
+label-occupied = %name%
53
+label-occupied-padding = 1
54
+
55
+label-urgent = %name%
56
+label-urgent-background = ${colors.alert}
57
+label-urgent-padding = 1
58
+
59
+label-empty = %name%
60
+label-empty-foreground = ${colors.disabled}
61
+label-empty-padding = 1
62
+
63
+[module/xwindow]
64
+type = internal/xwindow
65
+label = %title:0:60:...%
66
+
67
+[module/pulseaudio]
68
+type = internal/pulseaudio
69
+format-volume-prefix = "VOL "
70
+format-volume-prefix-foreground = ${colors.primary}
71
+format-volume = <label-volume>
72
+label-volume = %percentage%%
73
+label-muted = muted
74
+label-muted-foreground = ${colors.disabled}
75
+
76
+[module/memory]
77
+type = internal/memory
78
+interval = 2
79
+format-prefix = "RAM "
80
+format-prefix-foreground = ${colors.primary}
81
+label = %percentage_used:2%%
82
+
83
+[module/cpu]
84
+type = internal/cpu
85
+interval = 2
86
+format-prefix = "CPU "
87
+format-prefix-foreground = ${colors.primary}
88
+label = %percentage:2%%
89
+
90
+[module/wlan]
91
+type = internal/network
92
+interface-type = wireless
93
+interval = 5
94
+format-connected = <label-connected>
95
+label-connected = %essid%
96
+format-disconnected = <label-disconnected>
97
+label-disconnected = offline
98
+label-disconnected-foreground = ${colors.disabled}
99
+
100
+[module/battery]
101
+type = internal/battery
102
+full-at = 99
103
+low-at = 15
104
+battery = BAT0
105
+adapter = AC
106
+poll-interval = 5
107
+label-charging = CHG %percentage%%
108
+label-discharging = BAT %percentage%%
109
+label-full = FULL
110
+label-low = LOW %percentage%%
111
+label-low-foreground = ${colors.alert}
112
+
113
+[module/date]
114
+type = internal/date
115
+interval = 1
116
+date = %Y-%m-%d %H:%M
117
+label = %date%
118
+label-foreground = ${colors.primary}
119
+
120
+[settings]
121
+screenchange-reload = true
122
+pseudo-transparency = true
gar/config/rofi-gar.rasiadded
@@ -0,0 +1,93 @@
1
+/* Rofi theme for gar window manager */
2
+/* Copy to ~/.config/rofi/gar.rasi */
3
+/* Use with: rofi -theme gar -show drun */
4
+
5
+* {
6
+    bg:         #1a1a2e;
7
+    bg-alt:     #2d2d44;
8
+    fg:         #e0e0e0;
9
+    fg-alt:     #a0a0a0;
10
+    accent:     #5294e2;
11
+    urgent:     #ff5555;
12
+
13
+    background-color:   @bg;
14
+    text-color:         @fg;
15
+    border-color:       @accent;
16
+}
17
+
18
+window {
19
+    width:              600px;
20
+    border:             2px;
21
+    border-color:       @accent;
22
+    border-radius:      0px;
23
+    padding:            0px;
24
+}
25
+
26
+mainbox {
27
+    spacing:            0;
28
+    children:           [ inputbar, message, listview ];
29
+}
30
+
31
+inputbar {
32
+    padding:            12px;
33
+    background-color:   @bg-alt;
34
+    children:           [ prompt, entry ];
35
+}
36
+
37
+prompt {
38
+    text-color:         @accent;
39
+    padding:            0 8px 0 0;
40
+}
41
+
42
+entry {
43
+    placeholder:        "Search...";
44
+    placeholder-color:  @fg-alt;
45
+}
46
+
47
+message {
48
+    padding:            8px;
49
+    background-color:   @bg-alt;
50
+}
51
+
52
+listview {
53
+    lines:              8;
54
+    columns:            1;
55
+    fixed-height:       false;
56
+    spacing:            0;
57
+    scrollbar:          false;
58
+}
59
+
60
+element {
61
+    padding:            10px 12px;
62
+    spacing:            8px;
63
+}
64
+
65
+element normal.normal {
66
+    background-color:   @bg;
67
+}
68
+
69
+element alternate.normal {
70
+    background-color:   @bg;
71
+}
72
+
73
+element selected.normal {
74
+    background-color:   @accent;
75
+    text-color:         @bg;
76
+}
77
+
78
+element normal.urgent {
79
+    text-color:         @urgent;
80
+}
81
+
82
+element selected.urgent {
83
+    background-color:   @urgent;
84
+    text-color:         @bg;
85
+}
86
+
87
+element-icon {
88
+    size:               24px;
89
+}
90
+
91
+element-text {
92
+    vertical-align:     0.5;
93
+}
start-gar.shmodified
@@ -84,6 +84,13 @@ xrandr \\
8484
   --output HDMI-1 --mode 2560x1440 --pos 1920x0 \\
8585
   --output HDMI-0 --mode 3840x2160 --pos 4480x0
8686
 
87
+# Launch compositor before WM (for proper screen repainting)
88
+# --use-ewmh-active-win uses _NET_ACTIVE_WINDOW for focus detection
89
+if command -v picom > /dev/null 2>&1; then
90
+    picom -b --use-ewmh-active-win &
91
+    sleep 0.1
92
+fi
93
+
8794
 # Start gar
8895
 exec $GAR_BIN
8996
 EOF