Debian Codegraph @

snap/hooks/install

raw
1 #!/bin/sh -e
2
3 mkdir -p /usr/share/wayland-sessions/ /usr/lib/systemd/user/
4 sed -e s/miriway-session/miriway.session/ "$SNAP"/usr/share/wayland-sessions/miriway.desktop > /usr/share/wayland-sessions/miriway.desktop
5 cp "$SNAP"/usr/lib/systemd/user/miriway-session.target /usr/lib/systemd/user/
6
7 xdg_config=/etc/xdg/xdg-miriway
8
9 miriway_config="${xdg_config}/miriway-shell.config"
10 yambar_config="${xdg_config}/yambar/config.yml"
11
12 ###################################################################
13 # Ensure we have a miriway-shell config file with the fixed options
14 mkdir -p -m 755 "$(dirname "${miriway_config}")"
15
16 cat <<EOT > "${miriway_config}"
17 x11-window-title=Miriway
18 idle-timeout=600
19 app-env-amend=XDG_SESSION_TYPE=wayland:GTK_USE_PORTAL=0:XDG_CURRENT_DESKTOP=Miriway:GTK_A11Y=none
20
21 ctrl-alt=t:miriway-unsnap /snap/${SNAP_INSTANCE_NAME}/current/usr/bin/miriway-terminal
22 shell-component=miriway-background
23 shell-component=yambar --config="${yambar_config}"
24 shell-component=swaync
25 shell-component=/snap/${SNAP_INSTANCE_NAME}/usr/libexec/polkit-mate-authentication-agent-1
26 shell-component=miriway-unsnap /snap/${SNAP_INSTANCE_NAME}/current/usr/bin/synapse --startup
27 shell-meta=a:miriway-unsnap /snap/${SNAP_INSTANCE_NAME}/current/usr/bin/synapse
28
29 meta=Left:@dock-left
30 meta=Right:@dock-right
31 meta=Space:@toggle-maximized
32 meta=Home:@workspace-begin
33 meta=End:@workspace-end
34 meta=Page_Up:@workspace-up
35 meta=Page_Down:@workspace-down
36 ctrl-alt=BackSpace:@exit
37 EOT
38 # Ensure we have a miriway-shell config file with the fixed options
39 ###################################################################
40
41 ###################################################################
42 # Ensure we have a yambar config file with the fixed options
43 mkdir -p -m 755 "$(dirname "${yambar_config}")"
44 cat <<EOT > "${yambar_config}"
45 awesome: &awesome Font Awesome 6 Free:style=solid:pixelsize=14
46 ubuntu: &ubuntu Font Ubuntu 6 Free:style=solid:pixelsize=14
47
48 bar:
49 location: top
50 height: 21
51 background: 282828ff
52 font: *ubuntu
53
54 left:
55 - label:
56 content:
57 string:
58 text: " start"
59 margin: 5
60 on-click: miriway-unsnap /snap/${SNAP_INSTANCE_NAME}/current/usr/bin/synapse
61 deco: &greybg
62 background:
63 color: 3f3f3fff
64
65 center:
66 - clock:
67 content:
68 - string:
69 margin: 5
70 text: "{date} {time}"
71 deco: *greybg
72
73 right:
74 EOT
75
76 for wificard in /sys/class/net/wl*
77 do cat <<EOT >> "${yambar_config}"
78 - network:
79 name: $(basename "$wificard")
80 content:
81 map:
82 deco: *greybg
83 margin: 5
84 default: {string: {text: , font: *awesome}}
85 conditions:
86 state == down: {string: {text: , font: *awesome}}
87 state == up:
88 map:
89 default:
90 - string: {text: , font: *awesome, deco: *greybg}
91 # - string: {text: "{ssid} {dl-speed:mb}/{ul-speed:mb} Mb/s" }
92
93 conditions:
94 ipv4 == "":
95 - string: {text: , font: *awesome}
96 # - string: {text: "{ssid} {dl-speed:mb}/{ul-speed:mb} Mb/s"}
97 EOT
98 done
99
100 for battery in /sys/class/power_supply/BAT*
101 do cat <<EOT >> "${yambar_config}"
102 - battery:
103 name: $(basename "$battery")
104 anchors:
105 discharging: &discharging
106 list:
107 items:
108 - ramp:
109 tag: capacity
110 items:
111 - string: {text: , foreground: ff0000ff, font: *awesome}
112 - string: {text: , foreground: ffa600ff, font: *awesome}
113 - string: {text: , font: *awesome}
114 - string: {text: , font: *awesome}
115 - string: {text: , font: *awesome}
116 - string: {text: , font: *awesome}
117 - string: {text: , font: *awesome}
118 - string: {text: , font: *awesome}
119 - string: {text: , font: *awesome}
120 - string: {text: , foreground: 00ff00ff, font: *awesome}
121 - string: {text: "{capacity}% {estimate}"}
122 content:
123 map:
124 deco: *greybg
125 margin: 5
126 conditions:
127 state == unknown:
128 <<: *discharging
129 state == discharging:
130 <<: *discharging
131 state == charging:
132 - string: {text: , foreground: 00ff00ff, font: *awesome}
133 - string: {text: "{capacity}% {estimate}"}
134 state == full:
135 - string: {text: , foreground: 00ff00ff, font: *awesome}
136 - string: {text: "{capacity}% full"}
137 state == "not charging":
138 - ramp:
139 tag: capacity
140 items:
141 - string: {text:  , foreground: ff0000ff, font: *awesome}
142 - string: {text:  , foreground: ffa600ff, font: *awesome}
143 - string: {text:  , foreground: 00ff00ff, font: *awesome}
144 - string: {text:  , foreground: 00ff00ff, font: *awesome}
145 - string: {text:  , foreground: 00ff00ff, font: *awesome}
146 - string: {text:  , foreground: 00ff00ff, font: *awesome}
147 - string: {text:  , foreground: 00ff00ff, font: *awesome}
148 - string: {text:  , foreground: 00ff00ff, font: *awesome}
149 - string: {text:  , foreground: 00ff00ff, font: *awesome}
150 - string: {text:  , foreground: 00ff00ff, font: *awesome}
151 - string: {text: "{capacity}%"}
152 EOT
153 done
154 # Ensure we have a yambar config file with the fixed options
155 ###################################################################