feat: typora

This commit is contained in:
Klesh Wong 2022-05-15 14:08:26 +08:00
parent 92fa72c0e1
commit 4e9b0a87dc
8 changed files with 27 additions and 113 deletions

View File

@ -16,6 +16,4 @@ $2 == "connected" && $3 == "primary" {
}
' | xrdb -merge
systemctl --user restart dunst
nitrogen --restore

View File

@ -68,8 +68,8 @@ beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
beautiful.useless_gap = 5
beautiful.border_width = 3
beautiful.border_focus = "#5b97f7"
beautiful.wallpaper = ""
beautiful.font_name = "agave Nerd Font Mono"
beautiful.wallpaper = "/home/klesh/Nextcloud/wallpapers/great-pretender.jpg"
beautiful.font = "agave Nerd Font 12"
beautiful.notification_width = 400
beautiful.notification_shape = rrect
@ -516,7 +516,7 @@ globalkeys = gears.table.join(
-- Launcher
--awful.key({ modkey }, "p", function() awful.spawn.with_shell("dmenu_launcher") end,
-- {description = "dmenu launcher", group = "launcher"}),
awful.key({ modkey }, "p", function() awful.spawn.with_shell("rofi -show combi") end,
awful.key({ modkey }, "p", function() awful.spawn.with_shell("rofi -show combi -combi-modi drun,window,run") end,
{description = "rofi", group = "launcher"}),
-- Bookmark
@ -838,5 +838,6 @@ awful.spawn.with_shell("flameshot")
awful.spawn.with_shell("mpd")
awful.spawn.with_shell("blueman-applet")
awful.spawn.with_shell("nm-applet")
awful.spawn.with_shell("autorandr --change --force")
-- }}}

View File

@ -47,7 +47,6 @@ case "$UNAMEA" in
sudo pacman -S --noconfirm --needed \
xorg-server xorg-xinit xorg-xrandr xorg-xprop xorg-xev xdotool \
pipewire pipewire-pulse pipewire-jack pavucontrol \
arandr \
xclip xsel \
clang \
ibus ibus-rime rime-wubi \
@ -78,7 +77,8 @@ case "$UNAMEA" in
# laptop
if is_laptop; then
sudo pacman -S --noconfirm --needed \
acpi acpilight python-pip
arandr autorandr \
acpi light python-pip
yay -S --needed --noconfirm auto-cpufreq-git
sudo mkdir -p /etc/runit/sv/auto-cpufreq
sudo cp $DIR/auto-cpufreq/auto-cpufreq-runit /etc/runit/sv/auto-cpufreq/run
@ -90,6 +90,7 @@ esac
# configuration
lnsf "$DIR/autorandr/postswitch" "$XDG_CONFIG_HOME/autorandr/postswitch"
lnsf "$DIR/thunar/uca.xml" "$XDG_CONFIG_HOME/Thunar/uca.xml"
lnsf "$DIR/alacritty/alacritty.yml" "$XDG_CONFIG_HOME/alacritty/alacritty.yml"

View File

@ -14,6 +14,9 @@ configuration{
display-window: " 﩯 window";
display-Network: " 󰤨 Network";
sidebar-mode: true;
drun {
parse-user: true;
}
}
@theme "catppuccin"

View File

@ -69,4 +69,3 @@ EOT
# config dwm
mkdir -p "$XDG_CONFIG_HOME/dwm"
lnsf "$DIR/dwm/autostart" "$XDG_CONFIG_HOME/dwm/autostart"
lnsf "$DIR/autorandr/postswitch" "$XDG_CONFIG_HOME/autorandr/postswitch"

View File

@ -1,106 +0,0 @@
#!/bin/sh
set -e
DIR=$(dirname "$(readlink -f "$0")")
. "$DIR/../env.sh"
log 'Setting up system utilities X11 ime keyring clipboard screenshot filemanager network bluetooth'
case "$UNAMEA" in
*Ubuntu*)
sudo apt install -y \
xorg libx11-dev libxft-dev libxinerama-dev libxcursor-dev \
libxrandr-dev arandr autorandr \
pavucontrol \
ibus ibus-table ibus-table-wubi \
gnome-keyring \
xss-lock \
nitrogen \
network-manager network-manager-gnome \
exfat-utils \
dunst \
xclip xsel \
xdotool \
libnotify-bin \
flameshot scrot \
thunar gvfs-bin gvfs-backends thunar-archive-plugin file-roller tumbler
# desktop notification
lnsf "$DIR/dunst/dunstrc" "$XDG_CONFIG_HOME/dunst/dunstrc"
# network
sudo systemctl start NetworkManager
# bluetooth
if has_bluetooth; then
sudo apt install \
bluez bluez-tools blueman pulseaudio-module-bluetooth
sudo systemctl enable bluetooth
sudo systemctl start bluetooth
fi
# laptop
if is_laptop; then
sudo apt install \
acpilght tlp
sudo systemctl enable autorandr
sudo systemctl start autorandr
fi
;;
*artix*)
sudo pacman -S --noconfirm --needed \
xorg-server xorg-xinit xorg-xrandr xorg-xprop xorg-xev xdotool \
pipewire pipewire-pulse pipewire-jack pavucontrol \
arandr \
xclip xsel \
clang \
ibus ibus-rime rime-wubi \
networkmanager network-manager-applet \
exfat-utils \
gnome-keyring libsecret \
thunar gvfs-smb gvfs-mtp thunar-archive-plugin file-roller tumbler \
alacritty
# ntp
sudo pacman -S --noconfirm --needed \
chrony chrony-runit
sudo ln -sf /etc/runit/sv/chrony/ /run/runit/service/
# ime
RIME_CFG="$XDG_CONFIG_HOME/ibus/rime/build/default.yaml"
if ! grep -F "wubi86" "$RIME_CFG"; then
sed -i 's/schema_list:/schema_list:\n - schema: wubi86/' "$RIME_CFG"
fi
# bluetooth
if has_bluetooth; then
sudo pacman -S --noconfirm --needed \
bluez bluez-utils blueman
# bluetoothctl devices
# bluetoothctl pair <ADDR>
# bluetoothctl trust <ADDR>
# bluetoothctl connect <ADDR>
sudo ln -sf /etc/runit/sv/bluetoothd /run/runit/service/
fi
# laptop
if is_laptop; then
sudo pacman -S --noconfirm --needed \
acpi light python-pip
yay -S auto-cpufreq-git
sudo mkdir -p /etc/runit/sv/auto-cpufreq
sudo cp ./auto-cpufreq/auto-cpufreq-runit /etc/runit/sv/auto-cpufreq/run
sudo chmod +x /etc/runit/sv/auto-cpufreq/run
sudo ln -s /etc/runit/sv/auto-cpufreq/ /run/runit/service/
fi
;;
esac
# configuration
lnsf "$DIR/thunar/uca.xml" "$XDG_CONFIG_HOME/Thunar/uca.xml"
lnsf "$DIR/alacritty/alacritty.yml" "$XDG_CONFIG_HOME/alacritty/alacritty.yml"
if is_laptop; then
echo for non-root user to change backlight, add following rule to /etc/udev/rules.d/backlight.rules
echo ```
echo ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", GROUP="video", MODE="0664"
echo ```
echo for intel_backlight:
echo ```
echo RUN+="/bin/chgrp video /sys/class/backlight/intel_backlight/brightness"
echo RUN+="/bin/chmod g+w /sys/class/backlight/intel_backlight/brightness"
echo ```
fi

7
gui/typora.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
DIR=$(dirname "$(readlink -f "$0")")
. "$DIR/../env.sh"
log 'Setting up typora'
lnsf "$DIR/typora/typora.desktop" ~/.local/share/applications/typora.desktop

11
gui/typora/typora.desktop Normal file
View File

@ -0,0 +1,11 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=Typora
Icon=/home/klesh/Programs/Typora-linux-x64/resources/assets/icon/icon_128x128.png
Exec=/home/klesh/Programs/Typora-linux-x64/Typora %f
Comment=Minimal markdown md editor
Categories=Office;TextEditor;Utility
Terminal=false
MimeType=text/markdown
X-Desktop-File-Install-Version=0.26