Start calcurse upon log in with i3 - i3

I am trying to set my i3 configuration file in order to autostart calcurse when I log in.
I have added the line
exec --no-startup-id calcurse
but it doesn't work.

If you want calcurse in an open window on startup, try exec --no-startup-id [xterm/urxvt/whatever_terminal_you_use] -e calcurse. (most terminal use -e to execute a command, check the terminal help if it does not work)
If you want calcurse to run in the background (to get event notifications, and you will still be able to access the interface by executing calcurse in a terminal), go with exec --no-startup-id calcurse --daemon

Related

bash script to auto run on boot, make screen, execute a command and detach

I am using Centos 7 and on boot I would like to:
Make a screen
Execute a command: osrm-routed --algorithm=MLD
~/osrm-backend/profiles/australia-latest.osrm
Detatch from screen (possibly not needed, just as long as I can
access it myself after its running in future)
Here is something I have thought about, although not correct and wont work
filename: mapstart.sh
Contents of file:
#!/bin/bash
/usr/bin/screen -dmS mapapi osrm-routed --algorithm=MLD ~/osrm-backend/profiles/australia-latest.osrm
With your help with the script. I am not sure the best way to run that on boot with centos 7.
Appreciate your help and input.
For those who would like to know. The issue was with OSRM and centos. I was able to get it running using the full paths of everything and the following in crontab -e
To get the full path of osrm-backend i ran the command of:
which osrm-routed
It returned the result of:
/usr/local/bin/osrm-routed
That then enabled me to add the full path of the command I was trying to run from crontab -e which is required. From there it worked running the below in crontab -e
#reboot /usr/bin/screen -dm -S pistartup /usr/local/bin/osrm-routed --algorithm=MLD ~/osrm-backend/profiles/australia-latest.osrm
break down of all the above:
runs command at reboot only:
#reboot
full path to screen command:
/usr/bin/screen
create screen with name of pistartup and detach:
-dm -S pistartup
my particular command i wanted to run inside the screen:
/usr/local/bin/osrm-routed --algorithm=MLD ~/osrm-backend/profiles/australia-latest.osrm
Now when ever the machine is rebooted. it has created a screen and run my command. To resume the screen manually If i ever wanted to, i could issue the command of:
screen -r pistartup

Ubuntu - Run command on start-up

I would like to run 2 commands when Ubuntu starts up(before anyone even logs in)
Also, these commands should be able to work, immediately after boot up.
So how do I do this?
Navigate to /etc/ and run
sudo nano rc.local
Place your commands below the comments, and above the command, "exit 0"
The commands should run on startup

How do I run a command on login and have it appear in the console?

For example have it run tmux attach -d right when I login. .bashrc, .profile and the like seem to run it in the background? I want to see the action run in the terminal right after I login. I tried adding command="echo 1" entry to authorized_keys in .ssh that runs the command and logs me out which was not what I wanted.
To run something run right away as part of .bashrc when starting a login shell, put these as the last lines:
if shopt -q login_shell; then
exec tmux attach -d
# run exit if you want to be logged out if the exec fails, otherwise omit
exit
fi
However, this will mean you won't be dumped into an actual bash shell, and when tmux exits, you'll be logged out.

script command - bash linux terminal

I am running the cmd
script install-log.txt
the terminal successfully returns
Script started, file is install-log.txt
If I begin typing commands and receiving output to the screen
lsblk
fdisk -l
ls
echo ok
when I check the install-log.txt
nano install-log.txt
it is empty.
I thought all cmd was supposed to be saved there until the session is finished?
I am using Arch-Linux installation CD, and wanted to save this log to record my installation setup cmds.
You need to terminate script operation by running 'exit' command. That wont exit your terminal as such. Then you can view your log file.
Here is the duplicate with more detailed info -> Bash script: Using "script" command from a bash script for logging a session

cygwin: How to make a Windows Menu launcher for a remote application

I have made a application launcher for Thunderbird (called mythunderbird) on a remote machine using the .XWinrc file.
menu apps {
xterm exec "xterm"
"Emacs" exec "emacs"
notepad exec notepad
xload exec "xload -display %display%" # Comment
mythunderbird exec "ssh -X mckserver.mckserver.apollo3.com thunderbird"
}
This starts beautifully with a multiple of keystrokes (right click XWin > (pint to Applicatoins) > click mythunderbird.
Can someone tell me how I can add such a menu to a desktop short cut? Putting a short cut to run "xterm" then logging in to the remote server and starting Thunderbird is easy, but a lot of steps and clicks.
What I really need to do is know what to change in this default short cut for starting xterm:
C:\cygwin\bin\run.exe -p /usr/X11R6/bin xterm -display 127.0.0.1:0.0 -ls
What I like about the functionality of the XWinrc application is that it has a clean execution of Thunderbird without the residue of an extra terminal left running. If I start it outside XWinrc, I have Thunderbird running, but also an extra xterm running.
The way I got it to work was to make a script in cygwin in my home directory (/home/dave/mythunderbird) which does the ssh call.
In the windows shortcut, set the target C:\cygwin\bin\run.exe bash -le /home/dave/mythunderbird
run.exe stops the command window being displayed and bash -le runs the script in bash from a login shell

Resources