Xmonad run script on startup

inxi -Faz
System:    Kernel: 5.14.7-zen1-1-zen x86_64 bits: 64 compiler: gcc v: 11.1.0
           parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen root=UUID=37d276fe-853f-4e5b-b53d-a0d7d9cbb872 rw
           [email protected] rd.udev.log_priority=3 vt.global_cursor_default=0 systemd.unified_cgroup_hierarchy=1 loglevel=3
           splash
           Desktop: N/A vt: 1 dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:   Type: Laptop System: TOSHIBA product: Satellite P875 v: PSPLEU-048003 serial: <filter>
           Mobo: TOSHIBA model: Portable PC v: MP serial: <filter> UEFI: Insyde v: 6.30 date: 01/17/2013
Battery:   ID-1: BAT0 charge: 51.4 Wh (85.0%) condition: 60.5/71.3 Wh (84.8%) volts: 10.8 min: 10.8 model: PA5024U-1BRS
           type: Li-ion serial: <filter> status: Charging
CPU:       Info: Quad Core model: Intel Core i7-3630QM bits: 64 type: MT MCP arch: Ivy Bridge family: 6 model-id: 3A (58)
           stepping: 9 microcode: 21 cache: L2: 6 MiB
           flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 38311
           Speed: 3294 MHz min/max: 1200/3400 MHz Core speeds (MHz): 1: 3294 2: 1632 3: 3222 4: 3030 5: 1445 6: 3247 7: 3291
           8: 3292
           Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable
           Type: mds mitigation: Clear CPU buffers; SMT vulnerable
           Type: meltdown mitigation: PTI
           Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl and seccomp
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
           Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, STIBP: conditional, RSB filling
           Type: srbds status: Vulnerable: No microcode
           Type: tsx_async_abort status: Not affected
Graphics:  Device-1: Intel 3rd Gen Core processor Graphics vendor: Toshiba driver: i915 v: kernel bus-ID: 00:02.0
           chip-ID: 8086:0166 class-ID: 0300
           Device-2: Importek TOSHIBA Web Camera - HD type: USB driver: uvcvideo bus-ID: 1-1.3:3 chip-ID: 10f1:1a46
           class-ID: 0e02
           Display: x11 server: X.Org 1.20.13 compositor: picom v: git-dac85 driver: loaded: intel unloaded: modesetting
           alternate: fbdev,vesa display-ID: :0 screens: 1
           Screen-1: 0 s-res: 3840x1080 s-dpi: 96 s-size: 1013x285mm (39.9x11.2") s-diag: 1052mm (41.4")
           Monitor-1: LVDS1 res: 1920x1080 hz: 60 dpi: 128 size: 380x210mm (15.0x8.3") diag: 434mm (17.1")
           Monitor-2: HDMI1 res: 1920x1080 hz: 60 dpi: 81 size: 600x340mm (23.6x13.4") diag: 690mm (27.2")
           OpenGL: renderer: Mesa DRI Intel HD Graphics 4000 (IVB GT2) v: 4.2 Mesa 21.2.2 compat-v: 3.0 direct render: Yes
Audio:     Device-1: Intel 7 Series/C216 Family High Definition Audio vendor: Toshiba driver: snd_hda_intel v: kernel
           bus-ID: 00:1b.0 chip-ID: 8086:1e20 class-ID: 0403
           Device-2: Plantronics Plantronics Blackwire 3210 Series type: USB driver: plantronics,snd-usb-audio,usbhid
           bus-ID: 3-1:2 chip-ID: 047f:c055 class-ID: 0300 serial: <filter>
           Sound Server-1: ALSA v: k5.14.7-zen1-1-zen running: yes
           Sound Server-2: JACK v: 1.9.19 running: no
           Sound Server-3: PulseAudio v: 15.0 running: yes
           Sound Server-4: PipeWire v: 0.3.37 running: yes
Network:   Device-1: Qualcomm Atheros AR8162 Fast Ethernet vendor: Toshiba driver: alx v: kernel port: 2000 bus-ID: 01:00.0
           chip-ID: 1969:1090 class-ID: 0200
           IF: enp1s0 state: down mac: <filter>
           Device-2: Intel Centrino Wireless-N 2200 driver: iwlwifi v: kernel port: 2000 bus-ID: 02:00.0 chip-ID: 8086:0890
           class-ID: 0280
           IF: wlp2s0 state: up mac: <filter>
Drives:    Local Storage: total: 1.2 TiB used: 107.59 GiB (8.7%)
           SMART Message: Unable to run smartctl. Root privileges required.
           ID-1: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 860 EVO 1TB size: 931.51 GiB block-size: physical: 512 B
           logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: 4B6Q scheme: GPT
           ID-2: /dev/sdb maj-min: 8:16 vendor: Western Digital model: WD3200BEKT-60PVMT0 size: 298.09 GiB block-size:
           physical: 512 B logical: 512 B speed: 3.0 Gb/s type: HDD rpm: 7200 serial: <filter> rev: 1A01 scheme: MBR
Partition: ID-1: / raw-size: 446.92 GiB size: 446.92 GiB (100.00%) used: 107.56 GiB (24.1%) fs: btrfs dev: /dev/sda4
           maj-min: 8:4
           ID-2: /boot/efi raw-size: 260 MiB size: 256 MiB (98.46%) used: 23.7 MiB (9.3%) fs: vfat dev: /dev/sda2 maj-min: 8:2
           ID-3: /home raw-size: 446.92 GiB size: 446.92 GiB (100.00%) used: 107.56 GiB (24.1%) fs: btrfs dev: /dev/sda4
           maj-min: 8:4
           ID-4: /var/log raw-size: 446.92 GiB size: 446.92 GiB (100.00%) used: 107.56 GiB (24.1%) fs: btrfs dev: /dev/sda4
           maj-min: 8:4
           ID-5: /var/tmp raw-size: 446.92 GiB size: 446.92 GiB (100.00%) used: 107.56 GiB (24.1%) fs: btrfs dev: /dev/sda4
           maj-min: 8:4
Swap:      Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
           ID-1: swap-1 type: partition size: 1.78 GiB used: 0 KiB (0.0%) priority: -2 dev: /dev/sda6 maj-min: 8:6
           ID-2: swap-2 type: zram size: 11.58 GiB used: 2 MiB (0.0%) priority: 100 dev: /dev/zram0
Sensors:   System Temperatures: cpu: 53.0 C mobo: N/A
           Fan Speeds (RPM): N/A
Info:      Processes: 252 Uptime: 14m wakeups: 1 Memory: 11.58 GiB used: 2.05 GiB (17.7%) Init: systemd v: 249 tool: systemctl
           Compilers: gcc: 11.1.0 clang: 12.0.1 Packages: pacman: 2541 lib: 491 Shell: fish v: 3.3.1 default: Bash v: 5.1.8
           running-in: alacritty inxi: 3.3.06

Hello,
I am using Xmonad with Garuda and I need a script to run every time I boot my machine to set up my dual monitor setup. I have the script already, but I am unsure where to put it so it will be run on boot. I tried putting it in .profile, as well as in my StartupHook in xmonad.hs, but it is still not running. Ideally it would also run before nitrogen is called to set the wallpaper. Where is a location that is read/executed on boot or log in?

Report everything you have already attempted to solve your problem.

Desktop Environment: KDE/Xmonad

1 Like

Putting it in my xmonad.hs actually did work, I just had to put the full path to script even though I have /home/user/.local/bin in my path.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.