summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDebian Live user <user@debian-BULLSEYE-live-builder-AMD64>2023-04-28 17:02:20 -0400
committerDebian Live user <user@debian-BULLSEYE-live-builder-AMD64>2023-04-28 17:33:42 -0400
commit7e183e38d8ac3d0fc0d5ab257b63771e5badaa31 (patch)
treef006478d09ae4ec788a97d4c08e8a5e5bbe7b10b
parent49b42e352dae1eac7499090db68e5f18ebe75c8b (diff)
package installer that auto-backports i3-wm
-rw-r--r--Makefile8
-rw-r--r--dot/config/i3/config178
-rw-r--r--eschew-unstable.pref8
-rw-r--r--install-packages.bash105
4 files changed, 299 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 0d6259b..b8bea18 100644
--- a/Makefile
+++ b/Makefile
@@ -47,6 +47,14 @@ endif
47 47
48install: $(DESTINATIONS) 48install: $(DESTINATIONS)
49 49
50install-packages:
51ifeq ($(shell id -u),0)
52 install -m0644 eschew-unstable.pref /etc/apt/preferences.d/
53 bash install-packages.bash
54else
55 sudo -- $(MAKE) -$(MAKEFLAGS) $@
56endif
57
50simulate-install: 58simulate-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
4set $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).
9hide_edge_borders smart_no_gaps
10smart_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.
14font 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.
25exec --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.
29exec --no-startup-id nm-applet
30
31# Use pactl to adjust volume in PulseAudio.
32set $refresh_i3status killall -SIGUSR1 i3status
33bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
34bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
35bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
36bindsym 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
39floating_modifier $mod
40
41# start a terminal
42bindsym $mod+Return exec i3-sensible-terminal
43
44# kill focused window
45bindsym $mod+Shift+q kill
46bindsym $mod+Shift+c kill
47
48# start dmenu (a program launcher)
49bindsym $mod+d exec --no-startup-id dmenu_run
50bindsym $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.
59bindsym $mod+h focus left
60bindsym $mod+j focus down
61bindsym $mod+k focus up
62bindsym $mod+l focus right
63
64# alternatively, you can use the cursor keys:
65bindsym $mod+Left focus left
66bindsym $mod+Down focus down
67bindsym $mod+Up focus up
68bindsym $mod+Right focus right
69
70# move focused window
71bindsym $mod+Shift+h move left
72bindsym $mod+Shift+j move down
73bindsym $mod+Shift+k move up
74bindsym $mod+Shift+l move right
75
76# alternatively, you can use the cursor keys:
77bindsym $mod+Shift+Left move left
78bindsym $mod+Shift+Down move down
79bindsym $mod+Shift+Up move up
80bindsym $mod+Shift+Right move right
81
82# enter fullscreen mode for the focused container
83bindsym $mod+f fullscreen toggle
84
85# change container layout (stacked, tabbed, toggle split)
86bindsym $mod+s layout stacking
87bindsym $mod+w layout tabbed
88bindsym $mod+e layout toggle split
89
90# toggle tiling / floating
91bindsym $mod+t floating toggle
92
93# change focus between tiling / floating windows
94bindsym $mod+Shift+space fullscreen toggle
95bindsym $mod+space layout toggle stacking tabbed splitv splith
96
97# focus the parent container
98bindsym $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.
105set $ws1 "1"
106set $ws2 "2"
107set $ws3 "3"
108set $ws4 "4"
109set $ws5 "5"
110set $ws6 "6"
111set $ws7 "7"
112set $ws8 "8"
113set $ws9 "9"
114set $ws10 "10"
115
116# switch to workspace
117bindsym $mod+1 workspace number $ws1
118bindsym $mod+2 workspace number $ws2
119bindsym $mod+3 workspace number $ws3
120bindsym $mod+4 workspace number $ws4
121bindsym $mod+5 workspace number $ws5
122bindsym $mod+6 workspace number $ws6
123bindsym $mod+7 workspace number $ws7
124bindsym $mod+8 workspace number $ws8
125bindsym $mod+9 workspace number $ws9
126bindsym $mod+0 workspace number $ws10
127
128# move focused container to workspace
129bindsym $mod+Shift+1 move container to workspace number $ws1
130bindsym $mod+Shift+2 move container to workspace number $ws2
131bindsym $mod+Shift+3 move container to workspace number $ws3
132bindsym $mod+Shift+4 move container to workspace number $ws4
133bindsym $mod+Shift+5 move container to workspace number $ws5
134bindsym $mod+Shift+6 move container to workspace number $ws6
135bindsym $mod+Shift+7 move container to workspace number $ws7
136bindsym $mod+Shift+8 move container to workspace number $ws8
137bindsym $mod+Shift+9 move container to workspace number $ws9
138bindsym $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)
143bindsym $mod+Shift+r restart
144# exit i3 (logs you out of your X session)
145bindsym $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)
148mode "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
172bindsym $mod+r mode "resize"
173
174# Start i3bar to display a workspace bar (plus the system information i3status
175# finds out, if available)
176bar {
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
3Package: *
4Pin: release a=unstable
5Pin-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
2set -e
3
4apt()
5{
6 (set -x; command apt "$@")
7}
8
9[ "$(id -u)" = 0 ] || exec sudo bash "$0" "$@"
10
11basics='etckeeper git par ssh tmux vim w3m'
12#xorg='xorg xterm i3'
13xorg='xorg xterm'
14media='libdbus-glib-1-2 mpv pulseaudio'
15apt install --no-upgrade $basics $xorg $media
16
17apt_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
95get_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
103try_newer_build_deps=y
104apt_backport /usr/local/src https://salsa.debian.org/i3-team/i3-wm.git i3-wm
105