diff options
author | Debian Live user <user@debian-BULLSEYE-live-builder-AMD64> | 2023-04-28 17:02:20 -0400 |
---|---|---|
committer | Debian Live user <user@debian-BULLSEYE-live-builder-AMD64> | 2023-04-28 17:33:42 -0400 |
commit | 7e183e38d8ac3d0fc0d5ab257b63771e5badaa31 (patch) | |
tree | f006478d09ae4ec788a97d4c08e8a5e5bbe7b10b | |
parent | 49b42e352dae1eac7499090db68e5f18ebe75c8b (diff) |
package installer that auto-backports i3-wm
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | dot/config/i3/config | 178 | ||||
-rw-r--r-- | eschew-unstable.pref | 8 | ||||
-rw-r--r-- | install-packages.bash | 105 |
4 files changed, 299 insertions, 0 deletions
@@ -47,6 +47,14 @@ endif | |||
47 | 47 | ||
48 | install: $(DESTINATIONS) | 48 | install: $(DESTINATIONS) |
49 | 49 | ||
50 | install-packages: | ||
51 | ifeq ($(shell id -u),0) | ||
52 | install -m0644 eschew-unstable.pref /etc/apt/preferences.d/ | ||
53 | bash install-packages.bash | ||
54 | else | ||
55 | sudo -- $(MAKE) -$(MAKEFLAGS) $@ | ||
56 | endif | ||
57 | |||
50 | simulate-install: | 58 | simulate-install: |
51 | @echo | 59 | @echo |
52 | @echo \#\# SIMULATED INSTALL \#\# | 60 | @echo \#\# SIMULATED INSTALL \#\# |
diff --git a/dot/config/i3/config b/dot/config/i3/config new file mode 100644 index 0000000..9d27da4 --- /dev/null +++ b/dot/config/i3/config | |||
@@ -0,0 +1,178 @@ | |||
1 | # i3 config file (v4) | ||
2 | # Please see https://i3wm.org/docs/userguide.html for a complete reference! | ||
3 | |||
4 | set $mod Mod4 | ||
5 | |||
6 | # These require a newer i3 than available in Debian bullseye. | ||
7 | # The version in Debian sid backports without issue (but isn't in | ||
8 | # bullseye-backports). | ||
9 | hide_edge_borders smart_no_gaps | ||
10 | smart_borders no_gaps | ||
11 | |||
12 | # Font for window titles. Will also be used by the bar unless a different font | ||
13 | # is used in the bar {} block below. | ||
14 | font pango:monospace 8 | ||
15 | |||
16 | # This font is widely installed, provides lots of unicode glyphs, right-to-left | ||
17 | # text rendering and scalability on retina/hidpi displays (thanks to pango). | ||
18 | #font pango:DejaVu Sans Mono 8 | ||
19 | |||
20 | # The combination of xss-lock, nm-applet and pactl is a popular choice, so | ||
21 | # they are included here as an example. Modify as you see fit. | ||
22 | |||
23 | # xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the | ||
24 | # screen before suspend. Use loginctl lock-session to lock your screen. | ||
25 | exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork | ||
26 | |||
27 | # NetworkManager is the most popular way to manage wireless networks on Linux, | ||
28 | # and nm-applet is a desktop environment-independent system tray GUI for it. | ||
29 | exec --no-startup-id nm-applet | ||
30 | |||
31 | # Use pactl to adjust volume in PulseAudio. | ||
32 | set $refresh_i3status killall -SIGUSR1 i3status | ||
33 | bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status | ||
34 | bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status | ||
35 | bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status | ||
36 | bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status | ||
37 | |||
38 | # Use Mouse+$mod to drag floating windows to their wanted position | ||
39 | floating_modifier $mod | ||
40 | |||
41 | # start a terminal | ||
42 | bindsym $mod+Return exec i3-sensible-terminal | ||
43 | |||
44 | # kill focused window | ||
45 | bindsym $mod+Shift+q kill | ||
46 | bindsym $mod+Shift+c kill | ||
47 | |||
48 | # start dmenu (a program launcher) | ||
49 | bindsym $mod+d exec --no-startup-id dmenu_run | ||
50 | bindsym $mod+p exec --no-startup-id dmenu_run | ||
51 | # A more modern dmenu replacement is rofi: | ||
52 | # bindcode $mod+40 exec "rofi -modi drun,run -show drun" | ||
53 | # There also is i3-dmenu-desktop which only displays applications shipping a | ||
54 | # .desktop file. It is a wrapper around dmenu, so you need that installed. | ||
55 | # bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop | ||
56 | |||
57 | # change focus | ||
58 | # it would be nicer if jk and hl were interchangeable in vsplit and hsplit modes. | ||
59 | bindsym $mod+h focus left | ||
60 | bindsym $mod+j focus down | ||
61 | bindsym $mod+k focus up | ||
62 | bindsym $mod+l focus right | ||
63 | |||
64 | # alternatively, you can use the cursor keys: | ||
65 | bindsym $mod+Left focus left | ||
66 | bindsym $mod+Down focus down | ||
67 | bindsym $mod+Up focus up | ||
68 | bindsym $mod+Right focus right | ||
69 | |||
70 | # move focused window | ||
71 | bindsym $mod+Shift+h move left | ||
72 | bindsym $mod+Shift+j move down | ||
73 | bindsym $mod+Shift+k move up | ||
74 | bindsym $mod+Shift+l move right | ||
75 | |||
76 | # alternatively, you can use the cursor keys: | ||
77 | bindsym $mod+Shift+Left move left | ||
78 | bindsym $mod+Shift+Down move down | ||
79 | bindsym $mod+Shift+Up move up | ||
80 | bindsym $mod+Shift+Right move right | ||
81 | |||
82 | # enter fullscreen mode for the focused container | ||
83 | bindsym $mod+f fullscreen toggle | ||
84 | |||
85 | # change container layout (stacked, tabbed, toggle split) | ||
86 | bindsym $mod+s layout stacking | ||
87 | bindsym $mod+w layout tabbed | ||
88 | bindsym $mod+e layout toggle split | ||
89 | |||
90 | # toggle tiling / floating | ||
91 | bindsym $mod+t floating toggle | ||
92 | |||
93 | # change focus between tiling / floating windows | ||
94 | bindsym $mod+Shift+space fullscreen toggle | ||
95 | bindsym $mod+space layout toggle stacking tabbed splitv splith | ||
96 | |||
97 | # focus the parent container | ||
98 | bindsym $mod+a focus parent | ||
99 | |||
100 | # focus the child container | ||
101 | #bindsym $mod+d focus child | ||
102 | |||
103 | # Define names for default workspaces for which we configure key bindings later on. | ||
104 | # We use variables to avoid repeating the names in multiple places. | ||
105 | set $ws1 "1" | ||
106 | set $ws2 "2" | ||
107 | set $ws3 "3" | ||
108 | set $ws4 "4" | ||
109 | set $ws5 "5" | ||
110 | set $ws6 "6" | ||
111 | set $ws7 "7" | ||
112 | set $ws8 "8" | ||
113 | set $ws9 "9" | ||
114 | set $ws10 "10" | ||
115 | |||
116 | # switch to workspace | ||
117 | bindsym $mod+1 workspace number $ws1 | ||
118 | bindsym $mod+2 workspace number $ws2 | ||
119 | bindsym $mod+3 workspace number $ws3 | ||
120 | bindsym $mod+4 workspace number $ws4 | ||
121 | bindsym $mod+5 workspace number $ws5 | ||
122 | bindsym $mod+6 workspace number $ws6 | ||
123 | bindsym $mod+7 workspace number $ws7 | ||
124 | bindsym $mod+8 workspace number $ws8 | ||
125 | bindsym $mod+9 workspace number $ws9 | ||
126 | bindsym $mod+0 workspace number $ws10 | ||
127 | |||
128 | # move focused container to workspace | ||
129 | bindsym $mod+Shift+1 move container to workspace number $ws1 | ||
130 | bindsym $mod+Shift+2 move container to workspace number $ws2 | ||
131 | bindsym $mod+Shift+3 move container to workspace number $ws3 | ||
132 | bindsym $mod+Shift+4 move container to workspace number $ws4 | ||
133 | bindsym $mod+Shift+5 move container to workspace number $ws5 | ||
134 | bindsym $mod+Shift+6 move container to workspace number $ws6 | ||
135 | bindsym $mod+Shift+7 move container to workspace number $ws7 | ||
136 | bindsym $mod+Shift+8 move container to workspace number $ws8 | ||
137 | bindsym $mod+Shift+9 move container to workspace number $ws9 | ||
138 | bindsym $mod+Shift+0 move container to workspace number $ws10 | ||
139 | |||
140 | # reload the configuration file | ||
141 | #bindsym $mod+Shift+c reload | ||
142 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) | ||
143 | bindsym $mod+Shift+r restart | ||
144 | # exit i3 (logs you out of your X session) | ||
145 | bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" | ||
146 | |||
147 | # resize window (you can also use the mouse for that) | ||
148 | mode "resize" { | ||
149 | # These bindings trigger as soon as you enter the resize mode | ||
150 | |||
151 | # Pressing left will shrink the window’s width. | ||
152 | # Pressing right will grow the window’s width. | ||
153 | # Pressing up will shrink the window’s height. | ||
154 | # Pressing down will grow the window’s height. | ||
155 | bindsym h resize shrink width 10 px or 10 ppt | ||
156 | bindsym j resize grow height 10 px or 10 ppt | ||
157 | bindsym k resize shrink height 10 px or 10 ppt | ||
158 | bindsym l resize grow width 10 px or 10 ppt | ||
159 | |||
160 | # same bindings, but for the arrow keys | ||
161 | bindsym Left resize shrink width 10 px or 10 ppt | ||
162 | bindsym Down resize grow height 10 px or 10 ppt | ||
163 | bindsym Up resize shrink height 10 px or 10 ppt | ||
164 | bindsym Right resize grow width 10 px or 10 ppt | ||
165 | |||
166 | # back to normal: Enter or Escape or $mod+r | ||
167 | bindsym Return mode "default" | ||
168 | bindsym Escape mode "default" | ||
169 | bindsym $mod+r mode "default" | ||
170 | } | ||
171 | |||
172 | bindsym $mod+r mode "resize" | ||
173 | |||
174 | # Start i3bar to display a workspace bar (plus the system information i3status | ||
175 | # finds out, if available) | ||
176 | bar { | ||
177 | status_command i3status | ||
178 | } | ||
diff --git a/eschew-unstable.pref b/eschew-unstable.pref new file mode 100644 index 0000000..1aa87e8 --- /dev/null +++ b/eschew-unstable.pref | |||
@@ -0,0 +1,8 @@ | |||
1 | |||
2 | |||
3 | Package: * | ||
4 | Pin: release a=unstable | ||
5 | Pin-Priority: 50 | ||
6 | |||
7 | |||
8 | |||
diff --git a/install-packages.bash b/install-packages.bash new file mode 100644 index 0000000..3363353 --- /dev/null +++ b/install-packages.bash | |||
@@ -0,0 +1,105 @@ | |||
1 | #!/bin/bash | ||
2 | set -e | ||
3 | |||
4 | apt() | ||
5 | { | ||
6 | (set -x; command apt "$@") | ||
7 | } | ||
8 | |||
9 | [ "$(id -u)" = 0 ] || exec sudo bash "$0" "$@" | ||
10 | |||
11 | basics='etckeeper git par ssh tmux vim w3m' | ||
12 | #xorg='xorg xterm i3' | ||
13 | xorg='xorg xterm' | ||
14 | media='libdbus-glib-1-2 mpv pulseaudio' | ||
15 | apt install --no-upgrade $basics $xorg $media | ||
16 | |||
17 | apt_backport() | ||
18 | { | ||
19 | ( | ||
20 | set -e | ||
21 | apt install --no-upgrade debhelper | ||
22 | SOURCES_DIR=$1 | ||
23 | TARGET_URL=$2 | ||
24 | TARGET_PKG=$3 | ||
25 | case "$TARGET_PKG" in | ||
26 | '' | */*) exit 1 ;; | ||
27 | esac | ||
28 | mkdir -p "$SOURCES_DIR" | ||
29 | cd "$SOURCES_DIR" | ||
30 | |||
31 | if [ -e "$TARGET_PKG" ] | ||
32 | then | ||
33 | cd "$TARGET_PKG" | ||
34 | git pull --ff-only | ||
35 | else | ||
36 | rm -rf "$TARGET_PKG"~tmp | ||
37 | git clone --depth=1 "$TARGET_URL" "$TARGET_PKG"~tmp | ||
38 | mv -T "$TARGET_PKG"~tmp "$TARGET_PKG" | ||
39 | cd "$TARGET_PKG" | ||
40 | fi | ||
41 | |||
42 | arch=$(dpkg-architecture -q DEB_BUILD_ARCH) | ||
43 | version=$(dpkg-parsechangelog --show-field Version) | ||
44 | pkgs=$(dh_listpackages) | ||
45 | debs= | ||
46 | for pkg in $pkgs | ||
47 | do | ||
48 | debs="$debs ${pkg}_${version}_${arch}.deb" | ||
49 | done | ||
50 | |||
51 | set -x | ||
52 | pwd | ||
53 | for deb in $debs | ||
54 | do | ||
55 | [ -e ../"$deb" ] && continue || true | ||
56 | # We are missing a deb, therefore build. | ||
57 | |||
58 | if command -v mk-build-deps >/dev/null | ||
59 | then | ||
60 | mk-build-deps "$TARGET_PKG" --install | ||
61 | else | ||
62 | # We could 'apt install devscripts' but it pulls | ||
63 | # in like 50MB of perl deps, possibly nullifying | ||
64 | # the savings from removing unneeded build deps. | ||
65 | |||
66 | # However, we cannot simply use 'apt build-dep' | ||
67 | # because that would use the build-deps from the | ||
68 | # version of the package in the repo, which may | ||
69 | # differ from the source version. | ||
70 | |||
71 | # Arguably we do want to try that though, since | ||
72 | # it's a backport... | ||
73 | |||
74 | if [ "$try_newer_build_deps" ] | ||
75 | then | ||
76 | build_deps=$(get_build_deps) | ||
77 | apt install $build_deps | ||
78 | else | ||
79 | apt build-dep "$TARGET_PKG" | ||
80 | fi | ||
81 | fi | ||
82 | fakeroot ./debian/rules binary | ||
83 | break | ||
84 | done | ||
85 | |||
86 | set -- | ||
87 | for deb in $debs | ||
88 | do | ||
89 | set -- "$@" ../"$deb" | ||
90 | done | ||
91 | apt install "$@" | ||
92 | ) | ||
93 | } | ||
94 | |||
95 | get_build_deps() | ||
96 | { | ||
97 | # credit: Archemar @ https://unix.stackexchange.com/a/648927 | ||
98 | build_deps=$(dpkg-checkbuilddeps 2>&1 | | ||
99 | sed -n -e 's/dpkg-checkbuilddeps:\serror:\sUnmet build dependencies: //gp' \ | ||
100 | -e 's/[\(][^)]*[\)] //g') | ||
101 | } | ||
102 | |||
103 | try_newer_build_deps=y | ||
104 | apt_backport /usr/local/src https://salsa.debian.org/i3-team/i3-wm.git i3-wm | ||
105 | |||