Skip to content

Commit

Permalink
adding some thunar fixes and ajusting hyprland config
Browse files Browse the repository at this point in the history
  • Loading branch information
Heus-Sueh committed Sep 2, 2024
1 parent a72fca6 commit 4772ff0
Show file tree
Hide file tree
Showing 18 changed files with 141 additions and 968 deletions.
53 changes: 53 additions & 0 deletions files/scripts/firstboot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env bash
set -euo pipefail

# File to indicate that the script has already run
FIRSTBOOT_FILE="$HOME/.config/firstboot/firstboot_done"

# Function to generate a hash and write it to the firstboot file
generate_hash() {
# Create a unique hash based on the current timestamp and a random number
local hash
hash=$(echo "$(date +%s) $RANDOM" | sha256sum | cut -d' ' -f1)
echo "Hash: $hash" >"$FIRSTBOOT_FILE"
}

# Function to run modular commands and scripts
run_modules() {
# Add your commands and scripts here that you want to run on the first boot

# Example commands
echo "Setting up the environment..."
# Command to install packages, update the system, etc.
# sudo apt update && sudo apt upgrade -y

echo "Running theme setup script..."
# Example of running an external script
sudo flatpak override --filesystem=xdg-data/themes
sudo flatpak override --filesystem=xdg-data/icons
sudo flatpak override --filesystem=xdg-config/gtk-3.0
sudo flatpak override --filesystem=xdg-config/gtk-4.0
sudo flatpak override --filesystem=xdg-config/Kvantum
# ./setup_theme.sh

echo "Initial setup completed!"
}

# Check if the script has already run
if [[ ! -f "$FIRSTBOOT_FILE" ]]; then
echo "First boot detected. Running setup script..."
run_modules

# Create the file to indicate that the script has run
touch "$FIRSTBOOT_FILE"

# Generate and store the hash in the firstboot file
generate_hash

# Disable the systemd service after successful execution
echo "Disabling firstboot systemd service..."
sudo systemctl disable firstboot.service

else
echo "First boot script has already run. Nothing to do."
fi
5 changes: 5 additions & 0 deletions files/scripts/xdg-terminal-exec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail

curl -sSL https://raw.githubusercontent.com/Vladimir-csp/xdg-terminal-exec/master/xdg-terminal-exec -o /usr/bin/xdg-terminal-exec
chmod +x /usr/bin/xdg-terminal-exec
7 changes: 4 additions & 3 deletions files/system/etc/skel/.config/hypr/env.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env = XDG_SESSION_DESKTOP,Hyprland
# Use Wayland
env = CLUTTER_BACKEND,wayland
env = GDK_BACKEND,wayland,x11
env = QT_QPA_PLATFORM, wayland;xcb
env = QT_QPA_PLATFORM,wayland;xcb
env = ELECTRON_OZONE_PLATFORM_HINT,auto
env = MOZ_ENABLE_WAYLAND,1

Expand All @@ -15,13 +15,14 @@ env = WLR_RENDERER,vulkan

# Themes
env = GTK_THEME,adw-gtk3-dark
env = QT_QPA_PLATFORMTHEME, qt5ct
env = QT_WAYLAND_DISABLE_WINDOWDECORATION, 1
# env = QT_QPA_PLATFORMTHEME,qt5ct
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
env = QT_AUTO_SCREEN_SCALE_FACTOR,1
env = QT_STYLE_OVERRIDE,kvantum

# NVIDIA Fixes
# env = LIBVA_DRIVER_NAME,nvidia
# env = GBM_BACKEND,nvidia-drm
# env = __GLX_VENDOR_LIBRARY_NAME,nvidia
# env = __NV_PRIME_RENDER_OFFLOAD,1
# env = NVD_BACKEND,direct
13 changes: 6 additions & 7 deletions files/system/etc/skel/.config/hypr/exec.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ exec-once = /usr/libexec/xdg-desktop-portal-hyprland
exec-once = /usr/libexec/xdg-desktop-portal-gtk
exec-once = /usr/libexec/xdg-desktop-portal
exec-once = /usr/libexec/xfce-polkit
exec-once = exec /usr/libexec/pam_kwallet_init
exec-once = dbus-update-activation-environment --all
exec-once = /usr/bin/gnome-keyring-daemon --start --components=secrets

Expand All @@ -13,19 +12,19 @@ exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESK
exec-once = fcitx5
exec-once = waybar & dunst & nm-applet
exec-once = hypridle
# exec-once = hyprpaper
exec-once = swww-daemon
exec-once = hyprpaper
# exec-once = swww-daemon

# Clipboard: history
exec-once = wl-paste --type text --watch cliphist store
exec-once = wl-paste --type image --watch cliphist store

# Theme
$interface = org.gnome.desktop.interface
$wm-preferences = org.gnome.desktop.wm.preferences

exec-once = gsettings set $interface gtk-theme 'adw-gtk3-dark'
exec-once = gsettings set $wm-preferences 'adw-gtk3-dark'
exec-once = gsettings set $interface color-scheme 'prefer-dark'
exec-once = gsettings set $wm-preferences theme 'adw-gtk3-dark'
exec-once = gsettings set $interface gtk-theme 'adw-gtk3-dark'
exec-once = gsettings set $interface font-name 'Inter Variable 11'
# exec-once gsettings set $interface icon-theme 'Papirus-Dark'
exec-once = gsettings set $interface icon-theme 'Papirus-Dark'

18 changes: 13 additions & 5 deletions files/system/etc/skel/.config/hypr/keybinds.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
$hypr_scripts = $HOME/.config/hypr/scripts

$mainMod = SUPER
$files = nautilus
$term = alacritty
$files = thunar
$term = kitty
$launcher = rofi -show drun -theme ~/.config/rofi/launcher-fullscreen.rasi
$powermenu = wlogout
$grislurp = $hypr_scripts/grislurp
$screenshot = $hypr_scripts/screenshot.sh
$wallpaper-selector = $hypr_scripts/wallpaper_selector.sh

# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod SHIFT, r, exec, hyprctl reload
Expand Down Expand Up @@ -63,12 +64,12 @@ bind = $mainMod, D, exec, $launcher
bind = $mainMod CTRL, Backspace, exec, hyprlock
bind = $mainMod, Y, exec, killall -SIGUSR1 waybar
bind = $mainMod, Backspace, exec, $powermenu
bind = $mainMod ALT, T, exec, $wallpaper-selector

# Screenshot
bind = , Print, exec, $screenshot

bind = , CTRL Print, exec, $grislurp copy area
bind = , SHIFT Print, exec, $grislurp savecopy screen
bind = CTRL, Print, exec, $grislurp copy area
bind = SHIFT, Print, exec, $grislurp savecopy screen

#-------------#
# Numpad Keys #
Expand Down Expand Up @@ -173,6 +174,13 @@ bind = , XF86MonBrightnessDown, exec, $lower_brightness
bind = , xf86KbdBrightnessUp, exec, brightnessctl -d *::kbd_backlight set +33%
bind = , xf86KbdBrightnessDown, exec, brightnessctl -d *::kbd_backlight set 33%-

# --------------- #
# Global Keybinds #
# --------------- #

bind = CTRL SHIFT, M, pass, ^(xyz\.armcord\.ArmCord)$
bind = SUPER, F10, pass, ^(com\.obsproject\.Studio)$

# ------------- #
# Miscellaneous #
# ------------- #
Expand Down
2 changes: 2 additions & 0 deletions files/system/etc/skel/.config/hypr/rules.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ windowrule = center, title:^(Save As)(.*)$
windowrule = center, title:^(Library)(.*)$
windowrule = center, title:^(File Upload)(.*)$
windowrule = center, title:^(Authentication required)(.*)$
windowrule = center, title:^(Confirm to replace files)(.*)$

# Dialogs
windowrule = float, title:^(Open File)(.*)$
Expand All @@ -20,6 +21,7 @@ windowrule = float, title:^(Save As)(.*)$
windowrule = float, title:^(Library)(.*)$
windowrule = float, title:^(File Upload)(.*)$
windowrule = float, title:^(Authentication required)(.*)$
windowrule = float, title:^(Confirm to replace files)(.*)$
# fix for rofi xwayland
windowrule = float, title:^(rofi)(.*)$
windowrule = noborder, title:^(rofi)(.*)$
Expand Down
42 changes: 42 additions & 0 deletions files/system/etc/skel/.config/thunar/uca.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<icon>utilities-terminal</icon>
<name>Open Terminal Here</name>
<submenu></submenu>
<unique-id>1708198417972650-1</unique-id>
<command>kitty</command>
<description>Open the terminal in this directory</description>
<range></range>
<patterns>*</patterns>
<startup-notify/>
<directories/>
</action>
<action>
<icon>thunar</icon>
<name>Open Thunar as a root </name>
<submenu></submenu>
<unique-id>1725291435347888-1</unique-id>
<command>pkexec thunar %F</command>
<description></description>
<range>*</range>
<patterns>*</patterns>
<directories/>
</action>
<action>
<icon>inode-symlink</icon>
<name>Create a Link</name>
<submenu></submenu>
<unique-id>1725291634393236-2</unique-id>
<command>ln -s %f &apos;Link to %n&apos;</command>
<description>Create a symLink</description>
<range>*</range>
<patterns>*</patterns>
<directories/>
<audio-files/>
<image-files/>
<other-files/>
<text-files/>
<video-files/>
</action>
</actions>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Context]
filesystems=~/.local/share/applications;~/.local/share/icons
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Context]
sockets=wayland;
filesystems=xdg-run/podman;
Loading

0 comments on commit 4772ff0

Please sign in to comment.