Compare commits
3 Commits
2e108ba613
...
869ebd595c
| Author | SHA1 | Date | |
|---|---|---|---|
|
869ebd595c
|
|||
|
1946b362e8
|
|||
|
461888cff1
|
10
dwl.service
10
dwl.service
@@ -35,15 +35,15 @@ After=graphical-session-pre.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
Environment=XDG_RUNTIME_DIR=%I
|
||||
Environment=DWL_TAGS_FILE=%I/dwl.tags
|
||||
Environment=DWL_LOG_FILE=%I/dwl.log
|
||||
Environment=XDG_RUNTIME_DIR=%t
|
||||
Environment=DWL_TAGS_FILE=%t/dwl.tags
|
||||
Environment=DWL_LOG_FILE=%t/dwl.log
|
||||
Environment=DWLTAGS_FMT=DZEN
|
||||
Environment=XDG_CURRENT_DESKTOP=DWL
|
||||
Environment=XKB_DEFAULT_VARIANT=altgr-intl
|
||||
Environment=XKB_DEFAULT_OPTIONS=caps:escape,compose:rctrl
|
||||
Environment=PIPEWIRE_RUNTIME_DIR=/run/user/501
|
||||
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/501/bus
|
||||
Environment=PIPEWIRE_RUNTIME_DIR=%t
|
||||
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=%t/bus
|
||||
ExecStart=%h/bin/dwl.session
|
||||
Restart=on-failure
|
||||
RestartSec=1
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export $(dbus-launch)
|
||||
|
||||
echo $XDG_RUNTIME_DIR used for Wayland session
|
||||
export WLR_LIBINPUT_NO_DEVICES=1
|
||||
|
||||
export DWL_PATH=/usr/local/bin
|
||||
# export DWL_PATH=/home/mahesh/git/furnish/heshapps_dwl
|
||||
# export DWL_PATH=/home/mahesh/git/heshapps_codeberg_dwl
|
||||
export DWL_BAR_PATH=/usr/local/bin
|
||||
# export DWL_BAR_PATH=/home/mahesh/git/somebar_20240217/build
|
||||
export DWL_BAR=$DWL_BAR_PATH/somebar
|
||||
|
||||
16
dwl.start
16
dwl.start
@@ -1,17 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Start DWL
|
||||
RUNTIME_DIR=$(mktemp --directory --suffix=.${USER})
|
||||
RUNTIME_DIR=$(mktemp --dry-run --suffix=.${USER})
|
||||
|
||||
# Escape slashes in the path
|
||||
SNAME=$(systemd-escape ${RUNTIME_DIR}.service)
|
||||
|
||||
# SNAME=$(systemd-escape $(basename ${RUNTIME_DIR}).service)
|
||||
SNAME=${USER}_${XDG_VTNR}
|
||||
export XDG_SESSION_CLASS=user
|
||||
echo "#################"
|
||||
echo "$XDG_RUNTIME_DIR"
|
||||
echo "#################"
|
||||
# Start service blocking. Remove runtime directory upon completion.
|
||||
# Be sure to import XDG session variables for graphical-session to work
|
||||
systemctl --user import-environment XDG_SEAT && \
|
||||
systemctl --user import-environment XDG_SESSION_TYPE && \
|
||||
systemctl --user import-environment XDG_SESSION_CLASS && \
|
||||
systemctl --user import-environment XDG_VTNR && \
|
||||
systemctl --user import-environment XDG_RUNTIME_DIR && \
|
||||
systemctl --user import-environment XDG_SESSION_ID && \
|
||||
systemctl --wait --user start dwl@${SNAME} && \
|
||||
rm -rf ${RUNTIME_DIR}
|
||||
systemctl --wait --user start dwl@${SNAME}
|
||||
# && \
|
||||
# rm -rf ${RUNTIME_DIR}
|
||||
|
||||
@@ -8,5 +8,5 @@ mkfifo $SOMEBAR_INST_FIFO -m666
|
||||
# conky -c ~/.conkyrc > $SOMEBAR_INST_FIFO &
|
||||
nohup unibar --music-progress > $SOMEBAR_INST_FIFO &
|
||||
|
||||
$DWL_BAR -s $SOMEBAR_INST_FIFO > $SOMEBAR_INST_FIFO.log 2>&1
|
||||
dbus-launch --exit-with-session -- $DWL_BAR -s $SOMEBAR_INST_FIFO > $SOMEBAR_INST_FIFO.log 2>&1
|
||||
|
||||
|
||||
@@ -16,9 +16,12 @@ vim.opt.rtp:prepend(lazypath)
|
||||
require("lazy").setup({
|
||||
-- Config
|
||||
defaults = {
|
||||
lazy = true
|
||||
lazy = true,
|
||||
},
|
||||
rocks = {
|
||||
-- Currently no plugin requires luarocks
|
||||
enabled = false,
|
||||
},
|
||||
|
||||
-- Packages
|
||||
"asolkar/vim-color-molokini",
|
||||
"navarasu/onedark.nvim",
|
||||
@@ -95,7 +98,7 @@ require("copilot").setup({
|
||||
-- Treesitter
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all" (the listed parsers MUST always be installed)
|
||||
ensure_installed = { "comment", "perl", "ruby", "verilog", "verilog", "rust" },
|
||||
ensure_installed = { "comment", "perl", "ruby", "verilog", "rust" },
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
@@ -220,6 +223,10 @@ if vim.g.neovide then
|
||||
vim.g.neovide_scale_factor = 1.0
|
||||
end
|
||||
|
||||
-- -- Dependencies
|
||||
-- -- * Currently no plugin requires luarocks
|
||||
-- opts.rocks.hererocks = false
|
||||
|
||||
-- Set highlight on search
|
||||
vim.o.hlsearch = true
|
||||
|
||||
|
||||
158
rofi_menu.pl
Executable file
158
rofi_menu.pl
Executable file
@@ -0,0 +1,158 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Data::Dumper;
|
||||
|
||||
# Launch this with 'rofi' with something like this:
|
||||
#
|
||||
# % rofi -show Select -modes "Select:~/bin/rofi_menu.pl"
|
||||
|
||||
my $selection = $ARGV[0];
|
||||
|
||||
my $app = {};
|
||||
|
||||
if (defined $selection) {
|
||||
select_option($app, $selection);
|
||||
} else {
|
||||
show_options($app);
|
||||
}
|
||||
|
||||
# -----------
|
||||
# Subroutines
|
||||
# -----------
|
||||
sub show_options {
|
||||
my ($app) = @_;
|
||||
|
||||
my @categories = qw(Apps Tools Settings);
|
||||
print join ("\n", @categories);
|
||||
}
|
||||
|
||||
# -----------
|
||||
sub select_option {
|
||||
my ($app, $selection) = @_;
|
||||
|
||||
warn "Selected: $selection\n";
|
||||
|
||||
if ($selection eq 'Apps') {
|
||||
show_apps($app);
|
||||
} elsif ($selection eq 'Tools') {
|
||||
show_tools($app);
|
||||
} elsif ($selection eq 'Settings') {
|
||||
show_settings($app);
|
||||
} elsif (my ($sub_app) = $selection =~ /^Apps:(.*)/) {
|
||||
app_launch($app, $sub_app);
|
||||
} elsif (my ($sub_tool) = $selection =~ /^Tools:(.*)/) {
|
||||
tool_launch($app, $sub_tool);
|
||||
} elsif (my ($sub_setting) = $selection =~ /^Settings:(.*)/) {
|
||||
setting_launch($app, $sub_setting);
|
||||
}
|
||||
}
|
||||
|
||||
# -----------
|
||||
sub show_apps {
|
||||
my ($app) = @_;
|
||||
my @apps = qw(Gimp VSCode Antigravity Chrome);
|
||||
|
||||
print join ("\n", map { "Apps:$_" } @apps);
|
||||
}
|
||||
|
||||
# -----------
|
||||
sub show_tools {
|
||||
my ($app) = @_;
|
||||
my @apps = qw(Neovide Wezterm Calculator Audio);
|
||||
|
||||
print join ("\n", map { "Tools:$_" } @apps);
|
||||
}
|
||||
|
||||
# -----------
|
||||
sub show_settings {
|
||||
my ($app) = @_;
|
||||
my @apps = qw(Neovim Ghostty Git MPD ncmpcpp);
|
||||
|
||||
print join ("\n", map { "Settings:$_" } @apps);
|
||||
}
|
||||
|
||||
# -----------
|
||||
sub app_launch {
|
||||
my ($app, $sub_app) = @_;
|
||||
|
||||
if ($sub_app eq "Gimp") {
|
||||
launch_program($app, '/usr/bin/gimp');
|
||||
} elsif ($sub_app eq "Antigravity") {
|
||||
launch_program($app, '~/bin/dwl_antigravity');
|
||||
} elsif ($sub_app eq "VSCode") {
|
||||
launch_program($app, '/opt/vscode/VSCode-linux-x64/code',
|
||||
'--enable-features=UseOzonePlatform,WaylandWindowDecorations',
|
||||
'--ozone-platform-hint=auto',
|
||||
'--unity-launch');
|
||||
} elsif ($sub_app eq "Chrome") {
|
||||
launch_program($app, 'chromium',
|
||||
'--enable-features=UseOzonePlatform,WaylandWindowDecorations',
|
||||
'--ozone-platform=wayland',
|
||||
'--ozone-platform-hint=auto',
|
||||
'--unity-launch');
|
||||
}
|
||||
}
|
||||
|
||||
# -----------
|
||||
sub tool_launch {
|
||||
my ($app, $sub_tool) = @_;
|
||||
|
||||
if ($sub_tool eq "Neovide") {
|
||||
launch_program($app, 'neovide', '--fork');
|
||||
} elsif ($sub_tool eq "Wezterm") {
|
||||
launch_program($app, 'wezterm');
|
||||
} elsif ($sub_tool eq "Calculator") {
|
||||
launch_program($app, 'gnome-calculator');
|
||||
} elsif ($sub_tool eq "Audio") {
|
||||
launch_program($app, 'rofi', '-show', 'menu',
|
||||
'-modes', 'menu:~/bin/rofi_sound.pl');
|
||||
}
|
||||
}
|
||||
|
||||
# -----------
|
||||
sub setting_launch {
|
||||
my ($app, $sub_setting) = @_;
|
||||
|
||||
if ($sub_setting eq "Neovim") {
|
||||
launch_program($app, 'neovide', '--fork', '~/.config/nvim/init.lua');
|
||||
} elsif ($sub_setting eq "Ghostty") {
|
||||
launch_program($app, 'neovide', '--fork', '~/.config/ghostty/config');
|
||||
} elsif ($sub_setting eq "Git") {
|
||||
launch_program($app, 'neovide', '--fork', '~/.gitconfig');
|
||||
} elsif ($sub_setting eq "MPD") {
|
||||
launch_program($app, 'neovide', '--fork', '~/.config/mpd/mpd.conf');
|
||||
} elsif ($sub_setting eq "ncmpcpp") {
|
||||
launch_program($app, 'neovide', '--fork', '~/.config/ncmpcpp/config');
|
||||
}
|
||||
}
|
||||
|
||||
# -----------
|
||||
sub launch_program {
|
||||
my ($app, @program) = @_;
|
||||
|
||||
my $prog = join(' ', @program);
|
||||
system("nohup $prog > /dev/null 2>&1 &");
|
||||
|
||||
exit(0);
|
||||
|
||||
# my $pid = fork();
|
||||
|
||||
# die "launch_program: couldn't fork: $!" unless defined $pid;
|
||||
|
||||
# if ($pid == 0) {
|
||||
# # Child process
|
||||
# # Detach from the parent process's session to survive terminal closure
|
||||
# # (optional but recommended for complete daemonization)
|
||||
# # Use 'setsid()' if available/needed. A simple exit of the parent may suffice.
|
||||
|
||||
# # Execute the new program in place of the child process
|
||||
# exec(@program) or die "Couldn't exec your program: $!";
|
||||
# } else {
|
||||
# # Parent process
|
||||
# print "Launched child process with PID $pid\n";
|
||||
# # Parent can do other things here, or simply exit
|
||||
# exit(0); # Exit the parent script
|
||||
# }
|
||||
}
|
||||
Reference in New Issue
Block a user